Skip to content

Commit a188ac9

Browse files
committed
chore: update biometrics blocking view to match iOS
Signed-off-by: Brandon McAnsh <git@bmcreations.dev>
1 parent d52316c commit a188ac9

1 file changed

Lines changed: 20 additions & 51 deletions

File tree

app/src/main/java/com/getcode/view/main/home/components/BiometricsBlockingView.kt

Lines changed: 20 additions & 51 deletions
Original file line numberDiff line numberDiff line change
@@ -3,17 +3,11 @@ package com.getcode.view.main.home.components
33
import androidx.compose.animation.AnimatedVisibility
44
import androidx.compose.animation.fadeIn
55
import androidx.compose.animation.fadeOut
6-
import androidx.compose.foundation.Image
7-
import androidx.compose.foundation.background
8-
import androidx.compose.foundation.clickable
9-
import androidx.compose.foundation.layout.Arrangement
106
import androidx.compose.foundation.layout.Box
11-
import androidx.compose.foundation.layout.Column
12-
import androidx.compose.foundation.layout.padding
13-
import androidx.compose.foundation.layout.size
14-
import androidx.compose.foundation.layout.statusBarsPadding
15-
import androidx.compose.foundation.shape.RoundedCornerShape
16-
import androidx.compose.material.Text
7+
import androidx.compose.foundation.layout.PaddingValues
8+
import androidx.compose.foundation.layout.fillMaxSize
9+
import androidx.compose.foundation.shape.CircleShape
10+
import androidx.compose.material.Surface
1711
import androidx.compose.runtime.Composable
1812
import androidx.compose.runtime.LaunchedEffect
1913
import androidx.compose.runtime.getValue
@@ -22,15 +16,13 @@ import androidx.compose.runtime.remember
2216
import androidx.compose.runtime.setValue
2317
import androidx.compose.ui.Alignment
2418
import androidx.compose.ui.Modifier
25-
import androidx.compose.ui.graphics.Color
2619
import androidx.compose.ui.platform.LocalContext
27-
import androidx.compose.ui.res.painterResource
2820
import androidx.compose.ui.res.stringResource
29-
import androidx.compose.ui.unit.dp
3021
import androidx.lifecycle.Lifecycle
3122
import com.getcode.R
32-
import com.getcode.theme.BrandOverlay
33-
import com.getcode.theme.CodeTheme
23+
import com.getcode.theme.Brand
24+
import com.getcode.ui.components.ButtonState
25+
import com.getcode.ui.components.CodeButton
3426
import com.getcode.ui.components.OnLifecycleEvent
3527
import com.getcode.util.Biometrics
3628
import com.getcode.util.BiometricsError
@@ -46,44 +38,21 @@ internal fun BiometricsBlockingView(
4638
visible = !state.passed && !state.checking,
4739
enter = fadeIn(),
4840
exit = fadeOut()
41+
) {
42+
Surface(
43+
modifier = modifier,
44+
color = Brand.copy(alpha = 0.87f),
4945
) {
50-
Box(
51-
modifier = modifier.background(Color.Black),
52-
contentAlignment = Alignment.Center
53-
) {
54-
Image(
55-
modifier = Modifier
56-
.statusBarsPadding()
57-
.padding(vertical = CodeTheme.dimens.grid.x3)
58-
.padding(horizontal = CodeTheme.dimens.grid.x3)
59-
.align(Alignment.TopStart),
60-
painter = painterResource(
61-
R.drawable.ic_code_logo_white
62-
),
63-
contentDescription = "",
64-
)
65-
66-
Column(
67-
modifier = Modifier
68-
.background(BrandOverlay, RoundedCornerShape(8.dp))
69-
.clickable { state.request() }
70-
.padding(CodeTheme.dimens.grid.x3),
71-
verticalArrangement = Arrangement.spacedBy(
72-
CodeTheme.dimens.grid.x3,
73-
Alignment.CenterVertically
74-
),
75-
horizontalAlignment = Alignment.CenterHorizontally,
46+
Box(
47+
modifier = Modifier.fillMaxSize(),
48+
contentAlignment = Alignment.Center
7649
) {
77-
Image(
78-
modifier = Modifier.size(CodeTheme.dimens.staticGrid.x10),
79-
painter = painterResource(id = R.drawable.ic_biometrics),
80-
contentDescription = null
81-
)
82-
83-
Text(
84-
text = stringResource(R.string.action_biometricsClickToAuthenticate),
85-
style = CodeTheme.typography.textMedium,
86-
color = CodeTheme.colors.onBackground
50+
CodeButton(
51+
onClick = { state.request() },
52+
text = stringResource(id = R.string.action_unlockCode),
53+
contentPadding = PaddingValues(),
54+
shape = CircleShape,
55+
buttonState = ButtonState.Filled
8756
)
8857
}
8958
}

0 commit comments

Comments
 (0)