From 27c92ef3be3d4e019e669934e28ab22f6dbf6f47 Mon Sep 17 00:00:00 2001 From: nielsandriesse Date: Wed, 21 Oct 2020 09:41:28 +1100 Subject: [PATCH] Minor UI polish --- Signal/src/Loki/View Controllers/RestoreVC.swift | 14 +++++++------- .../Loki/Redesign/Style Guide/Values.swift | 4 ++-- 2 files changed, 9 insertions(+), 9 deletions(-) diff --git a/Signal/src/Loki/View Controllers/RestoreVC.swift b/Signal/src/Loki/View Controllers/RestoreVC.swift index d5dbd116c..e8b7b00da 100644 --- a/Signal/src/Loki/View Controllers/RestoreVC.swift +++ b/Signal/src/Loki/View Controllers/RestoreVC.swift @@ -7,8 +7,8 @@ final class RestoreVC : BaseVC { private var bottomConstraint: NSLayoutConstraint! // MARK: Components - private lazy var mnemonicTextField: TextField = { - let result = TextField(placeholder: NSLocalizedString("vc_restore_seed_text_field_hint", comment: "")) + private lazy var mnemonicTextView: TextView = { + let result = TextView(placeholder: NSLocalizedString("vc_restore_seed_text_field_hint", comment: "")) result.layer.borderColor = Colors.text.cgColor return result }() @@ -77,7 +77,7 @@ final class RestoreVC : BaseVC { restoreButtonContainer.pin(.trailing, to: .trailing, of: restoreButton, withInset: Values.massiveSpacing) restoreButtonContainer.pin(.bottom, to: .bottom, of: restoreButton) // Set up top stack view - let topStackView = UIStackView(arrangedSubviews: [ titleLabel, spacer1, explanationLabel, spacer2, mnemonicTextField, spacer3, legalLabel ]) + let topStackView = UIStackView(arrangedSubviews: [ titleLabel, spacer1, explanationLabel, spacer2, mnemonicTextView, spacer3, legalLabel ]) topStackView.axis = .vertical topStackView.alignment = .fill // Set up top stack view container @@ -111,7 +111,7 @@ final class RestoreVC : BaseVC { // On small screens we hide the legal label when the keyboard is up, but it's important that the user sees it so // in those instances we don't make the keyboard come up automatically if !isIPhone5OrSmaller { - mnemonicTextField.becomeFirstResponder() + mnemonicTextView.becomeFirstResponder() } } @@ -121,7 +121,7 @@ final class RestoreVC : BaseVC { // MARK: General @objc private func dismissKeyboard() { - mnemonicTextField.resignFirstResponder() + mnemonicTextView.resignFirstResponder() } // MARK: Updating @@ -159,7 +159,7 @@ final class RestoreVC : BaseVC { alert.addAction(UIAlertAction(title: NSLocalizedString("OK", comment: ""), style: .default, handler: nil)) presentAlert(alert) } - let mnemonic = mnemonicTextField.text! + let mnemonic = mnemonicTextView.text! do { let hexEncodedSeed = try Mnemonic.decode(mnemonic: mnemonic) let seed = Data(hex: hexEncodedSeed) @@ -171,7 +171,7 @@ final class RestoreVC : BaseVC { TSAccountManager.sharedInstance().phoneNumberAwaitingVerification = keyPair.hexEncodedPublicKey OWSPrimaryStorage.shared().setRestorationTime(Date().timeIntervalSince1970) UserDefaults.standard[.hasViewedSeed] = true - mnemonicTextField.resignFirstResponder() + mnemonicTextView.resignFirstResponder() Timer.scheduledTimer(withTimeInterval: 0.25, repeats: false) { _ in let displayNameVC = DisplayNameVC() self.navigationController!.pushViewController(displayNameVC, animated: true) diff --git a/SignalMessaging/Loki/Redesign/Style Guide/Values.swift b/SignalMessaging/Loki/Redesign/Style Guide/Values.swift index 2ce3c5be6..008b10c8f 100644 --- a/SignalMessaging/Loki/Redesign/Style Guide/Values.swift +++ b/SignalMessaging/Loki/Redesign/Style Guide/Values.swift @@ -64,8 +64,8 @@ public final class Values : NSObject { @objc public static let onboardingButtonBottomOffset = isIPhone5OrSmaller ? CGFloat(52) : CGFloat(72) // MARK: - Animation Values - @objc public static let fakeChatStartDelay: TimeInterval = 1.5 + @objc public static let fakeChatStartDelay: TimeInterval = 1 @objc public static let fakeChatAnimationDuration: TimeInterval = 0.4 - @objc public static let fakeChatDelay: TimeInterval = 2 + @objc public static let fakeChatDelay: TimeInterval = 1.5 @objc public static let fakeChatMessagePopAnimationStartScale: CGFloat = 0.6 }