Skip to content

Commit f1dba47

Browse files
Merge pull request #4 from XAli-SHX/master
2 parents 5af528e + f50c0c0 commit f1dba47

File tree

1 file changed

+5
-3
lines changed
  • speld/src/main/java/com/yogeshpaliyal/speld

1 file changed

+5
-3
lines changed

speld/src/main/java/com/yogeshpaliyal/speld/OtpView.kt

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -61,6 +61,7 @@ fun OtpCell(
6161
@Composable
6262
fun PinInput(
6363
modifier: Modifier = Modifier,
64+
cellModifier: Modifier = Modifier,
6465
length: Int = 5,
6566
value: String = "",
6667
disableKeypad: Boolean = false,
@@ -92,12 +93,12 @@ fun PinInput(
9293
)
9394

9495
Row(
95-
modifier = Modifier.fillMaxWidth(),
96+
modifier = modifier.fillMaxWidth(),
9697
horizontalArrangement = Arrangement.Center
9798
) {
9899
repeat(length) {
99100
OtpCell(
100-
modifier = modifier
101+
modifier = cellModifier
101102
.size(width = 45.dp, height = 45.dp)
102103
.clip(MaterialTheme.shapes.large)
103104
.background(
@@ -112,7 +113,8 @@ fun PinInput(
112113
isCursorVisible = value.length == it,
113114
obscureText
114115
)
115-
Spacer(modifier = Modifier.size(8.dp))
116+
if (it != length - 1)
117+
Spacer(modifier = Modifier.size(8.dp))
116118
}
117119
}
118120
}

0 commit comments

Comments
 (0)