From 3683f8d971a8103bedffa65a2b0873c3f0ff147a Mon Sep 17 00:00:00 2001 From: lovegaoshi <106490582+lovegaoshi@users.noreply.github.com> Date: Tue, 10 Dec 2024 15:00:12 -0800 Subject: [PATCH 1/2] chore: code cleanup --- src/components/playlists/View.tsx | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/src/components/playlists/View.tsx b/src/components/playlists/View.tsx index df96ce78..90909b9a 100644 --- a/src/components/playlists/View.tsx +++ b/src/components/playlists/View.tsx @@ -3,7 +3,6 @@ import React, { useEffect } from 'react'; import { IconButton, Divider, Text, TouchableRipple } from 'react-native-paper'; import { View, ImageBackground, StyleSheet, Linking } from 'react-native'; import { useTranslation } from 'react-i18next'; -import { DrawerContentComponentProps } from '@react-navigation/drawer'; import { useNoxSetting } from '@stores/useApp'; import usePlaybackAA from '@hooks/usePlaybackAA'; @@ -56,7 +55,7 @@ const BiliCard = (props: any) => { return <>{props.children}; }; -export default (props: DrawerContentComponentProps) => { +export default () => { const navigation = useNavigation(); const playlistIds = useNoxSetting(state => state.playlistIds); const playerStyle = useNoxSetting(state => state.playerStyle); @@ -86,7 +85,7 @@ export default (props: DrawerContentComponentProps) => { }, []); return ( - + Date: Tue, 10 Dec 2024 15:23:19 -0800 Subject: [PATCH 2/2] fix: newarch perf --- android/gradle.properties | 2 +- src/components/playlists/View.tsx | 10 ++++++++-- 2 files changed, 9 insertions(+), 3 deletions(-) diff --git a/android/gradle.properties b/android/gradle.properties index 005807b4..952ab614 100644 --- a/android/gradle.properties +++ b/android/gradle.properties @@ -35,7 +35,7 @@ reactNativeArchitectures=armeabi-v7a,arm64-v8a,x86,x86_64 # your application. You should enable this flag either if you want # to write custom TurboModules/Fabric components OR use libraries that # are providing them. -newArchEnabled=false +newArchEnabled=true # Use this property to enable or disable the Hermes JS engine. # If set to false, you will be using JSC instead. diff --git a/src/components/playlists/View.tsx b/src/components/playlists/View.tsx index 90909b9a..156dc29a 100644 --- a/src/components/playlists/View.tsx +++ b/src/components/playlists/View.tsx @@ -1,5 +1,5 @@ /* eslint-disable react-hooks/exhaustive-deps */ -import React, { useEffect } from 'react'; +import React, { useEffect, useState } from 'react'; import { IconButton, Divider, Text, TouchableRipple } from 'react-native-paper'; import { View, ImageBackground, StyleSheet, Linking } from 'react-native'; import { useTranslation } from 'react-i18next'; @@ -57,6 +57,7 @@ const BiliCard = (props: any) => { export default () => { const navigation = useNavigation(); + const [layoutHeight, setLayoutHeight] = useState(0); const playlistIds = useNoxSetting(state => state.playlistIds); const playerStyle = useNoxSetting(state => state.playerStyle); @@ -85,7 +86,12 @@ export default () => { }, []); return ( - + + layoutHeight === 0 && setLayoutHeight(e.nativeEvent.layout.height) + } + >