Support Dark Mode in passcode lock view
This commit is contained in:
parent
d0382f55c1
commit
a496d54ffa
1 changed files with 9 additions and 3 deletions
|
|
@ -32,7 +32,6 @@ open class PasscodeLockViewController: UIViewController, UITextFieldDelegate {
|
||||||
let passcodeLabel = UILabel(frame: CGRect(x: 0, y: 0, width: 300, height: 40))
|
let passcodeLabel = UILabel(frame: CGRect(x: 0, y: 0, width: 300, height: 40))
|
||||||
passcodeLabel.text = "EnterPasscode".localize()
|
passcodeLabel.text = "EnterPasscode".localize()
|
||||||
passcodeLabel.font = UIFont.boldSystemFont(ofSize: 18)
|
passcodeLabel.font = UIFont.boldSystemFont(ofSize: 18)
|
||||||
passcodeLabel.textColor = UIColor.black
|
|
||||||
passcodeLabel.textAlignment = .center
|
passcodeLabel.textAlignment = .center
|
||||||
passcodeLabel.translatesAutoresizingMaskIntoConstraints = false
|
passcodeLabel.translatesAutoresizingMaskIntoConstraints = false
|
||||||
self.view.addSubview(passcodeLabel)
|
self.view.addSubview(passcodeLabel)
|
||||||
|
|
@ -40,7 +39,7 @@ open class PasscodeLockViewController: UIViewController, UITextFieldDelegate {
|
||||||
|
|
||||||
let passcodeWrongAttemptsLabel = UILabel(frame: CGRect(x: 0, y: 0, width: 300, height: 40))
|
let passcodeWrongAttemptsLabel = UILabel(frame: CGRect(x: 0, y: 0, width: 300, height: 40))
|
||||||
passcodeWrongAttemptsLabel.text = ""
|
passcodeWrongAttemptsLabel.text = ""
|
||||||
passcodeWrongAttemptsLabel.textColor = UIColor.red
|
passcodeWrongAttemptsLabel.textColor = Globals.red
|
||||||
passcodeWrongAttemptsLabel.textAlignment = .center
|
passcodeWrongAttemptsLabel.textAlignment = .center
|
||||||
passcodeWrongAttemptsLabel.translatesAutoresizingMaskIntoConstraints = false
|
passcodeWrongAttemptsLabel.translatesAutoresizingMaskIntoConstraints = false
|
||||||
self.view.addSubview(passcodeWrongAttemptsLabel)
|
self.view.addSubview(passcodeWrongAttemptsLabel)
|
||||||
|
|
@ -53,11 +52,18 @@ open class PasscodeLockViewController: UIViewController, UITextFieldDelegate {
|
||||||
passcodeTextField.clearButtonMode = UITextField.ViewMode.whileEditing
|
passcodeTextField.clearButtonMode = UITextField.ViewMode.whileEditing
|
||||||
passcodeTextField.delegate = self
|
passcodeTextField.delegate = self
|
||||||
passcodeTextField.addTarget(self, action: #selector(self.passcodeTextFieldDidChange(_:)), for: UIControl.Event.editingChanged)
|
passcodeTextField.addTarget(self, action: #selector(self.passcodeTextFieldDidChange(_:)), for: UIControl.Event.editingChanged)
|
||||||
self.view.backgroundColor = UIColor.white
|
|
||||||
passcodeTextField.translatesAutoresizingMaskIntoConstraints = false
|
passcodeTextField.translatesAutoresizingMaskIntoConstraints = false
|
||||||
self.view.addSubview(passcodeTextField)
|
self.view.addSubview(passcodeTextField)
|
||||||
self.passcodeTextField = passcodeTextField
|
self.passcodeTextField = passcodeTextField
|
||||||
|
|
||||||
|
if #available(iOSApplicationExtension 13.0, *) {
|
||||||
|
view.backgroundColor = .systemBackground
|
||||||
|
passcodeTextField.backgroundColor = .secondarySystemBackground
|
||||||
|
passcodeTextField.textColor = .secondaryLabel
|
||||||
|
} else {
|
||||||
|
view.backgroundColor = .white
|
||||||
|
}
|
||||||
|
|
||||||
let biometryAuthButton = UIButton(type: .custom)
|
let biometryAuthButton = UIButton(type: .custom)
|
||||||
biometryAuthButton.setTitle("", for: .normal)
|
biometryAuthButton.setTitle("", for: .normal)
|
||||||
biometryAuthButton.setTitleColor(Globals.blue, for: .normal)
|
biometryAuthButton.setTitleColor(Globals.blue, for: .normal)
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue