|
|
|
@ -53,7 +53,7 @@ final class RestoreVC : UIViewController {
|
|
|
|
|
// Set up title label
|
|
|
|
|
let titleLabel = UILabel()
|
|
|
|
|
titleLabel.textColor = Colors.text
|
|
|
|
|
titleLabel.font = .boldSystemFont(ofSize: Values.veryLargeFontSize)
|
|
|
|
|
titleLabel.font = .boldSystemFont(ofSize: isSmallScreen ? Values.largeFontSize : Values.veryLargeFontSize)
|
|
|
|
|
titleLabel.text = NSLocalizedString("Restore your account", comment: "")
|
|
|
|
|
titleLabel.numberOfLines = 0
|
|
|
|
|
titleLabel.lineBreakMode = .byWordWrapping
|
|
|
|
@ -71,11 +71,11 @@ final class RestoreVC : UIViewController {
|
|
|
|
|
// Set up spacers
|
|
|
|
|
let topSpacer = UIView.vStretchingSpacer()
|
|
|
|
|
let spacer1 = UIView()
|
|
|
|
|
spacer1HeightConstraint = spacer1.set(.height, to: Values.veryLargeSpacing)
|
|
|
|
|
spacer1HeightConstraint = spacer1.set(.height, to: isSmallScreen ? Values.smallSpacing : Values.veryLargeSpacing)
|
|
|
|
|
let spacer2 = UIView()
|
|
|
|
|
spacer2HeightConstraint = spacer2.set(.height, to: Values.veryLargeSpacing)
|
|
|
|
|
spacer2HeightConstraint = spacer2.set(.height, to: isSmallScreen ? Values.smallSpacing : Values.veryLargeSpacing)
|
|
|
|
|
let spacer3 = UIView()
|
|
|
|
|
spacer3HeightConstraint = spacer3.set(.height, to: Values.veryLargeSpacing)
|
|
|
|
|
spacer3HeightConstraint = spacer3.set(.height, to: isSmallScreen ? Values.smallSpacing : Values.veryLargeSpacing)
|
|
|
|
|
let bottomSpacer = UIView.vStretchingSpacer()
|
|
|
|
|
let restoreButtonBottomOffsetSpacer = UIView()
|
|
|
|
|
restoreButtonBottomOffsetConstraint = restoreButtonBottomOffsetSpacer.set(.height, to: Values.onboardingButtonBottomOffset)
|
|
|
|
@ -139,10 +139,10 @@ final class RestoreVC : UIViewController {
|
|
|
|
|
@objc private func handleKeyboardWillChangeFrameNotification(_ notification: Notification) {
|
|
|
|
|
guard let newHeight = (notification.userInfo?[UIResponder.keyboardFrameEndUserInfoKey] as? NSValue)?.cgRectValue.size.height else { return }
|
|
|
|
|
bottomConstraint.constant = -newHeight // Negative due to how the constraint is set up
|
|
|
|
|
restoreButtonBottomOffsetConstraint.constant = Values.largeSpacing
|
|
|
|
|
spacer1HeightConstraint.constant = Values.mediumSpacing
|
|
|
|
|
spacer2HeightConstraint.constant = Values.mediumSpacing
|
|
|
|
|
spacer3HeightConstraint.constant = Values.mediumSpacing
|
|
|
|
|
restoreButtonBottomOffsetConstraint.constant = isSmallScreen ? Values.smallSpacing : Values.largeSpacing
|
|
|
|
|
spacer1HeightConstraint.constant = isSmallScreen ? Values.smallSpacing : Values.mediumSpacing
|
|
|
|
|
spacer2HeightConstraint.constant = isSmallScreen ? Values.smallSpacing : Values.mediumSpacing
|
|
|
|
|
spacer3HeightConstraint.constant = isSmallScreen ? Values.smallSpacing : Values.mediumSpacing
|
|
|
|
|
UIView.animate(withDuration: 0.25) {
|
|
|
|
|
self.view.layoutIfNeeded()
|
|
|
|
|
}
|
|
|
|
@ -151,9 +151,9 @@ final class RestoreVC : UIViewController {
|
|
|
|
|
@objc private func handleKeyboardWillHideNotification(_ notification: Notification) {
|
|
|
|
|
bottomConstraint.constant = 0
|
|
|
|
|
restoreButtonBottomOffsetConstraint.constant = Values.onboardingButtonBottomOffset
|
|
|
|
|
spacer1HeightConstraint.constant = Values.veryLargeSpacing
|
|
|
|
|
spacer2HeightConstraint.constant = Values.veryLargeSpacing
|
|
|
|
|
spacer3HeightConstraint.constant = Values.veryLargeSpacing
|
|
|
|
|
spacer1HeightConstraint.constant = isSmallScreen ? Values.smallSpacing : Values.veryLargeSpacing
|
|
|
|
|
spacer2HeightConstraint.constant = isSmallScreen ? Values.smallSpacing : Values.veryLargeSpacing
|
|
|
|
|
spacer3HeightConstraint.constant = isSmallScreen ? Values.smallSpacing : Values.veryLargeSpacing
|
|
|
|
|
UIView.animate(withDuration: 0.25) {
|
|
|
|
|
self.view.layoutIfNeeded()
|
|
|
|
|
}
|
|
|
|
|