Displaying max allowed characters

This commit is contained in:
dankito 2024-10-04 07:45:06 +02:00
parent a58bd1d2ce
commit a2d752aca1
1 changed files with 18 additions and 7 deletions

View File

@ -20,6 +20,7 @@ import net.codinux.banking.ui.composables.tan.ImageSizeControls
import net.codinux.banking.ui.config.Colors import net.codinux.banking.ui.config.Colors
import net.codinux.banking.ui.config.DI import net.codinux.banking.ui.config.DI
import net.codinux.banking.ui.extensions.ImeNext import net.codinux.banking.ui.extensions.ImeNext
import net.codinux.banking.ui.forms.CaptionText
import net.codinux.banking.ui.forms.OutlinedTextField import net.codinux.banking.ui.forms.OutlinedTextField
import net.codinux.banking.ui.forms.Select import net.codinux.banking.ui.forms.Select
import net.codinux.banking.ui.model.Config.NewLine import net.codinux.banking.ui.model.Config.NewLine
@ -140,6 +141,8 @@ fun CreateEpcQrCodeScreen(onClosed: () -> Unit) {
keyboardOptions = KeyboardOptions.ImeNext keyboardOptions = KeyboardOptions.ImeNext
) )
CaptionText("${receiverName.length} / 70")
OutlinedTextField( OutlinedTextField(
label = { Text("IBAN") }, label = { Text("IBAN") },
value = iban, value = iban,
@ -156,13 +159,17 @@ fun CreateEpcQrCodeScreen(onClosed: () -> Unit) {
keyboardOptions = KeyboardOptions.ImeNext keyboardOptions = KeyboardOptions.ImeNext
) )
OutlinedTextField( Row(Modifier.fillMaxWidth(), verticalAlignment = Alignment.CenterVertically) {
label = { Text("Betrag (optional)") }, OutlinedTextField(
value = amount, label = { Text("Betrag (optional)") },
onValueChange = { amount = it }, value = amount,
modifier = Modifier.fillMaxWidth().padding(vertical = 8.dp).focusRequester(amountFocus), onValueChange = { amount = it },
keyboardOptions = KeyboardOptions.ImeNext modifier = Modifier.weight(1f).padding(vertical = 8.dp).focusRequester(amountFocus),
) keyboardOptions = KeyboardOptions.ImeNext
)
Text(DI.formatUtil.formatCurrency("EUR"), Modifier.padding(start = 4.dp)) // Euro is currently the only supported currency
}
OutlinedTextField( OutlinedTextField(
label = { Text("Verwendungszweck (optional)") }, label = { Text("Verwendungszweck (optional)") },
@ -172,6 +179,8 @@ fun CreateEpcQrCodeScreen(onClosed: () -> Unit) {
keyboardOptions = KeyboardOptions.ImeNext keyboardOptions = KeyboardOptions.ImeNext
) )
CaptionText("${reference.length} / 140")
// not exposing it to user as it's a) not displayed by most apps and b) may causes overflow of used QR code library // not exposing it to user as it's a) not displayed by most apps and b) may causes overflow of used QR code library
// OutlinedTextField( // OutlinedTextField(
// label = { Text("Information für den Nutzer (optional)") }, // label = { Text("Information für den Nutzer (optional)") },
@ -180,6 +189,8 @@ fun CreateEpcQrCodeScreen(onClosed: () -> Unit) {
// modifier = Modifier.fillMaxWidth().padding(vertical = 8.dp), // modifier = Modifier.fillMaxWidth().padding(vertical = 8.dp),
// keyboardOptions = KeyboardOptions.ImeNext // keyboardOptions = KeyboardOptions.ImeNext
// ) // )
//
// CaptionText("${informationForUser.length} / 70")
} }
} }
} }