This commit is contained in:
Developer
2026-03-14 12:27:03 +08:00
parent e9b00d026f
commit fb819798b1
5 changed files with 207 additions and 161 deletions

View File

@@ -146,6 +146,8 @@ export function BigVideoCard({ item, isVisible, onPress }: Props) {
PanResponder.create({
onMoveShouldSetPanResponder: (_, gs) =>
Math.abs(gs.dx) > SWIPE_THRESHOLD && Math.abs(gs.dx) > Math.abs(gs.dy),
onMoveShouldSetPanResponderCapture: (_, gs) =>
Math.abs(gs.dx) > SWIPE_THRESHOLD && Math.abs(gs.dx) > Math.abs(gs.dy),
onPanResponderGrant: () => {
seekingRef.current = true;
swipeStartTime.current = currentTimeRef.current;
@@ -255,23 +257,25 @@ export function BigVideoCard({ item, isVisible, onPress }: Props) {
)}
</View>
{/* Progress bar between video and info */}
{videoUrl && duration > 0 && (
<View style={styles.progressTrack}>
<View
style={[
styles.progressLayer,
{ width: `${bufferedRatio * 100}%` as any, backgroundColor: "rgba(0,174,236,0.25)" },
]}
/>
<View
style={[
styles.progressLayer,
{ width: `${progressRatio * 100}%` as any, backgroundColor: "#00AEEC" },
]}
/>
</View>
)}
{/* Progress bar between video and info — always rendered to avoid height jump */}
<View style={styles.progressTrack}>
{videoUrl && duration > 0 && (
<>
<View
style={[
styles.progressLayer,
{ width: `${bufferedRatio * 100}%` as any, backgroundColor: "rgba(0,174,236,0.25)" },
]}
/>
<View
style={[
styles.progressLayer,
{ width: `${progressRatio * 100}%` as any, backgroundColor: "#00AEEC" },
]}
/>
</>
)}
</View>
{/* Info */}
<View style={styles.info}>

View File

@@ -18,24 +18,35 @@ const CARD_WIDTH = (width - 14) / 2;
interface Props {
item: LiveRoom;
isLivePulse?: Boolean;
onPress?: () => void;
fullWidth?: boolean;
}
export function LiveCard({ item, onPress }: Props) {
export function LiveCard({
item,
onPress,
fullWidth,
isLivePulse = false,
}: Props) {
const cardWidth = fullWidth ? width - 8 : CARD_WIDTH;
return (
<TouchableOpacity
style={styles.card}
style={[styles.card, { width: cardWidth }]}
onPress={onPress}
activeOpacity={0.85}
>
<View style={styles.thumbContainer}>
<Image
source={{ uri: proxyImageUrl(item.cover) }}
style={styles.thumb}
style={[
styles.thumb,
{ width: cardWidth, height: cardWidth * 0.5625 },
]}
resizeMode="cover"
/>
<View style={styles.liveBadge}>
<LivePulse />
{isLivePulse && <LivePulse />}
<Text style={styles.liveBadgeText}></Text>
</View>
<View style={styles.meta}>