From 039174ebb9b20d0efd59f2bbebab328e5d79be73 Mon Sep 17 00:00:00 2001 From: Pauljd Date: Fri, 13 Nov 2026 08:15:19 +0000 Subject: [PATCH] Create your own's text boxes follow the remote's rules Found testing RC1's first-run fallback on the emulator: the channel name box kept Up and Down, so Next couldn't be reached. OrbitField now uses textFieldKeys, as the sign-in boxes do (OK opens the keyboard, Up and Down move). Co-Authored-By: Claude Opus 5.5 --- .../app/src/main/java/tv/orbit/classic/CreateChannel.kt | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/android/app/src/main/java/tv/orbit/classic/CreateChannel.kt b/android/app/src/main/java/tv/orbit/classic/CreateChannel.kt index 502dece7..70178894 100644 --- a/android/app/src/main/java/tv/orbit/classic/CreateChannel.kt +++ b/android/app/src/main/java/tv/orbit/classic/CreateChannel.kt @@ -13,6 +13,7 @@ import androidx.compose.foundation.lazy.items import androidx.compose.foundation.shape.RoundedCornerShape import androidx.compose.foundation.text.BasicTextField import androidx.compose.foundation.text.KeyboardOptions +import androidx.compose.ui.input.key.onPreviewKeyEvent import androidx.compose.runtime.* import androidx.compose.ui.Alignment import androidx.compose.ui.Modifier @@ -217,9 +218,13 @@ internal fun ChoiceCard(title: String, lines: List, modifier: Modifier, @Composable internal fun OrbitField(value: String, onChange: (String) -> Unit, hint: String, modifier: Modifier) { var focused by remember { mutableStateOf(false) } + // The remote's rules for a text box (1.0 RC1, found on the emulator: Create your own's name box kept Up and Down, so its + // Next button couldn't be reached): OK opens the keyboard, Up and Down move on, as on the sign-in boxes. + val keyboard = androidx.compose.ui.platform.LocalSoftwareKeyboardController.current + val focus = androidx.compose.ui.platform.LocalFocusManager.current Box(modifier.onFocusChanged { focused = it.isFocused }.background(Panel, RoundedCornerShape(8.dp)).border(2.dp, if (focused) Yellow else Blue, RoundedCornerShape(8.dp)).padding(10.dp)) { if (value.isEmpty()) Text(hint, color = Muted, fontSize = 15.sp) - BasicTextField(value, { onChange(it.replace("\n", "")) }, Modifier.fillMaxWidth(), singleLine = true, textStyle = TextStyle(color = Ink, fontSize = 15.sp), + BasicTextField(value, { onChange(it.replace("\n", "")) }, Modifier.fillMaxWidth().onPreviewKeyEvent { event -> textFieldKeys(event.nativeKeyEvent, keyboard, focus) }, singleLine = true, textStyle = TextStyle(color = Ink, fontSize = 15.sp), cursorBrush = SolidColor(Yellow), keyboardOptions = KeyboardOptions(imeAction = ImeAction.Done)) } }