Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: newarch perf #688

Merged
merged 2 commits into from
Dec 10, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading