diff --git a/src/AzusaPlayerLandscape.tsx b/src/AzusaPlayerLandscape.tsx index db3cce02..eccf0910 100644 --- a/src/AzusaPlayerLandscape.tsx +++ b/src/AzusaPlayerLandscape.tsx @@ -69,6 +69,7 @@ const AzusaPlayer = () => { ? CombinedDarkTheme : CombinedDefaultTheme; const insets = useSafeAreaInsets(); + const mobileWidth = Dimensions.get('window').width; return ( @@ -99,16 +100,10 @@ const AzusaPlayer = () => { > diff --git a/src/components/background/MainBackground.tsx b/src/components/background/MainBackground.tsx index ca92c99e..e8da5ba1 100644 --- a/src/components/background/MainBackground.tsx +++ b/src/components/background/MainBackground.tsx @@ -15,8 +15,6 @@ import { biliNFTVideoFetch } from '@utils/mediafetch/biliNFT'; import logger from '@utils/Logger'; import { useIsLandscape } from '@hooks/useOrientation'; -const mobileHeight = Dimensions.get('window').height; - enum RESOLVE_TYPE { bvid = 'bvid', video = 'video', @@ -57,6 +55,7 @@ export const resolveBackgroundImage = async ( const MainBackground = (props: { children: JSX.Element }) => { const playerStyle = useNoxSetting(state => state.playerStyle); const isLandscape = useIsLandscape(); + const mobileHeight = Dimensions.get('window').height; const bkgrdImg = isLandscape && playerStyle.bkgrdImgLandscape ? playerStyle.bkgrdImgLandscape @@ -70,7 +69,7 @@ const MainBackground = (props: { children: JSX.Element }) => { {props.children} @@ -83,7 +82,7 @@ const MainBackground = (props: { children: JSX.Element }) => { {props.children} @@ -121,7 +120,6 @@ const MainBackground = (props: { children: JSX.Element }) => { const styles = StyleSheet.create({ mobileStyle: { flex: 1, - height: mobileHeight, }, videoStyle: { width: '100%', diff --git a/src/components/player/TrackInfo/TrackInfo.tsx b/src/components/player/TrackInfo/TrackInfo.tsx index f51dab7d..3320e6ab 100644 --- a/src/components/player/TrackInfo/TrackInfo.tsx +++ b/src/components/player/TrackInfo/TrackInfo.tsx @@ -24,6 +24,8 @@ export const TrackInfo: React.FC<{ const currentPlayingList = useNoxSetting(state => state.currentPlayingList); const [isImageVisible, setIsImageVisible] = useState(true); const opacity = useRef(new Animated.Value(1)).current; + const dimension = Dimensions.get('window'); + const albumArtSize = Math.min(dimension.width, dimension.height); const getTrackLocation = () => { const currentTPQueue = getCurrentTPQueue(); @@ -81,7 +83,10 @@ export const TrackInfo: React.FC<{ pointerEvents={isImageVisible ? 'auto' : 'none'} > { - + (playlistRef.current = ref)} data={currentRows} @@ -477,8 +485,6 @@ const stylesLocal = StyleSheet.create({ playlistContainer: { ...styles.topBarContainer, flex: 4, - // HACK: this should be justified as top bar and bottom bar all have a defined height. - maxHeight: Dimensions.get('window').height - 250, }, songInfoBackgroundImg: { opacity: 0.5 }, songInfoBackgroundBanner: { flex: 1 }, diff --git a/src/components/playlists/View.tsx b/src/components/playlists/View.tsx index e0f054b8..1a8b7172 100644 --- a/src/components/playlists/View.tsx +++ b/src/components/playlists/View.tsx @@ -311,7 +311,10 @@ export default (props: any) => { onSubmit={() => setNewPlaylistDialogOpen(false)} /> playlists[val])} onDragEnd={({ data }) => setPlaylistIds(data.map(playlist => playlist.id)) @@ -355,9 +358,7 @@ const styles = StyleSheet.create({ width: 40, height: 40, }, - draggableFlatList: { - maxHeight: Dimensions.get('window').height - 330, - }, + draggableFlatList: {}, bottomInfo: { paddingBottom: 20, }, diff --git a/src/components/setting/SplashSettings.tsx b/src/components/setting/SplashSettings.tsx index 9b6b7fba..968acb71 100644 --- a/src/components/setting/SplashSettings.tsx +++ b/src/components/setting/SplashSettings.tsx @@ -1,21 +1,16 @@ import * as React from 'react'; import { - Pressable, View, Animated, StyleSheet, PanResponder, + Dimensions, } from 'react-native'; import Image from 'react-native-fast-image'; -import { Dimensions } from 'react-native'; -import { useNoxSetting } from '@hooks/useSetting'; import { localSplashes } from '../background/AppOpenSplash'; -const isZeroVisible = (index: number, arrLen: number, repeat = false) => {}; - export default () => { - const playerStyle = useNoxSetting(state => state.playerStyle); const [index, setIndex] = React.useState(0); const position = React.useRef(new Animated.ValueXY()).current; const panResponder = React.useRef( diff --git a/src/components/setting/appearances/SkinSettings.tsx b/src/components/setting/appearances/SkinSettings.tsx index 0a9030c6..663bf154 100644 --- a/src/components/setting/appearances/SkinSettings.tsx +++ b/src/components/setting/appearances/SkinSettings.tsx @@ -37,8 +37,6 @@ import NoxTheme from '../../styles/NoxTheme'; import AdaptiveTheme from '../../styles/AdaptiveTheme'; import { getUniqObjects } from '@utils/Utils'; -const WindowWidth = Dimensions.get('window').width; - interface DisplayTheme extends NoxTheme.Style { builtin: boolean; } @@ -100,6 +98,7 @@ const SkinItem = ({ skin, checked, setChecked }: SkinItemProps) => { { scale: withSpring(isPressed.value ? 1.2 : 1) }, ], })); + const WindowWidth = Dimensions.get('window').width; const deleteTheme = () => setPlayerStyles(playerStyles.filter(pSkin => pSkin !== skin));