compose: onboarding: Rename child screens to pages
Signed-off-by: Aayush Gupta <aayushgupta219@gmail.com>
This commit is contained in:
@@ -80,8 +80,8 @@ private fun ScreenContent(
|
|||||||
verticalAlignment = Alignment.Top
|
verticalAlignment = Alignment.Top
|
||||||
) { page ->
|
) { page ->
|
||||||
when (pages[page]) {
|
when (pages[page]) {
|
||||||
ExtraScreen.Welcome -> WelcomeScreen()
|
ExtraScreen.Welcome -> WelcomePage()
|
||||||
ExtraScreen.Permissions -> PermissionsScreen()
|
ExtraScreen.Permissions -> PermissionsPage()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -30,17 +30,17 @@ import com.aurora.store.viewmodel.commons.PermissionRationaleViewModel
|
|||||||
import kotlin.random.Random
|
import kotlin.random.Random
|
||||||
|
|
||||||
@Composable
|
@Composable
|
||||||
fun PermissionsScreen(viewModel: PermissionRationaleViewModel = hiltViewModel()) {
|
fun PermissionsPage(viewModel: PermissionRationaleViewModel = hiltViewModel()) {
|
||||||
val permissions by viewModel.permissions.collectAsStateWithLifecycle()
|
val permissions by viewModel.permissions.collectAsStateWithLifecycle()
|
||||||
|
|
||||||
ScreenContent(
|
PageContent(
|
||||||
permissions = permissions,
|
permissions = permissions,
|
||||||
onPermissionCallback = { viewModel.refreshPermissionsList() }
|
onPermissionCallback = { viewModel.refreshPermissionsList() }
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
@Composable
|
@Composable
|
||||||
private fun ScreenContent(
|
private fun PageContent(
|
||||||
permissions: List<Permission> = emptyList(),
|
permissions: List<Permission> = emptyList(),
|
||||||
onPermissionCallback: (type: PermissionType) -> Unit = {}
|
onPermissionCallback: (type: PermissionType) -> Unit = {}
|
||||||
) {
|
) {
|
||||||
@@ -73,7 +73,7 @@ private fun ScreenContent(
|
|||||||
|
|
||||||
@Preview(showBackground = true)
|
@Preview(showBackground = true)
|
||||||
@Composable
|
@Composable
|
||||||
private fun PermissionsScreenPreview() {
|
private fun PermissionsPagePreview() {
|
||||||
val permissions = PermissionType.entries.map { type ->
|
val permissions = PermissionType.entries.map { type ->
|
||||||
Permission(
|
Permission(
|
||||||
type = type,
|
type = type,
|
||||||
@@ -84,7 +84,7 @@ private fun PermissionsScreenPreview() {
|
|||||||
)
|
)
|
||||||
}
|
}
|
||||||
PreviewTemplate {
|
PreviewTemplate {
|
||||||
ScreenContent(
|
PageContent(
|
||||||
permissions = permissions
|
permissions = permissions
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
@@ -35,18 +35,18 @@ import com.aurora.store.compose.ui.about.AboutDialog
|
|||||||
import com.aurora.store.data.model.Link
|
import com.aurora.store.data.model.Link
|
||||||
|
|
||||||
@Composable
|
@Composable
|
||||||
fun WelcomeScreen() {
|
fun WelcomePage() {
|
||||||
var shouldShowAboutDialog by rememberSaveable { mutableStateOf(false) }
|
var shouldShowAboutDialog by rememberSaveable { mutableStateOf(false) }
|
||||||
|
|
||||||
if (shouldShowAboutDialog) {
|
if (shouldShowAboutDialog) {
|
||||||
AboutDialog(onDismiss = { shouldShowAboutDialog = false })
|
AboutDialog(onDismiss = { shouldShowAboutDialog = false })
|
||||||
}
|
}
|
||||||
|
|
||||||
ScreenContent(onAboutAurora = { shouldShowAboutDialog = true })
|
PageContent(onAboutAurora = { shouldShowAboutDialog = true })
|
||||||
}
|
}
|
||||||
|
|
||||||
@Composable
|
@Composable
|
||||||
private fun ScreenContent(onAboutAurora: () -> Unit = {}) {
|
private fun PageContent(onAboutAurora: () -> Unit = {}) {
|
||||||
val context = LocalContext.current
|
val context = LocalContext.current
|
||||||
|
|
||||||
val links = listOf(
|
val links = listOf(
|
||||||
@@ -137,8 +137,8 @@ private fun ScreenContent(onAboutAurora: () -> Unit = {}) {
|
|||||||
|
|
||||||
@Preview(showBackground = true)
|
@Preview(showBackground = true)
|
||||||
@Composable
|
@Composable
|
||||||
private fun WelcomeScreenPreview() {
|
private fun WelcomePagePreview() {
|
||||||
PreviewTemplate {
|
PreviewTemplate {
|
||||||
ScreenContent()
|
PageContent()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
Reference in New Issue
Block a user