Skip to content

Commit fa3692f

Browse files
authored
Merge pull request #118 from code-payments/chore/receipt-placement-across-screen-sizes
fix(micropayments): address receipt placement across screen sizes
2 parents 6d8bfa8 + fd81bcf commit fa3692f

1 file changed

Lines changed: 10 additions & 10 deletions

File tree

app/src/main/java/com/getcode/view/main/bill/PaymentReceiptBill.kt

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -7,10 +7,11 @@ import androidx.compose.foundation.layout.BoxWithConstraints
77
import androidx.compose.foundation.layout.Column
88
import androidx.compose.foundation.layout.ExperimentalLayoutApi
99
import androidx.compose.foundation.layout.WindowInsets
10+
import androidx.compose.foundation.layout.fillMaxHeight
1011
import androidx.compose.foundation.layout.fillMaxWidth
12+
import androidx.compose.foundation.layout.heightIn
1113
import androidx.compose.foundation.layout.padding
1214
import androidx.compose.foundation.layout.size
13-
import androidx.compose.foundation.layout.statusBars
1415
import androidx.compose.foundation.layout.statusBarsIgnoringVisibility
1516
import androidx.compose.foundation.layout.width
1617
import androidx.compose.foundation.layout.windowInsetsPadding
@@ -52,32 +53,31 @@ internal fun Receipt(
5253
BoxWithConstraints(
5354
modifier = modifier
5455
.windowInsetsPadding(WindowInsets.statusBarsIgnoringVisibility)
55-
.padding(horizontal = CodeTheme.dimens.inset)
56-
.padding(
57-
top = screenHeight * 0.10f,
58-
bottom = CodeTheme.dimens.grid.x12
59-
)
56+
.padding(horizontal = CodeTheme.dimens.inset),
57+
contentAlignment = Alignment.Center
6058
) {
6159
val mW = maxWidth
62-
val size = remember { mW * 0.65f }
60+
val codeSize = remember { mW * 0.65f }
6361

6462
Column(
6563
modifier = Modifier
64+
.padding(bottom = screenHeight * 0.10f)
6665
.background(CodeTheme.colors.onBackground, shape = CodeTheme.shapes.receipt())
67-
.padding(top = CodeTheme.dimens.grid.x12),
66+
.padding(top = CodeTheme.dimens.grid.x12)
67+
.heightIn(0.dp, 800.dp),
6868
horizontalAlignment = Alignment.CenterHorizontally,
6969
verticalArrangement = Arrangement.spacedBy(CodeTheme.dimens.grid.x5)
7070
) {
7171
if (data.isNotEmpty()) {
7272
BoxWithConstraints(
7373
modifier = Modifier
74-
.size(size)
74+
.size(codeSize)
7575
.background(CodeTheme.colors.brandMuted, CircleShape),
7676
contentAlignment = Alignment.Center
7777
) {
7878
AndroidView(
7979
modifier = Modifier
80-
.width(size),
80+
.fillMaxWidth(),
8181
factory = { context ->
8282
KikCodeContentView(context).apply {
8383
this.logo =

0 commit comments

Comments
 (0)