Skip to content

Commit

Permalink
Merge pull request #4 from XAli-SHX/master
Browse files Browse the repository at this point in the history
  • Loading branch information
yogeshpaliyal authored Apr 22, 2023
2 parents 5af528e + f50c0c0 commit f1dba47
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions speld/src/main/java/com/yogeshpaliyal/speld/OtpView.kt
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,7 @@ fun OtpCell(
@Composable
fun PinInput(
modifier: Modifier = Modifier,
cellModifier: Modifier = Modifier,
length: Int = 5,
value: String = "",
disableKeypad: Boolean = false,
Expand Down Expand Up @@ -92,12 +93,12 @@ fun PinInput(
)

Row(
modifier = Modifier.fillMaxWidth(),
modifier = modifier.fillMaxWidth(),
horizontalArrangement = Arrangement.Center
) {
repeat(length) {
OtpCell(
modifier = modifier
modifier = cellModifier
.size(width = 45.dp, height = 45.dp)
.clip(MaterialTheme.shapes.large)
.background(
Expand All @@ -112,7 +113,8 @@ fun PinInput(
isCursorVisible = value.length == it,
obscureText
)
Spacer(modifier = Modifier.size(8.dp))
if (it != length - 1)
Spacer(modifier = Modifier.size(8.dp))
}
}
}

0 comments on commit f1dba47

Please sign in to comment.