feat: 性能优化 + Bug修复 + 搜索增强

- expo-image 替换 RN Image(VideoCard/LiveCard/BigVideoCard/CommentItem,recyclingKey)
- DanmakuList Animated.Value 对象池,减少 GC 压力
- FlatList 性能参数:windowSize=7 / maxToRenderPerBatch=6 / removeClippedSubviews
- bilibili.ts 请求去重(getVideoDetail/getPlayUrl)
- SESSDATA 迁移至 expo-secure-store(utils/secureStorage.ts,启动自动迁移)
- 主题系统扩展:新增 sheetBg/modalBg/modalText/placeholder/iconDefault/danger 等 token
- 多组件深色模式适配:DownloadSheet/LivePlayer/NativeVideoPlayer/DownloadProgressBtn/CommentItem/LoginModal
- 搜索页增强:搜索建议 + 热搜榜(hooks/useSearch.ts + app/search.tsx)
- LoginModal 修复轮询竞态(cancelled flag + try-catch)
- 修复 downloads.tsx 冗余三元表达式
This commit is contained in:
Developer
2026-03-26 00:43:37 +08:00
parent 27587859a4
commit 463c0db058
21 changed files with 524 additions and 103 deletions

View File

@@ -10,6 +10,7 @@ import {
useWindowDimensions,
} from "react-native";
import { Ionicons } from "@expo/vector-icons";
import { useTheme } from "../utils/theme";
interface Props {
hlsUrl: string;
@@ -87,6 +88,7 @@ function NativeLivePlayer({
onQualityChange?: (qn: number) => void;
}) {
const Video = require("react-native-video").default;
const theme = useTheme();
const [showControls, setShowControls] = useState(true);
const [paused, setPaused] = useState(false);
@@ -277,12 +279,12 @@ function NativeLivePlayer({
onPress={() => setShowQualityPanel(false)}
>
<TouchableOpacity activeOpacity={1} onPress={() => {}}>
<View style={styles.qualityPanel}>
<Text style={styles.qualityPanelTitle}></Text>
<View style={[styles.qualityPanel, { backgroundColor: theme.modalBg }]}>
<Text style={[styles.qualityPanelTitle, { color: theme.modalText }]}></Text>
{qualities.map((q) => (
<TouchableOpacity
key={q.qn}
style={[styles.qualityItem]}
style={[styles.qualityItem, { borderTopColor: theme.modalBorder }]}
onPress={() => {
onQualityChange?.(q.qn);
setShowQualityPanel(false);
@@ -291,6 +293,7 @@ function NativeLivePlayer({
<Text
style={[
styles.qualityItemText,
{ color: theme.modalTextSub },
currentQn === q.qn && styles.qualityItemTextActive,
]}
>