Skip to content

Commit

Permalink
Merge pull request #464 from PermanentOrg/feature/VSP-1470-iPadOS-Bio…
Browse files Browse the repository at this point in the history
…metrics-verification-screen-redesign

VSP-1470[IOS][Tablet] Face ID screen redesign
  • Loading branch information
luciancerbu-vsp authored Nov 8, 2024
2 parents 2ef5b14 + 33ed190 commit 9ed7d2e
Show file tree
Hide file tree
Showing 5 changed files with 29 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,9 @@ class BiometricsViewController: BaseViewController<AuthViewModel> {
@IBOutlet var titleLabel: UILabel!
@IBOutlet var loginButton: UIButton!
@IBOutlet var biometricsButton: UIButton!
@IBOutlet weak var leadingConstraint: NSLayoutConstraint!
@IBOutlet weak var trailingConstraint: NSLayoutConstraint!
var isCheckingBiometrics = false


override func viewDidLoad() {
Expand All @@ -24,6 +27,10 @@ class BiometricsViewController: BaseViewController<AuthViewModel> {

fileprivate func initUI() {
view.backgroundColor = .primary
if !Constants.Design.isPhone {
leadingConstraint.constant = view.frame.width * 0.36
trailingConstraint.constant = view.frame.width * 0.36
}

let gradientLayer = CAGradientLayer()
gradientLayer.frame = view.bounds
Expand Down Expand Up @@ -64,7 +71,10 @@ class BiometricsViewController: BaseViewController<AuthViewModel> {
}

private func attemptBiometricsAuth() {
guard !isCheckingBiometrics else { return }
isCheckingBiometrics = true
PermanentLocalAuthentication.instance.authenticate(onSuccess: {
self.isCheckingBiometrics = false
DispatchQueue.main.async {
EventsManager.trackEvent(event: .SignIn)
let defaultArchive: Int? = AuthenticationManager.shared.session?.account.defaultArchiveID
Expand All @@ -79,6 +89,7 @@ class BiometricsViewController: BaseViewController<AuthViewModel> {
}
}
}, onFailure: { error in
self.isCheckingBiometrics = false
self.handleBiometricsFailure(error)
})
}
Expand Down Expand Up @@ -126,7 +137,7 @@ class BiometricsViewController: BaseViewController<AuthViewModel> {
// Nothing to do here. Case treated by `loggedin` API call.
case LocalAuthErrors.localHardwareUnavailableError.statusCode:
break

default:
DispatchQueue.main.async {
self.showAlert(title: .error, message: error.errorDescription)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ struct AuthImageForRightSidePageView: View {
Rectangle()
.foregroundColor(.clear)
.background(
Image(.authLoginLeft)
Image(.authSignInLeft)
.resizable()
.aspectRatio(contentMode: .fill)
.clipped()
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
{
"images" : [
{
"filename" : "authSignIn.png",
"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.
6 changes: 4 additions & 2 deletions Permanent/Resources/Storyboards/Authentication.storyboard
Original file line number Diff line number Diff line change
Expand Up @@ -1312,8 +1312,10 @@ Cg
</view>
<connections>
<outlet property="biometricsButton" destination="YVx-LP-IWE" id="95T-Ls-NiT"/>
<outlet property="leadingConstraint" destination="pRE-gV-waE" id="uG6-7J-EXG"/>
<outlet property="loginButton" destination="1oE-8u-oNO" id="v4q-Dc-xtt"/>
<outlet property="titleLabel" destination="raA-Tx-XHQ" id="pTo-Q3-t2e"/>
<outlet property="trailingConstraint" destination="ZiB-uC-YwS" id="Noa-fk-k42"/>
</connections>
</viewController>
<placeholder placeholderIdentifier="IBFirstResponder" id="wbf-GM-ZQk" userLabel="First Responder" customClass="UIResponder" sceneMemberID="firstResponder"/>
Expand Down Expand Up @@ -1461,10 +1463,10 @@ Cg
<color white="1" alpha="1" colorSpace="custom" customColorSpace="genericGamma22GrayColorSpace"/>
</systemColor>
<systemColor name="systemOrangeColor">
<color red="1" green="0.58431372549019611" blue="0.0" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
<color red="1" green="0.58431372550000005" blue="0.0" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
</systemColor>
<systemColor name="systemPinkColor">
<color red="1" green="0.17647058823529413" blue="0.33333333333333331" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
<color red="1" green="0.1764705882" blue="0.33333333329999998" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
</systemColor>
</resources>
</document>

0 comments on commit 9ed7d2e

Please sign in to comment.