@@ -10,13 +10,13 @@ import androidx.compose.foundation.layout.Box
1010import androidx.compose.foundation.layout.Column
1111import androidx.compose.foundation.layout.PaddingValues
1212import androidx.compose.foundation.layout.Row
13- import androidx.compose.foundation.layout.Spacer
13+ import androidx.compose.foundation.layout.defaultMinSize
1414import androidx.compose.foundation.layout.fillMaxSize
1515import androidx.compose.foundation.layout.fillMaxWidth
16- import androidx.compose.foundation.layout.height
1716import androidx.compose.foundation.layout.offset
1817import androidx.compose.foundation.layout.padding
1918import androidx.compose.foundation.layout.size
19+ import androidx.compose.foundation.layout.sizeIn
2020import androidx.compose.foundation.pager.HorizontalPager
2121import androidx.compose.foundation.pager.rememberPagerState
2222import androidx.compose.foundation.shape.CircleShape
@@ -39,6 +39,7 @@ import to.bitkit.R
3939import to.bitkit.ui.components.BodyM
4040import to.bitkit.ui.components.ButtonSize
4141import to.bitkit.ui.components.Display
42+ import to.bitkit.ui.components.FillHeight
4243import to.bitkit.ui.components.Footnote
4344import to.bitkit.ui.components.SecondaryButton
4445import to.bitkit.ui.components.VerticalSpacer
@@ -53,18 +54,18 @@ private const val PAGE_COUNT = LAST_PAGE_INDEX + 1
5354
5455@Composable
5556fun OnboardingSlidesScreen (
56- currentTab : Int = 0,
5757 isGeoBlocked : Boolean ,
5858 onAdvancedSetupClick : () -> Unit ,
5959 onCreateClick : () -> Unit ,
6060 onRestoreClick : () -> Unit ,
61+ modifier : Modifier = Modifier ,
62+ currentTab : Int = 0,
6163) {
6264 val scope = rememberCoroutineScope()
6365 val pagerState = rememberPagerState(initialPage = currentTab, pageCount = { PAGE_COUNT })
6466
6567 Box (
66- modifier = Modifier
67- .screen()
68+ modifier = modifier.screen()
6869 ) {
6970 HorizontalPager (
7071 state = pagerState,
@@ -123,16 +124,14 @@ fun OnboardingSlidesScreen(
123124 verticalAlignment = Alignment .CenterVertically ,
124125 modifier = Modifier
125126 .align(Alignment .BottomCenter )
126- .padding(bottom = 16 .dp)
127- .height(16 .dp)
128127 .offset { IntOffset (0 , yOffset.roundToPx()) }
129128 .alpha(alpha)
130129 ) {
131130 repeat(PAGE_COUNT ) { index ->
132131 val size by animateDpAsState(
133132 targetValue = if (index == pagerState.currentPage) 10 .dp else 7 .dp,
134133 animationSpec = tween(durationMillis = 300 ),
135- label = " dotSize"
134+ label = " dotSize" ,
136135 )
137136 Box (
138137 modifier = Modifier
@@ -186,34 +185,37 @@ fun OnboardingTab(
186185 modifier : Modifier = Modifier ,
187186 disclaimerText : String? = null,
188187) {
189- Box (
190- contentAlignment = Alignment .TopCenter ,
188+ Column (
191189 modifier = modifier.fillMaxSize()
192190 ) {
191+ FillHeight ()
192+
193193 Image (
194194 painter = painterResource(id = imageResId),
195195 contentDescription = null ,
196196 contentScale = ContentScale .Fit ,
197197 modifier = Modifier
198- .padding(top = 125 .dp )
199- .fillMaxWidth( )
198+ .align( Alignment . CenterHorizontally )
199+ .sizeIn(maxWidth = 311 .dp, maxHeight = 311 .dp )
200200 )
201+
201202 Column (
202203 modifier = Modifier
203204 .fillMaxWidth()
204- .align(Alignment .BottomCenter ),
205+ .padding(top = 48 .dp)
206+ .defaultMinSize(minHeight = 255 .dp)
205207 ) {
206208 Display (text = title.withAccent(accentColor = titleAccentColor))
207- Spacer (modifier = Modifier .height( 8 .dp) )
209+ VerticalSpacer ( 14 .dp )
208210 BodyM (
209211 text = text,
210212 color = Colors .White64 ,
211- minLines = 3
213+ minLines = 3 ,
212214 )
213215 disclaimerText?.let {
214- Footnote (text = it)
216+ VerticalSpacer (4 .dp)
217+ Footnote (text = it, color = Colors .White32 )
215218 }
216- VerticalSpacer (70 .dp)
217219 }
218220 }
219221}
0 commit comments