mirror of
https://github.com/tapframe/NuvioStreaming.git
synced 2026-04-21 16:51:57 +00:00
alert orientation fix
This commit is contained in:
parent
2d5b1263b5
commit
5804959ddf
11 changed files with 242 additions and 214 deletions
|
|
@ -101,6 +101,7 @@ const AnnouncementOverlay: React.FC<AnnouncementOverlayProps> = ({
|
|||
transparent
|
||||
animationType="none"
|
||||
statusBarTranslucent
|
||||
supportedOrientations={['portrait', 'landscape']}
|
||||
onRequestClose={handleClose}
|
||||
>
|
||||
<View style={styles.overlay}>
|
||||
|
|
|
|||
|
|
@ -152,6 +152,7 @@ export const DropUpMenu = ({ visible, onClose, item, onOptionSelect, isSaved: is
|
|||
visible={visible}
|
||||
transparent
|
||||
animationType="none"
|
||||
supportedOrientations={['portrait', 'landscape']}
|
||||
onRequestClose={onClose}
|
||||
>
|
||||
<GestureHandlerRootView style={{ flex: 1 }}>
|
||||
|
|
|
|||
|
|
@ -1660,6 +1660,7 @@ const SeriesContentComponent: React.FC<SeriesContentProps> = ({
|
|||
animationType="fade"
|
||||
onRequestClose={closeEpisodeActionMenu}
|
||||
statusBarTranslucent
|
||||
supportedOrientations={['portrait', 'landscape']}
|
||||
>
|
||||
<Pressable
|
||||
style={{
|
||||
|
|
|
|||
|
|
@ -559,6 +559,7 @@ const TrailersSection: React.FC<TrailersSectionProps> = memo(({
|
|||
visible={dropdownVisible}
|
||||
transparent={true}
|
||||
animationType="fade"
|
||||
supportedOrientations={['portrait', 'landscape']}
|
||||
onRequestClose={() => setDropdownVisible(false)}
|
||||
>
|
||||
<TouchableOpacity
|
||||
|
|
|
|||
|
|
@ -3432,8 +3432,6 @@ const AndroidVideoPlayer: React.FC = () => {
|
|||
buffered={buffered}
|
||||
formatTime={formatTime}
|
||||
playerBackend={useVLC ? 'VLC' : 'ExoPlayer'}
|
||||
nextLoadingTitle={nextLoadingTitle}
|
||||
controlsFixedOffset={Math.min(Dimensions.get('window').width, Dimensions.get('window').height) >= 768 ? 120 : 100}
|
||||
/>
|
||||
|
||||
{/* Combined Volume & Brightness Gesture Indicator - NEW PILL STYLE (No Bar) */}
|
||||
|
|
|
|||
|
|
@ -1413,6 +1413,7 @@ const AddonsScreen = () => {
|
|||
visible={showConfirmModal}
|
||||
transparent
|
||||
animationType="fade"
|
||||
supportedOrientations={['portrait', 'landscape']}
|
||||
onRequestClose={() => {
|
||||
setShowConfirmModal(false);
|
||||
setAddonDetails(null);
|
||||
|
|
|
|||
|
|
@ -685,6 +685,7 @@ const CatalogSettingsScreen = () => {
|
|||
animationType="fade"
|
||||
transparent={true}
|
||||
visible={isRenameModalVisible}
|
||||
supportedOrientations={['portrait', 'landscape']}
|
||||
onRequestClose={() => {
|
||||
setIsRenameModalVisible(false);
|
||||
setCatalogToRename(null);
|
||||
|
|
|
|||
|
|
@ -1946,6 +1946,7 @@ const PluginsScreen: React.FC = () => {
|
|||
visible={showHelpModal}
|
||||
transparent={true}
|
||||
animationType="fade"
|
||||
supportedOrientations={['portrait', 'landscape']}
|
||||
onRequestClose={() => setShowHelpModal(false)}
|
||||
>
|
||||
<View style={styles.modalOverlay}>
|
||||
|
|
@ -1978,6 +1979,7 @@ const PluginsScreen: React.FC = () => {
|
|||
visible={showAddRepositoryModal}
|
||||
transparent={true}
|
||||
animationType="fade"
|
||||
supportedOrientations={['portrait', 'landscape']}
|
||||
onRequestClose={() => setShowAddRepositoryModal(false)}
|
||||
>
|
||||
<View style={styles.modalOverlay}>
|
||||
|
|
|
|||
|
|
@ -52,7 +52,7 @@ const ProfilesScreen: React.FC = () => {
|
|||
) => {
|
||||
setAlertTitle(title);
|
||||
setAlertMessage(message);
|
||||
setAlertActions(actions && actions.length > 0 ? actions : [{ label: 'OK', onPress: () => {} }]);
|
||||
setAlertActions(actions && actions.length > 0 ? actions : [{ label: 'OK', onPress: () => { } }]);
|
||||
setAlertVisible(true);
|
||||
};
|
||||
|
||||
|
|
@ -164,7 +164,7 @@ const ProfilesScreen: React.FC = () => {
|
|||
'Delete Profile',
|
||||
'Are you sure you want to delete this profile? This action cannot be undone.',
|
||||
[
|
||||
{ label: 'Cancel', onPress: () => {} },
|
||||
{ label: 'Cancel', onPress: () => { } },
|
||||
{
|
||||
label: 'Delete',
|
||||
onPress: () => {
|
||||
|
|
@ -281,6 +281,7 @@ const ProfilesScreen: React.FC = () => {
|
|||
visible={showAddModal}
|
||||
transparent
|
||||
animationType="fade"
|
||||
supportedOrientations={['portrait', 'landscape']}
|
||||
onRequestClose={() => setShowAddModal(false)}
|
||||
>
|
||||
<View style={styles.modalOverlay}>
|
||||
|
|
|
|||
|
|
@ -132,17 +132,27 @@ export const StreamsScreen = () => {
|
|||
const { showSuccess, showInfo } = useToast();
|
||||
|
||||
// Add dimension listener and tablet detection
|
||||
// Use a ref to track previous dimensions to avoid unnecessary re-renders
|
||||
const [dimensions, setDimensions] = useState(Dimensions.get('window'));
|
||||
const prevDimensionsRef = useRef({ width: dimensions.width, height: dimensions.height });
|
||||
|
||||
useEffect(() => {
|
||||
const subscription = Dimensions.addEventListener('change', ({ window }) => {
|
||||
// Only update state if dimensions actually changed (with 1px tolerance)
|
||||
const widthChanged = Math.abs(window.width - prevDimensionsRef.current.width) > 1;
|
||||
const heightChanged = Math.abs(window.height - prevDimensionsRef.current.height) > 1;
|
||||
|
||||
if (widthChanged || heightChanged) {
|
||||
prevDimensionsRef.current = { width: window.width, height: window.height };
|
||||
setDimensions(window);
|
||||
}
|
||||
});
|
||||
return () => subscription?.remove();
|
||||
}, []);
|
||||
|
||||
// Memoize tablet detection to prevent recalculation on every render
|
||||
const deviceWidth = dimensions.width;
|
||||
const isTablet = deviceWidth >= 768;
|
||||
const isTablet = useMemo(() => deviceWidth >= 768, [deviceWidth]);
|
||||
|
||||
// Add refs to prevent excessive updates and duplicate loads
|
||||
const isMounted = useRef(true);
|
||||
|
|
@ -303,6 +313,9 @@ export const StreamsScreen = () => {
|
|||
}, []);
|
||||
|
||||
// Monitor streams loading and update available providers immediately
|
||||
// Use a ref to track the previous providers to avoid unnecessary state updates
|
||||
const prevProvidersRef = useRef<Set<string>>(new Set());
|
||||
|
||||
useEffect(() => {
|
||||
// Skip processing if component is unmounting
|
||||
if (!isMounted.current) return;
|
||||
|
|
@ -317,15 +330,22 @@ export const StreamsScreen = () => {
|
|||
|
||||
if (providersWithStreams.length > 0) {
|
||||
logger.log(`📊 Providers with streams: ${providersWithStreams.join(', ')}`);
|
||||
const providersWithStreamsSet = new Set(providersWithStreams);
|
||||
|
||||
// Only update if we have new providers, don't remove existing ones during loading
|
||||
// Check if we actually have new providers before triggering state update
|
||||
const hasNewProviders = providersWithStreams.some(
|
||||
provider => !prevProvidersRef.current.has(provider)
|
||||
);
|
||||
|
||||
if (hasNewProviders) {
|
||||
setAvailableProviders(prevProviders => {
|
||||
const newProviders = new Set([...prevProviders, ...providersWithStreamsSet]);
|
||||
const newProviders = new Set([...prevProviders, ...providersWithStreams]);
|
||||
// Update ref to track current providers
|
||||
prevProvidersRef.current = newProviders;
|
||||
if (__DEV__) console.log('[StreamsScreen] availableProviders ->', Array.from(newProviders));
|
||||
return newProviders;
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
// Update loading states for individual providers
|
||||
const expectedProviders = ['stremio'];
|
||||
|
|
|
|||
|
|
@ -828,6 +828,7 @@ const TMDBSettingsScreen = () => {
|
|||
visible={languagePickerVisible}
|
||||
transparent
|
||||
animationType="slide"
|
||||
supportedOrientations={['portrait', 'landscape']}
|
||||
onRequestClose={() => setLanguagePickerVisible(false)}
|
||||
>
|
||||
<TouchableWithoutFeedback onPress={() => setLanguagePickerVisible(false)}>
|
||||
|
|
|
|||
Loading…
Reference in a new issue