This commit is contained in:
tapframe 2025-08-10 13:47:56 +05:30
parent a0714193be
commit a9fdf4dbc3

View file

@ -3,6 +3,7 @@ import { View, Text, StyleSheet, ScrollView, TouchableOpacity, ActivityIndicator
import { Image } from 'expo-image'; import { Image } from 'expo-image';
import MaterialIcons from 'react-native-vector-icons/MaterialIcons'; import MaterialIcons from 'react-native-vector-icons/MaterialIcons';
import { LinearGradient } from 'expo-linear-gradient'; import { LinearGradient } from 'expo-linear-gradient';
import { FlashList } from '@shopify/flash-list';
import { useTheme } from '../../contexts/ThemeContext'; import { useTheme } from '../../contexts/ThemeContext';
import { useSettings } from '../../hooks/useSettings'; import { useSettings } from '../../hooks/useSettings';
import { Episode } from '../../types/metadata'; import { Episode } from '../../types/metadata';
@ -635,7 +636,7 @@ export const SeriesContent: React.FC<SeriesContentProps> = ({
{currentSeasonEpisodes.length > 0 && ( {currentSeasonEpisodes.length > 0 && (
(settings?.episodeLayoutStyle === 'horizontal') ? ( (settings?.episodeLayoutStyle === 'horizontal') ? (
// Horizontal Layout (Netflix-style) // Horizontal Layout (Netflix-style)
<FlatList <FlashList
ref={episodeScrollViewRef as React.RefObject<FlatList<any>>} ref={episodeScrollViewRef as React.RefObject<FlatList<any>>}
data={currentSeasonEpisodes} data={currentSeasonEpisodes}
renderItem={({ item: episode, index }) => ( renderItem={({ item: episode, index }) => (
@ -663,34 +664,22 @@ export const SeriesContent: React.FC<SeriesContentProps> = ({
/> />
) : ( ) : (
// Vertical Layout (Traditional) // Vertical Layout (Traditional)
<View <FlashList
style={[ ref={episodeScrollViewRef as React.RefObject<FlatList<any>>}
styles.episodeList, data={currentSeasonEpisodes}
isTablet ? styles.episodeListContentVerticalTablet : styles.episodeListContentVertical renderItem={({ item: episode, index }) => (
]} <Animated.View
> key={episode.id}
{isTablet ? ( entering={FadeIn.duration(300).delay(100 + index * 30)}
<View style={styles.episodeGridVertical}> >
{currentSeasonEpisodes.map((episode, index) => ( {renderVerticalEpisodeCard(episode)}
<Animated.View </Animated.View>
key={episode.id}
entering={FadeIn.duration(300).delay(100 + index * 30)}
>
{renderVerticalEpisodeCard(episode)}
</Animated.View>
))}
</View>
) : (
currentSeasonEpisodes.map((episode, index) => (
<Animated.View
key={episode.id}
entering={FadeIn.duration(300).delay(100 + index * 30)}
>
{renderVerticalEpisodeCard(episode)}
</Animated.View>
))
)} )}
</View> keyExtractor={episode => episode.id.toString()}
estimatedItemSize={136}
contentContainerStyle={isTablet ? styles.episodeListContentVerticalTablet : styles.episodeListContentVertical}
numColumns={isTablet ? 2 : 1}
/>
) )
)} )}
</Animated.View> </Animated.View>
@ -737,6 +726,7 @@ const styles = StyleSheet.create({
}, },
episodeListContentVerticalTablet: { episodeListContentVerticalTablet: {
paddingHorizontal: 16, paddingHorizontal: 16,
paddingBottom: 20,
}, },
episodeGridVertical: { episodeGridVertical: {
flexDirection: 'row', flexDirection: 'row',