mirror of
https://github.com/ikun0014/lx-music-mobile.git
synced 2025-07-04 03:12:09 +08:00
修复某些设备下播放详情页播放组件高度显示问题
This commit is contained in:
parent
93e54c7afc
commit
13438c8a60
@ -59,6 +59,7 @@ export default memo(() => {
|
|||||||
|
|
||||||
const styles = StyleSheet.create({
|
const styles = StyleSheet.create({
|
||||||
container: {
|
container: {
|
||||||
|
flex: 0,
|
||||||
// backgroundColor: '#ccc',
|
// backgroundColor: '#ccc',
|
||||||
flexDirection: 'row',
|
flexDirection: 'row',
|
||||||
// justifyContent: 'center',
|
// justifyContent: 'center',
|
||||||
|
@ -5,7 +5,7 @@ import { useTheme } from '@/store/theme/hook'
|
|||||||
import { playNext, playPrev, togglePlay } from '@/core/player/player'
|
import { playNext, playPrev, togglePlay } from '@/core/player/player'
|
||||||
import { useIsPlay } from '@/store/player/hook'
|
import { useIsPlay } from '@/store/player/hook'
|
||||||
import { createStyle } from '@/utils/tools'
|
import { createStyle } from '@/utils/tools'
|
||||||
import { useLayout, useWindowSize } from '@/utils/hooks'
|
import { useWindowSize } from '@/utils/hooks'
|
||||||
import { BTN_WIDTH } from './MoreBtn/Btn'
|
import { BTN_WIDTH } from './MoreBtn/Btn'
|
||||||
import { useMemo } from 'react'
|
import { useMemo } from 'react'
|
||||||
|
|
||||||
@ -47,7 +47,6 @@ const MIN_SIZE = BTN_WIDTH * 1.2
|
|||||||
|
|
||||||
export default () => {
|
export default () => {
|
||||||
const winSize = useWindowSize()
|
const winSize = useWindowSize()
|
||||||
const { onLayout, width } = useLayout()
|
|
||||||
const maxHeight = Math.max(winSize.height * 0.11, MIN_SIZE)
|
const maxHeight = Math.max(winSize.height * 0.11, MIN_SIZE)
|
||||||
const containerStyle = useMemo(() => {
|
const containerStyle = useMemo(() => {
|
||||||
return {
|
return {
|
||||||
@ -55,10 +54,10 @@ export default () => {
|
|||||||
maxHeight,
|
maxHeight,
|
||||||
}
|
}
|
||||||
}, [maxHeight])
|
}, [maxHeight])
|
||||||
const size = Math.min(Math.max(width * 0.33 * global.lx.fontSize * 0.4, MIN_SIZE), MAX_SIZE, maxHeight)
|
const size = Math.min(Math.max(winSize.width * 0.33 * global.lx.fontSize * 0.4, MIN_SIZE), MAX_SIZE, maxHeight)
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<View style={containerStyle} onLayout={onLayout}>
|
<View style={containerStyle}>
|
||||||
<PrevBtn size={size} />
|
<PrevBtn size={size} />
|
||||||
<TogglePlayBtn size={size}/>
|
<TogglePlayBtn size={size}/>
|
||||||
<NextBtn size={size} />
|
<NextBtn size={size} />
|
||||||
|
@ -21,8 +21,7 @@ export default memo(() => {
|
|||||||
|
|
||||||
const styles = createStyle({
|
const styles = createStyle({
|
||||||
container: {
|
container: {
|
||||||
flexShrink: 1,
|
flex: 0,
|
||||||
flexGrow: 1,
|
|
||||||
width: '100%',
|
width: '100%',
|
||||||
// paddingTop: progressContentPadding,
|
// paddingTop: progressContentPadding,
|
||||||
// marginTop: -progressContentPadding,
|
// marginTop: -progressContentPadding,
|
||||||
|
@ -9,7 +9,6 @@ import PagerView, { type PagerViewOnPageSelectedEvent } from 'react-native-pager
|
|||||||
import Pic from './Pic'
|
import Pic from './Pic'
|
||||||
import Lyric from './Lyric'
|
import Lyric from './Lyric'
|
||||||
import { screenkeepAwake, screenUnkeepAwake } from '@/utils/nativeModules/utils'
|
import { screenkeepAwake, screenUnkeepAwake } from '@/utils/nativeModules/utils'
|
||||||
import { NAV_SHEAR_NATIVE_IDS } from '@/config/constant'
|
|
||||||
import commonState, { type InitState as CommonState } from '@/store/common/state'
|
import commonState, { type InitState as CommonState } from '@/store/common/state'
|
||||||
import { createStyle } from '@/utils/tools'
|
import { createStyle } from '@/utils/tools'
|
||||||
// import { useTheme } from '@/store/theme/hook'
|
// import { useTheme } from '@/store/theme/hook'
|
||||||
@ -91,9 +90,7 @@ export default memo(({ componentId }: { componentId: string }) => {
|
|||||||
<View style={{ ...styles.pageIndicatorItem, backgroundColor: pageIndex == 0 ? theme['c-primary-light-100-alpha-700'] : theme['c-primary-alpha-900'] }}></View>
|
<View style={{ ...styles.pageIndicatorItem, backgroundColor: pageIndex == 0 ? theme['c-primary-light-100-alpha-700'] : theme['c-primary-alpha-900'] }}></View>
|
||||||
<View style={{ ...styles.pageIndicatorItem, backgroundColor: pageIndex == 1 ? theme['c-primary-light-100-alpha-700'] : theme['c-primary-alpha-900'] }}></View>
|
<View style={{ ...styles.pageIndicatorItem, backgroundColor: pageIndex == 1 ? theme['c-primary-light-100-alpha-700'] : theme['c-primary-alpha-900'] }}></View>
|
||||||
</View> */}
|
</View> */}
|
||||||
<View style={styles.footer} nativeID={NAV_SHEAR_NATIVE_IDS.playDetail_player}>
|
<Player />
|
||||||
<Player />
|
|
||||||
</View>
|
|
||||||
</View>
|
</View>
|
||||||
</>
|
</>
|
||||||
)
|
)
|
||||||
@ -107,9 +104,6 @@ const styles = createStyle({
|
|||||||
pagerView: {
|
pagerView: {
|
||||||
flex: 1,
|
flex: 1,
|
||||||
},
|
},
|
||||||
footer: {
|
|
||||||
flex: 0,
|
|
||||||
},
|
|
||||||
// pageIndicator: {
|
// pageIndicator: {
|
||||||
// flex: 0,
|
// flex: 0,
|
||||||
// flexDirection: 'row',
|
// flexDirection: 'row',
|
||||||
|
Loading…
x
Reference in New Issue
Block a user