Merge branch 'mkirk/clearer-reminder' into release/2.22.0

pull/1/head
Michael Kirk 7 years ago
commit 028012836b

@ -85,7 +85,7 @@
346129C91FD2072E00532771 /* NSString+OWS.m in Sources */ = {isa = PBXBuildFile; fileRef = 346129C21FD2072D00532771 /* NSString+OWS.m */; };
346129CA1FD2072E00532771 /* UIImage+OWS.h in Headers */ = {isa = PBXBuildFile; fileRef = 346129C31FD2072D00532771 /* UIImage+OWS.h */; settings = {ATTRIBUTES = (Public, ); }; };
346129CB1FD2072E00532771 /* Promise+retainUntilComplete.swift in Sources */ = {isa = PBXBuildFile; fileRef = 346129C41FD2072D00532771 /* Promise+retainUntilComplete.swift */; };
346129CC1FD2072E00532771 /* NSAttributedString+OWS.h in Headers */ = {isa = PBXBuildFile; fileRef = 346129C51FD2072D00532771 /* NSAttributedString+OWS.h */; };
346129CC1FD2072E00532771 /* NSAttributedString+OWS.h in Headers */ = {isa = PBXBuildFile; fileRef = 346129C51FD2072D00532771 /* NSAttributedString+OWS.h */; settings = {ATTRIBUTES = (Public, ); }; };
346129CD1FD2072E00532771 /* UIImage+OWS.m in Sources */ = {isa = PBXBuildFile; fileRef = 346129C61FD2072D00532771 /* UIImage+OWS.m */; };
346129D01FD207F300532771 /* OWSAlerts.swift in Sources */ = {isa = PBXBuildFile; fileRef = 346129CF1FD207F200532771 /* OWSAlerts.swift */; };
346129D21FD2085A00532771 /* CommonStrings.swift in Sources */ = {isa = PBXBuildFile; fileRef = 346129D11FD2085A00532771 /* CommonStrings.swift */; };

@ -40,13 +40,20 @@ public class OWS2FAReminderViewController: UIViewController, PinEntryViewDelegat
let pinEntryView = PinEntryView()
self.pinEntryView = pinEntryView
pinEntryView.delegate = self
let instructionsText = NSLocalizedString("REMINDER_2FA_BODY", comment: "Body text for when user is peridoically prompted to enter their registration lock PIN")
pinEntryView.instructionsText = instructionsText
let instructionsTextHeader = NSLocalizedString("REMINDER_2FA_BODY_HEADER", comment: "Body header for when user is peridoically prompted to enter their registration lock PIN")
let instructionsTextBody = NSLocalizedString("REMINDER_2FA_BODY", comment: "Body text for when user is peridoically prompted to enter their registration lock PIN")
let attributes = [NSFontAttributeName: pinEntryView.boldLabelFont]
let attributedInstructionsText = NSAttributedString(string: instructionsTextHeader, attributes: attributes).rtlSafeAppend(" ", referenceView: pinEntryView).rtlSafeAppend(instructionsTextBody, referenceView: pinEntryView)
pinEntryView.attributedInstructionsText = attributedInstructionsText
view.addSubview(pinEntryView)
pinEntryView.autoPinWidthToSuperview(withMargin: 20)
pinEntryView.autoPin(toTopLayoutGuideOf: self, withInset: 0)
pinEntryView.autoPin(toTopLayoutGuideOf: self, withInset: ScaleFromIPhone5(16))
pinEntryView.autoPin(toBottomLayoutGuideOf: self, withInset: 0)
}

@ -21,6 +21,8 @@ NS_ASSUME_NONNULL_BEGIN
@property (nonatomic, weak, nullable) id<PinEntryViewDelegate> delegate;
@property (nonatomic, readonly) BOOL hasValidPin;
@property (nullable, nonatomic) NSString *instructionsText;
@property (nullable, nonatomic) NSAttributedString *attributedInstructionsText;
@property (nonatomic, readonly) UIFont *boldLabelFont;
- (void)clearText;
- (BOOL)makePinTextFieldFirstResponder;

@ -34,13 +34,22 @@ NS_ASSUME_NONNULL_BEGIN
}
#pragma mark - view creation
- (UIFont *)labelFont
{
return [UIFont ows_regularFontWithSize:ScaleFromIPhone5To7Plus(14.f, 16.f)];
}
- (UIFont *)boldLabelFont
{
return [UIFont ows_boldFontWithSize:ScaleFromIPhone5To7Plus(14.f, 16.f)];
}
- (UILabel *)createLabelWithText:(nullable NSString *)text
{
UILabel *label = [UILabel new];
label.textColor = [UIColor blackColor];
label.text = text;
label.font = [UIFont ows_regularFontWithSize:ScaleFromIPhone5To7Plus(14.f, 16.f)];
label.font = self.labelFont;
label.numberOfLines = 0;
label.lineBreakMode = NSLineBreakByWordWrapping;
label.textAlignment = NSTextAlignmentCenter;
@ -114,9 +123,19 @@ NS_ASSUME_NONNULL_BEGIN
self.instructionsLabel.text = instructionsText;
}
- (nullable NSAttributedString *)attributedInstructionsText
{
return self.instructionsLabel.attributedText;
}
- (void)setAttributedInstructionsText:(nullable NSAttributedString *)attributedInstructionsText
{
self.instructionsLabel.attributedText = attributedInstructionsText;
}
- (void)createContents
{
const CGFloat kVSpacing = ScaleFromIPhone5(12);
const CGFloat kVSpacing = ScaleFromIPhone5To7Plus(12, 30);
UILabel *instructionsLabel = [self createLabelWithText:nil];
self.instructionsLabel = instructionsLabel;

@ -675,7 +675,7 @@
"ENABLE_2FA_VIEW_NEXT_BUTTON" = "Next";
/* Error indicating that the entered 'two-factor auth PINs' do not match. */
"ENABLE_2FA_VIEW_PIN_DOES_NOT_MATCH" = "Pin does not match.";
"ENABLE_2FA_VIEW_PIN_DOES_NOT_MATCH" = "PIN does not match.";
/* Indicates that user should select a 'two factor auth pin'. */
"ENABLE_2FA_VIEW_SELECT_PIN_INSTRUCTIONS" = "Enter a Registration Lock PIN. You will be asked to enter this PIN the next time you register this phone number with Signal.";
@ -1475,7 +1475,10 @@
"RELAY_REGISTERED_ERROR_RECOVERY" = "The phone number you are trying to register has already been registered on another server, please unregister from there and try again.";
/* Body text for when user is peridoically prompted to enter their registration lock PIN */
"REMINDER_2FA_BODY" = "Registration Lock is enabled for your phone number.";
"REMINDER_2FA_BODY" = "Registration Lock is enabled for your phone number. To help you memorize your Registration Lock PIN, Signal will periodically ask you to confirm it.";
/* Body header for when user is peridoically prompted to enter their registration lock PIN */
"REMINDER_2FA_BODY_HEADER" = "Reminder:";
/* Alert message explaining what happens if you forget your 'two-factor auth pin' */
"REMINDER_2FA_FORGOT_PIN_ALERT_MESSAGE" = "Registration Lock helps protect your phone number from unauthorized registration attempts. This feature can be disabled at any time in your Signal privacy settings.";

@ -18,6 +18,7 @@ FOUNDATION_EXPORT const unsigned char SignalMessagingVersionString[];
#import <SignalMessaging/ContactsViewHelper.h>
#import <SignalMessaging/DebugLogger.h>
#import <SignalMessaging/Environment.h>
#import <SignalMessaging/NSAttributedString+OWS.h>
#import <SignalMessaging/NSString+OWS.h>
#import <SignalMessaging/OWSAudioPlayer.h>
#import <SignalMessaging/OWSContactAvatarBuilder.h>

@ -804,8 +804,6 @@ public class ShareViewController: UIViewController, ShareViewDelegate, SAEFailed
// Perhaps the AVFoundation APIs require some extra file system permssion we don't have in the
// passed through URL.
private func isVideoNeedingRelocation(itemProvider: NSItemProvider, itemUrl: URL) -> Bool {
Logger.info("\(self.logTag) isVideoNeedingRelocation: \(itemProvider.registeredTypeIdentifiers), itemUrl: \(itemUrl)")
let pathExtension = itemUrl.pathExtension
guard pathExtension.count > 0 else {
Logger.verbose("\(self.logTag) in \(#function): item URL has no file extension: \(itemUrl).")

Loading…
Cancel
Save