Skip to content

Commit dc0295c

Browse files
authored
Fix ui bug in external billing login (#144)
1 parent 7e0b642 commit dc0295c

File tree

2 files changed

+9
-2
lines changed

2 files changed

+9
-2
lines changed

ui/build.gradle.kts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -114,4 +114,3 @@ dependencies {
114114
androidTestImplementation(libs.test.espressoCore)
115115
androidTestImplementation(libs.test.runner)
116116
}
117-

ui/src/main/java/io/snabble/sdk/ui/payment/externalbilling/ui/ExternalBillingLoginScreen.kt

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,8 +17,10 @@ import androidx.compose.runtime.Composable
1717
import androidx.compose.runtime.mutableStateOf
1818
import androidx.compose.runtime.saveable.rememberSaveable
1919
import androidx.compose.ui.Alignment
20+
import androidx.compose.ui.ExperimentalComposeUiApi
2021
import androidx.compose.ui.Modifier
2122
import androidx.compose.ui.platform.LocalFocusManager
23+
import androidx.compose.ui.platform.LocalSoftwareKeyboardController
2224
import androidx.compose.ui.res.stringResource
2325
import androidx.compose.ui.text.style.TextAlign
2426
import androidx.compose.ui.tooling.preview.Preview
@@ -27,6 +29,7 @@ import io.snabble.sdk.ui.R
2729
import io.snabble.sdk.ui.payment.externalbilling.ui.widgets.PasswordField
2830
import io.snabble.sdk.ui.payment.payone.sepa.form.ui.widget.TextFieldWidget
2931

32+
@OptIn(ExperimentalComposeUiApi::class)
3033
@Composable
3134
fun ExternalBillingLoginScreen(
3235
onSaveClick: (username: String, password: String) -> Unit,
@@ -43,6 +46,8 @@ fun ExternalBillingLoginScreen(
4346
mutableStateOf("")
4447
}
4548
val passwordVisible = rememberSaveable { mutableStateOf(false) }
49+
50+
val keyboardController = LocalSoftwareKeyboardController.current
4651
Column(
4752
modifier = Modifier
4853
.fillMaxSize()
@@ -98,7 +103,10 @@ fun ExternalBillingLoginScreen(
98103
),
99104
enabled = password.value.isNotEmpty() && username.value.isNotEmpty(),
100105
shape = MaterialTheme.shapes.extraLarge,
101-
onClick = { onSaveClick(username.value, password.value) },
106+
onClick = {
107+
onSaveClick(username.value, password.value)
108+
keyboardController?.hide()
109+
},
102110
) {
103111
Text(text = stringResource(id = R.string.Snabble_Payment_ExternalBilling_add))
104112
}

0 commit comments

Comments
 (0)