mirror of
https://github.com/ikun0014/lx-music-mobile.git
synced 2025-07-03 15:02:08 +08:00
新增是否在左侧导航栏显示返回桌面按钮设置
This commit is contained in:
parent
a0d9f78ada
commit
35b891879c
Binary file not shown.
@ -16,6 +16,7 @@
|
|||||||
- 新增播放器音量大小设置,可以去播放详情页-播放器设置-音量大小更改
|
- 新增播放器音量大小设置,可以去播放详情页-播放器设置-音量大小更改
|
||||||
- 新增播放器播放速率设置,可以去播放详情页-播放器设置-播放速率更改
|
- 新增播放器播放速率设置,可以去播放详情页-播放器设置-播放速率更改
|
||||||
- 新增播放详情页歌词对齐方式设置,可以去播放详情页-播放器设置-歌词对齐方式更改
|
- 新增播放详情页歌词对齐方式设置,可以去播放详情页-播放器设置-歌词对齐方式更改
|
||||||
|
- 新增是否在左侧导航栏显示返回桌面按钮设置,默认关闭,可以去设置-基本设置-是否显示返回桌面按钮开启
|
||||||
- 支持wy源flac hires歌曲类型的显示
|
- 支持wy源flac hires歌曲类型的显示
|
||||||
- 添加kg源评论图片展示(@helloplhm-qwq)
|
- 添加kg源评论图片展示(@helloplhm-qwq)
|
||||||
- 支持kg源搜索列表、排行榜flac hires歌曲类型的显示(@helloplhm-qwq, @Folltoshe)
|
- 支持kg源搜索列表、排行榜flac hires歌曲类型的显示(@helloplhm-qwq, @Folltoshe)
|
||||||
|
@ -8,6 +8,7 @@ const defaultSetting: LX.AppSetting = {
|
|||||||
'common.isAgreePact': false,
|
'common.isAgreePact': false,
|
||||||
'common.autoHidePlayBar': true,
|
'common.autoHidePlayBar': true,
|
||||||
'common.drawerLayoutPosition': 'left',
|
'common.drawerLayoutPosition': 'left',
|
||||||
|
'common.showBackBtn': false,
|
||||||
|
|
||||||
'player.startupAutoPlay': false,
|
'player.startupAutoPlay': false,
|
||||||
'player.togglePlayMethod': 'listLoop',
|
'player.togglePlayMethod': 'listLoop',
|
||||||
|
@ -3,6 +3,7 @@
|
|||||||
"agree": "Agree",
|
"agree": "Agree",
|
||||||
"agree_go": "To turn on",
|
"agree_go": "To turn on",
|
||||||
"back": "Back",
|
"back": "Back",
|
||||||
|
"back_home": "Back",
|
||||||
"cancel": "Cancel",
|
"cancel": "Cancel",
|
||||||
"change_position": "Change Position",
|
"change_position": "Change Position",
|
||||||
"change_position_list_title": "Change the position of the list",
|
"change_position_list_title": "Change the position of the list",
|
||||||
@ -35,6 +36,7 @@
|
|||||||
"disagree": "Disagree",
|
"disagree": "Disagree",
|
||||||
"disagree_tip": "Cancelled...",
|
"disagree_tip": "Cancelled...",
|
||||||
"duplicate_list_tip": "You have previously favorited the list [{name}], do you want to update the songs?",
|
"duplicate_list_tip": "You have previously favorited the list [{name}], do you want to update the songs?",
|
||||||
|
"exit_app_tip": "Are you sure you want to quit the app?",
|
||||||
"input_error": "Don't input indiscriminately 😡",
|
"input_error": "Don't input indiscriminately 😡",
|
||||||
"list_add_btn_title": "Add the song(s) to {name}",
|
"list_add_btn_title": "Add the song(s) to {name}",
|
||||||
"list_add_tip_exists": "This song already exists in the list, don't click me again~😡",
|
"list_add_tip_exists": "This song already exists in the list, don't click me again~😡",
|
||||||
@ -187,6 +189,7 @@
|
|||||||
"setting_basic_share_type_clipboard": "copy to clipboard",
|
"setting_basic_share_type_clipboard": "copy to clipboard",
|
||||||
"setting_basic_share_type_system": "Share using the system",
|
"setting_basic_share_type_system": "Share using the system",
|
||||||
"setting_basic_show_animation": "Show switching animation",
|
"setting_basic_show_animation": "Show switching animation",
|
||||||
|
"setting_basic_show_back_btn": "Show back to desktop button",
|
||||||
"setting_basic_source": "Music source",
|
"setting_basic_source": "Music source",
|
||||||
"setting_basic_source_direct": "Direct API",
|
"setting_basic_source_direct": "Direct API",
|
||||||
"setting_basic_source_temp": "Temporary API (some features not available; workaround if Test API unavailable)",
|
"setting_basic_source_temp": "Temporary API (some features not available; workaround if Test API unavailable)",
|
||||||
|
@ -3,6 +3,7 @@
|
|||||||
"agree": "行行行",
|
"agree": "行行行",
|
||||||
"agree_go": "去开启",
|
"agree_go": "去开启",
|
||||||
"back": "返回",
|
"back": "返回",
|
||||||
|
"back_home": "返回桌面",
|
||||||
"cancel": "取消",
|
"cancel": "取消",
|
||||||
"change_position": "调整位置",
|
"change_position": "调整位置",
|
||||||
"change_position_list_title": "调整列表位置",
|
"change_position_list_title": "调整列表位置",
|
||||||
@ -35,6 +36,7 @@
|
|||||||
"disagree": "我就不",
|
"disagree": "我就不",
|
||||||
"disagree_tip": "那算了... 🙄",
|
"disagree_tip": "那算了... 🙄",
|
||||||
"duplicate_list_tip": "你之前已收藏过该列表 [{name}],是否需要更新里面的歌曲?",
|
"duplicate_list_tip": "你之前已收藏过该列表 [{name}],是否需要更新里面的歌曲?",
|
||||||
|
"exit_app_tip": "确定要退出应用吗?",
|
||||||
"input_error": "不要乱输好吧😡",
|
"input_error": "不要乱输好吧😡",
|
||||||
"list_add_btn_title": "把该歌曲添加到 {name}",
|
"list_add_btn_title": "把该歌曲添加到 {name}",
|
||||||
"list_add_tip_exists": "列表已经存在这首歌啦,不要再点我啦~😡",
|
"list_add_tip_exists": "列表已经存在这首歌啦,不要再点我啦~😡",
|
||||||
@ -187,6 +189,7 @@
|
|||||||
"setting_basic_share_type_clipboard": "复制到剪贴板",
|
"setting_basic_share_type_clipboard": "复制到剪贴板",
|
||||||
"setting_basic_share_type_system": "使用系统分享",
|
"setting_basic_share_type_system": "使用系统分享",
|
||||||
"setting_basic_show_animation": "显示切换动画",
|
"setting_basic_show_animation": "显示切换动画",
|
||||||
|
"setting_basic_show_back_btn": "显示返回桌面按钮",
|
||||||
"setting_basic_source": "音乐来源",
|
"setting_basic_source": "音乐来源",
|
||||||
"setting_basic_source_direct": "试听接口(这是最后的选择...)",
|
"setting_basic_source_direct": "试听接口(这是最后的选择...)",
|
||||||
"setting_basic_source_temp": "临时接口(软件的某些功能不可用,建议测试接口不可用再使用本接口)",
|
"setting_basic_source_temp": "临时接口(软件的某些功能不可用,建议测试接口不可用再使用本接口)",
|
||||||
|
Binary file not shown.
File diff suppressed because one or more lines are too long
@ -3,12 +3,13 @@ import { ScrollView, StatusBar, TouchableOpacity, View } from 'react-native'
|
|||||||
import { useNavActiveId } from '@/store/common/hook'
|
import { useNavActiveId } from '@/store/common/hook'
|
||||||
import { useTheme } from '@/store/theme/hook'
|
import { useTheme } from '@/store/theme/hook'
|
||||||
import { Icon } from '@/components/common/Icon'
|
import { Icon } from '@/components/common/Icon'
|
||||||
import { createStyle } from '@/utils/tools'
|
import { confirmDialog, createStyle, exitApp as backHome } from '@/utils/tools'
|
||||||
import { NAV_MENUS } from '@/config/constant'
|
import { NAV_MENUS } from '@/config/constant'
|
||||||
import type { InitState } from '@/store/common/state'
|
import type { InitState } from '@/store/common/state'
|
||||||
// import commonState from '@/store/common/state'
|
// import commonState from '@/store/common/state'
|
||||||
import { exitApp, setNavActiveId } from '@/core/common'
|
import { exitApp, setNavActiveId } from '@/core/common'
|
||||||
import { BorderWidths } from '@/theme'
|
import { BorderWidths } from '@/theme'
|
||||||
|
import { useSettingValue } from '@/store/setting/hook'
|
||||||
|
|
||||||
const NAV_WIDTH = 68
|
const NAV_WIDTH = 68
|
||||||
|
|
||||||
@ -74,7 +75,7 @@ const Header = () => {
|
|||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
type IdType = InitState['navActiveId'] | 'nav_exit'
|
type IdType = InitState['navActiveId'] | 'nav_exit' | 'back_home'
|
||||||
|
|
||||||
const MenuItem = ({ id, icon, onPress }: {
|
const MenuItem = ({ id, icon, onPress }: {
|
||||||
id: IdType
|
id: IdType
|
||||||
@ -103,11 +104,22 @@ const MenuItem = ({ id, icon, onPress }: {
|
|||||||
export default memo(() => {
|
export default memo(() => {
|
||||||
const theme = useTheme()
|
const theme = useTheme()
|
||||||
// console.log('render drawer nav')
|
// console.log('render drawer nav')
|
||||||
|
const showBackBtn = useSettingValue('common.showBackBtn')
|
||||||
|
|
||||||
const handlePress = (id: IdType) => {
|
const handlePress = (id: IdType) => {
|
||||||
if (id == 'nav_exit') {
|
switch (id) {
|
||||||
exitApp()
|
case 'nav_exit':
|
||||||
return
|
void confirmDialog({
|
||||||
|
message: global.i18n.t('exit_app_tip'),
|
||||||
|
confirmButtonText: global.i18n.t('list_remove_tip_button'),
|
||||||
|
}).then(isExit => {
|
||||||
|
if (!isExit) return
|
||||||
|
exitApp()
|
||||||
|
})
|
||||||
|
return
|
||||||
|
case 'back_home':
|
||||||
|
backHome()
|
||||||
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
global.app_event.changeMenuVisible(false)
|
global.app_event.changeMenuVisible(false)
|
||||||
@ -122,6 +134,9 @@ export default memo(() => {
|
|||||||
{NAV_MENUS.map(menu => <MenuItem key={menu.id} id={menu.id} icon={menu.icon} onPress={handlePress} />)}
|
{NAV_MENUS.map(menu => <MenuItem key={menu.id} id={menu.id} icon={menu.icon} onPress={handlePress} />)}
|
||||||
</View>
|
</View>
|
||||||
</ScrollView>
|
</ScrollView>
|
||||||
|
{
|
||||||
|
showBackBtn ? <MenuItem id="back_home" icon="back-2" onPress={handlePress} /> : null
|
||||||
|
}
|
||||||
<MenuItem id="nav_exit" icon="exit2" onPress={handlePress} />
|
<MenuItem id="nav_exit" icon="exit2" onPress={handlePress} />
|
||||||
</View>
|
</View>
|
||||||
)
|
)
|
||||||
|
@ -4,13 +4,14 @@ import { useI18n } from '@/lang'
|
|||||||
import { useNavActiveId } from '@/store/common/hook'
|
import { useNavActiveId } from '@/store/common/hook'
|
||||||
import { useTheme } from '@/store/theme/hook'
|
import { useTheme } from '@/store/theme/hook'
|
||||||
import { Icon } from '@/components/common/Icon'
|
import { Icon } from '@/components/common/Icon'
|
||||||
import { createStyle } from '@/utils/tools'
|
import { confirmDialog, createStyle, exitApp as backHome } from '@/utils/tools'
|
||||||
import { NAV_MENUS } from '@/config/constant'
|
import { NAV_MENUS } from '@/config/constant'
|
||||||
import type { InitState } from '@/store/common/state'
|
import type { InitState } from '@/store/common/state'
|
||||||
// import { navigations } from '@/navigation'
|
// import { navigations } from '@/navigation'
|
||||||
// import commonState from '@/store/common/state'
|
// import commonState from '@/store/common/state'
|
||||||
import { exitApp, setNavActiveId } from '@/core/common'
|
import { exitApp, setNavActiveId } from '@/core/common'
|
||||||
import Text from '@/components/common/Text'
|
import Text from '@/components/common/Text'
|
||||||
|
import { useSettingValue } from '@/store/setting/hook'
|
||||||
|
|
||||||
const styles = createStyle({
|
const styles = createStyle({
|
||||||
container: {
|
container: {
|
||||||
@ -68,7 +69,7 @@ const Header = () => {
|
|||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
type IdType = InitState['navActiveId'] | 'nav_exit'
|
type IdType = InitState['navActiveId'] | 'nav_exit' | 'back_home'
|
||||||
|
|
||||||
const MenuItem = ({ id, icon, onPress }: {
|
const MenuItem = ({ id, icon, onPress }: {
|
||||||
id: IdType
|
id: IdType
|
||||||
@ -97,31 +98,29 @@ const MenuItem = ({ id, icon, onPress }: {
|
|||||||
export default memo(() => {
|
export default memo(() => {
|
||||||
const theme = useTheme()
|
const theme = useTheme()
|
||||||
// console.log('render drawer nav')
|
// console.log('render drawer nav')
|
||||||
|
const showBackBtn = useSettingValue('common.showBackBtn')
|
||||||
|
|
||||||
const handlePress = (id: IdType) => {
|
const handlePress = (id: IdType) => {
|
||||||
if (id == 'nav_exit') {
|
switch (id) {
|
||||||
exitApp()
|
case 'nav_exit':
|
||||||
return
|
void confirmDialog({
|
||||||
|
message: global.i18n.t('exit_app_tip'),
|
||||||
|
confirmButtonText: global.i18n.t('list_remove_tip_button'),
|
||||||
|
}).then(isExit => {
|
||||||
|
if (!isExit) return
|
||||||
|
exitApp()
|
||||||
|
})
|
||||||
|
return
|
||||||
|
case 'back_home':
|
||||||
|
backHome()
|
||||||
|
return
|
||||||
}
|
}
|
||||||
// switch (id) {
|
|
||||||
// case 'nav_search':
|
|
||||||
// break
|
|
||||||
// case 'nav_songlist':
|
|
||||||
// break
|
|
||||||
// case 'nav_top':
|
|
||||||
// break
|
|
||||||
// case 'nav_love':
|
|
||||||
// break
|
|
||||||
// case 'nav_setting':
|
|
||||||
// // void InteractionManager.runAfterInteractions(() => {
|
|
||||||
// // navigations.pushSettingScreen(commonState.componentIds.home)
|
|
||||||
// // })
|
|
||||||
// return
|
|
||||||
// }
|
|
||||||
global.app_event.changeMenuVisible(false)
|
global.app_event.changeMenuVisible(false)
|
||||||
setNavActiveId(id)
|
setNavActiveId(id)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<View style={{ ...styles.container, backgroundColor: theme['c-content-background'] }}>
|
<View style={{ ...styles.container, backgroundColor: theme['c-content-background'] }}>
|
||||||
<Header />
|
<Header />
|
||||||
@ -130,6 +129,10 @@ export default memo(() => {
|
|||||||
{NAV_MENUS.map(menu => <MenuItem key={menu.id} id={menu.id} icon={menu.icon} onPress={handlePress} />)}
|
{NAV_MENUS.map(menu => <MenuItem key={menu.id} id={menu.id} icon={menu.icon} onPress={handlePress} />)}
|
||||||
</View>
|
</View>
|
||||||
</ScrollView>
|
</ScrollView>
|
||||||
|
|
||||||
|
{
|
||||||
|
showBackBtn ? <MenuItem id="back_home" icon="back-2" onPress={handlePress} /> : null
|
||||||
|
}
|
||||||
<MenuItem id="nav_exit" icon="exit2" onPress={handlePress} />
|
<MenuItem id="nav_exit" icon="exit2" onPress={handlePress} />
|
||||||
</View>
|
</View>
|
||||||
)
|
)
|
||||||
|
@ -0,0 +1,30 @@
|
|||||||
|
import { updateSetting } from '@/core/common'
|
||||||
|
import { useI18n } from '@/lang'
|
||||||
|
import { createStyle } from '@/utils/tools'
|
||||||
|
import React, { memo } from 'react'
|
||||||
|
import { View } from 'react-native'
|
||||||
|
import { useSettingValue } from '@/store/setting/hook'
|
||||||
|
|
||||||
|
|
||||||
|
import CheckBoxItem from '../../components/CheckBoxItem'
|
||||||
|
|
||||||
|
export default memo(() => {
|
||||||
|
const t = useI18n()
|
||||||
|
const showBackBtn = useSettingValue('common.showBackBtn')
|
||||||
|
const setShowBaclBtn = (showBackBtn: boolean) => {
|
||||||
|
updateSetting({ 'common.showBackBtn': showBackBtn })
|
||||||
|
}
|
||||||
|
|
||||||
|
return (
|
||||||
|
<View style={styles.content}>
|
||||||
|
<CheckBoxItem check={showBackBtn} label={t('setting_basic_show_back_btn')} onChange={setShowBaclBtn} />
|
||||||
|
</View>
|
||||||
|
)
|
||||||
|
})
|
||||||
|
|
||||||
|
|
||||||
|
const styles = createStyle({
|
||||||
|
content: {
|
||||||
|
marginTop: 5,
|
||||||
|
},
|
||||||
|
})
|
@ -10,6 +10,7 @@ import ShareType from './ShareType'
|
|||||||
import IsAutoTheme from './IsAutoTheme'
|
import IsAutoTheme from './IsAutoTheme'
|
||||||
import IsStartupAutoPlay from './IsStartupAutoPlay'
|
import IsStartupAutoPlay from './IsStartupAutoPlay'
|
||||||
import IsAutoHidePlayBar from './IsAutoHidePlayBar'
|
import IsAutoHidePlayBar from './IsAutoHidePlayBar'
|
||||||
|
import IsShowBackBtn from './IsShowBackBtn'
|
||||||
import DrawerLayoutPosition from './DrawerLayoutPosition'
|
import DrawerLayoutPosition from './DrawerLayoutPosition'
|
||||||
import { useI18n } from '@/lang/i18n'
|
import { useI18n } from '@/lang/i18n'
|
||||||
|
|
||||||
@ -22,6 +23,7 @@ export default memo(() => {
|
|||||||
<Theme />
|
<Theme />
|
||||||
<IsAutoTheme />
|
<IsAutoTheme />
|
||||||
<IsStartupAutoPlay />
|
<IsStartupAutoPlay />
|
||||||
|
<IsShowBackBtn />
|
||||||
<IsAutoHidePlayBar />
|
<IsAutoHidePlayBar />
|
||||||
<Source />
|
<Source />
|
||||||
<SourceName />
|
<SourceName />
|
||||||
|
5
src/types/app_setting.d.ts
vendored
5
src/types/app_setting.d.ts
vendored
@ -46,6 +46,11 @@ declare global {
|
|||||||
*/
|
*/
|
||||||
'common.drawerLayoutPosition': 'left' | 'right'
|
'common.drawerLayoutPosition': 'left' | 'right'
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 是否显示返回按钮
|
||||||
|
*/
|
||||||
|
'common.showBackBtn': boolean
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 主题id
|
* 主题id
|
||||||
*/
|
*/
|
||||||
|
Loading…
x
Reference in New Issue
Block a user