Initial commit

This is not completed functionality.
This commit is contained in:
bartonstee
2020-09-30 18:19:35 +02:00
committed by GitHub
parent 15477a5341
commit 4cadaa1db7
15 changed files with 20888 additions and 199 deletions

39
src/Backhandler.tsx Normal file
View File

@@ -0,0 +1,39 @@
import { Component, ReactNode, createElement } from "react";
import { TextStyle, ViewStyle, BackHandler, View } from "react-native";
import { Style } from "@mendix/pluggable-widgets-tools";
import { BackhandlerProps } from "../typings/BackhandlerProps";
export interface CustomStyle extends Style {
container: ViewStyle;
label: TextStyle;
}
export class Backhandler extends Component<BackhandlerProps<CustomStyle>> {
constructor(props: BackhandlerProps<CustomStyle>){
super(props)
this.handleBackButtonClick = this.handleBackButtonClick.bind(this);
}
render(): ReactNode {
return (
<View></View>
)
}
componentWillMount() {
if (this.props.disableBack) {
BackHandler.addEventListener('hardwareBackPress', this.handleBackButtonClick);
}
}
componentWillUnmount() {
BackHandler.removeEventListener('hardwareBackPress', this.handleBackButtonClick);
}
handleBackButtonClick() {
return true;
}
}