mirror of
https://github.com/tapframe/NuvioStreaming.git
synced 2026-04-22 17:22:03 +00:00
somne fixed to ios subtitle menu
This commit is contained in:
parent
79cf375b60
commit
b1afaa3d53
2 changed files with 21 additions and 24 deletions
|
|
@ -1,5 +1,5 @@
|
||||||
import React from 'react';
|
import React from 'react';
|
||||||
import { View, Text, TouchableOpacity, ScrollView, ActivityIndicator, Dimensions } from 'react-native';
|
import { View, Text, TouchableOpacity, ScrollView, ActivityIndicator, Platform, useWindowDimensions } from 'react-native';
|
||||||
import { MaterialIcons } from '@expo/vector-icons';
|
import { MaterialIcons } from '@expo/vector-icons';
|
||||||
import Animated, {
|
import Animated, {
|
||||||
FadeIn,
|
FadeIn,
|
||||||
|
|
@ -10,6 +10,7 @@ import Animated, {
|
||||||
import { styles } from '../utils/playerStyles';
|
import { styles } from '../utils/playerStyles';
|
||||||
import { WyzieSubtitle, SubtitleCue } from '../utils/playerTypes';
|
import { WyzieSubtitle, SubtitleCue } from '../utils/playerTypes';
|
||||||
import { getTrackDisplayName, formatLanguage } from '../utils/playerUtils';
|
import { getTrackDisplayName, formatLanguage } from '../utils/playerUtils';
|
||||||
|
import { useSafeAreaInsets } from 'react-native-safe-area-context';
|
||||||
|
|
||||||
interface SubtitleModalsProps {
|
interface SubtitleModalsProps {
|
||||||
showSubtitleModal: boolean;
|
showSubtitleModal: boolean;
|
||||||
|
|
@ -56,8 +57,7 @@ interface SubtitleModalsProps {
|
||||||
setSubtitleOffsetSec: (n: number) => void;
|
setSubtitleOffsetSec: (n: number) => void;
|
||||||
}
|
}
|
||||||
|
|
||||||
const { width, height } = Dimensions.get('window');
|
// Dynamic sizing handled inside component with useWindowDimensions
|
||||||
const MENU_WIDTH = Math.min(width * 0.85, 400);
|
|
||||||
|
|
||||||
export const SubtitleModals: React.FC<SubtitleModalsProps> = ({
|
export const SubtitleModals: React.FC<SubtitleModalsProps> = ({
|
||||||
showSubtitleModal,
|
showSubtitleModal,
|
||||||
|
|
@ -102,6 +102,10 @@ export const SubtitleModals: React.FC<SubtitleModalsProps> = ({
|
||||||
subtitleOffsetSec,
|
subtitleOffsetSec,
|
||||||
setSubtitleOffsetSec,
|
setSubtitleOffsetSec,
|
||||||
}) => {
|
}) => {
|
||||||
|
const insets = useSafeAreaInsets();
|
||||||
|
const { width, height } = useWindowDimensions();
|
||||||
|
const isIos = Platform.OS === 'ios';
|
||||||
|
const isLandscape = width > height;
|
||||||
// Track which specific addon subtitle is currently loaded
|
// Track which specific addon subtitle is currently loaded
|
||||||
const [selectedOnlineSubtitleId, setSelectedOnlineSubtitleId] = React.useState<string | null>(null);
|
const [selectedOnlineSubtitleId, setSelectedOnlineSubtitleId] = React.useState<string | null>(null);
|
||||||
// Track which addon subtitle is currently loading to show spinner per-item
|
// Track which addon subtitle is currently loading to show spinner per-item
|
||||||
|
|
@ -114,7 +118,11 @@ export const SubtitleModals: React.FC<SubtitleModalsProps> = ({
|
||||||
const chipPadH = isCompact ? 8 : 12;
|
const chipPadH = isCompact ? 8 : 12;
|
||||||
const chipPadV = isCompact ? 6 : 8;
|
const chipPadV = isCompact ? 6 : 8;
|
||||||
const controlBtn = { size: isCompact ? 28 : 32, radius: isCompact ? 14 : 16 };
|
const controlBtn = { size: isCompact ? 28 : 32, radius: isCompact ? 14 : 16 };
|
||||||
const previewHeight = isCompact ? 90 : 120;
|
const previewHeight = isCompact ? 90 : (isIos && isLandscape ? 100 : 120);
|
||||||
|
const menuWidth = Math.min(
|
||||||
|
width * (isIos ? (isLandscape ? 0.6 : 0.8) : 0.85),
|
||||||
|
isIos ? 420 : 400
|
||||||
|
);
|
||||||
|
|
||||||
React.useEffect(() => {
|
React.useEffect(() => {
|
||||||
if (showSubtitleModal && !isLoadingSubtitleList && availableSubtitles.length === 0) {
|
if (showSubtitleModal && !isLoadingSubtitleList && availableSubtitles.length === 0) {
|
||||||
|
|
@ -187,7 +195,7 @@ export const SubtitleModals: React.FC<SubtitleModalsProps> = ({
|
||||||
top: 0,
|
top: 0,
|
||||||
right: 0,
|
right: 0,
|
||||||
bottom: 0,
|
bottom: 0,
|
||||||
width: MENU_WIDTH,
|
width: menuWidth,
|
||||||
backgroundColor: '#1A1A1A',
|
backgroundColor: '#1A1A1A',
|
||||||
zIndex: 9999,
|
zIndex: 9999,
|
||||||
elevation: 20,
|
elevation: 20,
|
||||||
|
|
@ -197,6 +205,7 @@ export const SubtitleModals: React.FC<SubtitleModalsProps> = ({
|
||||||
shadowRadius: 10,
|
shadowRadius: 10,
|
||||||
borderTopLeftRadius: 20,
|
borderTopLeftRadius: 20,
|
||||||
borderBottomLeftRadius: 20,
|
borderBottomLeftRadius: 20,
|
||||||
|
paddingRight: 0,
|
||||||
}}
|
}}
|
||||||
>
|
>
|
||||||
{/* Header */}
|
{/* Header */}
|
||||||
|
|
@ -205,7 +214,7 @@ export const SubtitleModals: React.FC<SubtitleModalsProps> = ({
|
||||||
alignItems: 'center',
|
alignItems: 'center',
|
||||||
justifyContent: 'space-between',
|
justifyContent: 'space-between',
|
||||||
paddingHorizontal: 20,
|
paddingHorizontal: 20,
|
||||||
paddingTop: 60,
|
paddingTop: insets.top + (isCompact ? 8 : 12),
|
||||||
paddingBottom: 12,
|
paddingBottom: 12,
|
||||||
borderBottomWidth: 1,
|
borderBottomWidth: 1,
|
||||||
borderBottomColor: 'rgba(255, 255, 255, 0.08)',
|
borderBottomColor: 'rgba(255, 255, 255, 0.08)',
|
||||||
|
|
@ -260,7 +269,7 @@ export const SubtitleModals: React.FC<SubtitleModalsProps> = ({
|
||||||
|
|
||||||
<ScrollView
|
<ScrollView
|
||||||
style={{ flex: 1 }}
|
style={{ flex: 1 }}
|
||||||
contentContainerStyle={{ padding: 20, paddingBottom: isCompact ? 24 : 40 }}
|
contentContainerStyle={{ padding: 20, paddingBottom: (isCompact ? 24 : 40) + (isIos ? insets.bottom : 0) }}
|
||||||
showsVerticalScrollIndicator={false}
|
showsVerticalScrollIndicator={false}
|
||||||
>
|
>
|
||||||
{activeTab === 'built-in' && (
|
{activeTab === 'built-in' && (
|
||||||
|
|
|
||||||
|
|
@ -30,8 +30,7 @@ import { RootStackParamList } from '../navigation/AppNavigator';
|
||||||
import { logger } from '../utils/logger';
|
import { logger } from '../utils/logger';
|
||||||
import AsyncStorage from '@react-native-async-storage/async-storage';
|
import AsyncStorage from '@react-native-async-storage/async-storage';
|
||||||
import { BlurView as ExpoBlurView } from 'expo-blur';
|
import { BlurView as ExpoBlurView } from 'expo-blur';
|
||||||
import { BlurView as CommunityBlurView } from '@react-native-community/blur';
|
// Removed community blur and expo-constants for Android overlay
|
||||||
import Constants, { ExecutionEnvironment } from 'expo-constants';
|
|
||||||
import axios from 'axios';
|
import axios from 'axios';
|
||||||
import { useTheme } from '../contexts/ThemeContext';
|
import { useTheme } from '../contexts/ThemeContext';
|
||||||
|
|
||||||
|
|
@ -560,7 +559,7 @@ const createStyles = (colors: any) => StyleSheet.create({
|
||||||
left: 0,
|
left: 0,
|
||||||
right: 0,
|
right: 0,
|
||||||
bottom: 0,
|
bottom: 0,
|
||||||
backgroundColor: 'rgba(0,0,0,0.4)',
|
backgroundColor: colors.transparentDark,
|
||||||
},
|
},
|
||||||
androidBlurContainer: {
|
androidBlurContainer: {
|
||||||
position: 'absolute',
|
position: 'absolute',
|
||||||
|
|
@ -582,7 +581,7 @@ const createStyles = (colors: any) => StyleSheet.create({
|
||||||
left: 0,
|
left: 0,
|
||||||
right: 0,
|
right: 0,
|
||||||
bottom: 0,
|
bottom: 0,
|
||||||
backgroundColor: 'black',
|
backgroundColor: colors.darkBackground,
|
||||||
},
|
},
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
@ -1298,19 +1297,8 @@ const AddonsScreen = () => {
|
||||||
{Platform.OS === 'ios' ? (
|
{Platform.OS === 'ios' ? (
|
||||||
<ExpoBlurView intensity={80} style={styles.blurOverlay} tint="dark" />
|
<ExpoBlurView intensity={80} style={styles.blurOverlay} tint="dark" />
|
||||||
) : (
|
) : (
|
||||||
Constants.executionEnvironment === ExecutionEnvironment.StoreClient ? (
|
// Android: use solid themed background instead of semi-transparent overlay
|
||||||
<View style={[styles.androidBlurContainer, styles.androidFallbackBlur]} />
|
<View style={[styles.androidBlurContainer, { backgroundColor: colors.darkBackground }]} />
|
||||||
) : (
|
|
||||||
<View style={styles.androidBlurContainer}>
|
|
||||||
<CommunityBlurView
|
|
||||||
style={styles.androidBlur}
|
|
||||||
blurType="dark"
|
|
||||||
blurAmount={8}
|
|
||||||
overlayColor="rgba(0,0,0,0.4)"
|
|
||||||
reducedTransparencyFallbackColor="black"
|
|
||||||
/>
|
|
||||||
</View>
|
|
||||||
)
|
|
||||||
)}
|
)}
|
||||||
<View style={styles.modalContent}>
|
<View style={styles.modalContent}>
|
||||||
{addonDetails && (
|
{addonDetails && (
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue