Skip to content

Commit 4270f8e

Browse files
committed
fix: implement adaptative spacing
1 parent 578d07a commit 4270f8e

File tree

2 files changed

+15
-1
lines changed

2 files changed

+15
-1
lines changed

app/src/main/java/to/bitkit/ui/components/Spacers.kt

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ import androidx.compose.foundation.layout.ColumnScope
55
import androidx.compose.foundation.layout.RowScope
66
import androidx.compose.foundation.layout.Spacer
77
import androidx.compose.foundation.layout.height
8+
import androidx.compose.foundation.layout.sizeIn
89
import androidx.compose.foundation.layout.width
910
import androidx.compose.runtime.Composable
1011
import androidx.compose.ui.Modifier
@@ -18,6 +19,15 @@ fun VerticalSpacer(height: Dp) {
1819
Spacer(modifier = Modifier.height(height))
1920
}
2021

22+
@Composable
23+
fun ColumnScope.VerticalSpacer(minHeight: Dp, maxHeight: Dp) {
24+
Spacer(
25+
modifier = Modifier
26+
.weight(1f)
27+
.sizeIn(minHeight = minHeight, maxHeight = maxHeight)
28+
)
29+
}
30+
2131
@Composable
2232
fun HorizontalSpacer(width: Dp) {
2333
Spacer(modifier = Modifier.width(width))

app/src/main/java/to/bitkit/ui/screens/transfer/SpendingAmountScreen.kt

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ import androidx.compose.foundation.layout.fillMaxWidth
99
import androidx.compose.foundation.layout.height
1010
import androidx.compose.foundation.layout.imePadding
1111
import androidx.compose.foundation.layout.padding
12+
import androidx.compose.foundation.layout.sizeIn
1213
import androidx.compose.material3.HorizontalDivider
1314
import androidx.compose.runtime.Composable
1415
import androidx.compose.runtime.LaunchedEffect
@@ -154,12 +155,15 @@ private fun SpendingAmountNodeRunning(
154155
.imePadding()
155156
.testTag("SpendingAmount")
156157
) {
157-
VerticalSpacer(16.dp)
158+
VerticalSpacer(minHeight = 16.dp, maxHeight = 32.dp)
159+
158160
Display(
159161
text = stringResource(R.string.lightning__spending_amount__title)
160162
.withAccent(accentColor = Colors.Purple)
161163
)
162164

165+
FillHeight()
166+
163167
NumberPadTextField(
164168
input = uiState.input,
165169
displayUnit = currencies.displayUnit,

0 commit comments

Comments
 (0)