diff --git a/publish/changeLog.md b/publish/changeLog.md index 1dd4ac5..e87b275 100644 --- a/publish/changeLog.md +++ b/publish/changeLog.md @@ -1,3 +1,3 @@ -### 修复 +### 新增 -- 修复歌单详情页内歌曲最多只加载30首的问题 +- 隐藏黑色主题背景设置,默认关闭,可以去设置-主题设置更改 diff --git a/src/config/defaultSetting.ts b/src/config/defaultSetting.ts index f9e93f3..0e8274d 100644 --- a/src/config/defaultSetting.ts +++ b/src/config/defaultSetting.ts @@ -63,6 +63,7 @@ const defaultSetting: LX.AppSetting = { 'theme.id': 'blue_plus', 'theme.lightId': 'green', 'theme.darkId': 'black', + 'theme.hideBgDark': false, } diff --git a/src/lang/en_us.json b/src/lang/en_us.json index 70c52fb..24b2382 100644 --- a/src/lang/en_us.json +++ b/src/lang/en_us.json @@ -203,6 +203,7 @@ "setting_basic_startup_auto_play": "Play music automatically after startup", "setting_basic_theme": "Theme", "setting_basic_theme_auto_theme": "Follow the system light and dark mode to switch themes", + "setting_basic_theme_hide_bg_dark": "Hide black theme", "setting_list": "List settings", "setting_list_add_music_location_type": "Position when the song was added to the list", "setting_list_add_music_location_type_bottom": "Bottom", diff --git a/src/lang/zh_cn.json b/src/lang/zh_cn.json index e51341e..232b3b9 100644 --- a/src/lang/zh_cn.json +++ b/src/lang/zh_cn.json @@ -203,6 +203,7 @@ "setting_basic_startup_auto_play": "启动后自动播放音乐", "setting_basic_theme": "主题颜色", "setting_basic_theme_auto_theme": "跟随系统亮、暗模式切换主题", + "setting_basic_theme_hide_bg_dark": "隐藏黑色主题背景", "setting_list": "列表设置", "setting_list_add_music_location_type": "添加歌曲到列表时的位置", "setting_list_add_music_location_type_bottom": "底部", diff --git a/src/screens/Home/Views/Setting/settings/Theme/IsHideBgDark.tsx b/src/screens/Home/Views/Setting/settings/Theme/IsHideBgDark.tsx new file mode 100644 index 0000000..2eaa315 --- /dev/null +++ b/src/screens/Home/Views/Setting/settings/Theme/IsHideBgDark.tsx @@ -0,0 +1,37 @@ +import React, { memo } from 'react' +import { View } from 'react-native' + +import CheckBoxItem from '../../components/CheckBoxItem' +import { createStyle } from '@/utils/tools' +import { useI18n } from '@/lang' +import { updateSetting } from '@/core/common' +import { useSettingValue } from '@/store/setting/hook' +import { getTheme } from '@/theme/themes' +import { applyTheme } from '@/core/theme' +import settingState from '@/store/setting/state' + +export default memo(() => { + const t = useI18n() + const isHideBgDark = useSettingValue('theme.hideBgDark') + const setIsAutoTheme = (isHideBgDark: boolean) => { + updateSetting({ 'theme.hideBgDark': isHideBgDark }) + void getTheme().then(theme => { + if (theme.id != 'black' || !settingState.setting['common.isAutoTheme']) return + applyTheme(theme) + }) + } + + + return ( + + + + ) +}) + +const styles = createStyle({ + content: { + marginTop: 5, + // marginBottom: 5, + }, +}) diff --git a/src/screens/Home/Views/Setting/settings/Theme/index.tsx b/src/screens/Home/Views/Setting/settings/Theme/index.tsx index 0917a1d..aeec4a0 100644 --- a/src/screens/Home/Views/Setting/settings/Theme/index.tsx +++ b/src/screens/Home/Views/Setting/settings/Theme/index.tsx @@ -3,6 +3,7 @@ import React, { memo } from 'react' import Section from '../../components/Section' import Theme from './Theme' import IsAutoTheme from './IsAutoTheme' +import IsHideBgDark from './IsHideBgDark' import { useI18n } from '@/lang/i18n' export default memo(() => { @@ -12,6 +13,7 @@ export default memo(() => {
+
) }) diff --git a/src/theme/themes/index.ts b/src/theme/themes/index.ts index e3be9a7..f8299b4 100644 --- a/src/theme/themes/index.ts +++ b/src/theme/themes/index.ts @@ -55,7 +55,9 @@ export const buildActiveThemeColors = (theme: LX.Theme): LX.ActiveTheme => { } } else { const extInfo = (theme as LocalTheme).config.extInfo - if (extInfo['bg-image']) bgImg = BG_IMAGES[extInfo['bg-image']] + if (extInfo['bg-image']) { + if (theme.id != 'black' || !settingState.setting['theme.hideBgDark']) bgImg = BG_IMAGES[extInfo['bg-image']] + } } theme.config.extInfo = { ...theme.config.extInfo } diff --git a/src/types/app_setting.d.ts b/src/types/app_setting.d.ts index b53c0a8..67afd4a 100644 --- a/src/types/app_setting.d.ts +++ b/src/types/app_setting.d.ts @@ -71,6 +71,11 @@ declare global { */ 'theme.darkId': string + /** + * 隐藏黑色主题背景 + */ + 'theme.hideBgDark': boolean + /** * 启动时自动播放歌曲 */