Fix clipping

Some parts of the UI didn't work well with long languages
pull/238/head
nielsandriesse 4 years ago
parent 010a399ee7
commit 9c7163b1f0

@ -56,8 +56,9 @@ final class SeedReminderView : UIView {
labelStackView.spacing = 4
// Set up button
let button = Button(style: .prominentOutline, size: .small)
button.titleLabel!.font = .boldSystemFont(ofSize: CGFloat(13))
button.setTitle(NSLocalizedString("continue_2", comment: ""), for: UIControl.State.normal)
button.set(.width, to: 80)
button.set(.width, to: 96)
button.addTarget(self, action: #selector(handleContinueButtonTapped), for: UIControl.Event.touchUpInside)
// Set up content stack view
let contentStackView = UIStackView(arrangedSubviews: [ labelStackView ])

@ -67,9 +67,9 @@ final class PathVC : BaseVC {
// Set up rebuild path button
let learnMoreButtonContainer = UIView()
learnMoreButtonContainer.addSubview(learnMoreButton)
learnMoreButton.pin(.leading, to: .leading, of: learnMoreButtonContainer, withInset: 80)
learnMoreButton.pin(.leading, to: .leading, of: learnMoreButtonContainer, withInset: isIPhone5OrSmaller ? 64 : 80)
learnMoreButton.pin(.top, to: .top, of: learnMoreButtonContainer)
learnMoreButtonContainer.pin(.trailing, to: .trailing, of: learnMoreButton, withInset: 80)
learnMoreButtonContainer.pin(.trailing, to: .trailing, of: learnMoreButton, withInset: isIPhone5OrSmaller ? 64 : 80)
learnMoreButtonContainer.pin(.bottom, to: .bottom, of: learnMoreButton)
// Set up spacers
let topSpacer = UIView.vStretchingSpacer()

@ -197,7 +197,7 @@ private final class ViewMyQRCodeVC : UIViewController {
let spacing = isIPhone5OrSmaller ? Values.mediumSpacing : Values.largeSpacing
// Set up stack view
let stackView = UIStackView(arrangedSubviews: [ titleLabel, UIView.spacer(withHeight: spacing), qrCodeImageViewContainer, UIView.spacer(withHeight: spacing),
explanationLabel, UIView.spacer(withHeight: spacing), shareButtonContainer ])
explanationLabel, UIView.vStretchingSpacer(), shareButtonContainer ])
stackView.axis = .vertical
stackView.alignment = .fill
stackView.layoutMargins = UIEdgeInsets(top: Values.largeSpacing, left: Values.largeSpacing, bottom: 0, right: Values.largeSpacing)

@ -108,7 +108,11 @@ final class RestoreVC : BaseVC {
override func viewDidAppear(_ animated: Bool) {
super.viewDidAppear(animated)
mnemonicTextField.becomeFirstResponder()
// 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()
}
}
deinit {
@ -128,7 +132,9 @@ final class RestoreVC : BaseVC {
spacer1HeightConstraint.constant = isIPhone6OrSmaller ? Values.smallSpacing : Values.mediumSpacing
spacer2HeightConstraint.constant = isIPhone6OrSmaller ? Values.smallSpacing : Values.mediumSpacing
spacer3HeightConstraint.constant = isIPhone6OrSmaller ? Values.smallSpacing : Values.mediumSpacing
if isIPhone5OrSmaller { legalLabel.isUserInteractionEnabled = false }
UIView.animate(withDuration: 0.25) {
if isIPhone5OrSmaller { self.legalLabel.alpha = 0 }
self.view.layoutIfNeeded()
}
}
@ -139,7 +145,9 @@ final class RestoreVC : BaseVC {
spacer1HeightConstraint.constant = isIPhone5OrSmaller ? Values.smallSpacing : Values.veryLargeSpacing
spacer2HeightConstraint.constant = isIPhone5OrSmaller ? Values.smallSpacing : Values.veryLargeSpacing
spacer3HeightConstraint.constant = isIPhone5OrSmaller ? Values.smallSpacing : Values.veryLargeSpacing
if isIPhone5OrSmaller { legalLabel.isUserInteractionEnabled = true }
UIView.animate(withDuration: 0.25) {
if isIPhone5OrSmaller { self.legalLabel.alpha = 1 }
self.view.layoutIfNeeded()
}
}

@ -110,12 +110,13 @@ final class SeedVC : BaseVC {
copyButtonContainer.pin(.trailing, to: .trailing, of: copyButton, withInset: Values.massiveSpacing)
copyButtonContainer.pin(.bottom, to: .bottom, of: copyButton)
// Set up top stack view
let topStackView = UIStackView(arrangedSubviews: [ titleLabel, explanationLabel, mnemonicLabelContainer ])
let topStackView = UIStackView(arrangedSubviews: [ titleLabel, UIView.spacer(withHeight: isIPhone6OrSmaller ? Values.smallSpacing : Values.largeSpacing), explanationLabel,
UIView.spacer(withHeight: isIPhone6OrSmaller ? Values.smallSpacing + 2 : Values.largeSpacing), mnemonicLabelContainer ])
if !isIPhone5OrSmaller {
topStackView.addArrangedSubview(UIView.spacer(withHeight: Values.smallSpacing))
topStackView.addArrangedSubview(callToActionLabel) // Not that important and it really gets in the way on small screens
}
topStackView.axis = .vertical
topStackView.spacing = isIPhone6OrSmaller ? Values.smallSpacing : Values.largeSpacing
topStackView.alignment = .fill
// Set up top stack view container
let topStackViewContainer = UIView()

Loading…
Cancel
Save