Skip to content

Commit 9d0383a

Browse files
committed
fix: rename.
1 parent bbbee39 commit 9d0383a

File tree

3 files changed

+17
-15
lines changed

3 files changed

+17
-15
lines changed

app/smartphone/src/main/java/com/m3u/smartphone/ui/business/setting/SettingScreen.kt

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -98,7 +98,7 @@ fun SettingRoute(
9898
backup = backup,
9999
restore = restore,
100100
colorSchemes = colorSchemes,
101-
openColorCanvas = { colorScheme = it },
101+
openColorScheme = { colorScheme = it },
102102
restoreSchemes = viewModel::restoreSchemes,
103103
onClipboard = { viewModel.onClipboard(it) },
104104
onSubscribe = {
@@ -142,7 +142,7 @@ private fun SettingScreen(
142142
restore: () -> Unit,
143143
onClipboard: (String) -> Unit,
144144
colorSchemes: List<ColorScheme>,
145-
openColorCanvas: (ColorScheme) -> Unit,
145+
openColorScheme: (ColorScheme) -> Unit,
146146
restoreSchemes: () -> Unit,
147147
epgs: List<Playlist>,
148148
onDeleteEpgPlaylist: (String) -> Unit,
@@ -252,7 +252,7 @@ private fun SettingScreen(
252252
AppearanceFragment(
253253
colorSchemes = colorSchemes,
254254
colorArgb = colorArgb,
255-
openColorCanvas = openColorCanvas,
255+
openColorScheme = openColorScheme,
256256
restoreSchemes = restoreSchemes,
257257
contentPadding = contentPadding,
258258
modifier = Modifier.fillMaxSize()

app/smartphone/src/main/java/com/m3u/smartphone/ui/business/setting/fragments/AppearanceFragment.kt

Lines changed: 13 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@ import androidx.compose.foundation.layout.sizeIn
1616
import androidx.compose.foundation.lazy.LazyColumn
1717
import androidx.compose.foundation.lazy.LazyRow
1818
import androidx.compose.foundation.lazy.items
19+
import androidx.compose.foundation.lazy.rememberLazyListState
1920
import androidx.compose.material.icons.Icons
2021
import androidx.compose.material.icons.rounded.ColorLens
2122
import androidx.compose.material.icons.rounded.DarkMode
@@ -24,7 +25,6 @@ import androidx.compose.material.icons.rounded.FitScreen
2425
import androidx.compose.material.icons.rounded.FormatSize
2526
import androidx.compose.material.icons.rounded.HideImage
2627
import androidx.compose.material.icons.rounded.Restore
27-
import androidx.compose.material.icons.rounded.Stars
2828
import androidx.compose.material3.CardDefaults
2929
import androidx.compose.material3.HorizontalDivider
3030
import androidx.compose.material3.MaterialTheme
@@ -38,6 +38,7 @@ import androidx.compose.ui.res.stringResource
3838
import com.m3u.core.architecture.preferences.ClipMode
3939
import com.m3u.core.architecture.preferences.PreferencesKeys
4040
import com.m3u.core.architecture.preferences.mutablePreferenceOf
41+
import com.m3u.core.foundation.ui.thenIf
4142
import com.m3u.core.util.basic.title
4243
import com.m3u.data.database.model.ColorScheme
4344
import com.m3u.i18n.R.string
@@ -48,14 +49,15 @@ import com.m3u.smartphone.ui.material.components.TextPreference
4849
import com.m3u.smartphone.ui.material.components.ThemeSelection
4950
import com.m3u.smartphone.ui.material.ktx.Edge
5051
import com.m3u.smartphone.ui.material.ktx.blurEdges
52+
import com.m3u.smartphone.ui.material.ktx.isAtTop
5153
import com.m3u.smartphone.ui.material.ktx.plus
5254
import com.m3u.smartphone.ui.material.model.LocalSpacing
5355

5456
@Composable
5557
internal 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(),

app/smartphone/src/main/java/com/m3u/smartphone/ui/material/components/ThemeSelection.kt

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -111,11 +111,7 @@ fun ThemeSelection(
111111
Box(
112112
contentAlignment = Alignment.Center
113113
) {
114-
val corner by animateDpAsState(
115-
targetValue = if (!selected) spacing.extraLarge else spacing.medium,
116-
label = "corner"
117-
)
118-
val shape = AbsoluteSmoothCornerShape(corner, 65)
114+
val shape = AbsoluteSmoothCornerShape(spacing.large, 65)
119115
val brush = Brush.createPremiumBrush(
120116
colorScheme.primary,
121117
colorScheme.secondary

0 commit comments

Comments
 (0)