From 577d62ea537b428dc2d2c35ed0e9b3f5909b3be5 Mon Sep 17 00:00:00 2001 From: Calinteodor Date: Tue, 1 Mar 2022 17:41:45 +0200 Subject: [PATCH] feat(filmstrip/toolbox) mobile ui updates (#11051) --- .../filmstrip/components/native/Filmstrip.js | 18 ++- .../filmstrip/components/native/styles.js | 2 +- .../ConferenceNavigationContainer.js | 149 +++++++++--------- .../toolbox/components/native/Toolbox.js | 23 +-- .../toolbox/components/native/styles.js | 11 +- 5 files changed, 107 insertions(+), 96 deletions(-) diff --git a/react/features/filmstrip/components/native/Filmstrip.js b/react/features/filmstrip/components/native/Filmstrip.js index c4b11324c..ba80f0b05 100644 --- a/react/features/filmstrip/components/native/Filmstrip.js +++ b/react/features/filmstrip/components/native/Filmstrip.js @@ -1,13 +1,15 @@ // @flow import React, { PureComponent } from 'react'; -import { FlatList, SafeAreaView } from 'react-native'; +import { FlatList } from 'react-native'; +import { SafeAreaView } from 'react-native-safe-area-context'; import { getLocalParticipant } from '../../../base/participants'; import { Platform } from '../../../base/react'; import { connect } from '../../../base/redux'; import { ASPECT_RATIO_NARROW } from '../../../base/responsive-ui/constants'; import { shouldHideSelfView } from '../../../base/settings/functions.any'; +import { isToolboxVisible } from '../../../toolbox/functions'; import { setVisibleRemoteParticipants } from '../../actions'; import { isFilmstripVisible, shouldRemoteVideosBeVisible } from '../../functions'; @@ -37,6 +39,11 @@ type Props = { */ _disableSelfView: boolean, + /** + * Whether or not the toolbox is displayed. + */ + _toolboxVisible: Boolean, + _localParticipantId: string, /** @@ -90,7 +97,7 @@ class Filmstrip extends PureComponent { // layer #0 sits behind the window, creates a hole in the window, and // there we render the LargeVideo; layer #1 is known as media overlay in // EGL terms, renders on top of layer #0, and, consequently, is for the - // Filmstrip. With the separate LocalThumnail, we should have left the + // Filmstrip. With the separate LocalThumbnail, we should have left the // remote participants' Thumbnails in layer #1 and utilized layer #2 for // LocalThumbnail. Unfortunately, layer #2 is not practical (that's why // I said we had two practical layers only) because it renders on top of @@ -226,6 +233,7 @@ class Filmstrip extends PureComponent { const { _aspectRatio, _disableSelfView, + _toolboxVisible, _localParticipantId, _participants, _visible @@ -235,6 +243,7 @@ class Filmstrip extends PureComponent { return null; } + const bottomEdge = Platform.OS === 'ios' && !_toolboxVisible; const isNarrowAspectRatio = _aspectRatio === ASPECT_RATIO_NARROW; const filmstripStyle = isNarrowAspectRatio ? styles.filmstripNarrow : styles.filmstripWide; const { height, width } = this._getDimensions(); @@ -254,7 +263,9 @@ class Filmstrip extends PureComponent { } return ( - + { this._separateLocalThumbnail && !isNarrowAspectRatio @@ -307,6 +318,7 @@ function _mapStateToProps(state) { _disableSelfView: disableSelfView, _localParticipantId: getLocalParticipant(state)?.id, _participants: showRemoteVideos ? remoteParticipants : NO_REMOTE_VIDEOS, + _toolboxVisible: isToolboxVisible(state), _visible: enabled && isFilmstripVisible(state) }; } diff --git a/react/features/filmstrip/components/native/styles.js b/react/features/filmstrip/components/native/styles.js index 757437b6d..d0e59cb4b 100644 --- a/react/features/filmstrip/components/native/styles.js +++ b/react/features/filmstrip/components/native/styles.js @@ -45,7 +45,7 @@ export default { flexDirection: 'row', flexGrow: 0, justifyContent: 'flex-end', - marginBottom: BaseTheme.spacing[1] + margin: 6 }, /** diff --git a/react/features/mobile/navigation/components/conference/components/ConferenceNavigationContainer.js b/react/features/mobile/navigation/components/conference/components/ConferenceNavigationContainer.js index 968f4fb04..957230e85 100644 --- a/react/features/mobile/navigation/components/conference/components/ConferenceNavigationContainer.js +++ b/react/features/mobile/navigation/components/conference/components/ConferenceNavigationContainer.js @@ -4,7 +4,6 @@ import { NavigationContainer } from '@react-navigation/native'; import { createStackNavigator } from '@react-navigation/stack'; import React from 'react'; import { useTranslation } from 'react-i18next'; -import { SafeAreaProvider } from 'react-native-safe-area-context'; import { useSelector } from 'react-redux'; import { Chat } from '../../../../../chat'; @@ -63,81 +62,79 @@ const ConferenceNavigationContainer = () => { const { t } = useTranslation(); return ( - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + ); }; diff --git a/react/features/toolbox/components/native/Toolbox.js b/react/features/toolbox/components/native/Toolbox.js index bf32be7f3..2618384ed 100644 --- a/react/features/toolbox/components/native/Toolbox.js +++ b/react/features/toolbox/components/native/Toolbox.js @@ -1,9 +1,11 @@ // @flow import React from 'react'; -import { SafeAreaView, View } from 'react-native'; +import { View } from 'react-native'; +import { SafeAreaView } from 'react-native-safe-area-context'; import { ColorSchemeRegistry } from '../../../base/color-scheme'; +import { Platform } from '../../../base/react'; import { connect } from '../../../base/redux'; import { StyleType } from '../../../base/styles'; import { ChatButton } from '../../../chat'; @@ -26,6 +28,11 @@ import styles from './styles'; */ type Props = { + /** + * Whether or not the reactions feature is enabled. + */ + _reactionsEnabled: boolean, + /** * The color-schemed stylesheet of the feature. */ @@ -39,12 +46,7 @@ type Props = { /** * The width of the screen. */ - _width: number, - - /** - * Whether or not the reactions feature is enabled. - */ - _reactionsEnabled: boolean + _width: number }; /** @@ -54,11 +56,13 @@ type Props = { * @returns {React$Element}. */ function Toolbox(props: Props) { - if (!props._visible) { + const { _reactionsEnabled, _styles, _visible, _width } = props; + + if (!_visible) { return null; } - const { _styles, _width, _reactionsEnabled } = props; + const bottomEdge = Platform.OS === 'ios' && _visible; const { buttonStylesBorderless, hangupButtonStyles, toggledButtonStyles } = _styles; const additionalButtons = getMovableButtons(_width); const backgroundToggledStyle = { @@ -75,6 +79,7 @@ function Toolbox(props: Props) { style = { styles.toolboxContainer }>