From 4c93736c5e4b55fe4ea67ba2dfeb61e35a7e8108 Mon Sep 17 00:00:00 2001 From: James Chen Date: Wed, 27 Aug 2025 17:22:11 +0800 Subject: [PATCH] feat(ui): replace TouchableOpacity with Pressable for improved ripple effect and add color customization, android focus effect --- app/index.tsx | 3 ++- components/StyledButton.tsx | 1 + components/VideoCard.tv.tsx | 14 ++++++++++---- 3 files changed, 13 insertions(+), 5 deletions(-) diff --git a/app/index.tsx b/app/index.tsx index aa3489e..ed1fe18 100644 --- a/app/index.tsx +++ b/app/index.tsx @@ -15,6 +15,7 @@ import { useResponsiveLayout } from "@/hooks/useResponsiveLayout"; import { getCommonResponsiveStyles } from "@/utils/ResponsiveStyles"; import ResponsiveNavigation from "@/components/navigation/ResponsiveNavigation"; import { useApiConfig, getApiConfigErrorMessage } from "@/hooks/useApiConfig"; +import { Colors } from "@/constants/Colors"; const LOAD_MORE_THRESHOLD = 200; @@ -166,7 +167,7 @@ export default function HomeScreen() { 首页 - router.push("/live")}> + router.push("/live")}> {({ focused }) => ( 直播 )} diff --git a/components/StyledButton.tsx b/components/StyledButton.tsx index 7d5a21d..d0d582c 100644 --- a/components/StyledButton.tsx +++ b/components/StyledButton.tsx @@ -108,6 +108,7 @@ export const StyledButton = forwardRef( return ( setIsFocused(true)} onBlur={() => setIsFocused(false)} diff --git a/components/VideoCard.tv.tsx b/components/VideoCard.tv.tsx index 426c779..51c9bd8 100644 --- a/components/VideoCard.tv.tsx +++ b/components/VideoCard.tv.tsx @@ -1,5 +1,5 @@ import React, { useState, useEffect, useCallback, useRef, forwardRef } from "react"; -import { View, Text, Image, StyleSheet, TouchableOpacity, Alert, Animated } from "react-native"; +import { View, Text, Image, StyleSheet, Pressable, TouchableOpacity, Alert, Animated } from "react-native"; import { useRouter } from "expo-router"; import { Star, Play } from "lucide-react-native"; import { PlayRecordManager } from "@/services/storage"; @@ -147,13 +147,18 @@ const VideoCard = forwardRef( return ( - @@ -203,7 +208,8 @@ const VideoCard = forwardRef( )} - + + ); }