Compare commits
No commits in common. "cbc1e88a37d136f1759dae5eff3e598bec104152" and "d8f7dc72d454d2fc024b4ffae03c2f71264eb64c" have entirely different histories.
cbc1e88a37
...
d8f7dc72d4
4 changed files with 11 additions and 31 deletions
4
App.js
4
App.js
|
|
@ -15,11 +15,11 @@ import Update from "./src/constants/Update";
|
||||||
import ConnectionManager from "./src/managers/ConnectionManager";
|
import ConnectionManager from "./src/managers/ConnectionManager";
|
||||||
import URLHandler from "./src/utils/URLHandler";
|
import URLHandler from "./src/utils/URLHandler";
|
||||||
import {setSafeBounceHeight} from "react-navigation-collapsible";
|
import {setSafeBounceHeight} from "react-navigation-collapsible";
|
||||||
|
import {enableScreens} from 'react-native-screens';
|
||||||
import SplashScreen from 'react-native-splash-screen'
|
import SplashScreen from 'react-native-splash-screen'
|
||||||
|
|
||||||
// Native optimizations https://reactnavigation.org/docs/react-native-screens
|
// Native optimizations https://reactnavigation.org/docs/react-native-screens
|
||||||
// Crashes app when navigating away from webview on android 9+
|
enableScreens(true);
|
||||||
// enableScreens(true);
|
|
||||||
|
|
||||||
|
|
||||||
YellowBox.ignoreWarnings([ // collapsible headers cause this warning, just ignore as it is not an issue
|
YellowBox.ignoreWarnings([ // collapsible headers cause this warning, just ignore as it is not an issue
|
||||||
|
|
|
||||||
|
|
@ -160,7 +160,7 @@ class ErrorView extends React.PureComponent<Props, State> {
|
||||||
|
|
||||||
const styles = StyleSheet.create({
|
const styles = StyleSheet.create({
|
||||||
outer: {
|
outer: {
|
||||||
height: '100%',
|
height: '99%', // using 100% crashes planex screen for some reason on android 9+
|
||||||
},
|
},
|
||||||
inner: {
|
inner: {
|
||||||
marginTop: 'auto',
|
marginTop: 'auto',
|
||||||
|
|
|
||||||
|
|
@ -18,7 +18,6 @@ type Props = {
|
||||||
collapsibleStack: Object,
|
collapsibleStack: Object,
|
||||||
onMessage: Function,
|
onMessage: Function,
|
||||||
onScroll: Function,
|
onScroll: Function,
|
||||||
showAdvancedControls: boolean,
|
|
||||||
}
|
}
|
||||||
|
|
||||||
const AnimatedWebView = Animated.createAnimatedComponent(WebView);
|
const AnimatedWebView = Animated.createAnimatedComponent(WebView);
|
||||||
|
|
@ -30,7 +29,6 @@ class WebViewScreen extends React.PureComponent<Props> {
|
||||||
|
|
||||||
static defaultProps = {
|
static defaultProps = {
|
||||||
customJS: '',
|
customJS: '',
|
||||||
showAdvancedControls: true,
|
|
||||||
};
|
};
|
||||||
|
|
||||||
webviewRef: Object;
|
webviewRef: Object;
|
||||||
|
|
@ -47,10 +45,9 @@ class WebViewScreen extends React.PureComponent<Props> {
|
||||||
* Creates refresh button after mounting
|
* Creates refresh button after mounting
|
||||||
*/
|
*/
|
||||||
componentDidMount() {
|
componentDidMount() {
|
||||||
|
const rightButton = this.getRefreshButton.bind(this);
|
||||||
this.props.navigation.setOptions({
|
this.props.navigation.setOptions({
|
||||||
headerRight: this.props.showAdvancedControls
|
headerRight: rightButton,
|
||||||
? this.getAdvancedButtons
|
|
||||||
: this.getBasicButton,
|
|
||||||
});
|
});
|
||||||
this.props.navigation.addListener(
|
this.props.navigation.addListener(
|
||||||
'focus',
|
'focus',
|
||||||
|
|
@ -83,22 +80,7 @@ class WebViewScreen extends React.PureComponent<Props> {
|
||||||
*
|
*
|
||||||
* @return {*}
|
* @return {*}
|
||||||
*/
|
*/
|
||||||
getBasicButton = () => {
|
getRefreshButton() {
|
||||||
return (
|
|
||||||
<MaterialHeaderButtons>
|
|
||||||
<Item
|
|
||||||
title="refresh"
|
|
||||||
iconName="refresh"
|
|
||||||
onPress={this.onRefreshClicked}/>
|
|
||||||
<Item
|
|
||||||
title={i18n.t("general.openInBrowser")}
|
|
||||||
iconName="open-in-new"
|
|
||||||
onPress={this.onOpenClicked}/>
|
|
||||||
</MaterialHeaderButtons>
|
|
||||||
);
|
|
||||||
};
|
|
||||||
|
|
||||||
getAdvancedButtons = () => {
|
|
||||||
return (
|
return (
|
||||||
<MaterialHeaderButtons>
|
<MaterialHeaderButtons>
|
||||||
<Item
|
<Item
|
||||||
|
|
@ -119,7 +101,7 @@ class WebViewScreen extends React.PureComponent<Props> {
|
||||||
onPress={this.onOpenClicked}/>
|
onPress={this.onOpenClicked}/>
|
||||||
</MaterialHeaderButtons>
|
</MaterialHeaderButtons>
|
||||||
);
|
);
|
||||||
}
|
};
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Callback to use when refresh button is clicked. Reloads the webview.
|
* Callback to use when refresh button is clicked. Reloads the webview.
|
||||||
|
|
|
||||||
|
|
@ -207,11 +207,10 @@ class PlanexScreen extends React.Component<Props, State> {
|
||||||
+ 'true;'; // Prevents crash on ios
|
+ 'true;'; // Prevents crash on ios
|
||||||
}
|
}
|
||||||
|
|
||||||
shouldComponentUpdate(nextProps: Props): boolean {
|
// componentWillUpdate(prevProps: Props) {
|
||||||
if (nextProps.theme.dark !== this.props.theme.dark)
|
// if (prevProps.theme.dark !== this.props.theme.dark)
|
||||||
this.generateInjectedJS(this.state.currentGroup.id);
|
// this.generateInjectedCSS();
|
||||||
return true;
|
// }
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Callback used when closing the banner.
|
* Callback used when closing the banner.
|
||||||
|
|
@ -292,7 +291,6 @@ class PlanexScreen extends React.Component<Props, State> {
|
||||||
customJS={this.customInjectedJS}
|
customJS={this.customInjectedJS}
|
||||||
onMessage={this.onMessage}
|
onMessage={this.onMessage}
|
||||||
onScroll={this.onScroll}
|
onScroll={this.onScroll}
|
||||||
showAdvancedControls={false}
|
|
||||||
/>
|
/>
|
||||||
</View>
|
</View>
|
||||||
);
|
);
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue