From 24e675ff07769cb7dc03e5d53b1f2bdee8ced9e2 Mon Sep 17 00:00:00 2001 From: Michael Kirk Date: Thu, 5 Jul 2018 17:36:52 -0600 Subject: [PATCH] Use dismissable text views where cramped on shorter devices // FREEBIE --- Signal/src/ViewControllers/ProfileViewController.m | 7 ++++++- .../Registration/CodeVerificationViewController.m | 7 ++++++- Signal/src/views/PinEntryView.m | 7 ++++++- 3 files changed, 18 insertions(+), 3 deletions(-) diff --git a/Signal/src/ViewControllers/ProfileViewController.m b/Signal/src/ViewControllers/ProfileViewController.m index 56d96d18f..235bd2eea 100644 --- a/Signal/src/ViewControllers/ProfileViewController.m +++ b/Signal/src/ViewControllers/ProfileViewController.m @@ -117,7 +117,12 @@ NSString *const kProfileView_LastPresentedDate = @"kProfileView_LastPresentedDat [nameLabel autoPinLeadingToSuperviewMargin]; [nameLabel autoPinHeightToSuperviewWithMargin:5.f]; - UITextField *nameTextField = [UITextField new]; + UITextField *nameTextField; + if (UIDevice.currentDevice.isShorterThanIPhone5) { + nameTextField = [DismissableTextField new]; + } else { + nameTextField = [UITextField new]; + } _nameTextField = nameTextField; nameTextField.font = [UIFont ows_mediumFontWithSize:18.f]; nameTextField.textColor = [UIColor ows_materialBlueColor]; diff --git a/Signal/src/ViewControllers/Registration/CodeVerificationViewController.m b/Signal/src/ViewControllers/Registration/CodeVerificationViewController.m index 0cc01b497..014f6efcf 100644 --- a/Signal/src/ViewControllers/Registration/CodeVerificationViewController.m +++ b/Signal/src/ViewControllers/Registration/CodeVerificationViewController.m @@ -147,7 +147,12 @@ NS_ASSUME_NONNULL_BEGIN const CGFloat kHMargin = 36; - _challengeTextField = [UITextField new]; + if (UIDevice.currentDevice.isShorterThanIPhone5) { + _challengeTextField = [DismissableTextField new]; + } else { + _challengeTextField = [UITextField new]; + } + _challengeTextField.textColor = [UIColor blackColor]; _challengeTextField.placeholder = NSLocalizedString(@"VERIFICATION_CHALLENGE_DEFAULT_TEXT", @"Text field placeholder for SMS verification code during registration"); diff --git a/Signal/src/views/PinEntryView.m b/Signal/src/views/PinEntryView.m index 1e8cb6d97..cf69c398f 100644 --- a/Signal/src/views/PinEntryView.m +++ b/Signal/src/views/PinEntryView.m @@ -59,7 +59,12 @@ NS_ASSUME_NONNULL_BEGIN - (void)createPinTextfield { - self.pinTextfield = [UITextField new]; + if (UIDevice.currentDevice.isShorterThanIPhone5) { + self.pinTextfield = [DismissableTextField new]; + } else { + self.pinTextfield = [UITextField new]; + } + self.pinTextfield.textColor = [UIColor blackColor]; self.pinTextfield.font = [UIFont ows_mediumFontWithSize:ScaleFromIPhone5To7Plus(30.f, 36.f)]; self.pinTextfield.textAlignment = NSTextAlignmentCenter;