fix(rn,toolbox) fill gap underneath Toolbox

This is for devices without the home button.
This commit is contained in:
Saúl Ibarra Corretgé 2021-03-18 12:32:33 +01:00 committed by Saúl Ibarra Corretgé
parent 6b4d25c0d3
commit 9d4e49a5af
3 changed files with 37 additions and 49 deletions

View File

@ -1,7 +1,7 @@
// @flow // @flow
import React from 'react'; import React from 'react';
import { NativeModules, SafeAreaView, StatusBar } from 'react-native'; import { NativeModules, SafeAreaView, StatusBar, View } from 'react-native';
import { appNavigate } from '../../../app/actions'; import { appNavigate } from '../../../app/actions';
import { PIP_ENABLED, FULLSCREEN_ENABLED, getFeatureFlag } from '../../../base/flags'; import { PIP_ENABLED, FULLSCREEN_ENABLED, getFeatureFlag } from '../../../base/flags';
@ -272,7 +272,7 @@ class Conference extends AbstractConference<Props, *> {
</TintedView> </TintedView>
} }
<SafeAreaView <View
pointerEvents = 'box-none' pointerEvents = 'box-none'
style = { styles.toolboxAndFilmstripContainer }> style = { styles.toolboxAndFilmstripContainer }>
@ -285,10 +285,8 @@ class Conference extends AbstractConference<Props, *> {
<LonelyMeetingExperience /> <LonelyMeetingExperience />
{ _shouldDisplayTileView ? undefined : <Filmstrip /> } { _shouldDisplayTileView ? undefined : <Filmstrip /> }
<Toolbox /> <Toolbox />
</View>
</SafeAreaView>
<SafeAreaView <SafeAreaView
pointerEvents = 'box-none' pointerEvents = 'box-none'

View File

@ -1,10 +1,9 @@
// @flow // @flow
import React, { PureComponent } from 'react'; import React, { PureComponent } from 'react';
import { View } from 'react-native'; import { SafeAreaView, View } from 'react-native';
import { ColorSchemeRegistry } from '../../../base/color-scheme'; import { ColorSchemeRegistry } from '../../../base/color-scheme';
import { Container } from '../../../base/react';
import { connect } from '../../../base/redux'; import { connect } from '../../../base/redux';
import { StyleType } from '../../../base/styles'; import { StyleType } from '../../../base/styles';
import { ChatButton } from '../../../chat'; import { ChatButton } from '../../../chat';
@ -48,12 +47,37 @@ class Toolbox extends PureComponent<Props> {
* @returns {ReactElement} * @returns {ReactElement}
*/ */
render() { render() {
if (!this.props._visible) {
return null;
}
const { _styles } = this.props;
const { buttonStylesBorderless, hangupButtonStyles, toggledButtonStyles } = _styles;
return ( return (
<Container <View
style = { styles.toolbox } pointerEvents = 'box-none'
visible = { this.props._visible }> style = { styles.toolboxContainer }>
{ this._renderToolbar() } <SafeAreaView
</Container> accessibilityRole = 'toolbar'
pointerEvents = 'box-none'
style = { styles.toolbox }>
<AudioMuteButton
styles = { buttonStylesBorderless }
toggledStyles = { toggledButtonStyles } />
<VideoMuteButton
styles = { buttonStylesBorderless }
toggledStyles = { toggledButtonStyles } />
<ChatButton
styles = { buttonStylesBorderless }
toggledStyles = { this._getChatButtonToggledStyle(toggledButtonStyles) } />
<OverflowMenuButton
styles = { buttonStylesBorderless }
toggledStyles = { toggledButtonStyles } />
<HangupButton
styles = { hangupButtonStyles } />
</SafeAreaView>
</View>
); );
} }
@ -87,40 +111,6 @@ class Toolbox extends PureComponent<Props> {
] ]
}; };
} }
/**
* Renders the toolbar. In order to avoid a weird visual effect in which the
* toolbar is (visually) rendered and then visibly changes its size, it is
* rendered only after we've figured out the width available to the toolbar.
*
* @returns {React$Node}
*/
_renderToolbar() {
const { _styles } = this.props;
const { buttonStylesBorderless, hangupButtonStyles, toggledButtonStyles } = _styles;
return (
<View
accessibilityRole = 'toolbar'
pointerEvents = 'box-none'
style = { styles.toolbar }>
<AudioMuteButton
styles = { buttonStylesBorderless }
toggledStyles = { toggledButtonStyles } />
<VideoMuteButton
styles = { buttonStylesBorderless }
toggledStyles = { toggledButtonStyles } />
<ChatButton
styles = { buttonStylesBorderless }
toggledStyles = { this._getChatButtonToggledStyle(toggledButtonStyles) } />
<OverflowMenuButton
styles = { buttonStylesBorderless }
toggledStyles = { toggledButtonStyles } />
<HangupButton
styles = { hangupButtonStyles } />
</View>
);
}
} }
/** /**

View File

@ -62,7 +62,7 @@ const styles = {
/** /**
* The style of the toolbar. * The style of the toolbar.
*/ */
toolbar: { toolbox: {
alignItems: 'center', alignItems: 'center',
backgroundColor: ColorPalette.darkBackground, backgroundColor: ColorPalette.darkBackground,
borderRadius: 3, borderRadius: 3,
@ -74,9 +74,9 @@ const styles = {
}, },
/** /**
* The style of the root/top-level {@link Container} of {@link Toolbox}. * The style of the root/top-level container of {@link Toolbox}.
*/ */
toolbox: { toolboxContainer: {
flexDirection: 'column', flexDirection: 'column',
flexGrow: 0, flexGrow: 0,
width: '100%', width: '100%',