Pārlūkot izejas kodu

[RN] Fix full-screen mode when coming back from the background

On Android the status and navigation bars are shown again after coming back from
the background, so enter full-screen mode again if needed.
j8
Saúl Ibarra Corretgé 8 gadus atpakaļ
vecāks
revīzija
c57e713696

+ 1
- 0
react/features/background/index.js Parādīt failu

1
+export * from './actionTypes';
1
 import './middleware';
2
 import './middleware';
2
 import './reducer';
3
 import './reducer';

+ 13
- 5
react/features/full-screen/middleware.js Parādīt failu

3
 import { StatusBar } from 'react-native';
3
 import { StatusBar } from 'react-native';
4
 import { Immersive } from 'react-native-immersive';
4
 import { Immersive } from 'react-native-immersive';
5
 
5
 
6
+import { APP_STATE_CHANGED } from '../background';
6
 import {
7
 import {
7
     CONFERENCE_FAILED,
8
     CONFERENCE_FAILED,
8
     CONFERENCE_LEFT,
9
     CONFERENCE_LEFT,
23
  * @returns {Function}
24
  * @returns {Function}
24
  */
25
  */
25
 MiddlewareRegistry.register(store => next => action => {
26
 MiddlewareRegistry.register(store => next => action => {
26
-    let fullScreen;
27
+    let fullScreen = null;
27
 
28
 
28
     switch (action.type) {
29
     switch (action.type) {
30
+    case APP_STATE_CHANGED: {
31
+        // Check if we just came back from the background and reenable full
32
+        // screen mode if necessary.
33
+        if (action.appState === 'active') {
34
+            const conference = store.getState()['features/base/conference'];
35
+
36
+            fullScreen = conference ? !conference.audioOnly : false;
37
+        }
38
+        break;
39
+    }
40
+
29
     case CONFERENCE_WILL_JOIN: {
41
     case CONFERENCE_WILL_JOIN: {
30
         const conference = store.getState()['features/base/conference'];
42
         const conference = store.getState()['features/base/conference'];
31
 
43
 
37
     case CONFERENCE_LEFT:
49
     case CONFERENCE_LEFT:
38
         fullScreen = false;
50
         fullScreen = false;
39
         break;
51
         break;
40
-
41
-    default:
42
-        fullScreen = null;
43
-        break;
44
     }
52
     }
45
 
53
 
46
     if (fullScreen !== null) {
54
     if (fullScreen !== null) {

Notiek ielāde…
Atcelt
Saglabāt