mirror of
https://github.com/vitorpamplona/amethyst.git
synced 2026-08-09 16:14:40 +00:00
refactor: move Profile Gallery Style setting to Profile UI settings
The gallery style selector is profile-specific, so it now lives on the Profile UI settings screen alongside the other profile display toggles instead of the general Application Preferences screen. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01REGsru6cnm6wUzqm12Rh2d
This commit is contained in:
-23
@@ -53,7 +53,6 @@ import com.vitorpamplona.amethyst.model.ConnectivityType
|
||||
import com.vitorpamplona.amethyst.model.FeatureSetType
|
||||
import com.vitorpamplona.amethyst.model.FontFamilyType
|
||||
import com.vitorpamplona.amethyst.model.FontSizeType
|
||||
import com.vitorpamplona.amethyst.model.ProfileGalleryType
|
||||
import com.vitorpamplona.amethyst.model.ThemeType
|
||||
import com.vitorpamplona.amethyst.model.UiSettingsFlow
|
||||
import com.vitorpamplona.amethyst.model.parseAccentColorType
|
||||
@@ -62,7 +61,6 @@ import com.vitorpamplona.amethyst.model.parseConnectivityType
|
||||
import com.vitorpamplona.amethyst.model.parseFeatureSetType
|
||||
import com.vitorpamplona.amethyst.model.parseFontFamilyType
|
||||
import com.vitorpamplona.amethyst.model.parseFontSizeType
|
||||
import com.vitorpamplona.amethyst.model.parseGalleryType
|
||||
import com.vitorpamplona.amethyst.model.parseThemeType
|
||||
import com.vitorpamplona.amethyst.ui.components.TextSpinner
|
||||
import com.vitorpamplona.amethyst.ui.components.TitleExplainer
|
||||
@@ -129,7 +127,6 @@ fun SettingsScreen(sharedPrefs: UiSettingsFlow) {
|
||||
ShowProfilePictureChoice(sharedPrefs)
|
||||
ImmersiveScrollingChoice(sharedPrefs)
|
||||
FeatureSetChoice(sharedPrefs)
|
||||
GalleryChoice(sharedPrefs)
|
||||
}
|
||||
}
|
||||
|
||||
@@ -440,26 +437,6 @@ fun FeatureSetChoice(sharedPrefs: UiSettingsFlow) {
|
||||
}
|
||||
}
|
||||
|
||||
@Composable
|
||||
fun GalleryChoice(sharedPrefs: UiSettingsFlow) {
|
||||
val galleryItems =
|
||||
persistentListOf(
|
||||
TitleExplainer(stringRes(ProfileGalleryType.CLASSIC.resourceId)),
|
||||
TitleExplainer(stringRes(ProfileGalleryType.MODERN.resourceId)),
|
||||
)
|
||||
|
||||
val galleryIndex by sharedPrefs.gallerySet.collectAsState()
|
||||
|
||||
SettingsRow(
|
||||
R.string.gallery_style,
|
||||
R.string.gallery_style_description,
|
||||
galleryItems,
|
||||
galleryIndex.screenCode,
|
||||
) {
|
||||
sharedPrefs.gallerySet.tryEmit(parseGalleryType(it))
|
||||
}
|
||||
}
|
||||
|
||||
@Composable
|
||||
fun SettingsRow(
|
||||
name: Int,
|
||||
|
||||
+30
@@ -43,6 +43,10 @@ import androidx.compose.ui.tooling.preview.Preview
|
||||
import androidx.compose.ui.unit.dp
|
||||
import androidx.lifecycle.compose.collectAsStateWithLifecycle
|
||||
import com.vitorpamplona.amethyst.R
|
||||
import com.vitorpamplona.amethyst.model.ProfileGalleryType
|
||||
import com.vitorpamplona.amethyst.model.UiSettingsFlow
|
||||
import com.vitorpamplona.amethyst.model.parseGalleryType
|
||||
import com.vitorpamplona.amethyst.ui.components.TitleExplainer
|
||||
import com.vitorpamplona.amethyst.ui.navigation.navs.EmptyNav
|
||||
import com.vitorpamplona.amethyst.ui.navigation.navs.INav
|
||||
import com.vitorpamplona.amethyst.ui.navigation.topbars.TopBarWithBackButton
|
||||
@@ -51,6 +55,7 @@ import com.vitorpamplona.amethyst.ui.screen.loggedIn.mockAccountViewModel
|
||||
import com.vitorpamplona.amethyst.ui.stringRes
|
||||
import com.vitorpamplona.amethyst.ui.theme.Size20dp
|
||||
import com.vitorpamplona.amethyst.ui.theme.ThemeComparisonRow
|
||||
import kotlinx.collections.immutable.persistentListOf
|
||||
|
||||
@Preview
|
||||
@Composable
|
||||
@@ -129,11 +134,36 @@ fun ProfileUiSettingsContent(accountViewModel: AccountViewModel) {
|
||||
checked = showFollowers,
|
||||
onCheckedChange = { ui.showProfileFollowersFeed.tryEmit(it) },
|
||||
)
|
||||
HorizontalDivider(modifier = Modifier.padding(horizontal = Size20dp))
|
||||
|
||||
Column(modifier = Modifier.padding(vertical = 12.dp, horizontal = Size20dp)) {
|
||||
GalleryChoice(ui)
|
||||
}
|
||||
|
||||
Spacer(Modifier.height(16.dp))
|
||||
}
|
||||
}
|
||||
|
||||
@Composable
|
||||
fun GalleryChoice(sharedPrefs: UiSettingsFlow) {
|
||||
val galleryItems =
|
||||
persistentListOf(
|
||||
TitleExplainer(stringRes(ProfileGalleryType.CLASSIC.resourceId)),
|
||||
TitleExplainer(stringRes(ProfileGalleryType.MODERN.resourceId)),
|
||||
)
|
||||
|
||||
val galleryIndex by sharedPrefs.gallerySet.collectAsStateWithLifecycle()
|
||||
|
||||
SettingsRow(
|
||||
R.string.gallery_style,
|
||||
R.string.gallery_style_description,
|
||||
galleryItems,
|
||||
galleryIndex.screenCode,
|
||||
) {
|
||||
sharedPrefs.gallerySet.tryEmit(parseGalleryType(it))
|
||||
}
|
||||
}
|
||||
|
||||
@Composable
|
||||
private fun ProfileUiSwitchRow(
|
||||
title: String,
|
||||
|
||||
Reference in New Issue
Block a user