修复某些设备下播放详情页播放组件高度显示问题

This commit is contained in:
lyswhut 2024-01-04 13:57:50 +08:00
parent 93e54c7afc
commit 13438c8a60
4 changed files with 6 additions and 13 deletions

View File

@ -59,6 +59,7 @@ export default memo(() => {
const styles = StyleSheet.create({
container: {
flex: 0,
// backgroundColor: '#ccc',
flexDirection: 'row',
// justifyContent: 'center',

View File

@ -5,7 +5,7 @@ import { useTheme } from '@/store/theme/hook'
import { playNext, playPrev, togglePlay } from '@/core/player/player'
import { useIsPlay } from '@/store/player/hook'
import { createStyle } from '@/utils/tools'
import { useLayout, useWindowSize } from '@/utils/hooks'
import { useWindowSize } from '@/utils/hooks'
import { BTN_WIDTH } from './MoreBtn/Btn'
import { useMemo } from 'react'
@ -47,7 +47,6 @@ const MIN_SIZE = BTN_WIDTH * 1.2
export default () => {
const winSize = useWindowSize()
const { onLayout, width } = useLayout()
const maxHeight = Math.max(winSize.height * 0.11, MIN_SIZE)
const containerStyle = useMemo(() => {
return {
@ -55,10 +54,10 @@ export default () => {
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 (
<View style={containerStyle} onLayout={onLayout}>
<View style={containerStyle}>
<PrevBtn size={size} />
<TogglePlayBtn size={size}/>
<NextBtn size={size} />

View File

@ -21,8 +21,7 @@ export default memo(() => {
const styles = createStyle({
container: {
flexShrink: 1,
flexGrow: 1,
flex: 0,
width: '100%',
// paddingTop: progressContentPadding,
// marginTop: -progressContentPadding,

View File

@ -9,7 +9,6 @@ import PagerView, { type PagerViewOnPageSelectedEvent } from 'react-native-pager
import Pic from './Pic'
import Lyric from './Lyric'
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 { createStyle } from '@/utils/tools'
// 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 == 1 ? theme['c-primary-light-100-alpha-700'] : theme['c-primary-alpha-900'] }}></View>
</View> */}
<View style={styles.footer} nativeID={NAV_SHEAR_NATIVE_IDS.playDetail_player}>
<Player />
</View>
<Player />
</View>
</>
)
@ -107,9 +104,6 @@ const styles = createStyle({
pagerView: {
flex: 1,
},
footer: {
flex: 0,
},
// pageIndicator: {
// flex: 0,
// flexDirection: 'row',