Use offsets for the carousel instead of a page view.

Fix carousel for RTL layouts.
This commit is contained in:
Doug
2022-01-07 12:19:39 +00:00
parent b8e9179bbf
commit 0c649183ee
7 changed files with 104 additions and 37 deletions

View File

@@ -54,7 +54,7 @@ class OnboardingSplashScreenViewModel: OnboardingSplashScreenViewModelType, Onbo
register()
case .login:
login()
case .nextPage, .hiddenPage:
case .nextPage, .previousPage, .hiddenPage:
dispatch(action: .viewAction(viewAction))
}
}
@@ -65,6 +65,8 @@ class OnboardingSplashScreenViewModel: OnboardingSplashScreenViewModelType, Onbo
switch viewAction {
case .nextPage:
state.bindings.pageIndex = (state.bindings.pageIndex + 1) % state.content.count
case .previousPage:
state.bindings.pageIndex = max(0, (state.bindings.pageIndex - 1))
case .hiddenPage:
state.bindings.pageIndex = -1
case .login, .register: