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
@@ -18,11 +18,22 @@ import SwiftUI
@available(iOS 14.0, *)
struct OnboardingSplashScreenPageIndicator: View {
@Environment(\.theme) private var theme
let pageCount: Int
let pageIndex: Int
internal init(pageCount: Int, pageIndex: Int) {
self.pageCount = pageCount
if pageIndex == -1 {
self.pageIndex = pageCount - 1
} else {
self.pageIndex = pageIndex % pageCount
}
}
var body: some View {
HStack {
ForEach(0..<pageCount) { index in