Skip to content

Jitsi Meet - Secure, Simple and Scalable Video Conferences that you use as a standalone app or embed in your web application.

feat(mobile/navigation) updated screens that have footer

Calinteodorfbf693b2dc91
diff --git a/react/features/base/modal/components/JitsiKeyboardAvoidingView.js b/react/features/base/modal/components/JitsiKeyboardAvoidingView.js
index c7ce94e098..740987642d 100644
--- a/react/features/base/modal/components/JitsiKeyboardAvoidingView.js
+++ b/react/features/base/modal/components/JitsiKeyboardAvoidingView.js
@@ -1,13 +1,13 @@
// @flow
-import { useHeaderHeight } from '@react-navigation/elements';
+import { getDefaultHeaderHeight } from '@react-navigation/elements';
import React, { useEffect, useState } from 'react';
import {
KeyboardAvoidingView,
Platform,
StatusBar
} from 'react-native';
-import { useSafeAreaInsets } from 'react-native-safe-area-context';
+import { useSafeAreaFrame, useSafeAreaInsets } from 'react-native-safe-area-context';
import { StyleType } from '../../styles';
@@ -33,6 +33,11 @@ type Props = {
*/
hasTabNavigator: boolean,
+ /**
+ * Is the screen presented as a modal?
+ */
+ isModalPresentation: boolean,
+
/**
* Additional style to be appended to the KeyboardAvoidingView.
*/
@@ -45,26 +50,33 @@ const JitsiKeyboardAvoidingView = (
contentContainerStyle,
hasTabNavigator,
hasBottomTextInput,
+ isModalPresentation,
style
}: Props) => {
- const headerHeight = useHeaderHeight();
+ const frame = useSafeAreaFrame();
const insets = useSafeAreaInsets();
const [ bottomPadding, setBottomPadding ] = useState(insets.bottom);
+ const [ topPadding, setTopPadding ] = useState(insets.top);
useEffect(() => {
// This useEffect is needed because insets are undefined at first for some reason
// https://github.com/th3rdwave/react-native-safe-area-context/issues/54
setBottomPadding(insets.bottom);
+ setTopPadding(insets.top);
+ }, [ insets.bottom, insets.top ]);
- }, [ insets.bottom ]);
+ const headerHeight = getDefaultHeaderHeight(frame, isModalPresentation, topPadding);
+ // Notch devices have in general a header height between 103 and 106px
+ const topNotchDevice = headerHeight > 100;
+ const deviceHeight = topNotchDevice ? headerHeight - 50 : headerHeight;
const tabNavigatorPadding
- = hasTabNavigator ? headerHeight : 0;
+ = hasTabNavigator ? deviceHeight : 0;
const noNotchDevicePadding = bottomPadding || 10;
const iosVerticalOffset
- = headerHeight + noNotchDevicePadding + tabNavigatorPadding;
+ = deviceHeight + noNotchDevicePadding + tabNavigatorPadding;
const androidVerticalOffset = hasBottomTextInput
- ? headerHeight + StatusBar.currentHeight : headerHeight;
+ ? deviceHeight + StatusBar.currentHeight : deviceHeight;
return (
<KeyboardAvoidingView
diff --git a/react/features/base/modal/components/JitsiScreen.js b/react/features/base/modal/components/JitsiScreen.js
index b8b589432b..ff868fcab8 100644
--- a/react/features/base/modal/components/JitsiScreen.js
+++ b/react/features/base/modal/components/JitsiScreen.js
@@ -37,6 +37,11 @@ type Props = {
*/
hasTabNavigator?: boolean,
+ /**
+ * Is the screen presented as a modal?
+ */
+ isModalPresentation?: boolean,
+
/**
* Insets for the SafeAreaView.
*/
@@ -54,7 +59,8 @@ const JitsiScreen = ({
footerComponent,
hasTabNavigator = false,
hasBottomTextInput = false,
- safeAreaInsets = [ 'bottom', 'left', 'right' ],
+ isModalPresentation = true,
+ safeAreaInsets = [ 'left', 'right' ],
style
}: Props) => (
<View
@@ -63,6 +69,7 @@ const JitsiScreen = ({
contentContainerStyle = { contentContainerStyle }
hasBottomTextInput = { hasBottomTextInput }
hasTabNavigator = { hasTabNavigator }
+ isModalPresentation = { isModalPresentation }
style = { style }>
<SafeAreaView
edges = { safeAreaInsets }
diff --git a/react/features/chat/components/native/styles.js b/react/features/chat/components/native/styles.js
index ab106815ac..f289ca2b42 100644
--- a/react/features/chat/components/native/styles.js
+++ b/react/features/chat/components/native/styles.js
@@ -56,7 +56,8 @@ export default {
borderTopColor: 'rgb(209, 219, 231)',
borderTopWidth: 1,
flexDirection: 'row',
- paddingHorizontal: BoxModel.padding
+ paddingBottom: '4%',
+ paddingHorizontal: BaseTheme.spacing[3]
},
inputField: {
diff --git a/react/features/conference/components/native/carmode/Conference.tsx b/react/features/conference/components/native/carmode/Conference.tsx
index f78f2c17d8..5bb6ec9c6c 100644
--- a/react/features/conference/components/native/carmode/Conference.tsx
+++ b/react/features/conference/components/native/carmode/Conference.tsx
@@ -1,11 +1,13 @@
import React, { useEffect } from 'react';
import { useTranslation } from 'react-i18next';
-import { Text, SafeAreaView, View } from 'react-native';
+import { Text, View } from 'react-native';
import { withSafeAreaInsets } from 'react-native-safe-area-context';
import { useDispatch, useSelector } from 'react-redux';
-import JitsiScreen from '../../../../base/modal/components/JitsiScreen';
+import JitsiScreen from '../../../../base/modal/components/JitsiScreen';
import { LoadingIndicator, TintedView } from '../../../../base/react';
+import { isLocalVideoTrackDesktop } from '../../../../base/tracks';
+import { setPictureInPictureDisabled } from '../../../../mobile/picture-in-picture/functions';
import { setIsCarmode } from '../../../../video-layout/actions';
import ConferenceTimer from '../../ConferenceTimer';
import { isConnecting } from '../../functions';
@@ -15,8 +17,6 @@ import MicrophoneButton from './MicrophoneButton';
import SoundDeviceButton from './SoundDeviceButton';
import TitleBar from './TitleBar';
import styles from './styles';
-import { isLocalVideoTrackDesktop } from '../../../../base/tracks';
-import { setPictureInPictureDisabled } from '../../../../mobile/picture-in-picture/functions';
/**
* Implements the carmode tab.
@@ -38,7 +38,7 @@ const CarmodeTab = (): JSX.Element => {
if (!isSharing) {
setPictureInPictureDisabled(false);
}
- }
+ };
}, []);
return (
diff --git a/react/features/invite/components/add-people-dialog/native/AddPeopleDialog.js b/react/features/invite/components/add-people-dialog/native/AddPeopleDialog.js
index cb434fe551..b2c8c5156f 100644
--- a/react/features/invite/components/add-people-dialog/native/AddPeopleDialog.js
+++ b/react/features/invite/components/add-people-dialog/native/AddPeopleDialog.js
@@ -230,7 +230,6 @@ class AddPeopleDialog extends AbstractAddPeopleDialog<Props, State> {
data = { inviteItems }
horizontal = { true }
keyExtractor = { this._keyExtractor }
- keyboardShouldPersistTaps = 'always'
renderItem = { this._renderInvitedItem } />
</View> }
<View style = { styles.resultList }>
@@ -239,7 +238,6 @@ class AddPeopleDialog extends AbstractAddPeopleDialog<Props, State> {
data = { selectableItems }
extraData = { inviteItems }
keyExtractor = { this._keyExtractor }
- keyboardShouldPersistTaps = 'always'
renderItem = { this._renderItem } />
</View>
</JitsiScreen>
diff --git a/react/features/polls/components/native/PollCreate.js b/react/features/polls/components/native/PollCreate.js
index c073a0c489..e08010b73e 100644
--- a/react/features/polls/components/native/PollCreate.js
+++ b/react/features/polls/components/native/PollCreate.js
@@ -169,7 +169,6 @@ const PollCreate = (props: AbstractProps) => {
style = { chatStyles.pollCreateButton } >
{t('polls.create.cancel')}
</Button>
-
<Button
color = { BaseTheme.palette.screen01Header }
disabled = { isSubmitDisabled }
diff --git a/react/features/polls/components/native/styles.js b/react/features/polls/components/native/styles.js
index 23bc4abe08..666b6bc6f1 100644
--- a/react/features/polls/components/native/styles.js
+++ b/react/features/polls/components/native/styles.js
@@ -154,12 +154,12 @@ export const chatStyles = createStyleSheet({
},
pollCreateButtonsContainer: {
- paddingVertical: BaseTheme.spacing[2]
+ paddingVertical: '8%'
},
pollCreateButton: {
flex: 1,
- marginHorizontal: 8
+ marginHorizontal: BaseTheme.spacing[2]
},
pollSendLabel: {
@@ -200,7 +200,8 @@ export const chatStyles = createStyleSheet({
createPollButton: {
padding: 8,
- margin: BaseTheme.spacing[2]
+ marginHorizontal: BaseTheme.spacing[2],
+ marginVertical: BaseTheme.spacing[4]
},
PollPane: {