summaryrefslogtreecommitdiffhomepage
path: root/android/app
diff options
context:
space:
mode:
Diffstat (limited to 'android/app')
-rw-r--r--android/app/src/main/kotlin/net/mullvad/mullvadvpn/compose/screen/LoginScreen.kt3
-rw-r--r--android/app/src/main/kotlin/net/mullvad/mullvadvpn/compose/util/Keyboard.kt15
2 files changed, 17 insertions, 1 deletions
diff --git a/android/app/src/main/kotlin/net/mullvad/mullvadvpn/compose/screen/LoginScreen.kt b/android/app/src/main/kotlin/net/mullvad/mullvadvpn/compose/screen/LoginScreen.kt
index a0829b79d5..ba799d55c1 100644
--- a/android/app/src/main/kotlin/net/mullvad/mullvadvpn/compose/screen/LoginScreen.kt
+++ b/android/app/src/main/kotlin/net/mullvad/mullvadvpn/compose/screen/LoginScreen.kt
@@ -81,6 +81,7 @@ import net.mullvad.mullvadvpn.compose.textfield.mullvadWhiteTextFieldColors
import net.mullvad.mullvadvpn.compose.transitions.LoginTransition
import net.mullvad.mullvadvpn.compose.util.CollectSideEffectWithLifecycle
import net.mullvad.mullvadvpn.compose.util.OnNavResultValue
+import net.mullvad.mullvadvpn.compose.util.accountNumberKeyboardType
import net.mullvad.mullvadvpn.compose.util.accountNumberVisualTransformation
import net.mullvad.mullvadvpn.compose.util.showSnackbarImmediately
import net.mullvad.mullvadvpn.lib.theme.AppTheme
@@ -285,7 +286,7 @@ private fun ColumnScope.LoginInput(
keyboardOptions =
KeyboardOptions(
imeAction = if (state.loginButtonEnabled) ImeAction.Done else ImeAction.None,
- keyboardType = KeyboardType.NumberPassword,
+ keyboardType = KeyboardType.accountNumberKeyboardType(LocalContext.current),
),
onValueChange = onAccountNumberChange,
singleLine = true,
diff --git a/android/app/src/main/kotlin/net/mullvad/mullvadvpn/compose/util/Keyboard.kt b/android/app/src/main/kotlin/net/mullvad/mullvadvpn/compose/util/Keyboard.kt
new file mode 100644
index 0000000000..ce2e9206cc
--- /dev/null
+++ b/android/app/src/main/kotlin/net/mullvad/mullvadvpn/compose/util/Keyboard.kt
@@ -0,0 +1,15 @@
+package net.mullvad.mullvadvpn.compose.util
+
+import android.content.Context
+import androidx.compose.ui.text.input.KeyboardType
+
+fun KeyboardType.Companion.accountNumberKeyboardType(context: Context): KeyboardType =
+ if (isFireStick(context)) {
+ Number
+ } else {
+ NumberPassword
+ }
+
+// See: https://developer.amazon.com/docs/fire-tv/identify-amazon-fire-tv-devices.html
+private fun isFireStick(context: Context): Boolean =
+ context.packageManager.hasSystemFeature("amazon.hardware.fire_tv")