From 9261a0b9d3d95bd00d10aea71c01eec3e1b20b7c Mon Sep 17 00:00:00 2001 From: lyswhut Date: Sun, 24 Dec 2023 12:02:09 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BC=98=E5=8C=96=E5=AD=97=E4=BD=93=E9=98=B4?= =?UTF-8?q?=E5=BD=B1=EF=BC=8C=E4=BF=AE=E5=A4=8D=E6=BD=9C=E5=9C=A8=E5=8A=A8?= =?UTF-8?q?=E6=80=81=E8=83=8C=E6=99=AF=E6=98=BE=E7=A4=BA=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- dependencies-patch.js | 5 +++++ publish/changeLog.md | 4 ++-- src/components/common/Icon.tsx | 4 ++-- src/components/common/Text.tsx | 18 +++++++++--------- src/config/defaultSetting.ts | 2 +- src/core/init/common.ts | 2 +- src/lang/en_us.json | 3 ++- src/lang/zh_cn.json | 3 ++- .../settings/Basic/UserApiEditModal/action.ts | 2 +- src/utils/data.ts | 2 +- 10 files changed, 26 insertions(+), 19 deletions(-) diff --git a/dependencies-patch.js b/dependencies-patch.js index 9f09f20..51550f9 100644 --- a/dependencies-patch.js +++ b/dependencies-patch.js @@ -6,6 +6,11 @@ const path = require('node:path') const rootPath = path.join(__dirname, './') const patchs = [ + [ + path.join(rootPath, './node_modules/@react-native-community/cli-tools/build/findDevServerPort.js'), + 'let startPackager = true;', + 'let startPackager = false;', + ], [ path.join(rootPath, './node_modules/react-native-navigation/lib/android/app/build.gradle'), ` diff --git a/publish/changeLog.md b/publish/changeLog.md index 91ca2ad..756bc55 100644 --- a/publish/changeLog.md +++ b/publish/changeLog.md @@ -4,8 +4,8 @@ - 新增长按收藏列表名自动跳转列表顶部的功能 - 新增实验性的添加本地歌曲到我的收藏支持,与PC端类似,在我的收藏的列表菜单中选择歌曲目录,将添加所选目录下的所有歌曲,目前支持mp3/flac/ogg/wav等格式 - 新增歌曲标签编辑功能,允许编辑本地源且文件歌曲存在的歌曲标签信息 -- 新增动态背景,默认关闭,启用后将使用当前歌曲封面做APP背景 -- 新增APP全局字体阴影,默认开启,可到设置-主题设置关闭 +- 新增动态背景,启用后将使用当前歌曲封面做APP背景,默认关闭,可到设置-主题设置启用 +- 新增APP全局字体阴影,默认关闭,可到设置-主题设置启用 - 新增启用竖屏首页横向滚动设置,默认开启(原来的行为),如果你不想要竖屏的首页左右滑动则可以关闭此设置(#397) ### 优化 diff --git a/src/components/common/Icon.tsx b/src/components/common/Icon.tsx index 56f1385..3f333f4 100644 --- a/src/components/common/Icon.tsx +++ b/src/components/common/Icon.tsx @@ -37,8 +37,8 @@ export const Icon = memo(({ size = 15, rawSize, color, style, ...props }: IconPr const theme = useTheme() const textShadow = useTextShadow() const newStyle = textShadow ? StyleSheet.compose({ - textShadowColor: theme['c-primary-alpha-700'], - textShadowOffset: { width: 0, height: 0.2 }, + textShadowColor: theme['c-primary-dark-300-alpha-800'], + textShadowOffset: { width: 0.2, height: 0.2 }, textShadowRadius: 2, }, style) : style return ( diff --git a/src/components/common/Text.tsx b/src/components/common/Text.tsx index 547d8e2..3b6ff3c 100644 --- a/src/components/common/Text.tsx +++ b/src/components/common/Text.tsx @@ -1,4 +1,4 @@ -import { type ComponentProps } from 'react' +import { memo, type ComponentProps } from 'react' import { Text, type TextProps as _TextProps, StyleSheet, Animated, type ColorValue, type TextStyle } from 'react-native' import { useTextShadow, useTheme } from '@/store/theme/hook' import { setSpText } from '@/utils/pixelRatio' @@ -29,13 +29,13 @@ export interface TextProps extends _TextProps { // } // } -export default ({ style, size = 15, color, children, ...props }: TextProps) => { +export default memo(({ style, size = 15, color, children, ...props }: TextProps) => { const theme = useTheme() const textShadow = useTextShadow() style = StyleSheet.compose(textShadow ? { fontFamily: 'System', - textShadowColor: theme['c-primary-alpha-700'], - textShadowOffset: { width: 0, height: 0.2 }, + textShadowColor: theme['c-primary-dark-300-alpha-800'], + textShadowOffset: { width: 0.2, height: 0.2 }, textShadowRadius: 2, fontSize: setSpText(size), color: color ?? theme['c-font'], @@ -51,7 +51,7 @@ export default ({ style, size = 15, color, children, ...props }: TextProps) => { {...props} >{children} ) -} +}) export interface AnimatedTextProps extends _AnimatedTextProps { /** @@ -68,8 +68,8 @@ export const AnimatedText = ({ style, size = 15, color, children, ...props }: An const textShadow = useTextShadow() style = StyleSheet.compose(textShadow ? { fontFamily: 'System', - textShadowColor: theme['c-primary-alpha-700'], - textShadowOffset: { width: 0, height: 0.2 }, + textShadowColor: theme['c-primary-dark-300-alpha-800'], + textShadowOffset: { width: 0.2, height: 0.2 }, textShadowRadius: 2, fontSize: setSpText(size), color: color ?? theme['c-font'], @@ -107,8 +107,8 @@ export const AnimatedColorText = ({ style, size = 15, opacity: _opacity, color: style = StyleSheet.compose(textShadow ? { fontFamily: 'System', - textShadowColor: theme['c-primary-alpha-700'], - textShadowOffset: { width: 0, height: 0.2 }, + textShadowColor: theme['c-primary-dark-300-alpha-800'], + textShadowOffset: { width: 0.2, height: 0.2 }, textShadowRadius: 2, fontSize: setSpText(size), color: color as unknown as ColorValue, diff --git a/src/config/defaultSetting.ts b/src/config/defaultSetting.ts index 0fb7acb..1e88ca1 100644 --- a/src/config/defaultSetting.ts +++ b/src/config/defaultSetting.ts @@ -72,7 +72,7 @@ const defaultSetting: LX.AppSetting = { 'theme.darkId': 'black', 'theme.hideBgDark': false, 'theme.dynamicBg': false, - 'theme.fontShadow': true, + 'theme.fontShadow': false, } diff --git a/src/core/init/common.ts b/src/core/init/common.ts index e95bf59..2186900 100644 --- a/src/core/init/common.ts +++ b/src/core/init/common.ts @@ -37,7 +37,7 @@ export default async(setting: LX.AppSetting) => { if (!pic) return const picUrl = formatUri(pic) void prefetch(picUrl).then(() => { - if (pic != playerState.musicInfo.pic) return + if (pic != playerState.musicInfo.pic || !isDynamicBg) return setBgPic(picUrl) }) } diff --git a/src/lang/en_us.json b/src/lang/en_us.json index 0f43095..dd51c5b 100644 --- a/src/lang/en_us.json +++ b/src/lang/en_us.json @@ -436,11 +436,12 @@ "toggle_source_try": "Try switching to another source...", "understand": "Already understood 👌", "user_api__init_failed_alert": "Custom source [{name}] failed to initialize:", + "user_api_add_failed_tip": "Invalid custom source file", "user_api_allow_show_update_alert": "Allow update popups to be displayed", "user_api_btn_import": "Import", "user_api_empty": "It’s actually empty here 😲", "user_api_import_desc": "Select custom source file", - "user_api_import_failed_tip": "Import failed", + "user_api_import_failed_tip": "Import failed:", "user_api_import_success_tip": "Import successful 🎉", "user_api_max_tip": "A maximum of 20 sources can exist at the same time🤪\n\nIf you want to continue importing, please remove some old sources to make room.", "user_api_note": "Tip: Although we have isolated the running environment of the script as much as possible, importing scripts containing malicious behaviors may still affect your system, so please import with caution.", diff --git a/src/lang/zh_cn.json b/src/lang/zh_cn.json index 526a4b8..6d2a809 100644 --- a/src/lang/zh_cn.json +++ b/src/lang/zh_cn.json @@ -436,11 +436,12 @@ "toggle_source_try": "尝试切换到其他源...", "understand": "已了解 👌", "user_api__init_failed_alert": "自定义源 [{name}] 初始化失败:", + "user_api_add_failed_tip": "无效的自定义源文件", "user_api_allow_show_update_alert": "允许显示更新弹窗", "user_api_btn_import": "导入", "user_api_empty": "这里竟然是空的 😲", "user_api_import_desc": "选择自定义源文件", - "user_api_import_failed_tip": "导入失败", + "user_api_import_failed_tip": "导入失败:", "user_api_import_success_tip": "导入成功 🎉", "user_api_max_tip": "最多只能同时存在20个源哦🤪\n想要继续导入的话,请先移除一些旧的源腾出位置吧", "user_api_note": "提示:虽然我们已经尽可能地隔离了脚本的运行环境,但导入包含恶意行为的脚本仍可能会影响你的系统,请谨慎导入。", diff --git a/src/screens/Home/Views/Setting/settings/Basic/UserApiEditModal/action.ts b/src/screens/Home/Views/Setting/settings/Basic/UserApiEditModal/action.ts index 9850fa1..8d62c1e 100644 --- a/src/screens/Home/Views/Setting/settings/Basic/UserApiEditModal/action.ts +++ b/src/screens/Home/Views/Setting/settings/Basic/UserApiEditModal/action.ts @@ -12,7 +12,7 @@ export const handleImport = (path: string) => { toast(global.i18n.t('user_api_import_success_tip')) }).catch((error: any) => { log.error(error.stack) - toast(global.i18n.t('user_api_import_failed_tip')) + toast(global.i18n.t('user_api_import_failed_tip') + '\n' + error.message) }) } diff --git a/src/utils/data.ts b/src/utils/data.ts index f75f081..b4c1634 100644 --- a/src/utils/data.ts +++ b/src/utils/data.ts @@ -534,7 +534,7 @@ const matchInfo = (scriptInfo: string) => { } export const addUserApi = async(script: string): Promise => { const result = /^\/\*[\S|\s]+?\*\//.exec(script) - if (!result) throw new Error('无效的自定义源文件') + if (!result) throw new Error(global.i18n.t('user_api_add_failed_tip')) let scriptInfo = matchInfo(result[0])