@@ -4,12 +4,14 @@ import android.graphics.Bitmap
4
4
import android.graphics.BitmapFactory
5
5
import androidx.compose.foundation.background
6
6
import androidx.compose.foundation.layout.Box
7
+ import androidx.compose.foundation.layout.Column
7
8
import androidx.compose.foundation.layout.WindowInsets
8
9
import androidx.compose.foundation.layout.consumeWindowInsets
9
10
import androidx.compose.foundation.layout.fillMaxSize
10
11
import androidx.compose.foundation.layout.statusBars
11
12
import androidx.compose.foundation.layout.windowInsetsPadding
12
13
import androidx.compose.material3.MaterialTheme
14
+ import androidx.compose.material3.Text
13
15
import androidx.compose.runtime.Composable
14
16
import androidx.compose.runtime.getValue
15
17
import androidx.compose.runtime.mutableStateOf
@@ -76,83 +78,92 @@ fun OrchestratedSelfieCaptureScreen(
76
78
) {
77
79
val uiState = viewModel.uiState.collectAsStateWithLifecycle().value
78
80
var acknowledgedInstructions by rememberSaveable { mutableStateOf(false ) }
79
- Box (
81
+ Column (
80
82
modifier = modifier
81
83
.background(color = MaterialTheme .colorScheme.background)
82
84
.windowInsetsPadding(WindowInsets .statusBars)
83
85
.consumeWindowInsets(WindowInsets .statusBars)
84
86
.fillMaxSize(),
85
87
) {
86
- when {
87
- showInstructions && ! acknowledgedInstructions -> SmartSelfieInstructionsScreen (
88
- showAttribution = showAttribution,
89
- ) {
90
- acknowledgedInstructions = true
91
- }
88
+ Text (" The count is ${uiState.counttt} " )
89
+ SelfieCaptureScreen (
90
+ userId = userId,
91
+ jobId = jobId,
92
+ isEnroll = isEnroll,
93
+ allowAgentMode = allowAgentMode,
94
+ skipApiSubmission = skipApiSubmission,
95
+ )
92
96
93
- uiState.processingState != null -> ProcessingScreen (
94
- processingState = uiState.processingState,
95
- inProgressTitle = stringResource(R .string.si_smart_selfie_processing_title),
96
- inProgressSubtitle = stringResource(R .string.si_smart_selfie_processing_subtitle),
97
- inProgressIcon = painterResource(R .drawable.si_smart_selfie_processing_hero),
98
- successTitle = stringResource(R .string.si_smart_selfie_processing_success_title),
99
- successSubtitle = uiState.errorMessage.resolve().takeIf { it.isNotEmpty() }
100
- ? : stringResource(R .string.si_smart_selfie_processing_success_subtitle),
101
- successIcon = painterResource(R .drawable.si_processing_success),
102
- errorTitle = stringResource(R .string.si_smart_selfie_processing_error_title),
103
- errorSubtitle = uiState.errorMessage.resolve().takeIf { it.isNotEmpty() }
104
- ? : stringResource(id = R .string.si_processing_error_subtitle),
105
- errorIcon = painterResource(R .drawable.si_processing_error),
106
- continueButtonText = stringResource(R .string.si_continue),
107
- onContinue = { viewModel.onFinished(onResult) },
108
- retryButtonText = stringResource(R .string.si_smart_selfie_processing_retry_button),
109
- onRetry = viewModel::onRetry,
110
- closeButtonText = stringResource(R .string.si_smart_selfie_processing_close_button),
111
- onClose = { viewModel.onFinished(onResult) },
112
- )
113
-
114
- ! uiState.selfieToConfirm.isNull() -> ImageCaptureConfirmationDialog (
115
- titleText = stringResource(R .string.si_smart_selfie_confirmation_dialog_title),
116
- subtitleText = stringResource(
117
- R .string.si_smart_selfie_confirmation_dialog_subtitle,
118
- ),
119
- painter = remember {
120
- val path = uiState.selfieToConfirm?.absolutePath
121
- try {
122
- BitmapFactory .decodeFile(path)?.let { bitmap: Bitmap ->
123
- BitmapPainter (bitmap.asImageBitmap())
124
- } ? : run {
125
- SmileIDCrashReporting .hub.addBreadcrumb(
126
- " Failed to decode selfie image at $path " ,
127
- )
128
- ColorPainter (Color .Black )
129
- }
130
- } catch (e: Exception ) {
131
- SmileIDCrashReporting .hub.addBreadcrumb(
132
- " Error loading selfie image at $path " ,
133
- )
134
- SmileIDCrashReporting .hub.captureException(e)
135
- ColorPainter (Color .Black )
136
- }
137
- },
138
- confirmButtonText = stringResource(
139
- R .string.si_smart_selfie_confirmation_dialog_confirm_button,
140
- ),
141
- onConfirm = viewModel::submitJob,
142
- retakeButtonText = stringResource(
143
- R .string.si_smart_selfie_confirmation_dialog_retake_button,
144
- ),
145
- onRetake = viewModel::onSelfieRejected,
146
- scaleFactor = 1.25f ,
147
- )
148
-
149
- else -> SelfieCaptureScreen (
150
- userId = userId,
151
- jobId = jobId,
152
- isEnroll = isEnroll,
153
- allowAgentMode = allowAgentMode,
154
- skipApiSubmission = skipApiSubmission,
155
- )
156
- }
97
+ // when {
98
+ // showInstructions && !acknowledgedInstructions -> SmartSelfieInstructionsScreen(
99
+ // showAttribution = showAttribution,
100
+ // ) {
101
+ // acknowledgedInstructions = true
102
+ // }
103
+ //
104
+ // uiState.processingState != null -> ProcessingScreen(
105
+ // processingState = uiState.processingState,
106
+ // inProgressTitle = stringResource(R.string.si_smart_selfie_processing_title),
107
+ // inProgressSubtitle = stringResource(R.string.si_smart_selfie_processing_subtitle),
108
+ // inProgressIcon = painterResource(R.drawable.si_smart_selfie_processing_hero),
109
+ // successTitle = stringResource(R.string.si_smart_selfie_processing_success_title),
110
+ // successSubtitle = uiState.errorMessage.resolve().takeIf { it.isNotEmpty() }
111
+ // ?: stringResource(R.string.si_smart_selfie_processing_success_subtitle),
112
+ // successIcon = painterResource(R.drawable.si_processing_success),
113
+ // errorTitle = stringResource(R.string.si_smart_selfie_processing_error_title),
114
+ // errorSubtitle = uiState.errorMessage.resolve().takeIf { it.isNotEmpty() }
115
+ // ?: stringResource(id = R.string.si_processing_error_subtitle),
116
+ // errorIcon = painterResource(R.drawable.si_processing_error),
117
+ // continueButtonText = stringResource(R.string.si_continue),
118
+ // onContinue = { viewModel.onFinished(onResult) },
119
+ // retryButtonText = stringResource(R.string.si_smart_selfie_processing_retry_button),
120
+ // onRetry = viewModel::onRetry,
121
+ // closeButtonText = stringResource(R.string.si_smart_selfie_processing_close_button),
122
+ // onClose = { viewModel.onFinished(onResult) },
123
+ // )
124
+ //
125
+ // // !uiState.selfieToConfirm.isNull() -> ImageCaptureConfirmationDialog(
126
+ // // titleText = stringResource(R.string.si_smart_selfie_confirmation_dialog_title),
127
+ // // subtitleText = stringResource(
128
+ // // R.string.si_smart_selfie_confirmation_dialog_subtitle,
129
+ // // ),
130
+ // // painter = remember {
131
+ // // val path = uiState.selfieToConfirm?.absolutePath
132
+ // // try {
133
+ // // BitmapFactory.decodeFile(path)?.let { bitmap: Bitmap ->
134
+ // // BitmapPainter(bitmap.asImageBitmap())
135
+ // // } ?: run {
136
+ // // SmileIDCrashReporting.hub.addBreadcrumb(
137
+ // // "Failed to decode selfie image at $path",
138
+ // // )
139
+ // // ColorPainter(Color.Black)
140
+ // // }
141
+ // // } catch (e: Exception) {
142
+ // // SmileIDCrashReporting.hub.addBreadcrumb(
143
+ // // "Error loading selfie image at $path",
144
+ // // )
145
+ // // SmileIDCrashReporting.hub.captureException(e)
146
+ // // ColorPainter(Color.Black)
147
+ // // }
148
+ // // },
149
+ // // confirmButtonText = stringResource(
150
+ // // R.string.si_smart_selfie_confirmation_dialog_confirm_button,
151
+ // // ),
152
+ // // onConfirm = viewModel::submitJob,
153
+ // // retakeButtonText = stringResource(
154
+ // // R.string.si_smart_selfie_confirmation_dialog_retake_button,
155
+ // // ),
156
+ // // onRetake = viewModel::onSelfieRejected,
157
+ // // scaleFactor = 1.25f,
158
+ // // )
159
+ //
160
+ // else -> SelfieCaptureScreen(
161
+ // userId = userId,
162
+ // jobId = jobId,
163
+ // isEnroll = isEnroll,
164
+ // allowAgentMode = allowAgentMode,
165
+ // skipApiSubmission = skipApiSubmission,
166
+ // )
167
+ // }
157
168
}
158
169
}
0 commit comments