mirror of
https://github.com/ikun0014/lx-music-mobile.git
synced 2025-05-23 22:37:41 +08:00
分离布局
This commit is contained in:
parent
b5c884c2fa
commit
a9dd7ab939
@ -123,7 +123,7 @@
|
|||||||
"setting_backup_part_import_setting": "Import settings",
|
"setting_backup_part_import_setting": "Import settings",
|
||||||
"setting_backup_part_import_setting_desc": "Select the Settings file",
|
"setting_backup_part_import_setting_desc": "Select the Settings file",
|
||||||
"setting_basic": "General",
|
"setting_basic": "General",
|
||||||
"setting_basic__startup_auto_play": "Play music automatically after startup",
|
"setting_basic_startup_auto_play": "Play music automatically after startup",
|
||||||
"setting_basic_animation": "Random pop-up animation",
|
"setting_basic_animation": "Random pop-up animation",
|
||||||
"setting_basic_lang": "Language",
|
"setting_basic_lang": "Language",
|
||||||
"setting_basic_share_type": "Share",
|
"setting_basic_share_type": "Share",
|
||||||
|
@ -124,7 +124,7 @@
|
|||||||
"setting_backup_part_import_setting": "导入设置",
|
"setting_backup_part_import_setting": "导入设置",
|
||||||
"setting_backup_part_import_setting_desc": "选择配置文件",
|
"setting_backup_part_import_setting_desc": "选择配置文件",
|
||||||
"setting_basic": "基本设置",
|
"setting_basic": "基本设置",
|
||||||
"setting_basic__startup_auto_play": "启动后自动播放音乐",
|
"setting_basic_startup_auto_play": "启动后自动播放音乐",
|
||||||
"setting_basic_animation": "弹出层随机动画",
|
"setting_basic_animation": "弹出层随机动画",
|
||||||
"setting_basic_lang": "语言",
|
"setting_basic_lang": "语言",
|
||||||
"setting_basic_share_type": "分享方式",
|
"setting_basic_share_type": "分享方式",
|
||||||
|
27
src/screens/Home/Setting/Basic/IsAutoTheme.js
Normal file
27
src/screens/Home/Setting/Basic/IsAutoTheme.js
Normal file
@ -0,0 +1,27 @@
|
|||||||
|
import React, { memo } from 'react'
|
||||||
|
import { View } from 'react-native'
|
||||||
|
|
||||||
|
import { useGetter, useDispatch } from '@/store'
|
||||||
|
|
||||||
|
import CheckBoxItem from '../components/CheckBoxItem'
|
||||||
|
import { useTranslation } from '@/plugins/i18n'
|
||||||
|
import { getIsSupportedAutoTheme } from '@/utils/tools'
|
||||||
|
|
||||||
|
const isSupportedAutoTheme = getIsSupportedAutoTheme()
|
||||||
|
|
||||||
|
export default memo(() => {
|
||||||
|
const { t } = useTranslation()
|
||||||
|
const isAutoTheme = useGetter('common', 'isAutoTheme')
|
||||||
|
const setIsAutoTheme = useDispatch('common', 'setIsAutoTheme')
|
||||||
|
|
||||||
|
|
||||||
|
return (
|
||||||
|
isSupportedAutoTheme
|
||||||
|
? (
|
||||||
|
<View style={{ marginTop: 5, marginBottom: 15 }}>
|
||||||
|
<CheckBoxItem check={isAutoTheme} label={t('setting_basic_theme_auto_theme')} onChange={setIsAutoTheme} />
|
||||||
|
</View>
|
||||||
|
)
|
||||||
|
: null
|
||||||
|
)
|
||||||
|
})
|
@ -14,7 +14,7 @@ export default memo(() => {
|
|||||||
|
|
||||||
return (
|
return (
|
||||||
<View style={{ marginTop: 5, marginBottom: 15 }}>
|
<View style={{ marginTop: 5, marginBottom: 15 }}>
|
||||||
<CheckBoxItem check={startupAutoPlay} label={t('setting_basic__startup_auto_play')} onChange={setStartupAutoPlay} />
|
<CheckBoxItem check={startupAutoPlay} label={t('setting_basic_startup_auto_play')} onChange={setStartupAutoPlay} />
|
||||||
</View>
|
</View>
|
||||||
)
|
)
|
||||||
})
|
})
|
||||||
|
@ -4,10 +4,7 @@ import { StyleSheet, View, Text, ImageBackground, TouchableOpacity, InteractionM
|
|||||||
import { useGetter, useDispatch } from '@/store'
|
import { useGetter, useDispatch } from '@/store'
|
||||||
|
|
||||||
import SubTitle from '../components/SubTitle'
|
import SubTitle from '../components/SubTitle'
|
||||||
import CheckBoxItem from '../components/CheckBoxItem'
|
|
||||||
import { useTranslation } from '@/plugins/i18n'
|
import { useTranslation } from '@/plugins/i18n'
|
||||||
import { getIsSupportedAutoTheme } from '@/utils/tools'
|
|
||||||
const isSupportedAutoTheme = getIsSupportedAutoTheme()
|
|
||||||
|
|
||||||
const useActive = id => {
|
const useActive = id => {
|
||||||
const activeThemeId = useGetter('common', 'activeThemeId')
|
const activeThemeId = useGetter('common', 'activeThemeId')
|
||||||
@ -44,9 +41,6 @@ export default memo(() => {
|
|||||||
})
|
})
|
||||||
}, [setTheme])
|
}, [setTheme])
|
||||||
|
|
||||||
const isAutoTheme = useGetter('common', 'isAutoTheme')
|
|
||||||
const setIsAutoTheme = useDispatch('common', 'setIsAutoTheme')
|
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<SubTitle title={t('setting_basic_theme')}>
|
<SubTitle title={t('setting_basic_theme')}>
|
||||||
<View style={styles.list}>
|
<View style={styles.list}>
|
||||||
@ -54,17 +48,6 @@ export default memo(() => {
|
|||||||
themes.map(({ id, color, image }) => <ThemeItem key={id} color={color} image={image} id={id} setTheme={setThemeId} />)
|
themes.map(({ id, color, image }) => <ThemeItem key={id} color={color} image={image} id={id} setTheme={setThemeId} />)
|
||||||
}
|
}
|
||||||
</View>
|
</View>
|
||||||
|
|
||||||
{
|
|
||||||
isSupportedAutoTheme
|
|
||||||
? (
|
|
||||||
<View style={{ marginTop: 25, marginLeft: -25 }}>
|
|
||||||
<CheckBoxItem check={isAutoTheme} onChange={setIsAutoTheme} label={t('setting_basic_theme_auto_theme')} />
|
|
||||||
</View>
|
|
||||||
)
|
|
||||||
: null
|
|
||||||
}
|
|
||||||
|
|
||||||
</SubTitle>
|
</SubTitle>
|
||||||
)
|
)
|
||||||
})
|
})
|
||||||
|
@ -6,6 +6,7 @@ import Source from './Source'
|
|||||||
import SourceName from './SourceName'
|
import SourceName from './SourceName'
|
||||||
import Language from './Language'
|
import Language from './Language'
|
||||||
import ShareType from './ShareType'
|
import ShareType from './ShareType'
|
||||||
|
import IsAutoTheme from './IsAutoTheme'
|
||||||
import IsStartupAutoPlay from './IsStartupAutoPlay'
|
import IsStartupAutoPlay from './IsStartupAutoPlay'
|
||||||
import { useTranslation } from '@/plugins/i18n'
|
import { useTranslation } from '@/plugins/i18n'
|
||||||
|
|
||||||
@ -16,6 +17,7 @@ export default memo(() => {
|
|||||||
return (
|
return (
|
||||||
<Section title={t('setting_basic')}>
|
<Section title={t('setting_basic')}>
|
||||||
<Theme />
|
<Theme />
|
||||||
|
<IsAutoTheme />
|
||||||
<IsStartupAutoPlay />
|
<IsStartupAutoPlay />
|
||||||
<Source />
|
<Source />
|
||||||
<Language />
|
<Language />
|
||||||
|
Loading…
x
Reference in New Issue
Block a user