mirror of
https://github.com/tapframe/NuvioStreaming.git
synced 2026-04-20 16:22:04 +00:00
Enhance MetadataScreen by adding haptic feedback for season changes and updating episode selection logic; replace direct season change handler with a new function for improved user experience. Remove haptic feedback from episode selection for a cleaner interaction.
This commit is contained in:
parent
94c49a2767
commit
0202c2da2d
1 changed files with 15 additions and 2 deletions
|
|
@ -279,6 +279,17 @@ const MetadataScreen = () => {
|
||||||
toggleLibrary();
|
toggleLibrary();
|
||||||
}, [inLibrary, toggleLibrary]);
|
}, [inLibrary, toggleLibrary]);
|
||||||
|
|
||||||
|
// Add wrapper for season change with distinctive haptic feedback
|
||||||
|
const handleSeasonChangeWithHaptics = useCallback((seasonNumber: number) => {
|
||||||
|
// Change to Light impact for a more subtle feedback
|
||||||
|
Haptics.impactAsync(Haptics.ImpactFeedbackStyle.Light);
|
||||||
|
|
||||||
|
// Wait a tiny bit before changing season, making the feedback more noticeable
|
||||||
|
setTimeout(() => {
|
||||||
|
handleSeasonChange(seasonNumber);
|
||||||
|
}, 10);
|
||||||
|
}, [handleSeasonChange]);
|
||||||
|
|
||||||
// Add new animated value for watch progress
|
// Add new animated value for watch progress
|
||||||
const watchProgressOpacity = useSharedValue(0);
|
const watchProgressOpacity = useSharedValue(0);
|
||||||
const watchProgressScaleY = useSharedValue(0);
|
const watchProgressScaleY = useSharedValue(0);
|
||||||
|
|
@ -674,13 +685,15 @@ const MetadataScreen = () => {
|
||||||
}, []); // Empty dependency array as it doesn't depend on component state/props currently
|
}, []); // Empty dependency array as it doesn't depend on component state/props currently
|
||||||
|
|
||||||
const handleEpisodeSelect = useCallback((episode: Episode) => {
|
const handleEpisodeSelect = useCallback((episode: Episode) => {
|
||||||
|
// Removed haptic feedback
|
||||||
|
|
||||||
const episodeId = episode.stremioId || `${id}:${episode.season_number}:${episode.episode_number}`;
|
const episodeId = episode.stremioId || `${id}:${episode.season_number}:${episode.episode_number}`;
|
||||||
navigation.navigate('Streams', {
|
navigation.navigate('Streams', {
|
||||||
id,
|
id,
|
||||||
type,
|
type,
|
||||||
episodeId
|
episodeId
|
||||||
});
|
});
|
||||||
}, [navigation, id, type]); // Added dependencies
|
}, [navigation, id, type]);
|
||||||
|
|
||||||
// Animated styles
|
// Animated styles
|
||||||
const containerAnimatedStyle = useAnimatedStyle(() => ({
|
const containerAnimatedStyle = useAnimatedStyle(() => ({
|
||||||
|
|
@ -1312,7 +1325,7 @@ const MetadataScreen = () => {
|
||||||
episodes={episodes}
|
episodes={episodes}
|
||||||
selectedSeason={selectedSeason}
|
selectedSeason={selectedSeason}
|
||||||
loadingSeasons={loadingSeasons}
|
loadingSeasons={loadingSeasons}
|
||||||
onSeasonChange={handleSeasonChange}
|
onSeasonChange={handleSeasonChangeWithHaptics}
|
||||||
onSelectEpisode={handleEpisodeSelect}
|
onSelectEpisode={handleEpisodeSelect}
|
||||||
groupedEpisodes={groupedEpisodes}
|
groupedEpisodes={groupedEpisodes}
|
||||||
metadata={metadata}
|
metadata={metadata}
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue