Skip to content

Commit

Permalink
Merge pull request #463 from PermanentOrg/feature/VSP-1472-iOS-Biomet…
Browse files Browse the repository at this point in the history
…rics-verification-screen-redesign

VSP-1472[IOS][Mobile] Face ID
  • Loading branch information
luciancerbu-vsp authored Nov 7, 2024
2 parents 3d24cc9 + ce906e7 commit 2ef5b14
Show file tree
Hide file tree
Showing 5 changed files with 128 additions and 119 deletions.
1 change: 1 addition & 0 deletions Permanent/Common/Constants/Constants.swift
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,7 @@ struct TextFontStyle {
static let style47 = TextStyle(UIFont(name: "Usual-Bold", size: 32)!, TextStyle.calculateSpacing(fontSize: CGFloat(14), lineHeight: CGFloat(19)), NSTextAlignment.natural)
static let style48 = TextStyle(UIFont(name: "Usual-Light", size: 56)!, TextStyle.calculateSpacing(fontSize: CGFloat(14), lineHeight: CGFloat(19)), NSTextAlignment.natural)
static let style49 = TextStyle(UIFont(name: "Usual-Bold", size: 56)!, TextStyle.calculateSpacing(fontSize: CGFloat(14), lineHeight: CGFloat(19)), NSTextAlignment.natural)
static let style50 = TextStyle(UIFont(name: "Usual-Medium", size: 14)!, TextStyle.calculateSpacing(fontSize: CGFloat(14), lineHeight: CGFloat(19)), NSTextAlignment.natural)
}

struct Constants {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,10 +10,9 @@ import SwiftUI

class BiometricsViewController: BaseViewController<AuthViewModel> {
@IBOutlet var titleLabel: UILabel!
@IBOutlet var biometricsImageView: UIImageView!
@IBOutlet var biometricsButton: RoundedButton!
@IBOutlet var copyrightLabel: UILabel!
@IBOutlet var loginButton: UIButton!
@IBOutlet var biometricsButton: UIButton!


override func viewDidLoad() {
super.viewDidLoad()
Expand All @@ -25,22 +24,43 @@ class BiometricsViewController: BaseViewController<AuthViewModel> {

fileprivate func initUI() {
view.backgroundColor = .primary

let gradientLayer = CAGradientLayer()
gradientLayer.frame = view.bounds
gradientLayer.colors = [
UIColor(red: 0.075, green: 0.106, blue: 0.29, alpha: 1).cgColor,
UIColor(red: 0.213, green: 0.266, blue: 0.575, alpha: 1).cgColor
]
gradientLayer.startPoint = CGPoint(x: 0.0, y: 0.0)
gradientLayer.endPoint = CGPoint(x: 1.0, y: 1.0)
view.layer.insertSublayer(gradientLayer, at: 0)

navigationController?.setNavigationBarHidden(true, animated: false)

titleLabel.text = .welcomeMessage
titleLabel.text = "Welcome back!"
titleLabel.textColor = .white
titleLabel.font = TextFontStyle.style.font
titleLabel.font = TextFontStyle.style46.font

biometricsButton.setTitle(String(format: .unlockWithBiometrics, BiometryUtils.biometryInfo.name), for: [])
biometricsImageView.image = UIImage(named: BiometryUtils.biometryInfo.iconName)
biometricsButton.setFont(TextFontStyle.style50.font)
biometricsButton.setImage(UIImage(named: "biometricsUnlockIcon")?.withTintColor(UIColor(Color.blue900)), for: .normal)
biometricsButton.setImage(UIImage(named: "biometricsUnlockIcon")?.withTintColor(UIColor(Color.blue900.opacity(0.6))), for: .highlighted)
biometricsButton.setTitleColor(UIColor(Color.blue900), for: .normal)
biometricsButton.setTitleColor(UIColor(Color.blue900).withAlphaComponent(0.6), for: .highlighted)
biometricsButton.configuration?.imagePadding = 16
biometricsButton.configuration?.imagePlacement = .trailing
biometricsButton.layer.backgroundColor = UIColor(red: 1, green: 1, blue: 1, alpha: 1).cgColor
biometricsButton.layer.cornerRadius = 12
biometricsButton.layer.borderWidth = 1
biometricsButton.layer.borderColor = UIColor(red: 1, green: 1, blue: 1, alpha: 0.32).cgColor

loginButton.setTitle(.useLoginCredentials, for: [])
loginButton.setFont(TextFontStyle.style5.font)
loginButton.setTitleColor(.white, for: [])

copyrightLabel.text = .copyrightText
copyrightLabel.textColor = .white
copyrightLabel.font = TextFontStyle.style12.font
loginButton.setFont(TextFontStyle.style50.font)
loginButton.layer.cornerRadius = 12
loginButton.layer.borderWidth = 1
loginButton.layer.borderColor = UIColor(red: 1, green: 1, blue: 1, alpha: 0.32).cgColor
loginButton.setTitleColor(.white, for: [.normal])
loginButton.setTitleColor(.white.withAlphaComponent(0.9), for: [.highlighted])
}

private func attemptBiometricsAuth() {
Expand All @@ -63,8 +83,8 @@ class BiometricsViewController: BaseViewController<AuthViewModel> {
})
}

@IBAction
func biometricsCheckAction(_ sender: RoundedButton) {
//add a action for the biometrics button view pressed
@IBAction func biometricsCheckAction(_ sender: Any) {
attemptBiometricsAuth()
}

Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
{
"images" : [
{
"filename" : "Frame.svg",
"idiom" : "universal"
}
],
"info" : {
"author" : "xcode",
"version" : 1
}
}
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading

0 comments on commit 2ef5b14

Please sign in to comment.