Minor UI polish
This commit is contained in:
parent
bc3bde3a10
commit
27c92ef3be
|
@ -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)
|
||||
|
|
|
@ -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
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue