Explorar el Código

feat(filmstrip/toolbox) mobile ui updates (#11051)

master
Calinteodor hace 3 años
padre
commit
577d62ea53
No account linked to committer's email address

+ 15
- 3
react/features/filmstrip/components/native/Filmstrip.js Ver fichero

@@ -1,13 +1,15 @@
1 1
 // @flow
2 2
 
3 3
 import React, { PureComponent } from 'react';
4
-import { FlatList, SafeAreaView } from 'react-native';
4
+import { FlatList } from 'react-native';
5
+import { SafeAreaView } from 'react-native-safe-area-context';
5 6
 
6 7
 import { getLocalParticipant } from '../../../base/participants';
7 8
 import { Platform } from '../../../base/react';
8 9
 import { connect } from '../../../base/redux';
9 10
 import { ASPECT_RATIO_NARROW } from '../../../base/responsive-ui/constants';
10 11
 import { shouldHideSelfView } from '../../../base/settings/functions.any';
12
+import { isToolboxVisible } from '../../../toolbox/functions';
11 13
 import { setVisibleRemoteParticipants } from '../../actions';
12 14
 import { isFilmstripVisible, shouldRemoteVideosBeVisible } from '../../functions';
13 15
 
@@ -37,6 +39,11 @@ type Props = {
37 39
      */
38 40
     _disableSelfView: boolean,
39 41
 
42
+    /**
43
+     * Whether or not the toolbox is displayed.
44
+     */
45
+    _toolboxVisible: Boolean,
46
+
40 47
     _localParticipantId: string,
41 48
 
42 49
     /**
@@ -90,7 +97,7 @@ class Filmstrip extends PureComponent<Props> {
90 97
         // layer #0 sits behind the window, creates a hole in the window, and
91 98
         // there we render the LargeVideo; layer #1 is known as media overlay in
92 99
         // EGL terms, renders on top of layer #0, and, consequently, is for the
93
-        // Filmstrip. With the separate LocalThumnail, we should have left the
100
+        // Filmstrip. With the separate LocalThumbnail, we should have left the
94 101
         // remote participants' Thumbnails in layer #1 and utilized layer #2 for
95 102
         // LocalThumbnail. Unfortunately, layer #2 is not practical (that's why
96 103
         // I said we had two practical layers only) because it renders on top of
@@ -226,6 +233,7 @@ class Filmstrip extends PureComponent<Props> {
226 233
         const {
227 234
             _aspectRatio,
228 235
             _disableSelfView,
236
+            _toolboxVisible,
229 237
             _localParticipantId,
230 238
             _participants,
231 239
             _visible
@@ -235,6 +243,7 @@ class Filmstrip extends PureComponent<Props> {
235 243
             return null;
236 244
         }
237 245
 
246
+        const bottomEdge = Platform.OS === 'ios' && !_toolboxVisible;
238 247
         const isNarrowAspectRatio = _aspectRatio === ASPECT_RATIO_NARROW;
239 248
         const filmstripStyle = isNarrowAspectRatio ? styles.filmstripNarrow : styles.filmstripWide;
240 249
         const { height, width } = this._getDimensions();
@@ -254,7 +263,9 @@ class Filmstrip extends PureComponent<Props> {
254 263
         }
255 264
 
256 265
         return (
257
-            <SafeAreaView style = { filmstripStyle }>
266
+            <SafeAreaView
267
+                edges = { [ bottomEdge && 'bottom', 'left', 'right' ].filter(Boolean) }
268
+                style = { filmstripStyle }>
258 269
                 {
259 270
                     this._separateLocalThumbnail
260 271
                         && !isNarrowAspectRatio
@@ -307,6 +318,7 @@ function _mapStateToProps(state) {
307 318
         _disableSelfView: disableSelfView,
308 319
         _localParticipantId: getLocalParticipant(state)?.id,
309 320
         _participants: showRemoteVideos ? remoteParticipants : NO_REMOTE_VIDEOS,
321
+        _toolboxVisible: isToolboxVisible(state),
310 322
         _visible: enabled && isFilmstripVisible(state)
311 323
     };
312 324
 }

+ 1
- 1
react/features/filmstrip/components/native/styles.js Ver fichero

@@ -45,7 +45,7 @@ export default {
45 45
         flexDirection: 'row',
46 46
         flexGrow: 0,
47 47
         justifyContent: 'flex-end',
48
-        marginBottom: BaseTheme.spacing[1]
48
+        margin: 6
49 49
     },
50 50
 
51 51
     /**

+ 73
- 76
react/features/mobile/navigation/components/conference/components/ConferenceNavigationContainer.js Ver fichero

@@ -4,7 +4,6 @@ import { NavigationContainer } from '@react-navigation/native';
4 4
 import { createStackNavigator } from '@react-navigation/stack';
5 5
 import React from 'react';
6 6
 import { useTranslation } from 'react-i18next';
7
-import { SafeAreaProvider } from 'react-native-safe-area-context';
8 7
 import { useSelector } from 'react-redux';
9 8
 
10 9
 import { Chat } from '../../../../../chat';
@@ -63,81 +62,79 @@ const ConferenceNavigationContainer = () => {
63 62
     const { t } = useTranslation();
64 63
 
65 64
     return (
66
-        <SafeAreaProvider>
67
-            <NavigationContainer
68
-                independent = { true }
69
-                ref = { conferenceNavigationRef }
70
-                theme = { navigationContainerTheme }>
71
-                <ConferenceStack.Navigator
72
-                    initialRouteName = { screen.conference.main }
73
-                    screenOptions = {{
74
-                        presentation: 'modal'
75
-                    }}>
76
-                    <ConferenceStack.Screen
77
-                        component = { Conference }
78
-                        name = { screen.conference.main }
79
-                        options = { conferenceScreenOptions } />
80
-                    <ConferenceStack.Screen
81
-                        component = { ChatScreen }
82
-                        name = { chatScreenName }
83
-                        options = {{
84
-                            ...chatScreenOptions,
85
-                            title: t(chatTitleString)
86
-                        }} />
87
-                    <ConferenceStack.Screen
88
-                        component = { ParticipantsPane }
89
-                        name = { screen.conference.participants }
90
-                        options = {{
91
-                            ...participantsScreenOptions,
92
-                            title: t('participantsPane.header')
93
-                        }} />
94
-                    <ConferenceStack.Screen
95
-                        component = { SecurityDialog }
96
-                        name = { screen.conference.security }
97
-                        options = {{
98
-                            ...securityScreenOptions,
99
-                            title: t('security.header')
100
-                        }} />
101
-                    <ConferenceStack.Screen
102
-                        component = { StartRecordingDialog }
103
-                        name = { screen.conference.recording }
104
-                        options = {{
105
-                            ...recordingScreenOptions
106
-                        }} />
107
-                    <ConferenceStack.Screen
108
-                        component = { StartLiveStreamDialog }
109
-                        name = { screen.conference.liveStream }
110
-                        options = {{
111
-                            ...liveStreamScreenOptions
112
-                        }} />
113
-                    <ConferenceStack.Screen
114
-                        component = { SpeakerStats }
115
-                        name = { screen.conference.speakerStats }
116
-                        options = {{
117
-                            ...speakerStatsScreenOptions,
118
-                            title: t('speakerStats.speakerStats')
119
-                        }} />
120
-                    <ConferenceStack.Screen
121
-                        component = { LobbyScreen }
122
-                        name = { screen.lobby }
123
-                        options = { lobbyScreenOptions } />
124
-                    <ConferenceStack.Screen
125
-                        component = { AddPeopleDialog }
126
-                        name = { screen.conference.invite }
127
-                        options = {{
128
-                            ...inviteScreenOptions,
129
-                            title: t('addPeople.add')
130
-                        }} />
131
-                    <ConferenceStack.Screen
132
-                        component = { SharedDocument }
133
-                        name = { screen.conference.sharedDocument }
134
-                        options = {{
135
-                            ...sharedDocumentScreenOptions,
136
-                            title: t('documentSharing.title')
137
-                        }} />
138
-                </ConferenceStack.Navigator>
139
-            </NavigationContainer>
140
-        </SafeAreaProvider>
65
+        <NavigationContainer
66
+            independent = { true }
67
+            ref = { conferenceNavigationRef }
68
+            theme = { navigationContainerTheme }>
69
+            <ConferenceStack.Navigator
70
+                initialRouteName = { screen.conference.main }
71
+                screenOptions = {{
72
+                    presentation: 'modal'
73
+                }}>
74
+                <ConferenceStack.Screen
75
+                    component = { Conference }
76
+                    name = { screen.conference.main }
77
+                    options = { conferenceScreenOptions } />
78
+                <ConferenceStack.Screen
79
+                    component = { ChatScreen }
80
+                    name = { chatScreenName }
81
+                    options = {{
82
+                        ...chatScreenOptions,
83
+                        title: t(chatTitleString)
84
+                    }} />
85
+                <ConferenceStack.Screen
86
+                    component = { ParticipantsPane }
87
+                    name = { screen.conference.participants }
88
+                    options = {{
89
+                        ...participantsScreenOptions,
90
+                        title: t('participantsPane.header')
91
+                    }} />
92
+                <ConferenceStack.Screen
93
+                    component = { SecurityDialog }
94
+                    name = { screen.conference.security }
95
+                    options = {{
96
+                        ...securityScreenOptions,
97
+                        title: t('security.header')
98
+                    }} />
99
+                <ConferenceStack.Screen
100
+                    component = { StartRecordingDialog }
101
+                    name = { screen.conference.recording }
102
+                    options = {{
103
+                        ...recordingScreenOptions
104
+                    }} />
105
+                <ConferenceStack.Screen
106
+                    component = { StartLiveStreamDialog }
107
+                    name = { screen.conference.liveStream }
108
+                    options = {{
109
+                        ...liveStreamScreenOptions
110
+                    }} />
111
+                <ConferenceStack.Screen
112
+                    component = { SpeakerStats }
113
+                    name = { screen.conference.speakerStats }
114
+                    options = {{
115
+                        ...speakerStatsScreenOptions,
116
+                        title: t('speakerStats.speakerStats')
117
+                    }} />
118
+                <ConferenceStack.Screen
119
+                    component = { LobbyScreen }
120
+                    name = { screen.lobby }
121
+                    options = { lobbyScreenOptions } />
122
+                <ConferenceStack.Screen
123
+                    component = { AddPeopleDialog }
124
+                    name = { screen.conference.invite }
125
+                    options = {{
126
+                        ...inviteScreenOptions,
127
+                        title: t('addPeople.add')
128
+                    }} />
129
+                <ConferenceStack.Screen
130
+                    component = { SharedDocument }
131
+                    name = { screen.conference.sharedDocument }
132
+                    options = {{
133
+                        ...sharedDocumentScreenOptions,
134
+                        title: t('documentSharing.title')
135
+                    }} />
136
+            </ConferenceStack.Navigator>
137
+        </NavigationContainer>
141 138
     );
142 139
 };
143 140
 

+ 14
- 9
react/features/toolbox/components/native/Toolbox.js Ver fichero

@@ -1,9 +1,11 @@
1 1
 // @flow
2 2
 
3 3
 import React from 'react';
4
-import { SafeAreaView, View } from 'react-native';
4
+import { View } from 'react-native';
5
+import { SafeAreaView } from 'react-native-safe-area-context';
5 6
 
6 7
 import { ColorSchemeRegistry } from '../../../base/color-scheme';
8
+import { Platform } from '../../../base/react';
7 9
 import { connect } from '../../../base/redux';
8 10
 import { StyleType } from '../../../base/styles';
9 11
 import { ChatButton } from '../../../chat';
@@ -26,6 +28,11 @@ import styles from './styles';
26 28
  */
27 29
 type Props = {
28 30
 
31
+    /**
32
+     * Whether or not the reactions feature is enabled.
33
+     */
34
+    _reactionsEnabled: boolean,
35
+
29 36
     /**
30 37
      * The color-schemed stylesheet of the feature.
31 38
      */
@@ -39,12 +46,7 @@ type Props = {
39 46
     /**
40 47
      * The width of the screen.
41 48
      */
42
-    _width: number,
43
-
44
-    /**
45
-     * Whether or not the reactions feature is enabled.
46
-     */
47
-    _reactionsEnabled: boolean
49
+    _width: number
48 50
 };
49 51
 
50 52
 /**
@@ -54,11 +56,13 @@ type Props = {
54 56
  * @returns {React$Element}.
55 57
  */
56 58
 function Toolbox(props: Props) {
57
-    if (!props._visible) {
59
+    const { _reactionsEnabled, _styles, _visible, _width } = props;
60
+
61
+    if (!_visible) {
58 62
         return null;
59 63
     }
60 64
 
61
-    const { _styles, _width, _reactionsEnabled } = props;
65
+    const bottomEdge = Platform.OS === 'ios' && _visible;
62 66
     const { buttonStylesBorderless, hangupButtonStyles, toggledButtonStyles } = _styles;
63 67
     const additionalButtons = getMovableButtons(_width);
64 68
     const backgroundToggledStyle = {
@@ -75,6 +79,7 @@ function Toolbox(props: Props) {
75 79
             style = { styles.toolboxContainer }>
76 80
             <SafeAreaView
77 81
                 accessibilityRole = 'toolbar'
82
+                edges = { [ bottomEdge && 'bottom' ].filter(Boolean) }
78 83
                 pointerEvents = 'box-none'
79 84
                 style = { styles.toolbox }>
80 85
                 <AudioMuteButton

+ 4
- 7
react/features/toolbox/components/native/styles.js Ver fichero

@@ -18,7 +18,7 @@ const toolbarButton = {
18 18
     height: BUTTON_SIZE,
19 19
     justifyContent: 'center',
20 20
     marginHorizontal: 6,
21
-    marginTop: 6,
21
+    marginVertical: 6,
22 22
     width: BUTTON_SIZE
23 23
 };
24 24
 
@@ -86,9 +86,7 @@ const styles = {
86 86
         borderTopLeftRadius: 3,
87 87
         borderTopRightRadius: 3,
88 88
         flexDirection: 'row',
89
-        flexGrow: 0,
90
-        justifyContent: 'space-between',
91
-        margin: BaseTheme.spacing[2]
89
+        justifyContent: 'space-between'
92 90
     },
93 91
 
94 92
     /**
@@ -97,11 +95,10 @@ const styles = {
97 95
     toolboxContainer: {
98 96
         backgroundColor: BaseTheme.palette.uiBackground,
99 97
         flexDirection: 'column',
100
-        flexGrow: 0,
101
-        width: '100%',
102 98
         maxWidth: 580,
103 99
         marginLeft: 'auto',
104
-        marginRight: 'auto'
100
+        marginRight: 'auto',
101
+        width: '100%'
105 102
     }
106 103
 };
107 104
 

Loading…
Cancelar
Guardar