diff --git a/Config/BuM-Beta/BuildSettings.swift b/Config/BuM-Beta/BuildSettings.swift index 99e831164..787ade1a6 100644 --- a/Config/BuM-Beta/BuildSettings.swift +++ b/Config/BuM-Beta/BuildSettings.swift @@ -401,7 +401,7 @@ final class BuildSettings: NSObject { static let decryptNotificationsByDefault: Bool = true // MARK: - Authentication Screen - static let authScreenShowRegister = false + static let authScreenShowRegister = true static let authScreenShowPhoneNumber = false static let authScreenShowForgotPassword = false static let authScreenShowCustomServerOptions = true diff --git a/Riot/Assets/Base.lproj/LaunchScreen.storyboard b/Riot/Assets/Base.lproj/LaunchScreen.storyboard index 07c996ecf..c4ce318e4 100644 --- a/Riot/Assets/Base.lproj/LaunchScreen.storyboard +++ b/Riot/Assets/Base.lproj/LaunchScreen.storyboard @@ -1,9 +1,9 @@ - + - + diff --git a/Riot/Assets/Images.xcassets/launch_screen_logo.imageset/Contents.json b/Riot/Assets/Images.xcassets/launch_screen_logo.imageset/Contents.json index 332aaf86f..80cb64990 100644 --- a/Riot/Assets/Images.xcassets/launch_screen_logo.imageset/Contents.json +++ b/Riot/Assets/Images.xcassets/launch_screen_logo.imageset/Contents.json @@ -1,17 +1,17 @@ { "images" : [ { - "filename" : "launch_screen_logo.png", + "filename" : "launch_bwi.png", "idiom" : "universal", "scale" : "1x" }, { - "filename" : "launch_screen_logo@2x.png", + "filename" : "launch_bwi@2x.png", "idiom" : "universal", "scale" : "2x" }, { - "filename" : "launch_screen_logo@3x.png", + "filename" : "launch_bwi@3x.png", "idiom" : "universal", "scale" : "3x" } @@ -21,6 +21,6 @@ "version" : 1 }, "properties" : { - "template-rendering-intent" : "template" + "template-rendering-intent" : "original" } } diff --git a/Riot/Assets/Images.xcassets/launch_screen_logo.imageset/launch_bwi.png b/Riot/Assets/Images.xcassets/launch_screen_logo.imageset/launch_bwi.png new file mode 100644 index 000000000..1e06d2ded Binary files /dev/null and b/Riot/Assets/Images.xcassets/launch_screen_logo.imageset/launch_bwi.png differ diff --git a/Riot/Assets/Images.xcassets/launch_screen_logo.imageset/launch_bwi@2x.png b/Riot/Assets/Images.xcassets/launch_screen_logo.imageset/launch_bwi@2x.png new file mode 100644 index 000000000..6e0c03e29 Binary files /dev/null and b/Riot/Assets/Images.xcassets/launch_screen_logo.imageset/launch_bwi@2x.png differ diff --git a/Riot/Assets/Images.xcassets/launch_screen_logo.imageset/launch_bwi@3x.png b/Riot/Assets/Images.xcassets/launch_screen_logo.imageset/launch_bwi@3x.png new file mode 100644 index 000000000..c48e8d72f Binary files /dev/null and b/Riot/Assets/Images.xcassets/launch_screen_logo.imageset/launch_bwi@3x.png differ diff --git a/Riot/Assets/Images.xcassets/launch_screen_logo.imageset/launch_screen_logo.png b/Riot/Assets/Images.xcassets/launch_screen_logo.imageset/launch_screen_logo.png deleted file mode 100644 index 85d7a6a01..000000000 Binary files a/Riot/Assets/Images.xcassets/launch_screen_logo.imageset/launch_screen_logo.png and /dev/null differ diff --git a/Riot/Assets/Images.xcassets/launch_screen_logo.imageset/launch_screen_logo@2x.png b/Riot/Assets/Images.xcassets/launch_screen_logo.imageset/launch_screen_logo@2x.png deleted file mode 100644 index ac3f21dfb..000000000 Binary files a/Riot/Assets/Images.xcassets/launch_screen_logo.imageset/launch_screen_logo@2x.png and /dev/null differ diff --git a/Riot/Assets/Images.xcassets/launch_screen_logo.imageset/launch_screen_logo@3x.png b/Riot/Assets/Images.xcassets/launch_screen_logo.imageset/launch_screen_logo@3x.png deleted file mode 100644 index e049f4e98..000000000 Binary files a/Riot/Assets/Images.xcassets/launch_screen_logo.imageset/launch_screen_logo@3x.png and /dev/null differ diff --git a/Riot/Assets/de.lproj/Bwi.strings b/Riot/Assets/de.lproj/Bwi.strings index d9aae93c0..93dd38000 100644 --- a/Riot/Assets/de.lproj/Bwi.strings +++ b/Riot/Assets/de.lproj/Bwi.strings @@ -91,6 +91,11 @@ "bwi_timeline_userlabel_prefix_you" = "Du hast %@"; "bwi_timeline_userlabel_prefix_other_user" = "%@ hat %@"; +// bum authetication +"bum_authetication_title" = "Einloggen mit Matrix-ID"; +"bum_authetication_description" = "Wenn du einen Account auf einem Homeserver eingerichtet hast, benutze deine Matrix-ID (z.B. @benutzer:domain.com) und Passwort"; + + // MARK: - Onboarding "onboarding_use_case_message" = "Wir helfen dir, dich zu verbinden."; diff --git a/Riot/Assets/de.lproj/Vector.strings b/Riot/Assets/de.lproj/Vector.strings index b3e4a2048..516f921a3 100644 --- a/Riot/Assets/de.lproj/Vector.strings +++ b/Riot/Assets/de.lproj/Vector.strings @@ -1578,7 +1578,7 @@ "onboarding_splash_page_3_title" = "Sicherer Nachrichtenaustausch."; "onboarding_splash_page_2_message" = "Wähle wo deine Gespräche liegen, für Kontrolle und Unabhängigkeit. Verbunden mit Matrix."; "onboarding_splash_page_1_title" = "Nimm deine Gespräche in die eigene Hand."; -"onboarding_splash_login_button_title" = "Ich habe bereits ein Konto"; +"onboarding_splash_login_button_title" = "Loslegen"; "onboarding_splash_page_4_message" = "Element ist auch für die Arbeit großartig. Uns vertrauen einige der sichersten Organisationen der Welt."; "onboarding_splash_page_3_message" = "Ende-zu-Ende-verschlüsselt und ohne Telefonnummer nutzbar. Keine Werbung oder Datenerfassung."; "onboarding_splash_page_2_title" = "Du hast die Kontrolle."; diff --git a/Riot/Assets/en.lproj/Bwi.strings b/Riot/Assets/en.lproj/Bwi.strings index ee5f1f68f..23c5df548 100644 --- a/Riot/Assets/en.lproj/Bwi.strings +++ b/Riot/Assets/en.lproj/Bwi.strings @@ -92,6 +92,11 @@ "bwi_settings_ignored_users_text" = "Ignored users"; +// bum authetication +"bum_authetication_title" = "Sign in with Matrix ID"; +"bum_authetication_description" = "If you set up an account on a homeserver, use your Matrix ID (e.g. @user:domain.com) and password below."; + + // MARK: - Titles "title_people" = "Direct Messages"; diff --git a/Riot/Modules/Authentication/Legacy/AuthenticationViewController.m b/Riot/Modules/Authentication/Legacy/AuthenticationViewController.m index 83860c50e..d9eb8dc0c 100644 --- a/Riot/Modules/Authentication/Legacy/AuthenticationViewController.m +++ b/Riot/Modules/Authentication/Legacy/AuthenticationViewController.m @@ -94,6 +94,11 @@ static const CGFloat kAuthInputContainerViewMinHeightConstraintConstant = 150.0; @property (nonatomic, strong) MXKErrorAlertPresentation *errorPresenter; +// bwi: programmatic UI for BuM +@property (nonatomic, strong) UILabel *bwiBuMTitleLabel; +@property (nonatomic, strong) UILabel *bwiBuMDescriptionLabel; +@property (nonatomic, strong) UIImageView *bwiBuMLogoImageView; + @end @implementation AuthenticationViewController @@ -168,7 +173,7 @@ static const CGFloat kAuthInputContainerViewMinHeightConstraintConstant = 150.0; [self.customServersTickButton setImage:AssetImages.selectionUntick.image forState:UIControlStateNormal]; [self.customServersTickButton setImage:AssetImages.selectionUntick.image forState:UIControlStateHighlighted]; - if (!BuildSettings.authScreenShowRegister) + if (!BuildSettings.authScreenShowRegister || !BwiBuildSettings.bwiAuthentificationScreenEnableRegister) { self.navigationItem.rightBarButtonItem.enabled = NO; self.navigationItem.rightBarButtonItem.title = nil; @@ -247,6 +252,10 @@ static const CGFloat kAuthInputContainerViewMinHeightConstraintConstant = 150.0; _keyboardAvoider = [[KeyboardAvoider alloc] initWithScrollViewContainerView:self.view scrollView:self.authenticationScrollView]; [BwiSettings.shared reset]; + + if (BwiBuildSettings.bwiEnableBuMAuthentificationUI) { + [self bwiUpdateUIForBuM]; + } } -(void)setupPasswordIndicator:(AuthInputsView *)authInputsView @@ -604,7 +613,8 @@ static const CGFloat kAuthInputContainerViewMinHeightConstraintConstant = 150.0; { if (!authInputsview.isSingleSignOnRequired && !self.softLogoutCredentials - && BuildSettings.authScreenShowRegister) + && BuildSettings.authScreenShowRegister + && BwiBuildSettings.bwiAuthentificationScreenEnableRegister) { self.navigationItem.rightBarButtonItem.title = [VectorL10n authRegister]; } @@ -1248,6 +1258,7 @@ static const CGFloat kAuthInputContainerViewMinHeightConstraintConstant = 150.0; if (!authInputsview.recaptchaContainer.hidden) { + // bwi: for bum ui authInput constant+=authInputsview.frame.size.height; } } @@ -1863,6 +1874,9 @@ static const CGFloat kAuthInputContainerViewMinHeightConstraintConstant = 150.0; textField.contentVerticalAlignment = UIControlContentVerticalAlignmentCenter; textField.delegate = self; + textField.textColor = ThemeService.shared.theme.textPrimaryColor; + textField.backgroundColor = ThemeService.shared.theme.baseColor; + [self.customServersContainer addSubview:textField]; return textField; @@ -1935,4 +1949,82 @@ static const CGFloat kAuthInputContainerViewMinHeightConstraintConstant = 150.0; [self presentViewController:alert animated:YES completion:nil]; } +- (void) bwiUpdateUIForBuM { + self.bwiBuMTitleLabel = [self bwiTitleLabel]; + self.bwiBuMDescriptionLabel = [self bwiDescriptionLabel]; + self.bwiBuMLogoImageView = [self bwiLogoImageView]; + + [self bwiAdjustLoginUIForBuM]; +} + +- (UIImageView*)bwiLogoImageView { + UIImageView* bumImage = [[UIImageView alloc] init]; + bumImage.translatesAutoresizingMaskIntoConstraints = NO; + + bumImage.image = AssetImages.launchScreenLogo.image; + + bumImage.layer.cornerRadius = 5.0; + bumImage.layer.masksToBounds = YES; + + [self.contentView addSubview:bumImage]; + + [bumImage.centerXAnchor constraintEqualToAnchor:self.contentView.centerXAnchor].active = YES; + [bumImage.topAnchor constraintEqualToAnchor:self.contentView.topAnchor constant:20].active = YES; + [bumImage.heightAnchor constraintEqualToConstant:60].active = YES; + [bumImage.widthAnchor constraintEqualToAnchor:bumImage.heightAnchor].active = YES; + + return bumImage; +} + +- (UILabel*)bwiTitleLabel { + UILabel* titleLabel = [[UILabel alloc] init]; + titleLabel.translatesAutoresizingMaskIntoConstraints = NO; + + titleLabel.text = NSLocalizedStringFromTable(@"bum_authetication_title", @"Bwi", nil); + + UIFont* boldFont = [UIFont boldSystemFontOfSize:[UIFont systemFontSize] + 1]; + titleLabel.font = boldFont; + + titleLabel.textColor = ThemeService.shared.theme.textPrimaryColor; + + [self.contentView addSubview:titleLabel]; + + [titleLabel.centerXAnchor constraintEqualToAnchor:self.contentView.centerXAnchor].active = YES; + + [titleLabel.leadingAnchor constraintEqualToAnchor:self.contentView.leadingAnchor constant:40].active = YES; + [titleLabel.trailingAnchor constraintEqualToAnchor:self.contentView.trailingAnchor constant:-40].active = YES; + [titleLabel.topAnchor constraintEqualToAnchor:self.contentView.topAnchor constant:100].active = YES; + [titleLabel.heightAnchor constraintEqualToConstant:20].active = YES; + + return titleLabel; +} + +- (UILabel*)bwiDescriptionLabel { + UILabel* descLabel = [[UILabel alloc] init]; + descLabel.translatesAutoresizingMaskIntoConstraints = NO; + + descLabel.text = NSLocalizedStringFromTable(@"bum_authetication_description", @"Bwi", nil); + + descLabel.font = [UIFont systemFontOfSize:[UIFont systemFontSize] - 1]; + + descLabel.numberOfLines = 0; + descLabel.lineBreakMode = NSLineBreakByWordWrapping; + descLabel.textColor = ThemeService.shared.theme.textSecondaryColor; + + [self.view addSubview:descLabel]; + + [descLabel.centerXAnchor constraintEqualToAnchor:self.contentView.centerXAnchor].active = YES; + + [descLabel.leadingAnchor constraintEqualToAnchor:self.contentView.leadingAnchor constant:40].active = YES; + [descLabel.trailingAnchor constraintEqualToAnchor:self.contentView.trailingAnchor constant:-40].active = YES; + [descLabel.topAnchor constraintEqualToAnchor:self.contentView.topAnchor constant:135].active = YES; + [descLabel.heightAnchor constraintEqualToConstant:50].active = YES; + + return descLabel; +} + +- (void) bwiAdjustLoginUIForBuM { + [self.authInputsView.topAnchor constraintEqualToAnchor:self.contentView.topAnchor constant:200].active = YES; +} + @end diff --git a/Riot/Modules/LaunchLoading/LaunchLoadingView.swift b/Riot/Modules/LaunchLoading/LaunchLoadingView.swift index f2843db62..fb722696c 100644 --- a/Riot/Modules/LaunchLoading/LaunchLoadingView.swift +++ b/Riot/Modules/LaunchLoading/LaunchLoadingView.swift @@ -29,7 +29,8 @@ final class LaunchLoadingView: UIView, NibLoadable, Themable { // MARK: - Properties - @IBOutlet private weak var animationView: ElementView! + // bwi: for bum just rotate the bum image for now + @IBOutlet private weak var animationView: UIImageView! private var animationTimeline: Timeline_1! // MARK: - Setup @@ -42,9 +43,26 @@ final class LaunchLoadingView: UIView, NibLoadable, Themable { override func awakeFromNib() { super.awakeFromNib() + self.animationView.image = Asset.Images.launchScreenLogo.image + self.animationView.layer.cornerRadius = 50 + self.animationView.layer.masksToBounds = true + + /* let animationTimeline = Timeline_1(view: self.animationView, duration: LaunchAnimation.duration, repeatCount: LaunchAnimation.repeatCount) animationTimeline.play() self.animationTimeline = animationTimeline + */ + } + + override func didMoveToSuperview() { + super.didMoveToSuperview() + + let rotation: CABasicAnimation = CABasicAnimation(keyPath: "transform.rotation.z") + rotation.toValue = NSNumber(value: Double.pi * 2) + rotation.duration = 1 + rotation.isCumulative = true + rotation.repeatCount = Float.greatestFiniteMagnitude + self.animationView.layer.add(rotation, forKey: "rotationAnimation") } // MARK: - Public diff --git a/Riot/Modules/LaunchLoading/LaunchLoadingView.xib b/Riot/Modules/LaunchLoading/LaunchLoadingView.xib index c933d1e00..046c799fe 100644 --- a/Riot/Modules/LaunchLoading/LaunchLoadingView.xib +++ b/Riot/Modules/LaunchLoading/LaunchLoadingView.xib @@ -1,9 +1,10 @@ - + - + + @@ -13,12 +14,15 @@ - - - + + + + + + - + @@ -29,4 +33,9 @@ + + + + + diff --git a/RiotSwiftUI/Modules/Authentication/Common/Service/MatrixSDK/AuthenticationService.swift b/RiotSwiftUI/Modules/Authentication/Common/Service/MatrixSDK/AuthenticationService.swift index b7a356ed3..0e73d4445 100644 --- a/RiotSwiftUI/Modules/Authentication/Common/Service/MatrixSDK/AuthenticationService.swift +++ b/RiotSwiftUI/Modules/Authentication/Common/Service/MatrixSDK/AuthenticationService.swift @@ -75,7 +75,7 @@ class AuthenticationService: NSObject { fatalError("Invalid defeiault homeserver URL string.") } - state = AuthenticationState(flow: .login, homeserverAddress: BuildSettings.serverConfigDefaultHomeserverUrlString) + state = AuthenticationState(flow: .login, homeserverAddress: AppConfigService.shared.serverUrl()) client = clientType.init(homeServer: homeserverURL, unrecognizedCertificateHandler: nil) self.sessionCreator = sessionCreator diff --git a/RiotSwiftUI/Modules/Onboarding/SplashScreen/View/OnboardingSplashScreen.swift b/RiotSwiftUI/Modules/Onboarding/SplashScreen/View/OnboardingSplashScreen.swift index 6afe46726..c1bf1cb2f 100644 --- a/RiotSwiftUI/Modules/Onboarding/SplashScreen/View/OnboardingSplashScreen.swift +++ b/RiotSwiftUI/Modules/Onboarding/SplashScreen/View/OnboardingSplashScreen.swift @@ -96,16 +96,19 @@ struct OnboardingSplashScreen: View { /// The main action buttons. var buttons: some View { VStack(spacing: 12) { - Button { viewModel.send(viewAction: .register) } label: { - Text(VectorL10n.onboardingSplashRegisterButtonTitle) + if BwiBuildSettings.bwiOnboardingSplashScreenEnableRegister { + Button { viewModel.send(viewAction: .register) } label: { + Text(VectorL10n.onboardingSplashRegisterButtonTitle) + } + .buttonStyle(PrimaryActionButtonStyle()) } - .buttonStyle(PrimaryActionButtonStyle()) Button { viewModel.send(viewAction: .login) } label: { Text(VectorL10n.onboardingSplashLoginButtonTitle) .font(theme.fonts.body) .padding(12) } + .buttonStyle(PrimaryActionButtonStyle()) } .padding(.horizontal, 16) .readableFrame() diff --git a/bwi/BwiBuildSettings.swift b/bwi/BwiBuildSettings.swift index 7f0a5296f..2aebaecde 100644 --- a/bwi/BwiBuildSettings.swift +++ b/bwi/BwiBuildSettings.swift @@ -82,4 +82,14 @@ final class BwiBuildSettings: NSObject { static let bwiShowSessionSettingsFooter = false static let bwiEnablePersonalState = false + + // In onboarding splash screen dis/enable register button + static let bwiOnboardingSplashScreenEnableRegister = false + + // in Auth screen dis/enable register button even with onboarding splash screen enabled + static let bwiAuthentificationScreenEnableRegister = false + + // enable BuM style authentication UI (more Info text and a logo) + static let bwiEnableBuMAuthentificationUI = true + }