11package to.bitkit.ui.screens.transfer
22
33import androidx.compose.foundation.Image
4- import androidx.compose.foundation.layout.Box
54import androidx.compose.foundation.layout.Column
65import androidx.compose.foundation.layout.Spacer
76import androidx.compose.foundation.layout.fillMaxWidth
87import androidx.compose.foundation.layout.height
98import androidx.compose.foundation.layout.padding
10- import androidx.compose.foundation.layout.size
119import androidx.compose.material3.CenterAlignedTopAppBar
1210import androidx.compose.material3.ExperimentalMaterial3Api
1311import androidx.compose.runtime.Composable
@@ -20,6 +18,7 @@ import androidx.compose.ui.Modifier
2018import androidx.compose.ui.layout.ContentScale
2119import androidx.compose.ui.res.painterResource
2220import androidx.compose.ui.res.stringResource
21+ import androidx.compose.ui.tooling.preview.Devices.NEXUS_5
2322import androidx.compose.ui.tooling.preview.Preview
2423import androidx.compose.ui.unit.dp
2524import com.synonym.bitkitcore.regtestMine
@@ -110,14 +109,17 @@ private fun SettingUpScreen(
110109 actions = { CloseNavIcon (onCloseClick) },
111110 )
112111 Column (
112+ horizontalAlignment = Alignment .CenterHorizontally ,
113113 modifier = Modifier
114114 .fillMaxWidth()
115115 .padding(horizontal = 16 .dp)
116116 ) {
117117 Spacer (modifier = Modifier .height(12 .dp))
118118 if (inProgress) {
119119 Display (
120- text = stringResource(R .string.lightning__savings_progress__title).withAccent(accentColor = Colors .Purple ),
120+ text = stringResource(R .string.lightning__savings_progress__title)
121+ .withAccent(accentColor = Colors .Purple ),
122+ modifier = Modifier .fillMaxWidth(),
121123 )
122124 Spacer (modifier = Modifier .height(8 .dp))
123125 BodyM (
@@ -128,6 +130,7 @@ private fun SettingUpScreen(
128130 Display (
129131 text = stringResource(R .string.lightning__transfer_success__title_spending)
130132 .withAccent(accentColor = Colors .Purple ),
133+ modifier = Modifier .fillMaxWidth(),
131134 )
132135 Spacer (modifier = Modifier .height(8 .dp))
133136 BodyM (
@@ -140,6 +143,7 @@ private fun SettingUpScreen(
140143 TransferAnimationView (
141144 largeCircleRes = R .drawable.ln_sync_large,
142145 smallCircleRes = R .drawable.ln_sync_small,
146+ modifier = Modifier .weight(1f )
143147 )
144148 Spacer (modifier = Modifier .height(16 .dp))
145149 val steps = listOf (
@@ -156,23 +160,16 @@ private fun SettingUpScreen(
156160 .align(alignment = Alignment .CenterHorizontally )
157161 )
158162 } else {
159- Box (
160- contentAlignment = Alignment .Center ,
163+ Image (
164+ painter = painterResource(id = R .drawable.check),
165+ contentDescription = null ,
166+ contentScale = ContentScale .Fit ,
161167 modifier = Modifier
162- .fillMaxWidth()
163- .padding(horizontal = 16 .dp)
164- .padding(top = 16 .dp)
165- ) {
166- Image (
167- painter = painterResource(id = R .drawable.check),
168- contentDescription = null ,
169- contentScale = ContentScale .Fit ,
170- modifier = Modifier .size(256 .dp)
171- )
172- }
168+ .weight(1f )
169+ .padding(16 .dp)
170+ )
173171 }
174172
175- Spacer (modifier = Modifier .weight(1f ))
176173
177174 val randomOkText = localizedRandom(R .string.common__ok_random)
178175 PrimaryButton (
@@ -198,6 +195,16 @@ private fun SettingUpScreenProgressPreview() {
198195 }
199196}
200197
198+ @Preview(name = " Progress" , showSystemUi = true , showBackground = true , device = NEXUS_5 )
199+ @Composable
200+ private fun SettingUpScreenProgressSmallPreview () {
201+ AppThemeSurface {
202+ SettingUpScreen (
203+ lightningSetupStep = 2 ,
204+ )
205+ }
206+ }
207+
201208@Preview(name = " Success" , showSystemUi = true , showBackground = true )
202209@Composable
203210private fun SettingUpScreenSuccessPreview () {
@@ -207,3 +214,13 @@ private fun SettingUpScreenSuccessPreview() {
207214 )
208215 }
209216}
217+
218+ @Preview(name = " Success" , showSystemUi = true , showBackground = true , device = NEXUS_5 )
219+ @Composable
220+ private fun SettingUpScreenSuccessSmallPreview () {
221+ AppThemeSurface {
222+ SettingUpScreen (
223+ lightningSetupStep = 3 ,
224+ )
225+ }
226+ }
0 commit comments