Rename classes (not a State)
This commit is contained in:
parent
a57a6f45bb
commit
5875de1c51
3 changed files with 12 additions and 12 deletions
|
|
@ -59,8 +59,8 @@ fun OnBoardingScreen(
|
|||
onSignUp: () -> Unit = {},
|
||||
onSignIn: () -> Unit = {},
|
||||
) {
|
||||
val carrouselState = remember { SplashCarouselStateFactory().create() }
|
||||
val nbOfPages = carrouselState.items.size
|
||||
val carrouselData = remember { SplashCarouselDataFactory().create() }
|
||||
val nbOfPages = carrouselData.items.size
|
||||
var key by remember { mutableStateOf(false) }
|
||||
Box(
|
||||
modifier = modifier
|
||||
|
|
@ -92,7 +92,7 @@ fun OnBoardingScreen(
|
|||
state = pagerState,
|
||||
) { page ->
|
||||
// Our page content
|
||||
OnBoardingPage(carrouselState.items[page])
|
||||
OnBoardingPage(carrouselData.items[page])
|
||||
}
|
||||
HorizontalPagerIndicator(
|
||||
pagerState = pagerState,
|
||||
|
|
@ -118,7 +118,7 @@ fun OnBoardingScreen(
|
|||
|
||||
@Composable
|
||||
fun OnBoardingPage(
|
||||
item: SplashCarouselState.Item,
|
||||
item: SplashCarouselData.Item,
|
||||
modifier: Modifier = Modifier,
|
||||
) {
|
||||
Box(
|
||||
|
|
|
|||
|
|
@ -19,7 +19,7 @@ package io.element.android.features.onboarding
|
|||
import androidx.annotation.DrawableRes
|
||||
import androidx.annotation.StringRes
|
||||
|
||||
data class SplashCarouselState(
|
||||
data class SplashCarouselData(
|
||||
val items: List<Item>
|
||||
) {
|
||||
data class Item(
|
||||
|
|
@ -19,8 +19,8 @@ package io.element.android.features.onboarding
|
|||
import androidx.annotation.DrawableRes
|
||||
import io.element.android.libraries.ui.strings.R as StringR
|
||||
|
||||
class SplashCarouselStateFactory {
|
||||
fun create(): SplashCarouselState {
|
||||
class SplashCarouselDataFactory {
|
||||
fun create(): SplashCarouselData {
|
||||
val lightTheme = true
|
||||
|
||||
fun background(@DrawableRes lightDrawable: Int) =
|
||||
|
|
@ -29,9 +29,9 @@ class SplashCarouselStateFactory {
|
|||
fun hero(@DrawableRes lightDrawable: Int, @DrawableRes darkDrawable: Int) =
|
||||
if (lightTheme) lightDrawable else darkDrawable
|
||||
|
||||
return SplashCarouselState(
|
||||
return SplashCarouselData(
|
||||
listOf(
|
||||
SplashCarouselState.Item(
|
||||
SplashCarouselData.Item(
|
||||
StringR.string.ftue_auth_carousel_secure_title,
|
||||
StringR.string.ftue_auth_carousel_secure_body,
|
||||
hero(
|
||||
|
|
@ -40,19 +40,19 @@ class SplashCarouselStateFactory {
|
|||
),
|
||||
background(R.drawable.bg_carousel_page_1)
|
||||
),
|
||||
SplashCarouselState.Item(
|
||||
SplashCarouselData.Item(
|
||||
StringR.string.ftue_auth_carousel_control_title,
|
||||
StringR.string.ftue_auth_carousel_control_body,
|
||||
hero(R.drawable.ic_splash_control, R.drawable.ic_splash_control_dark),
|
||||
background(R.drawable.bg_carousel_page_2)
|
||||
),
|
||||
SplashCarouselState.Item(
|
||||
SplashCarouselData.Item(
|
||||
StringR.string.ftue_auth_carousel_encrypted_title,
|
||||
StringR.string.ftue_auth_carousel_encrypted_body,
|
||||
hero(R.drawable.ic_splash_secure, R.drawable.ic_splash_secure_dark),
|
||||
background(R.drawable.bg_carousel_page_3)
|
||||
),
|
||||
SplashCarouselState.Item(
|
||||
SplashCarouselData.Item(
|
||||
collaborationTitle(),
|
||||
StringR.string.ftue_auth_carousel_workplace_body,
|
||||
hero(
|
||||
Loading…
Add table
Add a link
Reference in a new issue