From fb53a3258d90ed2b13e2656bd0516bef5ce40247 Mon Sep 17 00:00:00 2001 From: Michael Kirk Date: Tue, 11 Apr 2017 13:25:34 -0400 Subject: [PATCH 1/2] clarify what to do on the verification screen // FREEBIE --- .../ViewControllers/CodeVerificationViewController.m | 12 ++++++++---- Signal/translations/en.lproj/Localizable.strings | 2 +- 2 files changed, 9 insertions(+), 5 deletions(-) diff --git a/Signal/src/ViewControllers/CodeVerificationViewController.m b/Signal/src/ViewControllers/CodeVerificationViewController.m index 28cd653d4..0c1d5bdef 100644 --- a/Signal/src/ViewControllers/CodeVerificationViewController.m +++ b/Signal/src/ViewControllers/CodeVerificationViewController.m @@ -126,11 +126,15 @@ NSString *const kCompletedRegistrationSegue = @"CompletedRegistration"; _phoneNumberLabel = [UILabel new]; _phoneNumberLabel.textColor = [UIColor ows_darkGrayColor]; _phoneNumberLabel.font = [UIFont ows_regularFontWithSize:20.f]; + _phoneNumberLabel.numberOfLines = 2; + _phoneNumberLabel.adjustsFontSizeToFitWidth = YES; [self.view addSubview:_phoneNumberLabel]; - [_phoneNumberLabel autoHCenterInSuperview]; - [_phoneNumberLabel autoPinEdge:ALEdgeTop toEdge:ALEdgeBottom ofView:header - withOffset:ScaleFromIPhone5To7Plus(25, 100)]; - + [_phoneNumberLabel autoPinWidthToSuperviewWithMargin:ScaleFromIPhone5(32)]; + [_phoneNumberLabel autoPinEdge:ALEdgeTop + toEdge:ALEdgeBottom + ofView:header + withOffset:ScaleFromIPhone5To7Plus(30, 100)]; + const CGFloat kHMargin = 36; _challengeTextField = [UITextField new]; diff --git a/Signal/translations/en.lproj/Localizable.strings b/Signal/translations/en.lproj/Localizable.strings index e78a287f0..b79c554ec 100644 --- a/Signal/translations/en.lproj/Localizable.strings +++ b/Signal/translations/en.lproj/Localizable.strings @@ -1088,7 +1088,7 @@ "VERIFICATION_HEADER" = "Verify"; /* Label indicating the phone number currently being verified. */ -"VERIFICATION_PHONE_NUMBER_FORMAT" = "Verifying: %@"; +"VERIFICATION_PHONE_NUMBER_FORMAT" = "Enter the verification code we sent to %@."; /* table cell label in conversation settings */ "VERIFY_PRIVACY" = "Verify Safety Number"; From ca768d071a7514380b4ced087eb8c133f4cbe9be Mon Sep 17 00:00:00 2001 From: Michael Kirk Date: Tue, 11 Apr 2017 13:32:59 -0400 Subject: [PATCH 2/2] repeat phone number in header, next to back button 1. Putting it near the back-button suggests the user can change it by going back. 2. The existing title "Verify" didn't add any value. // FREEBIE --- .../CodeVerificationViewController.m | 18 ++++++++++++------ .../translations/en.lproj/Localizable.strings | 5 +---- 2 files changed, 13 insertions(+), 10 deletions(-) diff --git a/Signal/src/ViewControllers/CodeVerificationViewController.m b/Signal/src/ViewControllers/CodeVerificationViewController.m index 0c1d5bdef..b37287ee2 100644 --- a/Signal/src/ViewControllers/CodeVerificationViewController.m +++ b/Signal/src/ViewControllers/CodeVerificationViewController.m @@ -104,7 +104,7 @@ NSString *const kCompletedRegistrationSegue = @"CompletedRegistration"; UILabel *titleLabel = [UILabel new]; titleLabel.textColor = [UIColor whiteColor]; - titleLabel.text = NSLocalizedString(@"VERIFICATION_HEADER", @"Navigation title in the registration flow - during the sms code verification process."); + titleLabel.text = [self phoneNumberText]; titleLabel.font = [UIFont ows_mediumFontWithSize:20.f]; [header addSubview:titleLabel]; [titleLabel autoPinToTopLayoutGuideOfViewController:self withInset:0]; @@ -231,12 +231,18 @@ NSString *const kCompletedRegistrationSegue = @"CompletedRegistration"; [_requestCallSpinner autoPinEdgeToSuperviewEdge:ALEdgeRight withInset:kSpinnerSpacing]; } -- (void)updatePhoneNumberLabel { - NSString *phoneNumber = [PhoneNumber bestEffortFormatPartialUserSpecifiedTextToLookLikeAPhoneNumber:[TSAccountManager localNumber]]; +- (NSString *)phoneNumberText +{ OWSAssert([TSAccountManager localNumber] != nil); - _phoneNumberLabel.text = [NSString stringWithFormat:NSLocalizedString(@"VERIFICATION_PHONE_NUMBER_FORMAT", - @"Label indicating the phone number currently being verified."), - phoneNumber]; + return [PhoneNumber bestEffortFormatPartialUserSpecifiedTextToLookLikeAPhoneNumber:[TSAccountManager localNumber]]; +} + +- (void)updatePhoneNumberLabel +{ + _phoneNumberLabel.text = + [NSString stringWithFormat:NSLocalizedString(@"VERIFICATION_PHONE_NUMBER_FORMAT", + @"Label indicating the phone number currently being verified."), + [self phoneNumberText]]; } - (void)startActivityIndicator diff --git a/Signal/translations/en.lproj/Localizable.strings b/Signal/translations/en.lproj/Localizable.strings index b79c554ec..820e24ff0 100644 --- a/Signal/translations/en.lproj/Localizable.strings +++ b/Signal/translations/en.lproj/Localizable.strings @@ -130,7 +130,7 @@ /* The title of the 'user blocked' alert. */ "BLOCK_LIST_VIEW_BLOCKED_ALERT_TITLE" = "User Blocked"; -/* The title of the 'You can't block yourself' alert. */ +/* The message of the 'You can't block yourself' alert. */ "BLOCK_LIST_VIEW_CANT_BLOCK_SELF_ALERT_MESSAGE" = "You can't block yourself."; /* The title of the 'You can't block yourself' alert. */ @@ -1084,9 +1084,6 @@ /* button text during registration to submit your SMS verification code */ "VERIFICATION_CHALLENGE_SUBMIT_CODE" = "Submit Verification Code"; -/* Navigation title in the registration flow - during the sms code verification process. */ -"VERIFICATION_HEADER" = "Verify"; - /* Label indicating the phone number currently being verified. */ "VERIFICATION_PHONE_NUMBER_FORMAT" = "Enter the verification code we sent to %@.";