diff --git a/merchant-terminal/src/main/java/net/taler/merchantpos/config/ConfigFragment.kt b/merchant-terminal/src/main/java/net/taler/merchantpos/config/ConfigFragment.kt index 99f9f91e..ae52257b 100644 --- a/merchant-terminal/src/main/java/net/taler/merchantpos/config/ConfigFragment.kt +++ b/merchant-terminal/src/main/java/net/taler/merchantpos/config/ConfigFragment.kt @@ -673,14 +673,34 @@ private fun ConfigScreen( Modifier .widthIn(max = if (isTabletLayout) 960.dp else 640.dp) .fillMaxSize() - .padding(20.dp), + // A phone in landscape has about 150 dp of screen left + // once the keyboard is up; 40 dp of it must not go on + // padding, or the field being typed into does not fit. + .padding( + horizontal = 20.dp, + vertical = if (isTabletLayout) 20.dp else 8.dp, + ), verticalArrangement = Arrangement.spacedBy(16.dp), ) { - RowButtons( - mode = mode, - onManual = { onModeChanged(ConfigMode.Manual) }, - onQr = { onModeChanged(ConfigMode.Qr) }, - ) + val tabs: @Composable () -> Unit = { + RowButtons( + mode = mode, + onManual = { onModeChanged(ConfigMode.Manual) }, + onQr = { onModeChanged(ConfigMode.Qr) }, + ) + } + // In Manual mode the tab row goes *inside* the form's own + // list, so that it can scroll away. With the keyboard up a + // phone in landscape has about 150 dp of screen left, and a + // tab row pinned above the form takes a third of it -- enough + // that the field being typed into could not be brought into + // view at all. The QR mode has nothing to type and a camera + // preview that wants a fixed height, so it keeps the row + // where it was. + if (mode != ConfigMode.Manual) + { + tabs() + } if (mode == ConfigMode.Manual) { ManualConfigScreen( @@ -688,6 +708,7 @@ private fun ConfigScreen( Modifier .fillMaxWidth() .weight(1f), + tabs = tabs, merchantUrl = merchantUrl, username = username, token = token, @@ -790,6 +811,7 @@ private fun ConfigScreen( @Composable private fun ManualConfigScreen( modifier: Modifier, + tabs: @Composable () -> Unit, merchantUrl: String, username: String, token: String, @@ -811,6 +833,7 @@ private fun ManualConfigScreen( state = formListState, verticalArrangement = Arrangement.spacedBy(16.dp), ) { + item { tabs() } item { OutlinedTextField( value = merchantUrl,