@@ -16,6 +16,7 @@ import androidx.compose.foundation.layout.sizeIn
1616import androidx.compose.foundation.lazy.LazyColumn
1717import androidx.compose.foundation.lazy.LazyRow
1818import androidx.compose.foundation.lazy.items
19+ import androidx.compose.foundation.lazy.rememberLazyListState
1920import androidx.compose.material.icons.Icons
2021import androidx.compose.material.icons.rounded.ColorLens
2122import androidx.compose.material.icons.rounded.DarkMode
@@ -24,7 +25,6 @@ import androidx.compose.material.icons.rounded.FitScreen
2425import androidx.compose.material.icons.rounded.FormatSize
2526import androidx.compose.material.icons.rounded.HideImage
2627import androidx.compose.material.icons.rounded.Restore
27- import androidx.compose.material.icons.rounded.Stars
2828import androidx.compose.material3.CardDefaults
2929import androidx.compose.material3.HorizontalDivider
3030import androidx.compose.material3.MaterialTheme
@@ -38,6 +38,7 @@ import androidx.compose.ui.res.stringResource
3838import com.m3u.core.architecture.preferences.ClipMode
3939import com.m3u.core.architecture.preferences.PreferencesKeys
4040import com.m3u.core.architecture.preferences.mutablePreferenceOf
41+ import com.m3u.core.foundation.ui.thenIf
4142import com.m3u.core.util.basic.title
4243import com.m3u.data.database.model.ColorScheme
4344import com.m3u.i18n.R.string
@@ -48,14 +49,15 @@ import com.m3u.smartphone.ui.material.components.TextPreference
4849import com.m3u.smartphone.ui.material.components.ThemeSelection
4950import com.m3u.smartphone.ui.material.ktx.Edge
5051import com.m3u.smartphone.ui.material.ktx.blurEdges
52+ import com.m3u.smartphone.ui.material.ktx.isAtTop
5153import com.m3u.smartphone.ui.material.ktx.plus
5254import com.m3u.smartphone.ui.material.model.LocalSpacing
5355
5456@Composable
5557internal fun AppearanceFragment (
5658 colorSchemes : List <ColorScheme >,
5759 colorArgb : Int ,
58- openColorCanvas : (ColorScheme ) -> Unit ,
60+ openColorScheme : (ColorScheme ) -> Unit ,
5961 restoreSchemes : () -> Unit ,
6062 modifier : Modifier = Modifier ,
6163 contentPadding : PaddingValues = PaddingValues ()
@@ -121,12 +123,16 @@ internal fun AppearanceFragment(
121123
122124 }
123125 HorizontalDivider ()
126+ val lazyListState = rememberLazyListState()
124127 LazyRow (
128+ state = lazyListState,
125129 modifier = Modifier
126130 .fillMaxWidth()
127- .blurEdges(
128- colorScheme.surface, edges = listOf (Edge .Start , Edge .End )
129- ),
131+ .thenIf(! lazyListState.isAtTop) {
132+ Modifier .blurEdges(
133+ colorScheme.surface, edges = listOf (Edge .Start , Edge .End )
134+ )
135+ },
130136 verticalAlignment = Alignment .CenterVertically ,
131137 horizontalArrangement = Arrangement .spacedBy(spacing.small),
132138 contentPadding = PaddingValues (spacing.medium)
@@ -146,13 +152,13 @@ internal fun AppearanceFragment(
146152 argb = colorScheme.argb
147153 isDarkMode = colorScheme.isDark
148154 },
149- onLongClick = { openColorCanvas (colorScheme) },
155+ onLongClick = { openColorScheme (colorScheme) },
150156 )
151157 }
152158// item {
153159// val inDarkTheme = isSystemInDarkTheme()
154160// ThemeAddSelection {
155- // openColorCanvas (
161+ // openColorScheme (
156162// ColorScheme(
157163// argb = Color(
158164// red = (0..0xFF).random(),
0 commit comments