From 7a90aa3a98d08a3d912cd213d9472992c0f7b72c Mon Sep 17 00:00:00 2001 From: Ash Date: Fri, 8 Mar 2024 17:38:44 +0800 Subject: [PATCH] feat(ui): add list and manage buttons in account switch tab dialog (#639) --- .../reader/ui/page/home/feeds/FeedsPage.kt | 9 +++++++++ .../page/home/feeds/accounts/AccountsTab.kt | 19 +++++++++++++++++-- 2 files changed, 26 insertions(+), 2 deletions(-) diff --git a/app/src/main/java/me/ash/reader/ui/page/home/feeds/FeedsPage.kt b/app/src/main/java/me/ash/reader/ui/page/home/feeds/FeedsPage.kt index 5a556f7e3..552e1652b 100644 --- a/app/src/main/java/me/ash/reader/ui/page/home/feeds/FeedsPage.kt +++ b/app/src/main/java/me/ash/reader/ui/page/home/feeds/FeedsPage.kt @@ -62,6 +62,7 @@ import me.ash.reader.ui.component.base.RYScaffold import me.ash.reader.ui.component.base.Subtitle import me.ash.reader.ui.ext.alphaLN import me.ash.reader.ui.ext.collectAsStateValue +import me.ash.reader.ui.ext.currentAccountId import me.ash.reader.ui.ext.findActivity import me.ash.reader.ui.ext.getCurrentVersion import me.ash.reader.ui.page.common.RouteName @@ -339,6 +340,14 @@ fun FeedsPage( } } }, + onClickSettings = { + accountTabVisible = false + navController.navigate("${RouteName.ACCOUNT_DETAILS}/${context.currentAccountId}") + }, + onClickManage = { + accountTabVisible = false + navController.navigate(RouteName.ACCOUNTS) + }, onDismissRequest = { accountTabVisible = false }, diff --git a/app/src/main/java/me/ash/reader/ui/page/home/feeds/accounts/AccountsTab.kt b/app/src/main/java/me/ash/reader/ui/page/home/feeds/accounts/AccountsTab.kt index d3039c2b9..c90268b34 100644 --- a/app/src/main/java/me/ash/reader/ui/page/home/feeds/accounts/AccountsTab.kt +++ b/app/src/main/java/me/ash/reader/ui/page/home/feeds/accounts/AccountsTab.kt @@ -9,6 +9,7 @@ import androidx.compose.material.icons.outlined.People import androidx.compose.material3.Icon import androidx.compose.material3.MaterialTheme import androidx.compose.material3.Text +import androidx.compose.material3.TextButton import androidx.compose.runtime.Composable import androidx.compose.ui.Alignment import androidx.compose.ui.Modifier @@ -36,6 +37,8 @@ fun AccountsTab( visible: Boolean = false, accounts: List, onAccountSwitch: (Account) -> Unit = {}, + onClickSettings: () -> Unit = {}, + onClickManage: () -> Unit = {}, onDismissRequest: () -> Unit = {}, ) { val context = LocalContext.current @@ -99,8 +102,20 @@ fun AccountsTab( } } }, - confirmButton = {}, - dismissButton = {}, + confirmButton = { + TextButton(onClick = onClickSettings) { + Text( + text = stringResource(R.string.settings), + ) + } + }, + dismissButton = { + TextButton(onClick = onClickManage) { + Text( + text = stringResource(R.string.list), + ) + } + }, ) }