From 5b74480398e89932490942734e836929231141e7 Mon Sep 17 00:00:00 2001 From: Shinokuni Date: Sun, 18 Feb 2024 23:38:47 +0100 Subject: [PATCH] Add initial layout of MoreTab --- .../com/readrops/app/compose/more/MoreTab.kt | 71 +++++++++++++++++-- .../src/main/res/drawable/ic_backup.xml | 5 ++ .../src/main/res/drawable/ic_settings.xml | 5 ++ 3 files changed, 77 insertions(+), 4 deletions(-) create mode 100644 appcompose/src/main/res/drawable/ic_backup.xml create mode 100644 appcompose/src/main/res/drawable/ic_settings.xml diff --git a/appcompose/src/main/java/com/readrops/app/compose/more/MoreTab.kt b/appcompose/src/main/java/com/readrops/app/compose/more/MoreTab.kt index e7d915f1..6990af89 100644 --- a/appcompose/src/main/java/com/readrops/app/compose/more/MoreTab.kt +++ b/appcompose/src/main/java/com/readrops/app/compose/more/MoreTab.kt @@ -1,26 +1,89 @@ package com.readrops.app.compose.more +import androidx.compose.foundation.Image import androidx.compose.foundation.layout.Column +import androidx.compose.foundation.layout.fillMaxSize +import androidx.compose.foundation.layout.size +import androidx.compose.material3.MaterialTheme import androidx.compose.material3.Text import androidx.compose.runtime.Composable +import androidx.compose.ui.Alignment +import androidx.compose.ui.Modifier +import androidx.compose.ui.res.painterResource +import androidx.compose.ui.res.stringResource +import androidx.compose.ui.unit.dp import cafe.adriel.voyager.navigator.tab.Tab import cafe.adriel.voyager.navigator.tab.TabOptions +import com.readrops.app.compose.BuildConfig +import com.readrops.app.compose.R +import com.readrops.app.compose.util.components.SelectableIconText +import com.readrops.app.compose.util.theme.LargeSpacer +import com.readrops.app.compose.util.theme.MediumSpacer +import com.readrops.app.compose.util.theme.ShortSpacer +import com.readrops.app.compose.util.theme.spacing object MoreTab : Tab { override val options: TabOptions @Composable get() = TabOptions( - index = 4u, - title = "More" + index = 4u, + title = "More" ) @Composable override fun Content() { - Column { + Column( + horizontalAlignment = Alignment.CenterHorizontally, + modifier = Modifier.fillMaxSize() + ) { + LargeSpacer() + + Image( + painter = painterResource(id = R.drawable.ic_freshrss), + contentDescription = null, + modifier = Modifier.size(64.dp) + ) + + MediumSpacer() + + Text( + text = stringResource(R.string.app_name), + style = MaterialTheme.typography.titleLarge + ) + + ShortSpacer() + Text( - text = "More" + text = "v${BuildConfig.VERSION_NAME} (${BuildConfig.VERSION_CODE})", + style = MaterialTheme.typography.labelLarge + ) + + LargeSpacer() + + SelectableIconText( + icon = painterResource(id = R.drawable.ic_settings), + text = stringResource(R.string.settings), + style = MaterialTheme.typography.titleMedium, + padding = MaterialTheme.spacing.mediumSpacing, + onClick = { } + ) + + SelectableIconText( + icon = painterResource(id = R.drawable.ic_settings), + text = "Backup", + style = MaterialTheme.typography.titleMedium, + padding = MaterialTheme.spacing.mediumSpacing, + onClick = { } + ) + + SelectableIconText( + icon = painterResource(id = R.drawable.ic_settings), + text = "Open-source libraries", + style = MaterialTheme.typography.titleMedium, + padding = MaterialTheme.spacing.mediumSpacing, + onClick = { } ) } } diff --git a/appcompose/src/main/res/drawable/ic_backup.xml b/appcompose/src/main/res/drawable/ic_backup.xml new file mode 100644 index 00000000..24f2a3d6 --- /dev/null +++ b/appcompose/src/main/res/drawable/ic_backup.xml @@ -0,0 +1,5 @@ + + + diff --git a/appcompose/src/main/res/drawable/ic_settings.xml b/appcompose/src/main/res/drawable/ic_settings.xml new file mode 100644 index 00000000..298a5a1f --- /dev/null +++ b/appcompose/src/main/res/drawable/ic_settings.xml @@ -0,0 +1,5 @@ + + +