mirror of
https://gitlab.opencode.de/bwi/bundesmessenger/clients/bundesmessenger-ios.git
synced 2026-04-18 07:28:28 +02:00
Fix layout for small screens
This commit is contained in:
@@ -42,6 +42,7 @@ final class EnterPinCodeViewController: UIViewController {
|
||||
@IBOutlet private weak var informationLabel: UILabel!
|
||||
@IBOutlet private weak var explanatoryLabel: UILabel!
|
||||
@IBOutlet private weak var forgotPinButton: UIButton!
|
||||
@IBOutlet private weak var bottomView: UIView!
|
||||
|
||||
// MARK: Private
|
||||
|
||||
@@ -160,6 +161,11 @@ final class EnterPinCodeViewController: UIViewController {
|
||||
}
|
||||
|
||||
private func setupViews() {
|
||||
let cancelBarButtonItem = MXKBarButtonItem(title: VectorL10n.cancel, style: .plain) { [weak self] in
|
||||
self?.cancelButtonAction()
|
||||
}
|
||||
|
||||
self.navigationItem.rightBarButtonItem = cancelBarButtonItem
|
||||
showCancelButton()
|
||||
|
||||
self.title = ""
|
||||
@@ -177,15 +183,11 @@ final class EnterPinCodeViewController: UIViewController {
|
||||
}
|
||||
|
||||
private func showCancelButton() {
|
||||
let cancelBarButtonItem = MXKBarButtonItem(title: VectorL10n.cancel, style: .plain) { [weak self] in
|
||||
self?.cancelButtonAction()
|
||||
}
|
||||
|
||||
self.navigationItem.rightBarButtonItem = cancelBarButtonItem
|
||||
self.navigationController?.navigationBar.isHidden = false
|
||||
}
|
||||
|
||||
private func hideCancelButton() {
|
||||
self.navigationItem.rightBarButtonItem = nil
|
||||
self.navigationController?.navigationBar.isHidden = true
|
||||
}
|
||||
|
||||
private func render(viewState: EnterPinCodeViewState) {
|
||||
@@ -224,6 +226,7 @@ final class EnterPinCodeViewController: UIViewController {
|
||||
self.informationLabel.text = VectorL10n.pinProtectionChoosePin
|
||||
self.explanatoryLabel.isHidden = false
|
||||
self.forgotPinButton.isHidden = true
|
||||
self.bottomView.isHidden = false
|
||||
self.notAllowedPinView.isHidden = true
|
||||
}
|
||||
|
||||
@@ -242,6 +245,7 @@ final class EnterPinCodeViewController: UIViewController {
|
||||
self.mainStackView.isHidden = false
|
||||
self.logoImageView.isHidden = true
|
||||
self.forgotPinButton.isHidden = true
|
||||
self.bottomView.isHidden = false
|
||||
self.notAllowedPinView.isHidden = false
|
||||
|
||||
renderPlaceholdersCount(.max, error: true)
|
||||
@@ -273,8 +277,9 @@ final class EnterPinCodeViewController: UIViewController {
|
||||
self.mainStackView.isHidden = false
|
||||
self.logoImageView.isHidden = false
|
||||
self.informationLabel.text = VectorL10n.pinProtectionEnterPin
|
||||
self.explanatoryLabel.text = nil
|
||||
self.explanatoryLabel.isHidden = true
|
||||
self.forgotPinButton.isHidden = false
|
||||
self.bottomView.isHidden = true
|
||||
self.notAllowedPinView.isHidden = true
|
||||
}
|
||||
|
||||
@@ -282,7 +287,7 @@ final class EnterPinCodeViewController: UIViewController {
|
||||
self.inactiveView.isHidden = true
|
||||
self.mainStackView.isHidden = false
|
||||
self.notAllowedPinView.isHidden = true
|
||||
self.explanatoryLabel.text = nil
|
||||
self.explanatoryLabel.isHidden = true
|
||||
self.placeholderStackView.vc_shake()
|
||||
}
|
||||
|
||||
@@ -317,8 +322,9 @@ final class EnterPinCodeViewController: UIViewController {
|
||||
self.mainStackView.isHidden = false
|
||||
self.logoImageView.isHidden = true
|
||||
self.informationLabel.text = VectorL10n.pinProtectionConfirmPinToDisable
|
||||
self.explanatoryLabel.text = nil
|
||||
self.explanatoryLabel.isHidden = true
|
||||
self.forgotPinButton.isHidden = true
|
||||
self.bottomView.isHidden = false
|
||||
self.notAllowedPinView.isHidden = true
|
||||
}
|
||||
|
||||
@@ -327,7 +333,7 @@ final class EnterPinCodeViewController: UIViewController {
|
||||
self.inactiveView.isHidden = false
|
||||
self.mainStackView.isHidden = true
|
||||
self.notAllowedPinView.isHidden = true
|
||||
self.explanatoryLabel.text = nil
|
||||
self.explanatoryLabel.isHidden = true
|
||||
}
|
||||
|
||||
private func renderPlaceholdersCount(_ count: Int, error: Bool = false) {
|
||||
|
||||
Reference in New Issue
Block a user