Clean up onboarding changes.

pull/2/head
Matthew Chen 6 years ago
parent 8d4cea0c27
commit 850b369076

@ -58,7 +58,6 @@ public class OnboardingBaseViewController: OWSViewController {
}
private func button(title: String, selector: Selector, titleColor: UIColor, backgroundColor: UIColor) -> OWSFlatButton {
// TODO: Make sure this all fits if dynamic font sizes are maxed out.
let font = UIFont.ows_dynamicTypeBodyClamped.ows_mediumWeight()
// Button height should be 48pt if the font is 17pt.
let buttonHeight = font.pointSize * 48 / 17

@ -16,9 +16,6 @@ public class OnboardingCaptchaViewController: OnboardingBaseViewController {
view.backgroundColor = Theme.backgroundColor
view.layoutMargins = .zero
// TODO:
// navigationItem.title = NSLocalizedString("SETTINGS_BACKUP", comment: "Label for the backup view in app settings.")
let titleLabel = self.titleLabel(text: NSLocalizedString("ONBOARDING_CAPTCHA_TITLE", comment: "Title of the 'onboarding Captcha' view."))
let titleRow = UIStackView(arrangedSubviews: [

@ -242,9 +242,13 @@ public class OnboardingController: NSObject {
Logger.info("")
// TODO:
// let view = OnboardingCaptchaViewController(onboardingController: self)
// navigationController.pushViewController(view, animated: true)
guard let navigationController = viewController.navigationController else {
owsFailDebug("Missing navigationController")
return
}
let view = Onboarding2FAViewController(onboardingController: self)
navigationController.pushViewController(view, animated: true)
}
@objc
@ -253,7 +257,7 @@ public class OnboardingController: NSObject {
Logger.info("")
// TODO:
showHomeView(view: view)
}
@objc
@ -262,7 +266,27 @@ public class OnboardingController: NSObject {
Logger.info("")
// TODO:
showHomeView(view: view)
}
private func showHomeView(view: UIViewController) {
AssertIsOnMainThread()
guard let navigationController = view.navigationController else {
owsFailDebug("Missing navigationController")
return
}
// In production, this view will never be presented in a modal.
// During testing (debug UI, etc.), it may be a modal.
let isModal = navigationController.presentingViewController != nil
if isModal {
view.dismiss(animated: true, completion: {
SignalApp.shared().showHomeView()
})
} else {
SignalApp.shared().showHomeView()
}
}
// MARK: - State

@ -24,7 +24,6 @@ public class OnboardingPermissionsViewController: OnboardingBaseViewController {
let explanationLabel = self.explanationLabel(explanationText: NSLocalizedString("ONBOARDING_PERMISSIONS_EXPLANATION",
comment: "Explanation in the 'onboarding permissions' view."))
// TODO: Make sure this all fits if dynamic font sizes are maxed out.
let giveAccessButton = self.button(title: NSLocalizedString("ONBOARDING_PERMISSIONS_ENABLE_PERMISSIONS_BUTTON",
comment: "Label for the 'give access' button in the 'onboarding permissions' view."),
selector: #selector(giveAccessPressed))
@ -63,7 +62,6 @@ public class OnboardingPermissionsViewController: OnboardingBaseViewController {
private func requestAccess() {
Logger.info("")
// TODO: We need to defer app's request notification permissions until onboarding is complete.
requestContactsAccess().then { _ in
return PushRegistrationManager.shared.registerUserNotificationSettings()
}.done { [weak self] in

@ -105,8 +105,6 @@ public class OnboardingPhoneNumberViewController: OnboardingBaseViewController {
validationWarningLabel.autoPinHeightToSuperview()
validationWarningLabel.autoPinEdge(toSuperviewEdge: .leading)
// TODO: Finalize copy.
let nextButton = self.button(title: NSLocalizedString("BUTTON_NEXT",
comment: "Label for the 'next' button."),
selector: #selector(nextPressed))

@ -37,7 +37,6 @@ public class OnboardingSplashViewController: OnboardingBaseViewController {
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",
comment: "Label for 'continue' button."),
selector: #selector(continuePressed))

Loading…
Cancel
Save