Skip to content

Commit 4c16482

Browse files
committed
fix: pin dots vertical alignment
1 parent 526a994 commit 4c16482

1 file changed

Lines changed: 40 additions & 6 deletions

File tree

app/src/main/java/to/bitkit/ui/sheets/ChangePinSheet.kt

Lines changed: 40 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -186,6 +186,8 @@ private fun ValidateContent(
186186

187187
VerticalSpacer(32.dp)
188188

189+
FillHeight()
190+
189191
AnimatedVisibility(visible = attemptsRemaining < Env.PIN_ATTEMPTS) {
190192
if (isLastAttempt) {
191193
BodyS(
@@ -208,14 +210,13 @@ private fun ValidateContent(
208210
.testTag("AttemptsRemaining")
209211
)
210212
}
211-
VerticalSpacer(16.dp)
212213
}
213214

214-
FillHeight()
215+
VerticalSpacer(16.dp)
215216

216217
PinDots(pin = pin)
217218

218-
VerticalSpacer(32.dp)
219+
FillHeight()
219220

220221
NumberPad(
221222
onPress = onKeyPress,
@@ -257,7 +258,7 @@ private fun NewPinContent(
257258

258259
PinDots(pin = pin)
259260

260-
VerticalSpacer(32.dp)
261+
FillHeight()
261262

262263
NumberPad(
263264
onPress = onKeyPress,
@@ -297,6 +298,8 @@ private fun ConfirmContent(
297298

298299
VerticalSpacer(32.dp)
299300

301+
FillHeight()
302+
300303
AnimatedVisibility(visible = showError) {
301304
BodyS(
302305
text = stringResource(R.string.security__cp_try_again),
@@ -308,11 +311,11 @@ private fun ConfirmContent(
308311
)
309312
}
310313

311-
FillHeight()
314+
VerticalSpacer(16.dp)
312315

313316
PinDots(pin = pin)
314317

315-
VerticalSpacer(32.dp)
318+
FillHeight()
316319

317320
NumberPad(
318321
onPress = onKeyPress,
@@ -386,6 +389,37 @@ private fun PreviewValidate() {
386389
}
387390
}
388391

392+
@Preview(showSystemUi = true)
393+
@Composable
394+
private fun PreviewValidateError() {
395+
AppThemeSurface {
396+
BottomSheetPreview {
397+
ValidateContent(
398+
pin = "12",
399+
attemptsRemaining = 3,
400+
onKeyPress = {},
401+
onBackClick = {},
402+
onClickForgotPin = {},
403+
)
404+
}
405+
}
406+
}
407+
408+
@Preview(showSystemUi = true)
409+
@Composable
410+
private fun PreviewConfirmError() {
411+
AppThemeSurface {
412+
BottomSheetPreview {
413+
ConfirmContent(
414+
pin = "12",
415+
showError = true,
416+
onKeyPress = {},
417+
onBackClick = {},
418+
)
419+
}
420+
}
421+
}
422+
389423
@Preview(showSystemUi = true)
390424
@Composable
391425
private fun PreviewNew() {

0 commit comments

Comments
 (0)