mirror of
https://github.com/zimplexing/OrionTV.git
synced 2026-02-04 03:36:29 +08:00
feat(ui): replace TouchableOpacity with Pressable for improved ripple effect and add color customization, android focus effect
This commit is contained in:
@@ -108,6 +108,7 @@ export const StyledButton = forwardRef<View, StyledButtonProps>(
|
||||
return (
|
||||
<Animated.View style={[animationStyle, style]}>
|
||||
<Pressable
|
||||
android_ripple={{ color: Colors.dark.link, borderless: false }}
|
||||
ref={ref}
|
||||
onFocus={() => setIsFocused(true)}
|
||||
onBlur={() => setIsFocused(false)}
|
||||
|
||||
@@ -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<View, VideoCardProps>(
|
||||
|
||||
return (
|
||||
<Animated.View style={[styles.wrapper, animatedStyle, { opacity: fadeAnim }]}>
|
||||
<TouchableOpacity
|
||||
<Pressable
|
||||
android_ripple={{
|
||||
color: Colors.dark.link,
|
||||
borderless: false,
|
||||
foreground: true,
|
||||
}}
|
||||
onPress={handlePress}
|
||||
onLongPress={handleLongPress}
|
||||
onFocus={handleFocus}
|
||||
onBlur={handleBlur}
|
||||
style={styles.pressable}
|
||||
activeOpacity={1}
|
||||
// activeOpacity={1}
|
||||
delayLongPress={1000}
|
||||
>
|
||||
<View style={styles.card}>
|
||||
@@ -203,7 +208,8 @@ const VideoCard = forwardRef<View, VideoCardProps>(
|
||||
</View>
|
||||
)}
|
||||
</View>
|
||||
</TouchableOpacity>
|
||||
</Pressable>
|
||||
|
||||
</Animated.View>
|
||||
);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user