mirror of
https://github.com/zimplexing/OrionTV.git
synced 2026-02-04 03:36:29 +08:00
feat: update color scheme and styles across components for improved UI consistency
This commit is contained in:
@@ -85,7 +85,7 @@ export default function DetailScreen() {
|
|||||||
<FontAwesome
|
<FontAwesome
|
||||||
name={isFavorited ? "heart" : "heart-o"}
|
name={isFavorited ? "heart" : "heart-o"}
|
||||||
size={24}
|
size={24}
|
||||||
color={isFavorited ? "#FFD700" : "#ccc"}
|
color={isFavorited ? "#feff5f" : "#ccc"}
|
||||||
/>
|
/>
|
||||||
</StyledButton>
|
</StyledButton>
|
||||||
</View>
|
</View>
|
||||||
@@ -107,29 +107,32 @@ export default function DetailScreen() {
|
|||||||
{!allSourcesLoaded && <ActivityIndicator style={{ marginLeft: 10 }} />}
|
{!allSourcesLoaded && <ActivityIndicator style={{ marginLeft: 10 }} />}
|
||||||
</View>
|
</View>
|
||||||
<View style={styles.sourceList}>
|
<View style={styles.sourceList}>
|
||||||
{searchResults.map((item, index) => (
|
{searchResults.map((item, index) => {
|
||||||
|
const isSelected = detail?.source === item.source;
|
||||||
|
return (
|
||||||
<StyledButton
|
<StyledButton
|
||||||
key={index}
|
key={index}
|
||||||
onPress={() => setDetail(item)}
|
onPress={() => setDetail(item)}
|
||||||
hasTVPreferredFocus={index === 0}
|
hasTVPreferredFocus={index === 0}
|
||||||
isSelected={detail?.source === item.source}
|
isSelected={isSelected}
|
||||||
style={styles.sourceButton}
|
style={styles.sourceButton}
|
||||||
>
|
>
|
||||||
<ThemedText style={styles.sourceButtonText}>{item.source_name}</ThemedText>
|
<ThemedText style={styles.sourceButtonText}>{item.source_name}</ThemedText>
|
||||||
{item.episodes.length > 1 && (
|
{item.episodes.length > 1 && (
|
||||||
<View style={styles.badge}>
|
<View style={[styles.badge, isSelected && styles.selectedBadge]}>
|
||||||
<Text style={styles.badgeText}>
|
<Text style={styles.badgeText}>
|
||||||
{item.episodes.length > 99 ? "99+" : `${item.episodes.length}`} 集
|
{item.episodes.length > 99 ? "99+" : `${item.episodes.length}`} 集
|
||||||
</Text>
|
</Text>
|
||||||
</View>
|
</View>
|
||||||
)}
|
)}
|
||||||
{item.resolution && (
|
{item.resolution && (
|
||||||
<View style={[styles.badge, { backgroundColor: "#28a745" }]}>
|
<View style={[styles.badge, { backgroundColor: "#666" }, isSelected && styles.selectedBadge]}>
|
||||||
<Text style={styles.badgeText}>{item.resolution}</Text>
|
<Text style={styles.badgeText}>{item.resolution}</Text>
|
||||||
</View>
|
</View>
|
||||||
)}
|
)}
|
||||||
</StyledButton>
|
</StyledButton>
|
||||||
))}
|
);
|
||||||
|
})}
|
||||||
</View>
|
</View>
|
||||||
</View>
|
</View>
|
||||||
<View style={styles.episodesContainer}>
|
<View style={styles.episodesContainer}>
|
||||||
@@ -236,17 +239,23 @@ const styles = StyleSheet.create({
|
|||||||
fontSize: 16,
|
fontSize: 16,
|
||||||
},
|
},
|
||||||
badge: {
|
badge: {
|
||||||
backgroundColor: "red",
|
backgroundColor: "#666",
|
||||||
borderRadius: 10,
|
borderRadius: 10,
|
||||||
paddingHorizontal: 6,
|
paddingHorizontal: 6,
|
||||||
paddingVertical: 2,
|
paddingVertical: 2,
|
||||||
marginLeft: 8,
|
marginLeft: 8,
|
||||||
},
|
},
|
||||||
badgeText: {
|
badgeText: {
|
||||||
color: "white",
|
color: "#fff",
|
||||||
fontSize: 12,
|
fontSize: 12,
|
||||||
fontWeight: "bold",
|
fontWeight: "bold",
|
||||||
},
|
},
|
||||||
|
selectedBadge: {
|
||||||
|
backgroundColor: "#4c4c4c",
|
||||||
|
},
|
||||||
|
selectedbadgeText: {
|
||||||
|
color: "#333",
|
||||||
|
},
|
||||||
episodesContainer: {
|
episodesContainer: {
|
||||||
marginTop: 20,
|
marginTop: 20,
|
||||||
},
|
},
|
||||||
|
|||||||
@@ -11,6 +11,7 @@ import { useRemoteControlStore } from "@/stores/remoteControlStore";
|
|||||||
import { RemoteControlModal } from "@/components/RemoteControlModal";
|
import { RemoteControlModal } from "@/components/RemoteControlModal";
|
||||||
import { useSettingsStore } from "@/stores/settingsStore";
|
import { useSettingsStore } from "@/stores/settingsStore";
|
||||||
import { useRouter } from "expo-router";
|
import { useRouter } from "expo-router";
|
||||||
|
import { Colors } from "@/constants/Colors";
|
||||||
|
|
||||||
export default function SearchScreen() {
|
export default function SearchScreen() {
|
||||||
const [keyword, setKeyword] = useState("");
|
const [keyword, setKeyword] = useState("");
|
||||||
@@ -101,7 +102,7 @@ export default function SearchScreen() {
|
|||||||
{
|
{
|
||||||
backgroundColor: colorScheme === "dark" ? "#2c2c2e" : "#f0f0f0",
|
backgroundColor: colorScheme === "dark" ? "#2c2c2e" : "#f0f0f0",
|
||||||
color: colorScheme === "dark" ? "white" : "black",
|
color: colorScheme === "dark" ? "white" : "black",
|
||||||
borderColor: isInputFocused ? "#007bff" : "transparent",
|
borderColor: isInputFocused ? Colors.dark.primary : "transparent",
|
||||||
},
|
},
|
||||||
]}
|
]}
|
||||||
placeholder="搜索电影、剧集..."
|
placeholder="搜索电影、剧集..."
|
||||||
|
|||||||
@@ -168,7 +168,7 @@ const styles = StyleSheet.create({
|
|||||||
position: "absolute",
|
position: "absolute",
|
||||||
left: 0,
|
left: 0,
|
||||||
height: 8,
|
height: 8,
|
||||||
backgroundColor: "#ff0000",
|
backgroundColor: "#fff",
|
||||||
borderRadius: 4,
|
borderRadius: 4,
|
||||||
},
|
},
|
||||||
progressBarTouchable: {
|
progressBarTouchable: {
|
||||||
|
|||||||
@@ -80,7 +80,7 @@ const styles = StyleSheet.create({
|
|||||||
},
|
},
|
||||||
seekingBarFilled: {
|
seekingBarFilled: {
|
||||||
height: "100%",
|
height: "100%",
|
||||||
backgroundColor: "#ff0000",
|
backgroundColor: "#fff",
|
||||||
borderRadius: 2.5,
|
borderRadius: 2.5,
|
||||||
},
|
},
|
||||||
});
|
});
|
||||||
|
|||||||
@@ -72,7 +72,9 @@ const styles = StyleSheet.create({
|
|||||||
sourceItem: {
|
sourceItem: {
|
||||||
paddingVertical: 2,
|
paddingVertical: 2,
|
||||||
margin: 4,
|
margin: 4,
|
||||||
width: "31%",
|
marginLeft: 10,
|
||||||
|
marginRight: 8,
|
||||||
|
width: "30%",
|
||||||
},
|
},
|
||||||
sourceItemText: {
|
sourceItemText: {
|
||||||
fontSize: 14,
|
fontSize: 14,
|
||||||
|
|||||||
@@ -29,11 +29,10 @@ export const StyledButton = forwardRef<View, StyledButtonProps>(
|
|||||||
color: colors.text,
|
color: colors.text,
|
||||||
},
|
},
|
||||||
selectedButton: {
|
selectedButton: {
|
||||||
backgroundColor: colors.tint,
|
backgroundColor: colors.primary,
|
||||||
},
|
},
|
||||||
focusedButton: {
|
focusedButton: {
|
||||||
backgroundColor: colors.link,
|
borderColor: colors.primary,
|
||||||
borderColor: colors.background,
|
|
||||||
},
|
},
|
||||||
selectedText: {
|
selectedText: {
|
||||||
color: Colors.dark.text,
|
color: Colors.dark.text,
|
||||||
@@ -47,11 +46,11 @@ export const StyledButton = forwardRef<View, StyledButtonProps>(
|
|||||||
color: colors.text,
|
color: colors.text,
|
||||||
},
|
},
|
||||||
focusedButton: {
|
focusedButton: {
|
||||||
backgroundColor: colors.link,
|
backgroundColor: colors.primary,
|
||||||
borderColor: colors.background,
|
borderColor: colors.background,
|
||||||
},
|
},
|
||||||
selectedButton: {
|
selectedButton: {
|
||||||
backgroundColor: "rgba(0, 122, 255, 0.3)",
|
backgroundColor: colors.primary,
|
||||||
},
|
},
|
||||||
selectedText: {
|
selectedText: {
|
||||||
color: colors.link,
|
color: colors.link,
|
||||||
@@ -65,7 +64,8 @@ export const StyledButton = forwardRef<View, StyledButtonProps>(
|
|||||||
color: colors.text,
|
color: colors.text,
|
||||||
},
|
},
|
||||||
focusedButton: {
|
focusedButton: {
|
||||||
backgroundColor: "rgba(119, 119, 119, 0.9)",
|
backgroundColor: "rgba(119, 119, 119, 0.2)",
|
||||||
|
borderColor: colors.primary,
|
||||||
},
|
},
|
||||||
selectedButton: {},
|
selectedButton: {},
|
||||||
selectedText: {},
|
selectedText: {},
|
||||||
|
|||||||
@@ -6,6 +6,7 @@ import { Heart, Star, Play, Trash2 } from "lucide-react-native";
|
|||||||
import { FavoriteManager, PlayRecordManager } from "@/services/storage";
|
import { FavoriteManager, PlayRecordManager } from "@/services/storage";
|
||||||
import { API, api } from "@/services/api";
|
import { API, api } from "@/services/api";
|
||||||
import { ThemedText } from "@/components/ThemedText";
|
import { ThemedText } from "@/components/ThemedText";
|
||||||
|
import { Colors } from "@/constants/Colors";
|
||||||
|
|
||||||
interface VideoCardProps {
|
interface VideoCardProps {
|
||||||
id: string;
|
id: string;
|
||||||
@@ -209,6 +210,9 @@ const styles = StyleSheet.create({
|
|||||||
overlay: {
|
overlay: {
|
||||||
...StyleSheet.absoluteFillObject,
|
...StyleSheet.absoluteFillObject,
|
||||||
backgroundColor: "rgba(0,0,0,0.3)",
|
backgroundColor: "rgba(0,0,0,0.3)",
|
||||||
|
borderColor: Colors.dark.border,
|
||||||
|
borderWidth: 2,
|
||||||
|
borderRadius: 8,
|
||||||
justifyContent: "center",
|
justifyContent: "center",
|
||||||
alignItems: "center",
|
alignItems: "center",
|
||||||
},
|
},
|
||||||
|
|||||||
@@ -199,17 +199,17 @@ const VideoLoadingAnimation: React.FC<VideoLoadingAnimationProps> = ({ showProgr
|
|||||||
</View>
|
</View>
|
||||||
</Animated.View>
|
</Animated.View>
|
||||||
|
|
||||||
<View style={styles.loadingDots}>
|
{/* <View style={styles.loadingDots}>
|
||||||
<Animated.View style={[styles.dot, animatedStyles.bounce[0]]} />
|
<Animated.View style={[styles.dot, animatedStyles.bounce[0]]} />
|
||||||
<Animated.View style={[styles.dot, animatedStyles.bounce[1]]} />
|
<Animated.View style={[styles.dot, animatedStyles.bounce[1]]} />
|
||||||
<Animated.View style={[styles.dot, animatedStyles.bounce[2]]} />
|
<Animated.View style={[styles.dot, animatedStyles.bounce[2]]} />
|
||||||
</View>
|
</View> */}
|
||||||
|
|
||||||
{showProgressBar && (
|
{showProgressBar && (
|
||||||
<View style={styles.progressBar}>
|
<View style={styles.progressBar}>
|
||||||
<Animated.View style={[styles.progressFill, animatedStyles.progress]}>
|
<Animated.View style={[styles.progressFill, animatedStyles.progress]}>
|
||||||
<LinearGradient
|
<LinearGradient
|
||||||
colors={["#4fd1c7", "#06b6d4", "#3b82f6", "#8b5cf6"]}
|
colors={["#00bb5e", "#feff5f"]}
|
||||||
style={StyleSheet.absoluteFill}
|
style={StyleSheet.absoluteFill}
|
||||||
start={{ x: 0, y: 0 }}
|
start={{ x: 0, y: 0 }}
|
||||||
end={{ x: 1, y: 0 }}
|
end={{ x: 1, y: 0 }}
|
||||||
|
|||||||
@@ -6,6 +6,7 @@ import { SettingsSection } from "./SettingsSection";
|
|||||||
import { useSettingsStore } from "@/stores/settingsStore";
|
import { useSettingsStore } from "@/stores/settingsStore";
|
||||||
import { useRemoteControlStore } from "@/stores/remoteControlStore";
|
import { useRemoteControlStore } from "@/stores/remoteControlStore";
|
||||||
import { useButtonAnimation } from "@/hooks/useAnimation";
|
import { useButtonAnimation } from "@/hooks/useAnimation";
|
||||||
|
import { Colors } from "@/constants/Colors";
|
||||||
|
|
||||||
interface APIConfigSectionProps {
|
interface APIConfigSectionProps {
|
||||||
onChanged: () => void;
|
onChanged: () => void;
|
||||||
@@ -126,8 +127,8 @@ const styles = StyleSheet.create({
|
|||||||
borderColor: "transparent",
|
borderColor: "transparent",
|
||||||
},
|
},
|
||||||
inputFocused: {
|
inputFocused: {
|
||||||
borderColor: "#007AFF",
|
borderColor: Colors.dark.primary,
|
||||||
shadowColor: "#007AFF",
|
shadowColor: Colors.dark.primary,
|
||||||
shadowOffset: { width: 0, height: 0 },
|
shadowOffset: { width: 0, height: 0 },
|
||||||
shadowOpacity: 0.8,
|
shadowOpacity: 0.8,
|
||||||
shadowRadius: 10,
|
shadowRadius: 10,
|
||||||
|
|||||||
@@ -6,6 +6,7 @@ import { SettingsSection } from "./SettingsSection";
|
|||||||
import { useSettingsStore } from "@/stores/settingsStore";
|
import { useSettingsStore } from "@/stores/settingsStore";
|
||||||
import { useRemoteControlStore } from "@/stores/remoteControlStore";
|
import { useRemoteControlStore } from "@/stores/remoteControlStore";
|
||||||
import { useButtonAnimation } from "@/hooks/useAnimation";
|
import { useButtonAnimation } from "@/hooks/useAnimation";
|
||||||
|
import { Colors } from "@/constants/Colors";
|
||||||
|
|
||||||
interface LiveStreamSectionProps {
|
interface LiveStreamSectionProps {
|
||||||
onChanged: () => void;
|
onChanged: () => void;
|
||||||
@@ -120,8 +121,8 @@ const styles = StyleSheet.create({
|
|||||||
borderColor: "transparent",
|
borderColor: "transparent",
|
||||||
},
|
},
|
||||||
inputFocused: {
|
inputFocused: {
|
||||||
borderColor: "#007AFF",
|
borderColor: Colors.dark.primary,
|
||||||
shadowColor: "#007AFF",
|
shadowColor: Colors.dark.primary,
|
||||||
shadowOffset: { width: 0, height: 0 },
|
shadowOffset: { width: 0, height: 0 },
|
||||||
shadowOpacity: 0.8,
|
shadowOpacity: 0.8,
|
||||||
shadowRadius: 10,
|
shadowRadius: 10,
|
||||||
|
|||||||
@@ -6,6 +6,7 @@ import { SettingsSection } from "./SettingsSection";
|
|||||||
import { useSettingsStore } from "@/stores/settingsStore";
|
import { useSettingsStore } from "@/stores/settingsStore";
|
||||||
import { useRemoteControlStore } from "@/stores/remoteControlStore";
|
import { useRemoteControlStore } from "@/stores/remoteControlStore";
|
||||||
import { useButtonAnimation } from "@/hooks/useAnimation";
|
import { useButtonAnimation } from "@/hooks/useAnimation";
|
||||||
|
import { Colors } from "@/constants/Colors";
|
||||||
|
|
||||||
interface RemoteInputSectionProps {
|
interface RemoteInputSectionProps {
|
||||||
onChanged: () => void;
|
onChanged: () => void;
|
||||||
@@ -59,7 +60,7 @@ export const RemoteInputSection: React.FC<RemoteInputSectionProps> = ({ onChange
|
|||||||
<Switch
|
<Switch
|
||||||
value={remoteInputEnabled}
|
value={remoteInputEnabled}
|
||||||
onValueChange={() => {}} // 禁用Switch的直接交互
|
onValueChange={() => {}} // 禁用Switch的直接交互
|
||||||
trackColor={{ false: "#767577", true: "#007AFF" }}
|
trackColor={{ false: "#767577", true: Colors.dark.primary }}
|
||||||
thumbColor={remoteInputEnabled ? "#ffffff" : "#f4f3f4"}
|
thumbColor={remoteInputEnabled ? "#ffffff" : "#f4f3f4"}
|
||||||
pointerEvents="none"
|
pointerEvents="none"
|
||||||
/>
|
/>
|
||||||
@@ -70,7 +71,7 @@ export const RemoteInputSection: React.FC<RemoteInputSectionProps> = ({ onChange
|
|||||||
<View style={styles.statusContainer}>
|
<View style={styles.statusContainer}>
|
||||||
<View style={styles.statusItem}>
|
<View style={styles.statusItem}>
|
||||||
<ThemedText style={styles.statusLabel}>服务状态:</ThemedText>
|
<ThemedText style={styles.statusLabel}>服务状态:</ThemedText>
|
||||||
<ThemedText style={[styles.statusValue, { color: isServerRunning ? "#00FF00" : "#FF6B6B" }]}>
|
<ThemedText style={[styles.statusValue, { color: isServerRunning ? Colors.dark.primary : "#FF6B6B" }]}>
|
||||||
{isServerRunning ? "运行中" : "已停止"}
|
{isServerRunning ? "运行中" : "已停止"}
|
||||||
</ThemedText>
|
</ThemedText>
|
||||||
</View>
|
</View>
|
||||||
|
|||||||
@@ -1,6 +1,7 @@
|
|||||||
import React, { useState } from "react";
|
import React, { useState } from "react";
|
||||||
import { StyleSheet, Pressable } from "react-native";
|
import { StyleSheet, Pressable } from "react-native";
|
||||||
import { ThemedView } from "@/components/ThemedView";
|
import { ThemedView } from "@/components/ThemedView";
|
||||||
|
import { Colors } from "@/constants/Colors";
|
||||||
|
|
||||||
interface SettingsSectionProps {
|
interface SettingsSectionProps {
|
||||||
children: React.ReactNode;
|
children: React.ReactNode;
|
||||||
@@ -9,12 +10,7 @@ interface SettingsSectionProps {
|
|||||||
focusable?: boolean;
|
focusable?: boolean;
|
||||||
}
|
}
|
||||||
|
|
||||||
export const SettingsSection: React.FC<SettingsSectionProps> = ({
|
export const SettingsSection: React.FC<SettingsSectionProps> = ({ children, onFocus, onBlur, focusable = false }) => {
|
||||||
children,
|
|
||||||
onFocus,
|
|
||||||
onBlur,
|
|
||||||
focusable = false
|
|
||||||
}) => {
|
|
||||||
const [isFocused, setIsFocused] = useState(false);
|
const [isFocused, setIsFocused] = useState(false);
|
||||||
|
|
||||||
const handleFocus = () => {
|
const handleFocus = () => {
|
||||||
@@ -28,20 +24,12 @@ export const SettingsSection: React.FC<SettingsSectionProps> = ({
|
|||||||
};
|
};
|
||||||
|
|
||||||
if (!focusable) {
|
if (!focusable) {
|
||||||
return (
|
return <ThemedView style={styles.section}>{children}</ThemedView>;
|
||||||
<ThemedView style={styles.section}>
|
|
||||||
{children}
|
|
||||||
</ThemedView>
|
|
||||||
);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<ThemedView style={[styles.section, isFocused && styles.sectionFocused]}>
|
<ThemedView style={[styles.section, isFocused && styles.sectionFocused]}>
|
||||||
<Pressable
|
<Pressable style={styles.sectionPressable} onFocus={handleFocus} onBlur={handleBlur}>
|
||||||
style={styles.sectionPressable}
|
|
||||||
onFocus={handleFocus}
|
|
||||||
onBlur={handleBlur}
|
|
||||||
>
|
|
||||||
{children}
|
{children}
|
||||||
</Pressable>
|
</Pressable>
|
||||||
</ThemedView>
|
</ThemedView>
|
||||||
@@ -57,7 +45,7 @@ const styles = StyleSheet.create({
|
|||||||
borderColor: "#333",
|
borderColor: "#333",
|
||||||
},
|
},
|
||||||
sectionFocused: {
|
sectionFocused: {
|
||||||
borderColor: "#007AFF",
|
borderColor: Colors.dark.primary,
|
||||||
backgroundColor: "#007AFF10",
|
backgroundColor: "#007AFF10",
|
||||||
},
|
},
|
||||||
sectionPressable: {
|
sectionPressable: {
|
||||||
|
|||||||
@@ -26,5 +26,6 @@ export const Colors = {
|
|||||||
tabIconSelected: tintColorDark,
|
tabIconSelected: tintColorDark,
|
||||||
link: "#0a7ea4",
|
link: "#0a7ea4",
|
||||||
border: "#333",
|
border: "#333",
|
||||||
|
primary: "#00bb5e",
|
||||||
},
|
},
|
||||||
};
|
};
|
||||||
|
|||||||
Reference in New Issue
Block a user