improved large album/playlist performance

switched to flatlist for all of those
This commit is contained in:
austinried
2021-08-25 16:13:35 +09:00
parent 81b5bfb56b
commit fac2b62ec2
13 changed files with 210 additions and 140 deletions

View File

@@ -28,6 +28,7 @@ const ResultsListItem: React.FC<{ item: SearchListItemType }> = ({ item }) => {
showStar={false}
listStyle="small"
onPress={onPress}
style={styles.listItem}
/>
)
}
@@ -69,25 +70,24 @@ const SearchResultsView: React.FC<{
return (
<GradientFlatList
contentContainerStyle={styles.listContent}
data={list}
renderItem={SearchResultsRenderItem}
keyExtractor={item => item.id}
keyExtractor={(item, i) => i.toString()}
onRefresh={refresh}
refreshing={refreshing}
overScrollMode="never"
onEndReached={fetchNextPage}
removeClippedSubviews={true}
onEndReachedThreshold={2}
contentMarginTop={6}
windowSize={5}
/>
)
}
const styles = StyleSheet.create({
listContent: {
minHeight: '100%',
listItem: {
paddingHorizontal: 10,
paddingTop: 6,
},
})