From 62d814117828420a3a29ecce1baea8739a6c76d1 Mon Sep 17 00:00:00 2001 From: James Chen Date: Mon, 1 Sep 2025 14:02:46 +0800 Subject: [PATCH] feat(ui): replace TouchableOpacity with Pressable in VideoCard component for improved touch handling --- components/VideoCard.tv.tsx | 179 ++++++++++++------------------------ 1 file changed, 61 insertions(+), 118 deletions(-) diff --git a/components/VideoCard.tv.tsx b/components/VideoCard.tv.tsx index 423b097..78411b9 100644 --- a/components/VideoCard.tv.tsx +++ b/components/VideoCard.tv.tsx @@ -150,126 +150,69 @@ const VideoCard = forwardRef( return ( - {Platform.isTV || deviceType !== 'tv' ? ( - - - - {isFocused && ( - - {isContinueWatching && ( - - - 继续观看 - - )} - - )} + [ + styles.pressable, + { + zIndex: pressed ? 999 : 1, // 确保按下时有最高优先级 + }, + ]} + // activeOpacity={1} + delayLongPress={1000} + > + + + {isFocused && ( + + {isContinueWatching && ( + + + 继续观看 + + )} + + )} - {/* 进度条 */} - {isContinueWatching && ( - - - - )} - - {rate && ( - - - {rate} - - )} - {year && ( - - {year} - - )} - {sourceName && ( - - {sourceName} - - )} - - - {title} - {isContinueWatching && ( - - - 第{episodeIndex}集 已观看 {Math.round((progress || 0) * 100)}% - - - )} - - - ) : ( - - - - {isFocused && ( - - {isContinueWatching && ( - - - 继续观看 - - )} - - )} - - {/* 进度条 */} - {isContinueWatching && ( - - - - )} - - {rate && ( - - - {rate} - - )} - {year && ( - - {year} - - )} - {sourceName && ( - - {sourceName} - - )} - - - {title} - {isContinueWatching && ( - - - 第{episodeIndex}集 已观看 {Math.round((progress || 0) * 100)}% - - - )} - - - - )} + {/* 进度条 */} + {isContinueWatching && ( + + + + )} + {rate && ( + + + {rate} + + )} + {year && ( + + {year} + + )} + {sourceName && ( + + {sourceName} + + )} + + + {title} + {isContinueWatching && ( + + + 第{episodeIndex}集 已观看 {Math.round((progress || 0) * 100)}% + + + )} + + ); }