Improved Planex display and webview fullscreen

This commit is contained in:
keplyx 2020-01-30 18:27:51 +01:00
parent 1816175659
commit d654a5d7a8
3 changed files with 7 additions and 5 deletions

View file

@ -5,7 +5,7 @@ import {Container} from "native-base";
import CustomHeader from "./CustomHeader"; import CustomHeader from "./CustomHeader";
import CustomSideMenu from "./CustomSideMenu"; import CustomSideMenu from "./CustomSideMenu";
import CustomMaterialIcon from "./CustomMaterialIcon"; import CustomMaterialIcon from "./CustomMaterialIcon";
import {Platform, View} from "react-native"; import {Platform, View, StatusBar} from "react-native";
import ThemeManager from "../utils/ThemeManager"; import ThemeManager from "../utils/ThemeManager";
import Touchable from "react-native-platform-touchable"; import Touchable from "react-native-platform-touchable";
import {ScreenOrientation} from "expo"; import {ScreenOrientation} from "expo";
@ -80,6 +80,7 @@ export default class BaseContainer extends React.Component<Props, State> {
key: this.props.navigation.state.key, key: this.props.navigation.state.key,
}); });
this.props.navigation.dispatch(setParamsAction); this.props.navigation.dispatch(setParamsAction);
StatusBar.setHidden(isLandscape);
} }
}); });
} }
@ -122,7 +123,7 @@ export default class BaseContainer extends React.Component<Props, State> {
rightButton={this.props.headerRightButton} rightButton={this.props.headerRightButton}
hasTabs={this.props.hasTabs} hasTabs={this.props.hasTabs}
hasBackButton={this.props.hasBackButton}/> hasBackButton={this.props.hasBackButton}/>
: <View style={{paddingTop: 20}}/>} : <View/>}
{this.props.children} {this.props.children}
</Container> </Container>
); );

View file

@ -144,7 +144,8 @@ export default class WebViewScreen extends React.Component<Props> {
hasBackButton={this.props.hasHeaderBackButton} hasBackButton={this.props.hasHeaderBackButton}
hasSideMenu={this.props.hasSideMenu} hasSideMenu={this.props.hasSideMenu}
enableRotation={true} enableRotation={true}
hideHeaderOnLandscape={true}> hideHeaderOnLandscape={true}
hasTabs={this.props.data.length > 1}>
{this.props.data.length === 1 ? {this.props.data.length === 1 ?
this.getWebview(this.props.data[0]) : this.getWebview(this.props.data[0]) :
<Tabs <Tabs

View file

@ -12,7 +12,7 @@ type Props = {
const PLANEX_URL = 'http://planex.insa-toulouse.fr/'; const PLANEX_URL = 'http://planex.insa-toulouse.fr/';
const CUSTOM_CSS_GENERAL = 'https://srv-falcon.etud.insa-toulouse.fr/~amicale_app/custom_css/planex/customMobile2.css'; const CUSTOM_CSS_GENERAL = 'https://srv-falcon.etud.insa-toulouse.fr/~amicale_app/custom_css/planex/customMobile3.css';
const CUSTOM_CSS_NIGHTMODE = 'https://srv-falcon.etud.insa-toulouse.fr/~amicale_app/custom_css/planex/customDark2.css'; const CUSTOM_CSS_NIGHTMODE = 'https://srv-falcon.etud.insa-toulouse.fr/~amicale_app/custom_css/planex/customDark2.css';
// // JS + JQuery functions used to remove alpha from events. Copy paste in browser console for quick testing // // JS + JQuery functions used to remove alpha from events. Copy paste in browser console for quick testing
@ -73,7 +73,7 @@ export default class PlanexScreen extends React.Component<Props> {
this.customInjectedJS = this.customInjectedJS =
'$(document).ready(function() {' + '$(document).ready(function() {' +
OBSERVE_MUTATIONS_INJECTED + OBSERVE_MUTATIONS_INJECTED +
'$("head").append(\'<meta name="viewport" content="width=device-width, initial-scale=0.8">\');' + '$("head").append(\'<meta name="viewport" content="width=device-width, initial-scale=0.7">\');' +
'$("head").append(\'<link rel="stylesheet" href="' + CUSTOM_CSS_GENERAL + '" type="text/css"/>\');'; '$("head").append(\'<link rel="stylesheet" href="' + CUSTOM_CSS_GENERAL + '" type="text/css"/>\');';
if (ThemeManager.getNightMode()) if (ThemeManager.getNightMode())