Update permissions view.

pull/2/head
Matthew Chen 6 years ago
parent 8bdbe24bd0
commit 6bc46fad66

@ -490,7 +490,7 @@ NSString *const kArchivedConversationsReuseIdentifier = @"kArchivedConversations
// UIViewController *view = [onboardingController initialViewController];
UIViewController *view =
[[OnboardingPermissionsViewController alloc] initWithOnboardingController:onboardingController];
[[OnboardingPhoneNumberViewController alloc] initWithOnboardingController:onboardingController];
OWSNavigationController *navigationController =
[[OWSNavigationController alloc] initWithRootViewController:view];
[self presentViewController:navigationController animated:YES completion:nil];

@ -23,6 +23,7 @@ public class OnboardingPermissionsViewController: OnboardingBaseViewController {
let explanationLabel = self.explanationLabel(explanationText: NSLocalizedString("ONBOARDING_PERMISSIONS_EXPLANATION",
comment: "Explanation in the 'onboarding permissions' view."))
explanationLabel.setCompressionResistanceVerticalLow()
// TODO: Make sure this all fits if dynamic font sizes are maxed out.
let giveAccessButton = self.button(title: NSLocalizedString("ONBOARDING_PERMISSIONS_ENABLE_PERMISSIONS_BUTTON",

@ -29,9 +29,6 @@ public class OnboardingPhoneNumberViewController: 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_PHONE_NUMBER_TITLE", comment: "Title of the 'onboarding phone number' view."))
// Country
@ -115,7 +112,7 @@ public class OnboardingPhoneNumberViewController: 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)
autoPinView(toBottomOfViewControllerOrKeyboard: stackView, avoidNotch: true)
@ -228,6 +225,8 @@ public class OnboardingPhoneNumberViewController: OnboardingBaseViewController {
lastRegisteredPhoneNumber.count > 0,
lastRegisteredPhoneNumber.hasPrefix(callingCode) {
phoneNumberTextField.text = lastRegisteredPhoneNumber.substring(from: callingCode.count)
} else if let phoneNumber = onboardingController.phoneNumber {
phoneNumberTextField.text = phoneNumber.userInput
}
updateState()

Loading…
Cancel
Save