Layout and color changes

This commit is contained in:
Arnfried Griesert
2024-02-28 15:54:28 +01:00
parent 709ebf5fee
commit ae123f1265
4 changed files with 39 additions and 26 deletions

View File

@@ -38,21 +38,22 @@ struct IntroduceFederationScreen1: View {
.padding(5) // outer border size
.background(Color(ThemeService.shared().theme.backgroundColor))
.clipShape(Circle())
.frame(width: IntroduceFederationView.imageSize + 10, height: IntroduceFederationView.imageSize + 10)
.frame(width: IntroduceFederationView.imageSize + 1, height: IntroduceFederationView.imageSize + 12)
.padding(.trailing, 76)
}
.padding(.bottom, 42)
Text(BWIL10n.introduceFederationScreen1Title)
.foregroundColor(Color(ThemeService.shared().theme.textPrimaryColor))
.font(.system(size: 28, weight: .semibold))
.multilineTextAlignment(.center)
Text(BWIL10n.introduceFederationScreen1Description)
.foregroundColor(Color(ThemeService.shared().theme.textSecondaryColor))
.foregroundColor(Color(ThemeService.shared().theme.textPrimaryColor))
.font(.system(size: 17))
.multilineTextAlignment(.center)
Spacer()
}
.padding(.horizontal)
.padding(.top, IntroduceFederationView.topConstraintTitle - IntroduceFederationView.imageSize)
.padding(.top, IntroduceFederationView.topConstraintTitle - IntroduceFederationView.imageSize - 12)
}
}
}

View File

@@ -26,19 +26,20 @@ struct IntroduceFederationScreen2: View {
Image(uiImage: getImage(darkmode: ThemeService.shared().isCurrentThemeDark()))
.resizable()
.aspectRatio(contentMode: .fit)
.frame(height: IntroduceFederationView.imageSize)
.frame(height: IntroduceFederationView.imageSize + 12)
.padding(.bottom, 42)
Text(BWIL10n.introduceFederationScreen2Title)
.foregroundColor(Color(ThemeService.shared().theme.textPrimaryColor))
.font(.system(size: 28, weight: .semibold))
.multilineTextAlignment(.center)
Text(BWIL10n.introduceFederationScreen2Description)
.foregroundColor(Color(ThemeService.shared().theme.textSecondaryColor))
.foregroundColor(Color(ThemeService.shared().theme.textPrimaryColor))
.font(.system(size: 17))
.multilineTextAlignment(.center)
Spacer()
}
.padding(.horizontal)
.padding(.top, IntroduceFederationView.topConstraintTitle - IntroduceFederationView.imageSize)
.padding(.top, IntroduceFederationView.topConstraintTitle - IntroduceFederationView.imageSize - 12)
}
}

View File

@@ -26,23 +26,20 @@ struct IntroduceFederationScreen3: View {
.resizable()
.aspectRatio(contentMode: .fit)
.frame(height: IntroduceFederationView.topConstraintTitle)
.padding(.bottom, 42)
Text(BWIL10n.introduceFederationScreen3Title)
.foregroundColor(Color(ThemeService.shared().theme.textPrimaryColor))
.font(.system(size: 28, weight: .semibold))
.multilineTextAlignment(.center)
Text(BWIL10n.introduceFederationScreen3Description)
.foregroundColor(Color(ThemeService.shared().theme.textSecondaryColor))
.foregroundColor(Color(ThemeService.shared().theme.textPrimaryColor))
.font(.system(size: 17))
.multilineTextAlignment(.center)
Spacer()
Button(action: onConfirm) {
Text(BWIL10n.introduceFederationStart)
.padding(10)
.frame(maxWidth: .infinity, maxHeight: 40)
.foregroundColor(.white)
.background(Color(ThemeService.shared().theme.tintColor))
.clipShape(RoundedRectangle(cornerRadius: 10))
}
.buttonStyle(PrimaryActionButtonStyle())
.padding(.bottom, 80)
}
.padding(.horizontal)

View File

@@ -44,6 +44,7 @@ struct IntroduceFederationView: View {
Button(action: presentPreviousScreen) {
Image(systemName: "arrow.left")
.foregroundColor(Color(ThemeService.shared().theme.textSecondaryColor))
.padding()
}
}
Spacer()
@@ -51,32 +52,45 @@ struct IntroduceFederationView: View {
Button(action: presentNextScreen) {
Image(systemName: "arrow.right")
.foregroundColor(Color(ThemeService.shared().theme.textSecondaryColor))
.padding()
}
}
}
.padding()
}
.onAppear {
setupIndicatorColors()
}
}
private func setupIndicatorColors() {
UIPageControl.appearance().currentPageIndicatorTintColor = ThemeService.shared().theme.textPrimaryColor
UIPageControl.appearance().pageIndicatorTintColor = ThemeService.shared().theme.textSecondaryColor
}
private func presentNextScreen() {
switch visibleScreen {
case .screen1:
visibleScreen = .screen2
case .screen2:
visibleScreen = .screen3
case .screen3:
break
withAnimation {
switch visibleScreen {
case .screen1:
visibleScreen = .screen2
case .screen2:
visibleScreen = .screen3
case .screen3:
break
}
}
}
private func presentPreviousScreen() {
switch visibleScreen {
case .screen1:
break
case .screen2:
visibleScreen = .screen1
case .screen3:
visibleScreen = .screen2
withAnimation {
switch visibleScreen {
case .screen1:
break
case .screen2:
visibleScreen = .screen1
case .screen3:
visibleScreen = .screen2
}
}
}