Improve a bit AccountTab UI
This commit is contained in:
parent
ad7929f444
commit
76d7f98227
@ -36,6 +36,7 @@ import androidx.compose.ui.platform.LocalContext
|
||||
import androidx.compose.ui.res.painterResource
|
||||
import androidx.compose.ui.res.stringResource
|
||||
import androidx.compose.ui.text.font.FontWeight
|
||||
import androidx.compose.ui.text.style.TextOverflow
|
||||
import androidx.compose.ui.unit.dp
|
||||
import androidx.lifecycle.compose.collectAsStateWithLifecycle
|
||||
import cafe.adriel.voyager.koin.getScreenModel
|
||||
@ -133,8 +134,8 @@ object AccountTab : Tab {
|
||||
LaunchedEffect(state.opmlExportSuccess) {
|
||||
if (state.opmlExportSuccess) {
|
||||
val action = snackbarHostState.showSnackbar(
|
||||
message = "OPML export success",
|
||||
actionLabel = "Open file"
|
||||
message = context.getString(R.string.opml_export_success),
|
||||
actionLabel = context.resources.getString(R.string.open)
|
||||
)
|
||||
|
||||
if (action == SnackbarResult.ActionPerformed) {
|
||||
@ -184,10 +185,11 @@ object AccountTab : Tab {
|
||||
horizontalArrangement = Arrangement.SpaceBetween,
|
||||
modifier = Modifier
|
||||
.fillMaxWidth()
|
||||
.padding(horizontal = MaterialTheme.spacing.mediumSpacing)
|
||||
.padding(start = MaterialTheme.spacing.mediumSpacing)
|
||||
) {
|
||||
Row(
|
||||
verticalAlignment = Alignment.CenterVertically,
|
||||
modifier = Modifier.weight(1f)
|
||||
) {
|
||||
Image(
|
||||
painter = adaptiveIconPainterResource(id = state.account.accountType!!.iconRes),
|
||||
@ -200,7 +202,9 @@ object AccountTab : Tab {
|
||||
Column {
|
||||
Text(
|
||||
text = state.account.accountName!!,
|
||||
style = MaterialTheme.typography.titleLarge
|
||||
style = MaterialTheme.typography.titleLarge,
|
||||
maxLines = 1,
|
||||
overflow = TextOverflow.Ellipsis
|
||||
)
|
||||
|
||||
if (state.account.displayedName != null) {
|
||||
@ -208,7 +212,9 @@ object AccountTab : Tab {
|
||||
|
||||
Text(
|
||||
text = state.account.displayedName!!,
|
||||
style = MaterialTheme.typography.bodyMedium
|
||||
style = MaterialTheme.typography.bodyMedium,
|
||||
maxLines = 1,
|
||||
overflow = TextOverflow.Ellipsis
|
||||
)
|
||||
}
|
||||
}
|
||||
@ -216,7 +222,7 @@ object AccountTab : Tab {
|
||||
|
||||
if (state.account.isLocal) {
|
||||
ThreeDotsMenu(
|
||||
items = mapOf(1 to "Rename"),
|
||||
items = mapOf(1 to stringResource(id = R.string.rename_account)),
|
||||
onItemClick = {
|
||||
screenModel.openDialog(DialogState.RenameAccount(state.account.accountName!!))
|
||||
},
|
||||
|
@ -19,6 +19,7 @@ import androidx.compose.ui.Modifier
|
||||
import androidx.compose.ui.graphics.Color
|
||||
import androidx.compose.ui.graphics.painter.Painter
|
||||
import androidx.compose.ui.text.TextStyle
|
||||
import androidx.compose.ui.text.style.TextOverflow
|
||||
import androidx.compose.ui.unit.Dp
|
||||
import com.readrops.app.util.theme.spacing
|
||||
import com.readrops.app.util.toDp
|
||||
@ -45,6 +46,8 @@ fun BaseText(
|
||||
text = text,
|
||||
style = style,
|
||||
color = color,
|
||||
maxLines = 1,
|
||||
overflow = TextOverflow.Ellipsis
|
||||
)
|
||||
}
|
||||
}
|
||||
|
@ -188,4 +188,5 @@
|
||||
<string name="disable_battery_optimization">Désactiver l\'optimisation de la batterie</string>
|
||||
<string name="disable_battery_optimization_subtitle">Peut aider à éviter que le système n\'empêche la synchronisation d\'arrière-plan</string>
|
||||
<string name="battery_optimization_already_disabled">L\'optimisation de la batterie est déjà optimisée pour cette appli</string>
|
||||
<string name="opml_export_success">Export OPML réussi</string>
|
||||
</resources>
|
@ -197,4 +197,5 @@
|
||||
<string name="disable_battery_optimization">Disable battery optimization</string>
|
||||
<string name="disable_battery_optimization_subtitle">Can help with background synchronization not being killed by the system</string>
|
||||
<string name="battery_optimization_already_disabled">Battery optimization already disabled for this app</string>
|
||||
<string name="opml_export_success">OPML export success</string>
|
||||
</resources>
|
Loading…
x
Reference in New Issue
Block a user