From 0ba42473d15a6071c240ffd0d9144c0613670c7e Mon Sep 17 00:00:00 2001 From: Tuan Pham Date: Tue, 28 Nov 2023 15:47:27 -0600 Subject: [PATCH] chore: update UX --- .../GetReadyPage/CameraPreviewView.swift | 2 +- .../Views/GetReadyPage/GetReadyPageView.swift | 22 +++++-------------- .../Liveness/FaceLivenessDetectionView.swift | 1 - 3 files changed, 7 insertions(+), 18 deletions(-) diff --git a/Sources/FaceLiveness/Views/GetReadyPage/CameraPreviewView.swift b/Sources/FaceLiveness/Views/GetReadyPage/CameraPreviewView.swift index b6a87104..b815b723 100644 --- a/Sources/FaceLiveness/Views/GetReadyPage/CameraPreviewView.swift +++ b/Sources/FaceLiveness/Views/GetReadyPage/CameraPreviewView.swift @@ -11,7 +11,7 @@ struct CameraPreviewView: View { private static let previewWidthRatio = 0.6 private static let previewHeightRatio = 0.55 private static let previewXPositionRatio = 0.5 - private static let previewYPositionRatio = 0.5 + private static let previewYPositionRatio = 0.6 @StateObject var model: CameraPreviewViewModel diff --git a/Sources/FaceLiveness/Views/GetReadyPage/GetReadyPageView.swift b/Sources/FaceLiveness/Views/GetReadyPage/GetReadyPageView.swift index faa3618c..00ecb9b7 100644 --- a/Sources/FaceLiveness/Views/GetReadyPage/GetReadyPageView.swift +++ b/Sources/FaceLiveness/Views/GetReadyPage/GetReadyPageView.swift @@ -10,15 +10,12 @@ import SwiftUI struct GetReadyPageView: View { let beginCheckButtonDisabled: Bool let onBegin: () -> Void - let onCancel: () -> Void init( onBegin: @escaping () -> Void, - onCancel: @escaping () -> Void, beginCheckButtonDisabled: Bool = false ) { self.onBegin = onBegin - self.onCancel = onCancel self.beginCheckButtonDisabled = beginCheckButtonDisabled } @@ -27,24 +24,17 @@ struct GetReadyPageView: View { ZStack { CameraPreviewView() VStack { - HStack(alignment: .top) { - Spacer() - CloseButton( - action: onCancel - ) - } - Text(LocalizedStrings.preview_center_your_face_text) - .font(.title) - .multilineTextAlignment(.center) - - Spacer() WarningBox( titleText: LocalizedStrings.get_ready_photosensitivity_title, bodyText: LocalizedStrings.get_ready_photosensitivity_description, popoverContent: { photosensitivityWarningPopoverContent } ) .accessibilityElement(children: .combine) - } + Text(LocalizedStrings.preview_center_your_face_text) + .font(.title) + .multilineTextAlignment(.center) + Spacer() + }.padding() } beginCheckButton } @@ -82,6 +72,6 @@ struct GetReadyPageView: View { struct GetReadyPageView_Previews: PreviewProvider { static var previews: some View { - GetReadyPageView(onBegin: {}, onCancel: {}) + GetReadyPageView(onBegin: {}) } } diff --git a/Sources/FaceLiveness/Views/Liveness/FaceLivenessDetectionView.swift b/Sources/FaceLiveness/Views/Liveness/FaceLivenessDetectionView.swift index 31b023e4..64098e5f 100644 --- a/Sources/FaceLiveness/Views/Liveness/FaceLivenessDetectionView.swift +++ b/Sources/FaceLiveness/Views/Liveness/FaceLivenessDetectionView.swift @@ -151,7 +151,6 @@ public struct FaceLivenessDetectorView: View { guard displayState != .displayingLiveness else { return } displayState = .displayingLiveness }, - onCancel: { onCompletion(.failure(.userCancelled)) }, beginCheckButtonDisabled: false ) .onAppear {