From 477346c6ce5966d462f28c08d7c74edaa51d8e93 Mon Sep 17 00:00:00 2001 From: Yogesh Singh Date: Fri, 1 Dec 2023 14:21:53 +0530 Subject: [PATCH 01/84] added landscape mode support --- .../android/app/src/main/AndroidManifest.xml | 9 +++------ .../react-native-room-kit/example/ios/Podfile.lock | 4 ++-- .../src/components/Footer.tsx | 14 ++++++++++++-- .../src/components/GridView.tsx | 6 +++++- .../src/components/MeetingScreenContent.tsx | 4 +++- .../src/components/TilesContainer.tsx | 6 +++--- 6 files changed, 28 insertions(+), 15 deletions(-) diff --git a/packages/react-native-room-kit/example/android/app/src/main/AndroidManifest.xml b/packages/react-native-room-kit/example/android/app/src/main/AndroidManifest.xml index d7de1a19a..17bb100f7 100644 --- a/packages/react-native-room-kit/example/android/app/src/main/AndroidManifest.xml +++ b/packages/react-native-room-kit/example/android/app/src/main/AndroidManifest.xml @@ -30,13 +30,11 @@ + android:label="@string/app_name" /> + android:label="@string/app_name" /> + android:windowSoftInputMode="adjustResize"> diff --git a/packages/react-native-room-kit/example/ios/Podfile.lock b/packages/react-native-room-kit/example/ios/Podfile.lock index 72abf5303..60d70519d 100644 --- a/packages/react-native-room-kit/example/ios/Podfile.lock +++ b/packages/react-native-room-kit/example/ios/Podfile.lock @@ -318,7 +318,7 @@ PODS: - React-Core - react-native-camera/RN (4.2.1): - React-Core - - react-native-hms (1.9.4): + - react-native-hms (1.9.5): - HMSBroadcastExtensionSDK (= 0.0.9) - HMSHLSPlayerSDK (= 0.0.2) - HMSSDK (= 1.3.0) @@ -690,7 +690,7 @@ SPEC CHECKSUMS: React-logger: a1f028f6d8639a3f364ef80419e5e862e1115250 react-native-blur: cfdad7b3c01d725ab62a8a729f42ea463998afa2 react-native-camera: 3eae183c1d111103963f3dd913b65d01aef8110f - react-native-hms: d140f0172b83b6e5aaad9601552394380378f910 + react-native-hms: f3045b22556ab390f7f441d16203dc34786d8216 react-native-lottie-splash-screen: 015423265bac5f46016dff2e31c97b9590808856 react-native-safe-area-context: 61c8c484a3a9e7d1fda19f7b1794b35bbfd2262a react-native-simple-toast: bf002828cf816775a6809f7a9ec3907509bce11f diff --git a/packages/react-native-room-kit/src/components/Footer.tsx b/packages/react-native-room-kit/src/components/Footer.tsx index 19b6ab70d..1267b60de 100644 --- a/packages/react-native-room-kit/src/components/Footer.tsx +++ b/packages/react-native-room-kit/src/components/Footer.tsx @@ -24,6 +24,7 @@ import { } from '../hooks-sdk'; import { useSelector } from 'react-redux'; import type { RootState } from '../redux'; +import { useIsLandscapeOrientation } from '../utils/dimension'; interface FooterProps {} @@ -32,6 +33,7 @@ export const _Footer: React.FC = () => { const canPublishAudio = useCanPublishAudio(); const canPublishVideo = useCanPublishVideo(); const canPublishScreen = useCanPublishScreen(); + const isLandscapeOrientation = useIsLandscapeOrientation(); const isViewer = !(canPublishAudio || canPublishVideo || canPublishScreen); @@ -105,7 +107,7 @@ export const _Footer: React.FC = () => { > @@ -152,7 +154,15 @@ const styles = StyleSheet.create({ flexDirection: 'row', alignItems: 'center', justifyContent: 'center', - marginBottom: Platform.OS === 'android' ? 16 : 0, // TODO: need to correct hide aimation offsets because of this change + marginBottom: Platform.OS === 'android' ? 16 : 0, // TODO: need to correct hide animation offsets because of this change + }, + landscapeContainer: { + paddingTop: 4, + paddingHorizontal: 4, + flexDirection: 'row', + alignItems: 'center', + justifyContent: 'center', + marginBottom: Platform.OS === 'android' ? 4 : 0, }, hlsContainer: { paddingTop: 8, diff --git a/packages/react-native-room-kit/src/components/GridView.tsx b/packages/react-native-room-kit/src/components/GridView.tsx index daea1a51d..30001c73a 100644 --- a/packages/react-native-room-kit/src/components/GridView.tsx +++ b/packages/react-native-room-kit/src/components/GridView.tsx @@ -18,6 +18,7 @@ import type { RootState } from '../redux'; import { PaginationDots } from './PaginationDots'; import { setGridViewActivePage } from '../redux/actions'; import { Tile } from './Tile'; +import { useIsLandscapeOrientation } from '../utils/dimension'; export type GridViewProps = { onPeerTileMorePress(peerTrackNode: PeerTrackNode): void; @@ -157,6 +158,7 @@ const styles = StyleSheet.create({ container: { flex: 1, position: 'relative', + flexDirection: 'row', }, measureLayoutView: { position: 'absolute', @@ -183,6 +185,8 @@ const RegularTiles = React.forwardRef< (state: RootState) => state.app.gridViewActivePage ); + const isLandscapeOrientation = useIsLandscapeOrientation(); + const _keyExtractor = React.useCallback((item) => item[0]?.id, []); const _handleViewableItemsChanged = React.useCallback( @@ -234,7 +238,7 @@ const RegularTiles = React.forwardRef< ) : null} diff --git a/packages/react-native-room-kit/src/components/MeetingScreenContent.tsx b/packages/react-native-room-kit/src/components/MeetingScreenContent.tsx index 510f6a4b1..d71d8169c 100644 --- a/packages/react-native-room-kit/src/components/MeetingScreenContent.tsx +++ b/packages/react-native-room-kit/src/components/MeetingScreenContent.tsx @@ -20,6 +20,7 @@ import { HMSStatusBar } from './StatusBar'; import { AnimatedFooter } from './AnimatedFooter'; import { HLSFooter } from './HLSFooter'; import { AnimatedHeader } from './AnimatedHeader'; +import { useIsLandscapeOrientation } from '../utils/dimension'; // import { ReconnectionView } from './ReconnectionView'; interface MeetingScreenContentProps { @@ -36,6 +37,7 @@ export const MeetingScreenContent: React.FC = ({ const isPipModeActive = useSelector( (state: RootState) => state.app.pipModeStatus === PipModes.ACTIVE ); + const isLandscapeOrientation = useIsLandscapeOrientation(); const toggleControls = useCallback(() => { 'worklet'; @@ -90,7 +92,7 @@ export const MeetingScreenContent: React.FC = ({