新增是否在左侧导航栏显示退出应用按钮设置

This commit is contained in:
lyswhut 2023-03-25 11:46:23 +08:00
parent 46d982ee4e
commit d64a70852f
13 changed files with 54 additions and 7 deletions

View File

@ -19,6 +19,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

View File

@ -9,6 +9,7 @@ const defaultSetting: LX.AppSetting = {
'common.autoHidePlayBar': true, 'common.autoHidePlayBar': true,
'common.drawerLayoutPosition': 'left', 'common.drawerLayoutPosition': 'left',
'common.showBackBtn': false, 'common.showBackBtn': false,
'common.showExitBtn': true,
'player.startupAutoPlay': false, 'player.startupAutoPlay': false,
'player.togglePlayMethod': 'listLoop', 'player.togglePlayMethod': 'listLoop',

View File

@ -190,6 +190,7 @@
"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_show_back_btn": "Show back to desktop button",
"setting_basic_show_exit_btn": "Show exit app 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)",

View File

@ -190,6 +190,7 @@
"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_show_back_btn": "显示返回桌面按钮",
"setting_basic_show_exit_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

View File

@ -105,6 +105,7 @@ 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 showBackBtn = useSettingValue('common.showBackBtn')
const showExitBtn = useSettingValue('common.showExitBtn')
const handlePress = (id: IdType) => { const handlePress = (id: IdType) => {
switch (id) { switch (id) {
@ -135,9 +136,11 @@ export default memo(() => {
</View> </View>
</ScrollView> </ScrollView>
{ {
showBackBtn ? <MenuItem id="back_home" icon="back-2" onPress={handlePress} /> : null showBackBtn ? <MenuItem id="back_home" icon="home" onPress={handlePress} /> : null
}
{
showExitBtn ? <MenuItem id="nav_exit" icon="exit2" onPress={handlePress} /> : null
} }
<MenuItem id="nav_exit" icon="exit2" onPress={handlePress} />
</View> </View>
) )
}) })

View File

@ -99,6 +99,7 @@ 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 showBackBtn = useSettingValue('common.showBackBtn')
const showExitBtn = useSettingValue('common.showExitBtn')
const handlePress = (id: IdType) => { const handlePress = (id: IdType) => {
switch (id) { switch (id) {
@ -131,9 +132,11 @@ export default memo(() => {
</ScrollView> </ScrollView>
{ {
showBackBtn ? <MenuItem id="back_home" icon="back-2" onPress={handlePress} /> : null showBackBtn ? <MenuItem id="back_home" icon="home" onPress={handlePress} /> : null
}
{
showExitBtn ? <MenuItem id="nav_exit" icon="exit2" onPress={handlePress} /> : null
} }
<MenuItem id="nav_exit" icon="exit2" onPress={handlePress} />
</View> </View>
) )
}) })

View File

@ -11,13 +11,13 @@ import CheckBoxItem from '../../components/CheckBoxItem'
export default memo(() => { export default memo(() => {
const t = useI18n() const t = useI18n()
const showBackBtn = useSettingValue('common.showBackBtn') const showBackBtn = useSettingValue('common.showBackBtn')
const setShowBaclBtn = (showBackBtn: boolean) => { const setShowBackBtn = (showBackBtn: boolean) => {
updateSetting({ 'common.showBackBtn': showBackBtn }) updateSetting({ 'common.showBackBtn': showBackBtn })
} }
return ( return (
<View style={styles.content}> <View style={styles.content}>
<CheckBoxItem check={showBackBtn} label={t('setting_basic_show_back_btn')} onChange={setShowBaclBtn} /> <CheckBoxItem check={showBackBtn} label={t('setting_basic_show_back_btn')} onChange={setShowBackBtn} />
</View> </View>
) )
}) })

View File

@ -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 showExitBtn = useSettingValue('common.showExitBtn')
const setShowExitBtn = (showExitBtn: boolean) => {
updateSetting({ 'common.showExitBtn': showExitBtn })
}
return (
<View style={styles.content}>
<CheckBoxItem check={showExitBtn} label={t('setting_basic_show_exit_btn')} onChange={setShowExitBtn} />
</View>
)
})
const styles = createStyle({
content: {
marginTop: 5,
},
})

View File

@ -9,6 +9,7 @@ import ShareType from './ShareType'
import IsStartupAutoPlay from './IsStartupAutoPlay' import IsStartupAutoPlay from './IsStartupAutoPlay'
import IsAutoHidePlayBar from './IsAutoHidePlayBar' import IsAutoHidePlayBar from './IsAutoHidePlayBar'
import IsShowBackBtn from './IsShowBackBtn' import IsShowBackBtn from './IsShowBackBtn'
import IsShowExitBtn from './IsShowExitBtn'
import DrawerLayoutPosition from './DrawerLayoutPosition' import DrawerLayoutPosition from './DrawerLayoutPosition'
import { useI18n } from '@/lang/i18n' import { useI18n } from '@/lang/i18n'
@ -20,6 +21,7 @@ export default memo(() => {
<Section title={t('setting_basic')}> <Section title={t('setting_basic')}>
<IsStartupAutoPlay /> <IsStartupAutoPlay />
<IsShowBackBtn /> <IsShowBackBtn />
<IsShowExitBtn />
<IsAutoHidePlayBar /> <IsAutoHidePlayBar />
<Source /> <Source />
<SourceName /> <SourceName />

View File

@ -51,6 +51,11 @@ declare global {
*/ */
'common.showBackBtn': boolean 'common.showBackBtn': boolean
/**
* 退
*/
'common.showExitBtn': boolean
/** /**
* id * id
*/ */