mirror of https://github.com/jitsi/jitsi-meet
On Android we go into "immersive mode" when in a conference, this is our way of being full-creen. There are occasions, however, in which Android takes us out of immerfive mode without us (the application / SDK) knowing: when a child activity is started, a modal window shown, etc. In order to be resilient to any possible change in the immersive mode, register a listener which will be called when Android changes it, so we can re-eavluate if we need it and thus re-enable it.pull/2446/head
parent
59d046dca9
commit
4757c1ebca
@ -0,0 +1,11 @@ |
||||
/** |
||||
* The type of redux action to set the Immersive change event listener. |
||||
* |
||||
* { |
||||
* type: _SET_IMMERSIVE_LISTENER, |
||||
* listener: Function |
||||
* } |
||||
* |
||||
* @protected |
||||
*/ |
||||
export const _SET_IMMERSIVE_LISTENER = Symbol('_SET_IMMERSIVE_LISTENER'); |
@ -0,0 +1,20 @@ |
||||
// @flow
|
||||
|
||||
import { _SET_IMMERSIVE_LISTENER } from './actionTypes'; |
||||
|
||||
/** |
||||
* Sets the listener to be used with React Native's Immersive API. |
||||
* |
||||
* @param {Function} listener - Function to be set as the change event listener. |
||||
* @protected |
||||
* @returns {{ |
||||
* type: _SET_IMMERSIVE_LISTENER, |
||||
* listener: Function |
||||
* }} |
||||
*/ |
||||
export function _setImmersiveListener(listener: ?Function) { |
||||
return { |
||||
type: _SET_IMMERSIVE_LISTENER, |
||||
listener |
||||
}; |
||||
} |
@ -1 +1,2 @@ |
||||
import './middleware'; |
||||
import './reducer'; |
||||
|
@ -0,0 +1,21 @@ |
||||
import { ReducerRegistry } from '../../base/redux'; |
||||
|
||||
import { _SET_IMMERSIVE_LISTENER } from './actionTypes'; |
||||
|
||||
const INITIAL_STATE = { |
||||
listener: undefined |
||||
}; |
||||
|
||||
ReducerRegistry.register( |
||||
'features/full-screen', |
||||
(state = INITIAL_STATE, action) => { |
||||
switch (action.type) { |
||||
case _SET_IMMERSIVE_LISTENER: |
||||
return { |
||||
...state, |
||||
listener: action.listener |
||||
}; |
||||
} |
||||
|
||||
return state; |
||||
}); |
Loading…
Reference in new issue