Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

W.I.P. feat(mobile/navigation): reorganized transitions and added carmode tile view case #15315

Draft
wants to merge 1 commit into
base: master
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ import Conference from '../../../../../conference/components/native/Conference';
// @ts-ignore
import CarMode from '../../../../../conference/components/native/carmode/CarMode';
// @ts-ignore
import { arePollsDisabled } from '../../../../../conference/functions';
import { arePollsDisabled } from '../../../../../conference/functions.native';
// @ts-ignore
import SharedDocument from '../../../../../etherpad/components/native/SharedDocument';
// @ts-ignore
Expand All @@ -43,12 +43,14 @@ import SpeakerStats
import LanguageSelectorDialog
// @ts-ignore
from '../../../../../subtitles/components/native/LanguageSelectorDialog';
import { shouldDisplayTileView } from '../../../../../video-layout/functions.native';
import Whiteboard from '../../../../../whiteboard/components/native/Whiteboard';
// @ts-ignore
import { screen } from '../../../routes';
import {
breakoutRoomsScreenOptions,
carmodeScreenOptions,
carmodeScreenOptionsInTileView,
chatScreenOptions,
conferenceScreenOptions,
gifsMenuOptions,
Expand Down Expand Up @@ -84,9 +86,11 @@ const ConferenceStack = createStackNavigator();

const ConferenceNavigationContainer = () => {
const isPollsDisabled = useSelector(arePollsDisabled);
const isInTileview = useSelector(shouldDisplayTileView);
let ChatScreen;
let chatScreenName;
let chatTitleString;
let carModeScreenOptions;

if (isPollsDisabled) {
ChatScreen = Chat;
Expand All @@ -97,6 +101,12 @@ const ConferenceNavigationContainer = () => {
chatScreenName = screen.conference.chatandpolls.main;
chatTitleString = 'chat.titleWithPolls';
}

if (isInTileview) {
carModeScreenOptions = carmodeScreenOptionsInTileView;
} else {
carModeScreenOptions = carmodeScreenOptions;
}
const { t } = useTranslation();

return (
Expand Down Expand Up @@ -199,7 +209,7 @@ const ConferenceNavigationContainer = () => {
component = { CarMode }
name = { screen.conference.carmode }
options = {{
...carmodeScreenOptions,
...carModeScreenOptions,
title: t('carmode.labels.title')
}} />
<ConferenceStack.Screen
Expand Down
38 changes: 28 additions & 10 deletions react/features/mobile/navigation/screenOptions.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,24 +8,31 @@ import { goBack as goBackToLobbyScreen } from './components/lobby/LobbyNavigatio
import { lobbyScreenHeaderCloseButton, screenHeaderCloseButton } from './functions';
import { goBack as goBackToWelcomeScreen } from './rootNavigationContainerRef';


/**
* Default modal transition for the current platform.
* Modal transition for the current platform.
*/
export const modalPresentation = Platform.select({
const modalPresentation = Platform.select({
ios: TransitionPresets.ModalPresentationIOS,
default: TransitionPresets.DefaultTransition
});

/**
* Screen options and transition types.
* Full Screen options.
*/
export const fullScreenOptions = {
const fullScreenOptions = {
...TransitionPresets.ModalTransition,
gestureEnabled: false,
headerShown: false
};

/**
* Transition type for the current platform.
*/
const carmodeTileViewTransition = Platform.select({
ios: TransitionPresets.SlideFromRightIOS,
default: TransitionPresets.DefaultTransition
});

/**
* Navigation container theme.
*/
Expand All @@ -40,11 +47,6 @@ export const navigationContainerTheme = {
*/
export const welcomeScreenOptions = {
...TransitionPresets.ModalTransition,
gestureEnabled: false,
headerShown: true,
headerStyle: {
backgroundColor: BaseTheme.palette.ui01
},
headerTitleStyle: {
color: BaseTheme.palette.text01
}
Expand Down Expand Up @@ -101,6 +103,22 @@ export const breakoutRoomsScreenOptions = presentationScreenOptions;
*/
export const carmodeScreenOptions = presentationScreenOptions;

/**
* Screen options for car mode in tile view.
*/
export const carmodeScreenOptionsInTileView = {
...carmodeTileViewTransition,
gestureEnabled: true,
headerLeft: () => screenHeaderCloseButton(goBack),
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@saghul As I mentioned in the description, I added a close button after the screen recording was done.

headerShown: true,
headerStyle: {
backgroundColor: BaseTheme.palette.ui01
},
headerTitleStyle: {
color: BaseTheme.palette.text01
}
};

/**
* Screen options for chat.
*/
Expand Down