enhancement(common): rename compact post layout

This commit is contained in:
Diego Beraldin 2023-10-01 10:21:53 +02:00
parent 6a808439f3
commit d21b6799f6
6 changed files with 10 additions and 10 deletions

View File

@ -6,25 +6,25 @@ import dev.icerock.moko.resources.compose.stringResource
sealed interface PostLayout { sealed interface PostLayout {
data object Card : PostLayout data object Card : PostLayout
data object List : PostLayout data object Compact : PostLayout
data object Full : PostLayout data object Full : PostLayout
} }
@Composable @Composable
fun PostLayout.toReadableName(): String = when (this) { fun PostLayout.toReadableName(): String = when (this) {
PostLayout.Full -> stringResource(MR.strings.settings_post_layout_full) PostLayout.Full -> stringResource(MR.strings.settings_post_layout_full)
PostLayout.List -> stringResource(MR.strings.settings_post_layout_list) PostLayout.Compact -> stringResource(MR.strings.settings_post_layout_compact)
else -> stringResource(MR.strings.settings_post_layout_card) else -> stringResource(MR.strings.settings_post_layout_card)
} }
fun Int.toPostLayout(): PostLayout = when (this) { fun Int.toPostLayout(): PostLayout = when (this) {
1 -> PostLayout.List 1 -> PostLayout.Compact
2 -> PostLayout.Full 2 -> PostLayout.Full
else -> PostLayout.Card else -> PostLayout.Card
} }
fun PostLayout.toInt(): Int = when (this) { fun PostLayout.toInt(): Int = when (this) {
PostLayout.Full -> 2 PostLayout.Full -> 2
PostLayout.List -> 1 PostLayout.Compact -> 1
else -> 0 else -> 0
} }

View File

@ -71,7 +71,7 @@ fun PostCard(
} }
}, },
) { ) {
if (postLayout != PostLayout.List) { if (postLayout != PostLayout.Compact) {
ExtendedPost( ExtendedPost(
post = post, post = post,
hideAuthor = hideAuthor, hideAuthor = hideAuthor,
@ -236,7 +236,7 @@ private fun ExtendedPost(
if (withOverflowBlurred) { if (withOverflowBlurred) {
Box( Box(
modifier = Modifier modifier = Modifier
.height(Spacing.s) .height(Spacing.l)
.fillMaxWidth() .fillMaxWidth()
.align(Alignment.BottomCenter).background( .align(Alignment.BottomCenter).background(
brush = Brush.verticalGradient( brush = Brush.verticalGradient(

View File

@ -52,7 +52,7 @@ class PostLayoutBottomSheet : Screen {
) )
val values = listOf( val values = listOf(
PostLayout.Card, PostLayout.Card,
PostLayout.List, PostLayout.Compact,
PostLayout.Full, PostLayout.Full,
) )
Column( Column(

View File

@ -109,7 +109,7 @@
<string name="settings_enable_swipe_actions">Enable swipe actions</string> <string name="settings_enable_swipe_actions">Enable swipe actions</string>
<string name="settings_custom_seed_color">Custom theme color</string> <string name="settings_custom_seed_color">Custom theme color</string>
<string name="settings_post_layout">Post layout</string> <string name="settings_post_layout">Post layout</string>
<string name="settings_post_layout_list">List</string> <string name="settings_post_layout_compact">Compact</string>
<string name="settings_post_layout_card">Card</string> <string name="settings_post_layout_card">Card</string>
<string name="settings_post_layout_full">Full</string> <string name="settings_post_layout_full">Full</string>
<string name="settings_color_blue">Corporate blue</string> <string name="settings_color_blue">Corporate blue</string>

View File

@ -106,7 +106,7 @@
<string name="settings_enable_swipe_actions">Activar acciones de deslizamiento</string> <string name="settings_enable_swipe_actions">Activar acciones de deslizamiento</string>
<string name="settings_custom_seed_color">Color tema personalizado</string> <string name="settings_custom_seed_color">Color tema personalizado</string>
<string name="settings_post_layout">Disposición publicaciones</string> <string name="settings_post_layout">Disposición publicaciones</string>
<string name="settings_post_layout_list">Listado</string> <string name="settings_post_layout_compact">Compacto</string>
<string name="settings_post_layout_card">Tarjetas</string> <string name="settings_post_layout_card">Tarjetas</string>
<string name="settings_post_layout_full">Completo</string> <string name="settings_post_layout_full">Completo</string>
<string name="settings_color_blue">Azul corporativo</string> <string name="settings_color_blue">Azul corporativo</string>

View File

@ -106,7 +106,7 @@
<string name="settings_enable_swipe_actions">Consenti azioni allo swipe</string> <string name="settings_enable_swipe_actions">Consenti azioni allo swipe</string>
<string name="settings_custom_seed_color">Colore tema personalizzato</string> <string name="settings_custom_seed_color">Colore tema personalizzato</string>
<string name="settings_post_layout">Layout post</string> <string name="settings_post_layout">Layout post</string>
<string name="settings_post_layout_list">Lista</string> <string name="settings_post_layout_compact">Compatto</string>
<string name="settings_post_layout_card">Carta</string> <string name="settings_post_layout_card">Carta</string>
<string name="settings_post_layout_full">Intero</string> <string name="settings_post_layout_full">Intero</string>
<string name="settings_color_blue">Blu aziendale</string> <string name="settings_color_blue">Blu aziendale</string>