修复播放详情页设置面板当前音量显示格式问题

This commit is contained in:
lyswhut 2023-03-31 14:10:40 +08:00
parent aed86632d1
commit bd8213041f
4 changed files with 8 additions and 5 deletions

View File

@ -13,3 +13,4 @@
- 修复搜索提示列表的显示时机问题
- 就放tx源歌词获取失败的问题
- 修复将播放速率调整为0.6后再次打开设置面板将会导致app崩溃的问题
- 修复播放详情页设置面板当前音量显示格式问题

View File

@ -36,7 +36,7 @@ const Progress = ({ progress, duration }: {
// const { progress } = usePlayTimeBuffer()
const theme = useTheme()
// console.log(progress)
const progressStr = `${progress * 100}%`
const progressStr = `${Math.trunc(progress * 100)}%`
const progressDotStyle = useMemo(() => {
return {

View File

@ -14,10 +14,12 @@ import ButtonPrimary from '@/components/common/ButtonPrimary'
import playerState from '@/store/player/state'
import settingState from '@/store/setting/state'
const MIN_VALUE = 60
const MAX_VALUE = 200
const Volume = () => {
const theme = useTheme()
const playbackRate = useSettingValue('player.playbackRate') * 100
const playbackRate = Math.trunc(useSettingValue('player.playbackRate') * 100)
const [sliderSize, setSliderSize] = useState(playbackRate)
const [isSliding, setSliding] = useState(false)
const t = useI18n()
@ -55,8 +57,8 @@ const Volume = () => {
<View style={styles.content}>
<Text style={styles.label} color={theme['c-font-label']}>{`${((isSliding ? sliderSize : playbackRate) / 100).toFixed(2)}x`}</Text>
<Slider
minimumValue={60}
maximumValue={200}
minimumValue={MIN_VALUE}
maximumValue={MAX_VALUE}
onSlidingComplete={handleSlidingComplete}
onValueChange={handleValueChange}
onSlidingStart={handleSlidingStart}

View File

@ -13,7 +13,7 @@ import { setVolume } from '@/plugins/player'
const Volume = () => {
const theme = useTheme()
const volume = useSettingValue('player.volume') * 100
const volume = Math.trunc(useSettingValue('player.volume') * 100)
const [sliderSize, setSliderSize] = useState(volume)
const [isSliding, setSliding] = useState(false)
const t = useI18n()