Update splash view.
This commit is contained in:
parent
f6d6dd767c
commit
78ea3e565f
|
@ -482,6 +482,18 @@ NSString *const kArchivedConversationsReuseIdentifier = @"kArchivedConversations
|
|||
[self.searchResultsController viewDidAppear:animated];
|
||||
|
||||
self.hasEverAppeared = YES;
|
||||
|
||||
dispatch_async(dispatch_get_main_queue(), ^{
|
||||
OnboardingController *onboardingController = [OnboardingController new];
|
||||
[onboardingController
|
||||
updateWithPhoneNumber:[[OnboardingPhoneNumber alloc] initWithE164:@"+13213214321" userInput:@"3213214321"]];
|
||||
|
||||
UIViewController *view = [onboardingController initialViewController];
|
||||
// [[OnboardingCaptchaViewController alloc] initWithOnboardingController:onboardingController];
|
||||
OWSNavigationController *navigationController =
|
||||
[[OWSNavigationController alloc] initWithRootViewController:view];
|
||||
[self presentViewController:navigationController animated:YES completion:nil];
|
||||
});
|
||||
}
|
||||
|
||||
- (void)viewDidDisappear:(BOOL)animated
|
||||
|
|
|
@ -31,7 +31,7 @@ public class OnboardingBaseViewController: OWSViewController {
|
|||
let titleLabel = UILabel()
|
||||
titleLabel.text = text
|
||||
titleLabel.textColor = Theme.primaryColor
|
||||
titleLabel.font = UIFont.ows_dynamicTypeTitle2.ows_mediumWeight()
|
||||
titleLabel.font = UIFont.ows_dynamicTypeTitle1.ows_mediumWeight()
|
||||
titleLabel.numberOfLines = 0
|
||||
titleLabel.lineBreakMode = .byWordWrapping
|
||||
titleLabel.textAlignment = .center
|
||||
|
@ -75,6 +75,8 @@ public class OnboardingBaseViewController: OWSViewController {
|
|||
public override func viewWillAppear(_ animated: Bool) {
|
||||
super.viewWillAppear(animated)
|
||||
|
||||
self.navigationController?.isNavigationBarHidden = true
|
||||
|
||||
// TODO: Is there a better way to do this?
|
||||
if let navigationController = self.navigationController as? OWSNavigationController {
|
||||
SignalApp.shared().signUpFlowNavigationController = navigationController
|
||||
|
@ -83,6 +85,12 @@ public class OnboardingBaseViewController: OWSViewController {
|
|||
}
|
||||
}
|
||||
|
||||
public override func viewDidAppear(_ animated: Bool) {
|
||||
super.viewDidAppear(animated)
|
||||
|
||||
self.navigationController?.isNavigationBarHidden = true
|
||||
}
|
||||
|
||||
// MARK: - Orientation
|
||||
|
||||
public override var supportedInterfaceOrientations: UIInterfaceOrientationMask {
|
||||
|
|
|
@ -73,8 +73,6 @@ public class OnboardingCaptchaViewController: OnboardingBaseViewController {
|
|||
public override func viewWillAppear(_ animated: Bool) {
|
||||
super.viewWillAppear(animated)
|
||||
|
||||
self.navigationController?.isNavigationBarHidden = false
|
||||
|
||||
loadContent()
|
||||
}
|
||||
|
||||
|
@ -93,12 +91,6 @@ public class OnboardingCaptchaViewController: OnboardingBaseViewController {
|
|||
webView.scrollView.contentOffset = .zero
|
||||
}
|
||||
|
||||
public override func viewDidAppear(_ animated: Bool) {
|
||||
super.viewDidAppear(animated)
|
||||
|
||||
self.navigationController?.isNavigationBarHidden = false
|
||||
}
|
||||
|
||||
// MARK: - Notifications
|
||||
|
||||
@objc func didBecomeActive() {
|
||||
|
|
|
@ -65,18 +65,6 @@ public class OnboardingPermissionsViewController: OnboardingBaseViewController {
|
|||
}
|
||||
}
|
||||
|
||||
public override func viewWillAppear(_ animated: Bool) {
|
||||
super.viewWillAppear(animated)
|
||||
|
||||
self.navigationController?.isNavigationBarHidden = false
|
||||
}
|
||||
|
||||
public override func viewDidAppear(_ animated: Bool) {
|
||||
super.viewDidAppear(animated)
|
||||
|
||||
self.navigationController?.isNavigationBarHidden = false
|
||||
}
|
||||
|
||||
// MARK: Request Access
|
||||
|
||||
private func requestAccess() {
|
||||
|
|
|
@ -132,17 +132,9 @@ public class OnboardingPhoneNumberViewController: OnboardingBaseViewController {
|
|||
strokeView.autoPinEdge(toSuperviewEdge: .bottom)
|
||||
}
|
||||
|
||||
public override func viewWillAppear(_ animated: Bool) {
|
||||
super.viewWillAppear(animated)
|
||||
|
||||
self.navigationController?.isNavigationBarHidden = false
|
||||
}
|
||||
|
||||
public override func viewDidAppear(_ animated: Bool) {
|
||||
super.viewDidAppear(animated)
|
||||
|
||||
self.navigationController?.isNavigationBarHidden = false
|
||||
|
||||
phoneNumberTextField.becomeFirstResponder()
|
||||
|
||||
if tsAccountManager.isReregistering() {
|
||||
|
|
|
@ -14,9 +14,6 @@ public class OnboardingSplashViewController: OnboardingBaseViewController {
|
|||
view.backgroundColor = Theme.backgroundColor
|
||||
view.layoutMargins = .zero
|
||||
|
||||
// TODO:
|
||||
// navigationItem.title = NSLocalizedString("SETTINGS_BACKUP", comment: "Label for the backup view in app settings.")
|
||||
|
||||
let heroImage = UIImage(named: "onboarding_splash_hero")
|
||||
let heroImageView = UIImageView(image: heroImage)
|
||||
heroImageView.contentMode = .scaleAspectFit
|
||||
|
@ -29,12 +26,16 @@ public class OnboardingSplashViewController: OnboardingBaseViewController {
|
|||
view.addSubview(titleLabel)
|
||||
titleLabel.autoPinEdges(toSuperviewMarginsExcludingEdge: .bottom)
|
||||
|
||||
// TODO: Finalize copy.
|
||||
let explanationLabel = self.explanationLabel(explanationText: NSLocalizedString("ONBOARDING_SPLASH_EXPLANATION",
|
||||
comment: "Explanation in the 'onboarding splash' view."),
|
||||
linkText: NSLocalizedString("ONBOARDING_SPLASH_TERM_AND_PRIVACY_POLICY",
|
||||
comment: "Link to the 'terms and privacy policy' in the 'onboarding splash' view."),
|
||||
selector: #selector(explanationLabelTapped))
|
||||
let explanationLabel = UILabel()
|
||||
explanationLabel.text = NSLocalizedString("ONBOARDING_SPLASH_TERM_AND_PRIVACY_POLICY",
|
||||
comment: "Link to the 'terms and privacy policy' in the 'onboarding splash' view.")
|
||||
explanationLabel.textColor = .ows_materialBlue
|
||||
explanationLabel.font = UIFont.ows_dynamicTypeBody
|
||||
explanationLabel.numberOfLines = 0
|
||||
explanationLabel.textAlignment = .center
|
||||
explanationLabel.lineBreakMode = .byWordWrapping
|
||||
explanationLabel.isUserInteractionEnabled = true
|
||||
explanationLabel.addGestureRecognizer(UITapGestureRecognizer(target: self, action: #selector(explanationLabelTapped)))
|
||||
|
||||
// TODO: Make sure this all fits if dynamic font sizes are maxed out.
|
||||
let continueButton = self.button(title: NSLocalizedString("BUTTON_CONTINUE",
|
||||
|
@ -46,9 +47,9 @@ public class OnboardingSplashViewController: OnboardingBaseViewController {
|
|||
heroImageView,
|
||||
UIView.spacer(withHeight: 22),
|
||||
titleLabel,
|
||||
UIView.spacer(withHeight: 56),
|
||||
UIView.spacer(withHeight: 92),
|
||||
explanationLabel,
|
||||
UIView.spacer(withHeight: 40),
|
||||
UIView.spacer(withHeight: 24),
|
||||
continueButton
|
||||
])
|
||||
stackView.axis = .vertical
|
||||
|
@ -56,23 +57,11 @@ public class OnboardingSplashViewController: OnboardingBaseViewController {
|
|||
stackView.layoutMargins = UIEdgeInsets(top: 32, left: 32, bottom: 32, right: 32)
|
||||
stackView.isLayoutMarginsRelativeArrangement = true
|
||||
view.addSubview(stackView)
|
||||
stackView.autoPinWidthToSuperviewMargins()
|
||||
stackView.autoPinWidthToSuperview()
|
||||
stackView.autoPin(toTopLayoutGuideOf: self, withInset: 0)
|
||||
stackView.autoPin(toBottomLayoutGuideOf: self, withInset: 0)
|
||||
}
|
||||
|
||||
public override func viewWillAppear(_ animated: Bool) {
|
||||
super.viewWillAppear(animated)
|
||||
|
||||
self.navigationController?.isNavigationBarHidden = true
|
||||
}
|
||||
|
||||
public override func viewDidAppear(_ animated: Bool) {
|
||||
super.viewDidAppear(animated)
|
||||
|
||||
self.navigationController?.isNavigationBarHidden = true
|
||||
}
|
||||
|
||||
// MARK: - Events
|
||||
|
||||
@objc func explanationLabelTapped(sender: UIGestureRecognizer) {
|
||||
|
|
|
@ -1533,7 +1533,7 @@
|
|||
"ONBOARDING_SPLASH_EXPLANATION" = "By continuing, you agree to Signal's terms.";
|
||||
|
||||
/* Link to the 'terms and privacy policy' in the 'onboarding splash' view. */
|
||||
"ONBOARDING_SPLASH_TERM_AND_PRIVACY_POLICY" = "Terms and Privacy Policy";
|
||||
"ONBOARDING_SPLASH_TERM_AND_PRIVACY_POLICY" = "Terms & Privacy Policy";
|
||||
|
||||
/* Title of the 'onboarding splash' view. */
|
||||
"ONBOARDING_SPLASH_TITLE" = "Signal is the private messenger for everybody";
|
||||
|
|
Loading…
Reference in New Issue