@@ -2,21 +2,23 @@ package to.bitkit.ui.screens.wallets.receive
22
33import androidx.compose.foundation.Image
44import androidx.compose.foundation.layout.Arrangement
5+ import androidx.compose.foundation.layout.Box
56import androidx.compose.foundation.layout.Column
67import androidx.compose.foundation.layout.Row
78import androidx.compose.foundation.layout.Spacer
89import androidx.compose.foundation.layout.fillMaxWidth
910import androidx.compose.foundation.layout.height
10- import androidx.compose.foundation.layout.heightIn
1111import androidx.compose.foundation.layout.padding
1212import androidx.compose.runtime.Composable
1313import androidx.compose.runtime.remember
14+ import androidx.compose.ui.Alignment
1415import androidx.compose.ui.Modifier
1516import androidx.compose.ui.layout.ContentScale
1617import androidx.compose.ui.res.painterResource
1718import androidx.compose.ui.res.stringResource
1819import androidx.compose.ui.text.SpanStyle
1920import androidx.compose.ui.text.font.FontWeight
21+ import androidx.compose.ui.tooling.preview.Devices.PIXEL_TABLET
2022import androidx.compose.ui.tooling.preview.Preview
2123import androidx.compose.ui.unit.dp
2224import kotlinx.serialization.Serializable
@@ -116,52 +118,58 @@ private fun ReceiveConfirmContent(
116118 SheetTopBar (stringResource(R .string.wallet__receive_bitcoin), onBack = onBackClick)
117119 Spacer (Modifier .height(24 .dp))
118120
119- Column (
120- modifier = Modifier .padding(horizontal = 16 .dp )
121+ Box (
122+ modifier = Modifier .fillMaxWidth( )
121123 ) {
122- BalanceHeaderView (
123- sats = receiveSats,
124- modifier = Modifier .fillMaxWidth()
125- )
126- Spacer (modifier = Modifier .height(24 .dp))
127- BodyM (
128- text = stringResource(if (isAdditional) R .string.wallet__receive_connect_additional else R .string.wallet__receive_connect_initial)
129- .replace(" {networkFee}" , networkFeeFormatted)
130- .replace(" {serviceFee}" , serviceFeeFormatted)
131- .withAccent(
132- defaultColor = Colors .White64 ,
133- accentStyle = SpanStyle (color = Colors .White , fontWeight = FontWeight .Bold )
134- )
135- )
136- Spacer (modifier = Modifier .height(32 .dp))
137- Column {
138- Caption13Up (text = stringResource(R .string.wallet__receive_will), color = Colors .White64 )
139- Spacer (Modifier .height(4 .dp))
140- Title (text = receiveAmountFormatted)
141- }
142- Spacer (modifier = Modifier .weight(1f ))
124+
143125 Image (
144126 painter = painterResource(R .drawable.lightning),
145127 contentDescription = null ,
146128 contentScale = ContentScale .Fit ,
147129 modifier = Modifier
148- .heightIn(max = 256 .dp)
130+ .padding(bottom = 150 .dp)
149131 .fillMaxWidth()
132+ .align(Alignment .BottomCenter )
150133 )
151- Spacer (modifier = Modifier .weight(1f ))
152- Row (horizontalArrangement = Arrangement .spacedBy(16 .dp)) {
153- SecondaryButton (
154- text = stringResource(R .string.common__learn_more),
155- onClick = onLearnMoreClick,
156- modifier = Modifier .weight(1f )
134+
135+ Column (
136+ modifier = Modifier .padding(horizontal = 16 .dp)
137+ ) {
138+ BalanceHeaderView (
139+ sats = receiveSats,
140+ modifier = Modifier .fillMaxWidth()
157141 )
158- PrimaryButton (
159- text = stringResource(R .string.common__continue),
160- onClick = onContinueClick,
161- modifier = Modifier .weight(1f )
142+ Spacer (modifier = Modifier .height(24 .dp))
143+ BodyM (
144+ text = stringResource(if (isAdditional) R .string.wallet__receive_connect_additional else R .string.wallet__receive_connect_initial)
145+ .replace(" {networkFee}" , networkFeeFormatted)
146+ .replace(" {serviceFee}" , serviceFeeFormatted)
147+ .withAccent(
148+ defaultColor = Colors .White64 ,
149+ accentStyle = SpanStyle (color = Colors .White , fontWeight = FontWeight .Bold )
150+ )
162151 )
152+ Spacer (modifier = Modifier .height(32 .dp))
153+ Column {
154+ Caption13Up (text = stringResource(R .string.wallet__receive_will), color = Colors .White64 )
155+ Spacer (Modifier .height(4 .dp))
156+ Title (text = receiveAmountFormatted)
157+ }
158+ Spacer (modifier = Modifier .weight(1f ))
159+ Row (horizontalArrangement = Arrangement .spacedBy(16 .dp)) {
160+ SecondaryButton (
161+ text = stringResource(R .string.common__learn_more),
162+ onClick = onLearnMoreClick,
163+ modifier = Modifier .weight(1f )
164+ )
165+ PrimaryButton (
166+ text = stringResource(R .string.common__continue),
167+ onClick = onContinueClick,
168+ modifier = Modifier .weight(1f )
169+ )
170+ }
171+ Spacer (modifier = Modifier .height(32 .dp))
163172 }
164- Spacer (modifier = Modifier .height(32 .dp))
165173 }
166174 }
167175}
@@ -199,3 +207,36 @@ private fun Preview2() {
199207 )
200208 }
201209}
210+
211+ @Preview(showBackground = true , name = " Small device" , widthDp = 400 , heightDp = 620 )
212+ @Composable
213+ private fun Preview3 () {
214+ AppThemeSurface {
215+ ReceiveConfirmContent (
216+ receiveSats = 12500L ,
217+ isAdditional = true ,
218+ networkFeeFormatted = " $0.50" ,
219+ serviceFeeFormatted = " $1.00" ,
220+ receiveAmountFormatted = " $100.00" ,
221+ onLearnMoreClick = {},
222+ onContinueClick = {},
223+ onBackClick = {},
224+ )
225+ }
226+ }
227+ @Preview(showBackground = true , name = " Tablet" , device = PIXEL_TABLET )
228+ @Composable
229+ private fun Preview4 () {
230+ AppThemeSurface {
231+ ReceiveConfirmContent (
232+ receiveSats = 12500L ,
233+ isAdditional = true ,
234+ networkFeeFormatted = " $0.50" ,
235+ serviceFeeFormatted = " $1.00" ,
236+ receiveAmountFormatted = " $100.00" ,
237+ onLearnMoreClick = {},
238+ onContinueClick = {},
239+ onBackClick = {},
240+ )
241+ }
242+ }
0 commit comments