1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950 |
- /**
- * Sample React Native App
- * https://github.com/facebook/react-native
- *
- * @format
- * @flow
- */
- import React, {Component} from 'react';
- import {Platform, StyleSheet, Text, View,Toast} from 'react-native';
- import QRScannerView from './qr'
- export default class DefaultScreen extends Component {
- render() {
- return (
- < QRScannerView
- onScanResultReceived={this.barcodeReceived.bind(this)}
- renderTopBarView={() => this._renderTitleBar()}
- renderBottomMenuView={() => this._renderMenu()}
- />
- )
- }
- _renderTitleBar(){
- return(
- <Text
- style={{color:'white',textAlignVertical:'center', textAlign:'center',font:20,padding:12}}
- >Here is title bar</Text>
- );
- }
- _renderMenu() {
- return (
- <Text
- style={{color:'white',textAlignVertical:'center', textAlign:'center',font:20,padding:12}}
- >
- Here is bottom menu
- </Text>
- )
- }
- barcodeReceived(e) {
- alert('Type: ' + e.type + '\nData: ' + e.data);
- //console.log(e)
- }
- }
|