Bladeren bron

[RN] Adjust Conference for the reduced UI mode

master
Saúl Ibarra Corretgé 7 jaren geleden
bovenliggende
commit
7a9ff9975a

+ 22
- 4
react/features/conference/components/Conference.native.js Bestand weergeven

@@ -66,6 +66,13 @@ type Props = {
66 66
      */
67 67
     _onHardwareBackPress: Function,
68 68
 
69
+    /**
70
+     * The indicator which determines if we are in reduced UI mode.
71
+     *
72
+     * @private
73
+     */
74
+    _reducedUI: boolean,
75
+
69 76
     /**
70 77
      * The handler which dispatches the (redux) action setToolboxVisible to
71 78
      * show/hide the Toolbox.
@@ -192,8 +199,9 @@ class Conference extends Component<Props> {
192 199
 
193 200
                 {/*
194 201
                   * If there is a ringing call, show the callee's info.
195
-                  */}
196
-                <CalleeInfoContainer />
202
+                  */
203
+                    !this.props._reducedUI && <CalleeInfoContainer />
204
+                }
197 205
 
198 206
                 {/*
199 207
                   * The activity/loading indicator goes above everything, except
@@ -223,8 +231,9 @@ class Conference extends Component<Props> {
223 231
 
224 232
                 {/*
225 233
                   * The dialogs are in the topmost stacking layers.
226
-                  */}
227
-                <DialogContainer />
234
+                  */
235
+                    !this.props._reducedUI && <DialogContainer />
236
+                }
228 237
             </Container>
229 238
         );
230 239
     }
@@ -367,6 +376,7 @@ function _mapDispatchToProps(dispatch) {
367 376
 function _mapStateToProps(state) {
368 377
     const { connecting, connection } = state['features/base/connection'];
369 378
     const { conference, joining, leaving } = state['features/base/conference'];
379
+    const { reducedUI } = state['features/base/responsive-ui'];
370 380
 
371 381
     // XXX There is a window of time between the successful establishment of the
372 382
     // XMPP connection and the subsequent commencement of joining the MUC during
@@ -392,6 +402,14 @@ function _mapStateToProps(state) {
392 402
          */
393 403
         _connecting: Boolean(connecting_),
394 404
 
405
+        /**
406
+         * The indicator which determines if we are in reduced UI mode.
407
+         *
408
+         * @private
409
+         * @type {boolean}
410
+         */
411
+        _reducedUI: reducedUI,
412
+
395 413
         /**
396 414
          * The indicator which determines whether the Toolbox is visible.
397 415
          *

+ 2
- 0
react/features/conference/index.js Bestand weergeven

@@ -1,3 +1,5 @@
1 1
 import './route';
2 2
 
3 3
 export * from './components';
4
+
5
+import './middleware';

+ 40
- 0
react/features/conference/middleware.js Bestand weergeven

@@ -0,0 +1,40 @@
1
+// @flow
2
+
3
+import {
4
+    CONFERENCE_JOINED,
5
+    VIDEO_QUALITY_LEVELS,
6
+    setReceiveVideoQuality
7
+} from '../base/conference';
8
+import { SET_REDUCED_UI } from '../base/responsive-ui';
9
+import { MiddlewareRegistry } from '../base/redux';
10
+import { setFilmstripEnabled } from '../filmstrip';
11
+import { setToolboxEnabled } from '../toolbox';
12
+
13
+MiddlewareRegistry.register(({ dispatch, getState }) => next => action => {
14
+    const result = next(action);
15
+
16
+    switch (action.type) {
17
+    case CONFERENCE_JOINED:
18
+    case SET_REDUCED_UI: {
19
+        const state = getState();
20
+        const { audioOnly } = state['features/base/conference'];
21
+        const { reducedUI } = state['features/base/responsive-ui'];
22
+
23
+        dispatch(setToolboxEnabled(!reducedUI));
24
+        dispatch(setFilmstripEnabled(!reducedUI));
25
+
26
+        // XXX: Currently setting the received video quality will disable
27
+        // audio-only mode if engaged, that's why we check for it here.
28
+        if (!audioOnly) {
29
+            dispatch(setReceiveVideoQuality(
30
+                    reducedUI
31
+                        ? VIDEO_QUALITY_LEVELS.LOW
32
+                        : VIDEO_QUALITY_LEVELS.HIGH));
33
+        }
34
+
35
+        break;
36
+    }
37
+    }
38
+
39
+    return result;
40
+});

+ 4
- 1
react/features/mobile/full-screen/middleware.js Bestand weergeven

@@ -12,6 +12,7 @@ import {
12 12
 } from '../../base/conference';
13 13
 import { HIDE_DIALOG } from '../../base/dialog';
14 14
 import { Platform } from '../../base/react';
15
+import { SET_REDUCED_UI } from '../../base/responsive-ui';
15 16
 import { MiddlewareRegistry } from '../../base/redux';
16 17
 
17 18
 /**
@@ -34,7 +35,9 @@ MiddlewareRegistry.register(({ getState }) => next => action => {
34 35
     case APP_STATE_CHANGED:
35 36
     case CONFERENCE_WILL_JOIN:
36 37
     case HIDE_DIALOG:
37
-    case SET_AUDIO_ONLY: {
38
+    case SET_AUDIO_ONLY:
39
+    case SET_REDUCED_UI: {
40
+        // FIXME: Simplify this by listening to Immediate events.
38 41
         // Check if we just came back from the background and re-enable full
39 42
         // screen mode if necessary.
40 43
         const { appState } = action;

Laden…
Annuleren
Opslaan