<|start_filename|>example/package.json<|end_filename|>
{
  "name": "example",
  "version": "0.0.1",
  "private": true,
  "scripts": {
    "start": "node node_modules/react-native/local-cli/cli.js start",
    "setupDev" : "mkdir node_modules/react-native-kiosk-mode/; rm -rf node_modules/react-native-kiosk-mode/index.js node_modules/react-native-kiosk-mode/android; ln -s  ../../../android/ node_modules/react-native-kiosk-mode/android;ln -s  ../../../index.js node_modules/react-native-kiosk-mode/index.js; cp ../package.json node_modules/react-native-kiosk-mode/"
  },
  "dependencies": {
    "react-native": "^0.21.0",
    "react-native-router-flux": "^2.3.9"
  }
}


<|start_filename|>example/index.js<|end_filename|>
/**
 * Sample React Native App
 * https://github.com/facebook/react-native
 */
'use strict';
import React, {
    AppRegistry,
    Component,
    StyleSheet,
    Text,
    ScrollView,
    Dimensions,
    TouchableWithoutFeedback,
    TouchableHighlight,
    TextInput,
    View,
    Image
} from 'react-native';

import KioskMode, {KioskMode} from 'react-native-kiosk-mode'

import {
    Actions,
    Router,
    Route,
    Schema,
    Animations,
    TabBar
} from 'react-native-router-flux'

class Example extends Component {
    constructor(a, b) {
        super(a, b)
        this.state = {
            focus: true
        }
    }
    ComponentWillMount() {
        KioskMode.onKioskMode();
    }
    render() {

        return (
            <Immersive />
        );
    }
}

class main extends Component {
    render() {
        return (
            <Router hideNavBar={true}>
                <Route name="Main" type="reset" component={Example}/>
            </Router>
        )
    }
}

const {height, width} = Dimensions.get('window');
const styles = StyleSheet.create({
    container: {
        flex: 1,
        backgroundColor: '#F5FCFF'
    },
    image: {
        height: 200
    }
});

AppRegistry.registerComponent('example', () => main);


<|start_filename|>index.js<|end_filename|>
import React, {Component} from 'react';

import {NativeModules, View, Keyboard, Platform, TouchableWithoutFeedback} from 'react-native';

const KioskMode = NativeModules.KioskMode
export default KioskMode;

import _ from 'lodash';

export class Immersive extends Component {
    constructor(props, context) {
        super(props, context)
        this.autoKioskMode = _.debounce(KioskMode.autoKioskMode, 200);
    }
    componentWillMount() {
        this.keyboardDidHideListener = Keyboard.addListener('keyboardDidHide', this._keyboardDidHide);
    }
    _keyboardDidHide() {
        KioskMode.autoKioskMode();
    }

    autoKioskMode() {
        KioskMode.autoKioskMode();
    }

    render() {
        return (this.autoKioskMode() || null);
    }
}


<|start_filename|>package.json<|end_filename|>
{
  "name": "react-native-kiosk-mode",
  "version": "0.0.2",
  "description": "React Native KioskMode plugin",
  "main": "index.js",
  "scripts": {
    "test": "test"
  },
  "repository": {
    "type": "git",
    "url": "git+https://github.com/sciphergfx/react-native-kiosk-mode.git"
  },
  "keywords": [
    "react-native",
    "android",
    "react-component"
  ],
  "author": "<NAME>",
  "license": "MIT",
  "bugs": {
    "url": "https://github.com/sciphergfx/react-native-kiosk-mode/issues"
  },
  "homepage": "https://github.com/sciphergfx/react-native-kiosk-mode#readme",
  "dependencies": {
    "debounce": "^1.0.0"
  }
}
