Skip to content

Commit

Permalink
chore: update UX
Browse files Browse the repository at this point in the history
  • Loading branch information
phantumcode committed Nov 28, 2023
1 parent fe51273 commit 0ba4247
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 18 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
22 changes: 6 additions & 16 deletions Sources/FaceLiveness/Views/GetReadyPage/GetReadyPageView.swift
Original file line number Diff line number Diff line change
Expand Up @@ -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
}

Expand All @@ -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
}
Expand Down Expand Up @@ -82,6 +72,6 @@ struct GetReadyPageView: View {

struct GetReadyPageView_Previews: PreviewProvider {
static var previews: some View {
GetReadyPageView(onBegin: {}, onCancel: {})
GetReadyPageView(onBegin: {})
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -151,7 +151,6 @@ public struct FaceLivenessDetectorView: View {
guard displayState != .displayingLiveness else { return }
displayState = .displayingLiveness
},
onCancel: { onCompletion(.failure(.userCancelled)) },
beginCheckButtonDisabled: false
)
.onAppear {
Expand Down

0 comments on commit 0ba4247

Please sign in to comment.