mirror of
https://github.com/Novaloop-AG/element-x-android.git
synced 2026-11-02 21:32:34 +00:00
Optimize code
This commit is contained in:
committed by
Benoit Marty
parent
06d778859c
commit
bad39d62e9
+2
-1
@@ -83,11 +83,12 @@ private fun PinEntryRow(
|
|||||||
horizontalArrangement = Arrangement.spacedBy(8.dp, alignment = Alignment.CenterHorizontally),
|
horizontalArrangement = Arrangement.spacedBy(8.dp, alignment = Alignment.CenterHorizontally),
|
||||||
verticalArrangement = Arrangement.spacedBy(8.dp),
|
verticalArrangement = Arrangement.spacedBy(8.dp),
|
||||||
) {
|
) {
|
||||||
|
val focusedIndex = pinEntry.digits.indexOfFirst { it is PinDigit.Empty }
|
||||||
pinEntry.digits.forEachIndexed { index, digit ->
|
pinEntry.digits.forEachIndexed { index, digit ->
|
||||||
PinDigitView(
|
PinDigitView(
|
||||||
digit = digit,
|
digit = digit,
|
||||||
isSecured = isSecured,
|
isSecured = isSecured,
|
||||||
isFocused = isFocused && index == pinEntry.digits.indexOfFirst { it is PinDigit.Empty }
|
isFocused = isFocused && index == focusedIndex
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user