mirror of
https://gitlab.opencode.de/bwi/bundesmessenger/clients/bundesmessenger-ios.git
synced 2026-04-18 15:38:28 +02:00
MESSENGER-2762 Initial Merge
This commit is contained in:
@@ -2,6 +2,7 @@
|
||||
// $ createScreen.sh SetPinCode/EnterPinCode EnterPinCode
|
||||
/*
|
||||
Copyright 2020 New Vector Ltd
|
||||
Copyright (c) 2021 BWI GmbH
|
||||
|
||||
Licensed under the Apache License, Version 2.0 (the "License");
|
||||
you may not use this file except in compliance with the License.
|
||||
@@ -161,7 +162,7 @@ final class EnterPinCodeViewController: UIViewController {
|
||||
}
|
||||
|
||||
private func setupViews() {
|
||||
let cancelBarButtonItem = MXKBarButtonItem(title: VectorL10n.cancel, style: .plain) { [weak self] in
|
||||
let cancelBarButtonItem = MXKBarButtonItem(title: NSLocalizedString("cancel", tableName: "Vector", comment: ""), style: .plain) { [weak self] in
|
||||
self?.cancelButtonAction()
|
||||
}
|
||||
|
||||
@@ -171,6 +172,7 @@ final class EnterPinCodeViewController: UIViewController {
|
||||
self.title = ""
|
||||
|
||||
notAllowedPinLabel.text = VectorL10n.pinProtectionNotAllowedPin
|
||||
forgotPinButton.setTitle(VectorL10n.pinProtectionForgotPin, for: .normal)
|
||||
|
||||
placeholderStackView.vc_removeAllArrangedSubviews()
|
||||
for i in 0..<PinCodePreferences.shared.numberOfDigits {
|
||||
@@ -227,6 +229,7 @@ final class EnterPinCodeViewController: UIViewController {
|
||||
self.logoImageView.isHidden = true
|
||||
self.informationLabel.text = VectorL10n.pinProtectionChoosePin
|
||||
self.explanatoryLabel.isHidden = false
|
||||
self.explanatoryLabel.text = VectorL10n.pinProtectionExplanatory
|
||||
self.forgotPinButton.isHidden = true
|
||||
self.bottomView.isHidden = false
|
||||
self.notAllowedPinView.isHidden = true
|
||||
@@ -258,15 +261,16 @@ final class EnterPinCodeViewController: UIViewController {
|
||||
self.mainStackView.isHidden = false
|
||||
self.informationLabel.text = VectorL10n.pinProtectionConfirmPin
|
||||
self.notAllowedPinView.isHidden = true
|
||||
|
||||
self.explanatoryLabel.isHidden = true
|
||||
|
||||
// reset placeholders
|
||||
renderPlaceholdersCount(0)
|
||||
}
|
||||
|
||||
private func renderPinsDontMatch() {
|
||||
let error = MXKErrorViewModel(title: VectorL10n.pinProtectionMismatchErrorTitle,
|
||||
message: VectorL10n.pinProtectionMismatchErrorMessage)
|
||||
|
||||
let error = MXKErrorViewModel(title: NSLocalizedString("pin_protection_mismatch_error_title", tableName: "Vector", comment: ""),
|
||||
message: NSLocalizedString("pin_protection_mismatch_error_message", tableName: "Vector", comment: ""))
|
||||
|
||||
self.activityPresenter.removeCurrentActivityIndicator(animated: true)
|
||||
self.errorPresenter.presentError(from: self, for: error, animated: true) {
|
||||
self.viewModel.process(viewAction: .pinsDontMatchAlertAction)
|
||||
@@ -294,23 +298,23 @@ final class EnterPinCodeViewController: UIViewController {
|
||||
}
|
||||
|
||||
private func renderWrongPinTooManyTimes() {
|
||||
let error = MXKErrorViewModel(title: VectorL10n.pinProtectionMismatchErrorTitle,
|
||||
message: VectorL10n.pinProtectionMismatchTooManyTimesErrorMessage)
|
||||
let error = MXKErrorViewModel(title: NSLocalizedString("pin_protection_mismatch_error_title", tableName: "Vector", comment: ""),
|
||||
message: NSLocalizedString("pin_protection_mismatch_too_many_times_error_message", tableName: "Vector", comment: ""))
|
||||
|
||||
self.activityPresenter.removeCurrentActivityIndicator(animated: true)
|
||||
self.errorPresenter.presentError(from: self, for: error, animated: true, handler: nil)
|
||||
}
|
||||
|
||||
private func renderForgotPin() {
|
||||
let controller = UIAlertController(title: VectorL10n.pinProtectionResetAlertTitle,
|
||||
message: VectorL10n.pinProtectionResetAlertMessage,
|
||||
let controller = UIAlertController(title: NSLocalizedString("pin_protection_reset_alert_title", tableName: "Vector", comment: ""),
|
||||
message: NSLocalizedString("pin_protection_reset_alert_message", tableName: "Vector", comment: ""),
|
||||
preferredStyle: .alert)
|
||||
|
||||
let resetAction = UIAlertAction(title: VectorL10n.pinProtectionResetAlertActionReset, style: .default) { (_) in
|
||||
let resetAction = UIAlertAction(title: NSLocalizedString("pin_protection_reset_alert_action_reset", tableName: "Vector", comment: ""), style: .default) { (_) in
|
||||
self.viewModel.process(viewAction: .forgotPinAlertResetAction)
|
||||
}
|
||||
|
||||
let cancelAction = UIAlertAction(title: VectorL10n.cancel, style: .cancel) { (_) in
|
||||
let cancelAction = UIAlertAction(title: NSLocalizedString("cancel", tableName: "Vector", comment: ""), style: .cancel) { (_) in
|
||||
self.viewModel.process(viewAction: .forgotPinAlertCancelAction)
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user