From 08db2b0efc81b10fa9ed1416ea6c35dc8f2d6e79 Mon Sep 17 00:00:00 2001 From: Brian Gunter Date: Mon, 11 May 2026 10:23:02 -0400 Subject: [PATCH] Accept digits in the PIN field in addition to l/r/u/d (#1330) ## Description This enhances the PIN entry system by allowing users to input digits using the numbers 0-9. This is useful for those using a keyboard or universal remote with a number pad. ### Testing Tested on Nvidia Shield Pro and Onn 4k Pro ## Screenshots Screenshot_20260429_083041 --------- Co-authored-by: Damontecres --- .../damontecres/wholphin/ui/setup/PinEntry.kt | 28 +++++++++++++++++++ app/src/main/res/values/strings.xml | 1 + 2 files changed, 29 insertions(+) diff --git a/app/src/main/java/com/github/damontecres/wholphin/ui/setup/PinEntry.kt b/app/src/main/java/com/github/damontecres/wholphin/ui/setup/PinEntry.kt index e0d49631..f9f22591 100644 --- a/app/src/main/java/com/github/damontecres/wholphin/ui/setup/PinEntry.kt +++ b/app/src/main/java/com/github/damontecres/wholphin/ui/setup/PinEntry.kt @@ -25,6 +25,7 @@ import androidx.compose.ui.input.key.key import androidx.compose.ui.input.key.onKeyEvent import androidx.compose.ui.input.key.type import androidx.compose.ui.res.stringResource +import androidx.compose.ui.text.font.FontWeight import androidx.compose.ui.unit.dp import androidx.compose.ui.unit.sp import androidx.tv.material3.MaterialTheme @@ -72,6 +73,16 @@ fun PinEntry( Key.DirectionRight -> "R" Key.DirectionDown -> "D" Key.DirectionLeft -> "L" + Key.Zero, Key.NumPad0 -> "0" + Key.One, Key.NumPad1 -> "1" + Key.Two, Key.NumPad2 -> "2" + Key.Three, Key.NumPad3 -> "3" + Key.Four, Key.NumPad4 -> "4" + Key.Five, Key.NumPad5 -> "5" + Key.Six, Key.NumPad6 -> "6" + Key.Seven, Key.NumPad7 -> "7" + Key.Eight, Key.NumPad8 -> "8" + Key.Nine, Key.NumPad9 -> "9" else -> return@onKeyEvent false } onTextChange.invoke(str) @@ -122,6 +133,16 @@ fun PinEntryCreate( Key.DirectionRight -> "R" Key.DirectionDown -> "D" Key.DirectionLeft -> "L" + Key.Zero, Key.NumPad0 -> "0" + Key.One, Key.NumPad1 -> "1" + Key.Two, Key.NumPad2 -> "2" + Key.Three, Key.NumPad3 -> "3" + Key.Four, Key.NumPad4 -> "4" + Key.Five, Key.NumPad5 -> "5" + Key.Six, Key.NumPad6 -> "6" + Key.Seven, Key.NumPad7 -> "7" + Key.Eight, Key.NumPad8 -> "8" + Key.Nine, Key.NumPad9 -> "9" else -> return@onKeyEvent false } onTextChange.invoke(str) @@ -154,6 +175,7 @@ fun PinEntryCreate( @Composable fun PinArrowRow(modifier: Modifier = Modifier) { Row( + verticalAlignment = Alignment.CenterVertically, horizontalArrangement = Arrangement.spacedBy(8.dp), modifier = modifier, ) { @@ -167,6 +189,12 @@ fun PinArrowRow(modifier: Modifier = Modifier) { fontFamily = FontAwesome, ) } + Text( + text = stringResource(R.string.pin_digits_hint), + color = MaterialTheme.colorScheme.onSurface, + style = MaterialTheme.typography.headlineSmall, + fontWeight = FontWeight.SemiBold, + ) } } diff --git a/app/src/main/res/values/strings.xml b/app/src/main/res/values/strings.xml index afa848d6..b9b56865 100644 --- a/app/src/main/res/values/strings.xml +++ b/app/src/main/res/values/strings.xml @@ -390,6 +390,7 @@ Incorrect PIN must be 4 keys or longer Will remove PIN + [0-9] Image disk cache size (MB) View options Columns