feat: 新增夜间主题“静谧蓝”
This commit is contained in:
parent
1fa76318f5
commit
10a3a4ac1e
|
|
@ -456,7 +456,13 @@ class App : Application(), IApp, SketchFactory {
|
|||
return getColorByAttr(context, R.attr.colorTextSecondary, theme)
|
||||
}
|
||||
return if (ThemeUtil.isNightMode(theme)) {
|
||||
context.getColorCompat(R.color.theme_color_on_chip_night)
|
||||
context.getColorCompat(
|
||||
resources.getIdentifier(
|
||||
"theme_color_on_chip_$theme",
|
||||
"color",
|
||||
packageName
|
||||
)
|
||||
)
|
||||
} else context.getColorCompat(R.color.theme_color_on_chip_light)
|
||||
}
|
||||
R.attr.colorUnselected -> {
|
||||
|
|
@ -589,8 +595,14 @@ class App : Application(), IApp, SketchFactory {
|
|||
}
|
||||
}
|
||||
R.attr.colorOnToolbarBar -> {
|
||||
return if (ThemeUtil.isNightMode(theme) || ThemeUtil.getThemeTranslucent() == ThemeUtil.THEME_TRANSLUCENT_LIGHT) {
|
||||
context.getColorCompat(R.color.theme_color_on_toolbar_bar_dark)
|
||||
return if (ThemeUtil.isTranslucentTheme(theme) || ThemeUtil.isNightMode(theme)) {
|
||||
context.getColorCompat(
|
||||
resources.getIdentifier(
|
||||
"theme_color_on_toolbar_bar_$theme",
|
||||
"color",
|
||||
packageName
|
||||
)
|
||||
)
|
||||
} else {
|
||||
context.getColorCompat(R.color.theme_color_on_toolbar_bar_light)
|
||||
}
|
||||
|
|
|
|||
|
|
@ -95,6 +95,7 @@ fun getColorPalette(
|
|||
onSecondary = Color(0xFFFFFFFF),
|
||||
background = extendedColors.background,
|
||||
onBackground = extendedColors.text,
|
||||
surface = extendedColors.card
|
||||
)
|
||||
} else {
|
||||
lightColors(
|
||||
|
|
|
|||
|
|
@ -38,7 +38,6 @@ import androidx.compose.ui.text.style.TextOverflow
|
|||
import androidx.compose.ui.unit.dp
|
||||
import androidx.compose.ui.unit.sp
|
||||
import com.huanchengfly.tieba.post.R
|
||||
import com.huanchengfly.tieba.post.activities.ThreadActivity
|
||||
import com.huanchengfly.tieba.post.api.abstractText
|
||||
import com.huanchengfly.tieba.post.api.models.protos.ThreadInfo
|
||||
import com.huanchengfly.tieba.post.api.models.protos.frsPage.Classify
|
||||
|
|
@ -48,6 +47,8 @@ import com.huanchengfly.tieba.post.arch.collectPartialAsState
|
|||
import com.huanchengfly.tieba.post.arch.onEvent
|
||||
import com.huanchengfly.tieba.post.arch.pageViewModel
|
||||
import com.huanchengfly.tieba.post.ui.common.windowsizeclass.WindowWidthSizeClass
|
||||
import com.huanchengfly.tieba.post.ui.page.LocalNavigator
|
||||
import com.huanchengfly.tieba.post.ui.page.destinations.ThreadPageDestination
|
||||
import com.huanchengfly.tieba.post.ui.page.forum.getSortType
|
||||
import com.huanchengfly.tieba.post.ui.widgets.Chip
|
||||
import com.huanchengfly.tieba.post.ui.widgets.compose.FeedCard
|
||||
|
|
@ -242,6 +243,7 @@ fun ForumThreadListPage(
|
|||
viewModel: ForumThreadListViewModel = if (isGood) pageViewModel<GoodThreadListViewModel>() else pageViewModel<LatestThreadListViewModel>()
|
||||
) {
|
||||
val context = LocalContext.current
|
||||
val navigator = LocalNavigator.current
|
||||
val snackbarHostState = LocalSnackbarHostState.current
|
||||
LazyLoad(loaded = viewModel.initialized) {
|
||||
viewModel.send(getFirstLoadIntent(context, forumName, isGood))
|
||||
|
|
@ -333,10 +335,7 @@ fun ForumThreadListPage(
|
|||
goodClassifyId = goodClassifyId,
|
||||
goodClassifyHoldersProvider = { goodClassifies },
|
||||
onItemClicked = {
|
||||
ThreadActivity.launch(
|
||||
context,
|
||||
it.threadId.toString()
|
||||
)
|
||||
navigator.navigate(ThreadPageDestination(it.threadId))
|
||||
},
|
||||
onAgree = {
|
||||
viewModel.send(
|
||||
|
|
|
|||
|
|
@ -17,6 +17,7 @@ import androidx.compose.ui.ExperimentalComposeUiApi
|
|||
import androidx.compose.ui.Modifier
|
||||
import androidx.compose.ui.graphics.Color
|
||||
import androidx.compose.ui.platform.LocalContext
|
||||
import androidx.compose.ui.res.stringArrayResource
|
||||
import androidx.compose.ui.res.stringResource
|
||||
import androidx.compose.ui.unit.dp
|
||||
import com.google.accompanist.drawablepainter.rememberDrawablePainter
|
||||
|
|
@ -82,6 +83,8 @@ fun CustomSettingsPage(
|
|||
)
|
||||
}
|
||||
prefsItem {
|
||||
val darkThemeValues = stringArrayResource(id = R.array.dark_theme_values)
|
||||
val darkThemeNames = stringArrayResource(id = R.array.dark_theme_names)
|
||||
ListPref(
|
||||
key = "dark_theme",
|
||||
title = stringResource(id = R.string.settings_night_mode),
|
||||
|
|
@ -95,10 +98,11 @@ fun CustomSettingsPage(
|
|||
)
|
||||
}
|
||||
},
|
||||
entries = mapOf(
|
||||
ThemeUtil.THEME_GREY_DARK to "深邃灰",
|
||||
ThemeUtil.THEME_AMOLED_DARK to "A屏黑"
|
||||
),
|
||||
entries = darkThemeValues.associateWith { value ->
|
||||
darkThemeNames[darkThemeValues.indexOf(
|
||||
value
|
||||
)]
|
||||
},
|
||||
useSelectedAsSummary = true,
|
||||
)
|
||||
}
|
||||
|
|
|
|||
|
|
@ -67,6 +67,7 @@ object ThemeUtil {
|
|||
const val THEME_PURPLE = "purple"
|
||||
const val THEME_PINK = "pink"
|
||||
const val THEME_RED = "red"
|
||||
const val THEME_BLUE_DARK = "blue_dark"
|
||||
const val THEME_GREY_DARK = "grey_dark"
|
||||
const val THEME_AMOLED_DARK = "amoled_dark"
|
||||
|
||||
|
|
@ -395,6 +396,7 @@ object ThemeUtil {
|
|||
THEME_PURPLE -> R.style.TiebaLite_Purple
|
||||
THEME_PINK -> R.style.TiebaLite_Pink
|
||||
THEME_RED -> R.style.TiebaLite_Red
|
||||
THEME_BLUE_DARK -> R.style.TiebaLite_Dark_Blue
|
||||
THEME_GREY_DARK -> R.style.TiebaLite_Dark_Grey
|
||||
THEME_AMOLED_DARK -> R.style.TiebaLite_Dark_Amoled
|
||||
THEME_CUSTOM -> R.style.TiebaLite_Custom
|
||||
|
|
@ -415,6 +417,7 @@ object ThemeUtil {
|
|||
THEME_PURPLE,
|
||||
THEME_PINK,
|
||||
THEME_RED,
|
||||
THEME_BLUE_DARK,
|
||||
THEME_GREY_DARK,
|
||||
THEME_AMOLED_DARK -> theme.lowercase(Locale.getDefault())
|
||||
|
||||
|
|
|
|||
|
|
@ -0,0 +1,6 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<shape xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:shape="rectangle">
|
||||
<corners android:radius="@dimen/radius" />
|
||||
<solid android:color="@color/theme_color_card_blue_dark" />
|
||||
</shape>
|
||||
|
|
@ -36,6 +36,7 @@
|
|||
<item>pink</item>
|
||||
<item>red</item>
|
||||
<item>purple</item>
|
||||
<item>blue_dark</item>
|
||||
<item>grey_dark</item>
|
||||
<item>amoled_dark</item>
|
||||
</string-array>
|
||||
|
|
@ -46,16 +47,19 @@
|
|||
<item>少女粉</item>
|
||||
<item>新年红</item>
|
||||
<item>星空紫</item>
|
||||
<item>静谧蓝</item>
|
||||
<item>深邃灰</item>
|
||||
<item>A屏黑</item>
|
||||
<item>纯黑</item>
|
||||
</string-array>
|
||||
|
||||
<string-array name="dark_theme_names">
|
||||
<item>静谧蓝</item>
|
||||
<item>深邃灰</item>
|
||||
<item>A屏黑</item>
|
||||
<item>纯黑</item>
|
||||
</string-array>
|
||||
|
||||
<string-array name="dark_theme_values">
|
||||
<item>blue_dark</item>
|
||||
<item>grey_dark</item>
|
||||
<item>amoled_dark</item>
|
||||
</string-array>
|
||||
|
|
|
|||
|
|
@ -78,6 +78,7 @@
|
|||
<color name="theme_color_primary_black">@color/black</color>
|
||||
<color name="theme_color_primary_purple">#FF512DA8</color>
|
||||
<color name="theme_color_primary_dark">@color/tieba</color>
|
||||
<color name="theme_color_primary_blue_dark">@color/tieba</color>
|
||||
<color name="theme_color_primary_grey_dark">@color/tieba</color>
|
||||
<color name="theme_color_primary_amoled_dark">@color/tieba</color>
|
||||
|
||||
|
|
@ -88,6 +89,7 @@
|
|||
<color name="theme_color_accent_black">@color/black</color>
|
||||
<color name="theme_color_accent_purple">#FF512DA8</color>
|
||||
<color name="theme_color_accent_dark">@color/tieba</color>
|
||||
<color name="theme_color_accent_blue_dark">@color/tieba</color>
|
||||
<color name="theme_color_accent_grey_dark">@color/tieba</color>
|
||||
<color name="theme_color_accent_amoled_dark">@color/tieba</color>
|
||||
|
||||
|
|
@ -95,19 +97,24 @@
|
|||
<color name="theme_color_accent_night">#FF5588D7</color>
|
||||
|
||||
<color name="theme_color_chip_light">#FFF8F8F8</color>
|
||||
<color name="theme_color_chip_blue_dark">#242F3D</color>
|
||||
<color name="theme_color_chip_grey_dark">#323232</color>
|
||||
<color name="theme_color_chip_amoled_dark">#1E1E1E</color>
|
||||
|
||||
<color name="theme_color_on_chip_light">#FF808080</color>
|
||||
<color name="theme_color_on_chip_night">#FF808080</color>
|
||||
<color name="theme_color_on_chip_blue_dark">#68737E</color>
|
||||
<color name="theme_color_on_chip_grey_dark">#FF808080</color>
|
||||
<color name="theme_color_on_chip_amoled_dark">#FF808080</color>
|
||||
|
||||
<color name="theme_color_window_background_light">#FFF8F8F8</color>
|
||||
<color name="theme_color_window_background_dark">#FF10171F</color>
|
||||
<color name="theme_color_window_background_grey_dark">#FF212121</color>
|
||||
<color name="theme_color_window_background_blue_dark">#17212B</color>
|
||||
<color name="theme_color_window_background_grey_dark">#FF202020</color>
|
||||
<color name="theme_color_window_background_amoled_dark">#FF1E1E1E</color>
|
||||
|
||||
<color name="theme_color_toolbar_white">@color/white</color>
|
||||
<color name="theme_color_toolbar_dark">#FF15202B</color>
|
||||
<color name="theme_color_toolbar_blue_dark">#17212B</color>
|
||||
<color name="theme_color_toolbar_grey_dark">#202020</color>
|
||||
<color name="theme_color_toolbar_amoled_dark">#000000</color>
|
||||
<color name="theme_color_toolbar_translucent_light">#00FFFFFF</color>
|
||||
|
|
@ -124,17 +131,20 @@
|
|||
<color name="theme_color_toolbar_item_secondary_translucent_light">#8AFFFFFF</color>
|
||||
<color name="theme_color_toolbar_item_secondary_translucent_dark">#B3000000</color>
|
||||
<color name="theme_color_toolbar_item_secondary_dark">#CCE6E7EE</color>
|
||||
<color name="theme_color_toolbar_item_secondary_grey_dark">#CCE6E7EE</color>
|
||||
<color name="theme_color_toolbar_item_secondary_amoled_dark">#CCE6E7EE</color>
|
||||
<color name="theme_color_toolbar_item_secondary_blue_dark">#CCEEEEEE</color>
|
||||
<color name="theme_color_toolbar_item_secondary_grey_dark">#CCEEEEEE</color>
|
||||
<color name="theme_color_toolbar_item_secondary_amoled_dark">#CCEEEEEE</color>
|
||||
|
||||
<color name="theme_color_toolbar_item_active_white">@color/theme_color_accent_white</color>
|
||||
<color name="theme_color_toolbar_item_active_translucent_light">#FFFFFFFF</color>
|
||||
<color name="theme_color_toolbar_item_active_translucent_dark">#FF000000</color>
|
||||
<color name="theme_color_toolbar_item_active_dark">@color/white</color>
|
||||
<color name="theme_color_toolbar_item_active_blue_dark">@color/white</color>
|
||||
<color name="theme_color_toolbar_item_active_grey_dark">@color/white</color>
|
||||
<color name="theme_color_toolbar_item_active_amoled_dark">@color/white</color>
|
||||
|
||||
<color name="theme_color_toolbar_bar_light">#F8F8F8</color>
|
||||
<color name="theme_color_toolbar_bar_blue_dark">#242F3D</color>
|
||||
<color name="theme_color_toolbar_bar_grey_dark">#2C2C2C</color>
|
||||
<color name="theme_color_toolbar_bar_amoled_dark">#1E1E1E</color>
|
||||
<color name="theme_color_toolbar_bar_translucent_light">#10FFFFFF</color>
|
||||
|
|
@ -142,8 +152,17 @@
|
|||
|
||||
<color name="theme_color_on_toolbar_bar_light">#BFBFBF</color>
|
||||
<color name="theme_color_on_toolbar_bar_dark">#5C5C5C</color>
|
||||
<color name="theme_color_on_toolbar_bar_blue_dark">#626C79</color>
|
||||
<color name="theme_color_on_toolbar_bar_grey_dark">#5C5C5C</color>
|
||||
<color name="theme_color_on_toolbar_bar_amoled_dark">#5C5C5C</color>
|
||||
<color name="theme_color_on_toolbar_bar_translucent_light">@color/theme_color_accent_grey_dark
|
||||
</color>
|
||||
<color name="theme_color_on_toolbar_bar_translucent_dark">
|
||||
@color/theme_color_on_toolbar_bar_light
|
||||
</color>
|
||||
|
||||
<color name="theme_color_nav_bar_surface_light">#FFF8F8F8</color>
|
||||
<color name="theme_color_nav_bar_surface_blue_dark">#141F2A</color>
|
||||
<color name="theme_color_nav_bar_surface_grey_dark">#242424</color>
|
||||
<color name="theme_color_nav_bar_surface_amoled_dark">#282828</color>
|
||||
|
||||
|
|
@ -152,18 +171,21 @@
|
|||
|
||||
<color name="theme_color_background_light">#FFFFFFFF</color>
|
||||
<color name="theme_color_background_dark">#FF131D28</color>
|
||||
<color name="theme_color_background_grey_dark">#202020</color>
|
||||
<color name="theme_color_background_blue_dark">#17212B</color>
|
||||
<color name="theme_color_background_grey_dark">#FF202020</color>
|
||||
<color name="theme_color_background_amoled_dark">#FF000000</color>
|
||||
|
||||
<color name="theme_color_on_accent_light">#FFFFFFFF</color>
|
||||
<color name="theme_color_on_accent_dark">#FF131D28</color>
|
||||
<color name="theme_color_on_accent_grey_dark">#FF212121</color>
|
||||
<color name="theme_color_on_accent_blue_dark">#FF17212B</color>
|
||||
<color name="theme_color_on_accent_grey_dark">#FF202020</color>
|
||||
<color name="theme_color_on_accent_amoled_dark">#FF000000</color>
|
||||
<color name="theme_color_on_accent_translucent_light">#FFFFFFFF</color>
|
||||
<color name="theme_color_on_accent_translucent_dark">#FF212121</color>
|
||||
|
||||
<color name="theme_color_nav_light">@color/white</color>
|
||||
<color name="theme_color_nav_dark">#FF15202B</color>
|
||||
<color name="theme_color_nav_blue_dark">#1B2733</color>
|
||||
<color name="theme_color_nav_grey_dark">#FF303030</color>
|
||||
<color name="theme_color_nav_amoled_dark">#FF171717</color>
|
||||
|
||||
|
|
@ -171,6 +193,7 @@
|
|||
<color name="theme_color_unselected_translucent_light">#43FFFFFF</color>
|
||||
<color name="theme_color_unselected_translucent_dark">#4D000000</color>
|
||||
<color name="theme_color_unselected_dark">#FF415C68</color>
|
||||
<color name="theme_color_unselected_blue_dark">#5A6670</color>
|
||||
<color name="theme_color_unselected_grey_dark">#FF808080</color>
|
||||
<color name="theme_color_unselected_amoled_dark">#FF808080</color>
|
||||
|
||||
|
|
@ -178,6 +201,7 @@
|
|||
<color name="theme_color_floor_card_translucent_light">#15FFFFFF</color>
|
||||
<color name="theme_color_floor_card_translucent_dark">#2A000000</color>
|
||||
<color name="theme_color_floor_card_dark">#FF1A2A39</color>
|
||||
<color name="theme_color_floor_card_blue_dark">#242F3D</color>
|
||||
<color name="theme_color_floor_card_grey_dark">#FF1E1E1E</color>
|
||||
<color name="theme_color_floor_card_amoled_dark">#FF1E1E1E</color>
|
||||
|
||||
|
|
@ -185,6 +209,7 @@
|
|||
<color name="theme_color_card_translucent_light">#10FFFFFF</color>
|
||||
<color name="theme_color_card_translucent_dark">#20000000</color>
|
||||
<color name="theme_color_card_dark">#FF131D27</color>
|
||||
<color name="theme_color_card_blue_dark">#202B37</color>
|
||||
<color name="theme_color_card_grey_dark">#FF2A2A2A</color>
|
||||
<color name="theme_color_card_amoled_dark">#FF101010</color>
|
||||
|
||||
|
|
@ -192,6 +217,7 @@
|
|||
<color name="theme_color_swipe_refresh_view_background_translucent_light">#FFFFFFFF</color>
|
||||
<color name="theme_color_swipe_refresh_view_background_translucent_dark">#FF1C1C1C</color>
|
||||
<color name="theme_color_swipe_refresh_view_background_dark">#FF1C2938</color>
|
||||
<color name="theme_color_swipe_refresh_view_background_blue_dark">#202B37</color>
|
||||
<color name="theme_color_swipe_refresh_view_background_grey_dark">#FF252525</color>
|
||||
<color name="theme_color_swipe_refresh_view_background_amoled_dark">#FF1C1C1C</color>
|
||||
|
||||
|
|
@ -199,6 +225,7 @@
|
|||
<color name="theme_color_divider_translucent_light">#10FFFFFF</color>
|
||||
<color name="theme_color_divider_translucent_dark">#15000000</color>
|
||||
<color name="theme_color_divider_dark">#FF10171D</color>
|
||||
<color name="theme_color_divider_blue_dark">#242F3D</color>
|
||||
<color name="theme_color_divider_grey_dark">#FF1E1E1E</color>
|
||||
<color name="theme_color_divider_amoled_dark">#FF1E1E1E</color>
|
||||
|
||||
|
|
|
|||
|
|
@ -238,6 +238,14 @@
|
|||
<item name="activeItemTint">@color/default_color_toolbar_item_active</item>
|
||||
</style>
|
||||
|
||||
<style name="Toolbar.Dark.Blue" parent="Toolbar.Dark">
|
||||
<item name="android:popupTheme">@style/OverflowMenu.Dark.Blue</item>
|
||||
<item name="popupTheme">@style/OverflowMenu.Dark.Blue</item>
|
||||
<item name="android:actionOverflowMenuStyle">@style/OverflowMenu.Dark.Blue</item>
|
||||
<item name="actionOverflowMenuStyle">@style/OverflowMenu.Dark.Blue</item>
|
||||
<item name="android:colorBackground">@color/theme_color_background_blue_dark</item>
|
||||
</style>
|
||||
|
||||
<style name="Toolbar.Dark.Grey" parent="Toolbar.Dark">
|
||||
<item name="android:popupTheme">@style/OverflowMenu.Dark.Grey</item>
|
||||
<item name="popupTheme">@style/OverflowMenu.Dark.Grey</item>
|
||||
|
|
@ -494,6 +502,10 @@
|
|||
<item name="android:popupBackground">@drawable/bg_popup_dark</item>
|
||||
</style>
|
||||
|
||||
<style name="OverflowMenu.Dark.Blue" parent="OverflowMenu.Dark">
|
||||
<item name="android:popupBackground">@drawable/bg_popup_dark_blue</item>
|
||||
</style>
|
||||
|
||||
<style name="OverflowMenu.Dark.Grey" parent="OverflowMenu.Dark">
|
||||
<item name="android:popupBackground">@drawable/bg_popup_dark_grey</item>
|
||||
</style>
|
||||
|
|
@ -615,6 +627,23 @@
|
|||
<item name="colorDivider">#FF10171D</item>
|
||||
</style>
|
||||
|
||||
<style name="TiebaLite.Dark.Blue" parent="AppTheme.Dark">
|
||||
<item name="toolbarStyle">@style/Toolbar.Dark.Blue</item>
|
||||
<item name="actionOverflowMenuStyle">@style/OverflowMenu.Dark.Blue</item>
|
||||
<item name="colorPrimary">@color/theme_color_primary_blue_dark</item>
|
||||
<item name="colorAccent">@color/theme_color_accent_blue_dark</item>
|
||||
<item name="colorToolbar">@color/theme_color_toolbar_blue_dark</item>
|
||||
<item name="colorToolbarItem">@color/theme_color_toolbar_item_night</item>
|
||||
<item name="colorToolbarItemActive">@color/theme_color_toolbar_item_active_blue_dark</item>
|
||||
<item name="color_toolbar_item_secondary">
|
||||
@color/theme_color_toolbar_item_secondary_blue_dark
|
||||
</item>
|
||||
<item name="colorBg">@color/theme_color_background_blue_dark</item>
|
||||
<item name="colorChip">@color/theme_color_window_background_blue_dark</item>
|
||||
<item name="colorNavBar">@color/theme_color_nav_blue_dark</item>
|
||||
<item name="colorDivider">@color/theme_color_divider_blue_dark</item>
|
||||
</style>
|
||||
|
||||
<style name="TiebaLite.Dark.Grey" parent="AppTheme.Dark">
|
||||
<item name="toolbarStyle">@style/Toolbar.Dark.Grey</item>
|
||||
<item name="actionOverflowMenuStyle">@style/OverflowMenu.Dark.Grey</item>
|
||||
|
|
|
|||
Loading…
Reference in New Issue