Skip to content

Commit

Permalink
Merge pull request #688 from lovegaoshi/dev
Browse files Browse the repository at this point in the history
fix: newarch perf
  • Loading branch information
lovegaoshi authored Dec 10, 2024
2 parents dcd619f + e89a274 commit d780bc2
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 5 deletions.
2 changes: 1 addition & 1 deletion android/gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down
13 changes: 9 additions & 4 deletions src/components/playlists/View.tsx
Original file line number Diff line number Diff line change
@@ -1,9 +1,8 @@
/* 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';
import { DrawerContentComponentProps } from '@react-navigation/drawer';

import { useNoxSetting } from '@stores/useApp';
import usePlaybackAA from '@hooks/usePlaybackAA';
Expand Down Expand Up @@ -56,8 +55,9 @@ const BiliCard = (props: any) => {
return <>{props.children}</>;
};

export default (props: DrawerContentComponentProps) => {
export default () => {
const navigation = useNavigation();
const [layoutHeight, setLayoutHeight] = useState(0);
const playlistIds = useNoxSetting(state => state.playlistIds);
const playerStyle = useNoxSetting(state => state.playerStyle);

Expand Down Expand Up @@ -86,7 +86,12 @@ export default (props: DrawerContentComponentProps) => {
}, []);

return (
<View {...props} style={styles.flex}>
<View
style={layoutHeight === 0 ? styles.flex : { height: layoutHeight }}
onLayout={e =>
layoutHeight === 0 && setLayoutHeight(e.nativeEvent.layout.height)
}
>
<View style={styles.topPadding} />
<BiliCard backgroundURI={playerStyle.biliGarbCard}>
<RenderDrawerItem
Expand Down

0 comments on commit d780bc2

Please sign in to comment.