fix(ui): account tab color style

This commit is contained in:
Ash 2024-06-28 17:00:57 +08:00
parent f8be59e610
commit da09214236
No known key found for this signature in database
1 changed files with 12 additions and 6 deletions

View File

@ -2,7 +2,14 @@ package me.ash.reader.ui.page.home.feeds.accounts
import androidx.compose.foundation.background
import androidx.compose.foundation.clickable
import androidx.compose.foundation.layout.*
import androidx.compose.foundation.layout.Arrangement
import androidx.compose.foundation.layout.Box
import androidx.compose.foundation.layout.Column
import androidx.compose.foundation.layout.ExperimentalLayoutApi
import androidx.compose.foundation.layout.FlowRow
import androidx.compose.foundation.layout.padding
import androidx.compose.foundation.layout.size
import androidx.compose.foundation.layout.width
import androidx.compose.foundation.shape.CircleShape
import androidx.compose.material.icons.Icons
import androidx.compose.material.icons.outlined.People
@ -22,7 +29,6 @@ import androidx.compose.ui.text.style.TextAlign
import androidx.compose.ui.text.style.TextOverflow
import androidx.compose.ui.unit.dp
import androidx.compose.ui.unit.sp
import androidx.compose.foundation.layout.FlowRow
import me.ash.reader.R
import me.ash.reader.domain.model.account.Account
import me.ash.reader.ui.component.base.RYDialog
@ -75,14 +81,14 @@ fun AccountsTab(
.clip(CircleShape)
.background(
if (account.id == context.currentAccountId) {
MaterialTheme.colorScheme.tertiaryContainer alwaysLight true
} else {
MaterialTheme.colorScheme.primaryContainer alwaysLight true
} else {
MaterialTheme.colorScheme.surfaceDim alwaysLight true
}
),
contentAlignment = Alignment.Center,
) {
Icon(account = account)
AccountTypeIcon(account = account)
}
Text(
modifier = Modifier
@ -117,7 +123,7 @@ fun AccountsTab(
}
@Composable
fun Icon(
fun AccountTypeIcon(
account: Account,
) {
val icon = account.type.toIcon().takeIf { it is ImageVector }?.let { it as ImageVector }