taler-android

Android apps for GNU Taler (wallet, PoS, cashier)
Log | Files | Refs | README | LICENSE

cash-keypad-submit-is-cut-off.diff (2624B)


      1 diff --git a/merchant-terminal/src/main/java/net/taler/merchantpos/checkout/CheckoutAmountEntry.kt b/merchant-terminal/src/main/java/net/taler/merchantpos/checkout/CheckoutAmountEntry.kt
      2 index a22c8c34..994b6507 100644
      3 --- a/merchant-terminal/src/main/java/net/taler/merchantpos/checkout/CheckoutAmountEntry.kt
      4 +++ b/merchant-terminal/src/main/java/net/taler/merchantpos/checkout/CheckoutAmountEntry.kt
      5 @@ -244,16 +244,35 @@ internal fun CheckoutAmountEntry(
      6  
      7                  isLandscape ->
      8                  {
      9 +                    // The keypad is a fixed stack: four rows of keys, a gap,
     10 +                    // and the submit button.  At 48 dp a key that is 280 dp
     11 +                    // tall, and a phone in landscape leaves about 300 dp once
     12 +                    // the title row and this padding are taken off -- so the
     13 +                    // submit button, which carries the amount about to be
     14 +                    // recorded, was drawn half off the bottom of the screen
     15 +                    // with no way to scroll to it.  The keys give way first,
     16 +                    // and the column scrolls as a backstop, which is what
     17 +                    // every other branch here already does.
     18 +                    val keyGap = 8.dp
     19 +                    val actionGap = 16.dp
     20 +                    val submitHeight = 48.dp
     21 +                    val keyHeight =
     22 +                        ((maxHeight - 40.dp - keyGap * 3 - actionGap - submitHeight) / 4)
     23 +                            .coerceIn(36.dp, 48.dp)
     24                      Row(
     25                          modifier = Modifier.fillMaxSize().padding(horizontal = 24.dp, vertical = 20.dp),
     26                          horizontalArrangement = Arrangement.spacedBy(36.dp),
     27                          verticalAlignment = Alignment.Top,
     28                      ) {
     29                          CheckoutNumberPad(
     30 -                            modifier = Modifier.weight(0.59f),
     31 -                            keyHeight = 48.dp,
     32 -                            keyGap = 8.dp,
     33 -                            actionGap = 16.dp,
     34 +                            modifier =
     35 +                                Modifier
     36 +                                    .weight(0.59f)
     37 +                                    .fillMaxHeight()
     38 +                                    .verticalScroll(rememberScrollState()),
     39 +                            keyHeight = keyHeight,
     40 +                            keyGap = keyGap,
     41 +                            actionGap = actionGap,
     42                              submitLabel = submitLabel,
     43                              enabled = submitEnabled,
     44                              onDigit = onDigit,