feat(ui): unify android ripple effect logic for Pressable across HomeScreen, StyledButton, and VideoCard components

This commit is contained in:
James Chen
2025-08-28 09:18:24 +08:00
parent f7ae93bd3d
commit 67275988bd
3 changed files with 3 additions and 3 deletions

View File

@@ -167,7 +167,7 @@ export default function HomeScreen() {
<View style={dynamicStyles.headerContainer}>
<View style={{ flexDirection: "row", alignItems: "center" }}>
<ThemedText style={dynamicStyles.headerTitle}></ThemedText>
<Pressable android_ripple={Platform.isTV ? {color:'transparent'} : ( deviceType==='tv' ? {color: Colors.dark.link}: {color:'transparent'})} style={{ marginLeft: 20 }} onPress={() => router.push("/live")}>
<Pressable android_ripple={Platform.isTV || deviceType !== 'tv'? { color: 'transparent' } : { color: Colors.dark.link }} style={{ marginLeft: 20 }} onPress={() => router.push("/live")}>
{({ focused }) => (
<ThemedText style={[dynamicStyles.headerTitle, { color: focused ? "white" : "grey" }]}></ThemedText>
)}

View File

@@ -110,7 +110,7 @@ export const StyledButton = forwardRef<View, StyledButtonProps>(
return (
<Animated.View style={[animationStyle, style]}>
<Pressable
android_ripple={Platform.isTV ? { color: 'transparent' } : (deviceType === 'tv' ? { color: Colors.dark.link } : { color: 'transparent' })}
android_ripple={Platform.isTV || deviceType !== 'tv'? { color: 'transparent' } : { color: Colors.dark.link }}
ref={ref}
onFocus={() => setIsFocused(true)}
onBlur={() => setIsFocused(false)}

View File

@@ -151,7 +151,7 @@ const VideoCard = forwardRef<View, VideoCardProps>(
return (
<Animated.View style={[styles.wrapper, animatedStyle, { opacity: fadeAnim }]}>
<Pressable
android_ripple={Platform.isTV ? { color: 'transparent' } : (deviceType === 'tv' ? { color: Colors.dark.link } : { color: 'transparent' })}
android_ripple={Platform.isTV || deviceType !== 'tv'? { color: 'transparent' } : { color: Colors.dark.link }}
onPress={handlePress}
onLongPress={handleLongPress}
onFocus={handleFocus}