diff --git a/App/android/app/build.gradle b/App/android/app/build.gradle index 2b2f7adc..ec49a2d4 100755 --- a/App/android/app/build.gradle +++ b/App/android/app/build.gradle @@ -149,6 +149,7 @@ android { } dependencies { + compile project(':react-native-maps') compile project(':react-native-device-info') compile project(':react-native-material-shadows') compile project(':react-native-linear-gradient') diff --git a/App/android/app/src/main/AndroidManifest.xml b/App/android/app/src/main/AndroidManifest.xml index 94c48efd..46057b3b 100755 --- a/App/android/app/src/main/AndroidManifest.xml +++ b/App/android/app/src/main/AndroidManifest.xml @@ -1,27 +1,30 @@ + package="com.app"> - + - - - - - - - + android:name=".MainApplication" + android:label="@string/app_name" + android:icon="@mipmap/ic_launcher" + android:allowBackup="false" + android:theme="@style/AppTheme"> + + + + + + + + diff --git a/App/android/app/src/main/java/com/app/MainApplication.java b/App/android/app/src/main/java/com/app/MainApplication.java index 8b11f16a..23ca3771 100755 --- a/App/android/app/src/main/java/com/app/MainApplication.java +++ b/App/android/app/src/main/java/com/app/MainApplication.java @@ -3,6 +3,7 @@ package com.app; import android.app.Application; import com.facebook.react.ReactApplication; +import com.airbnb.android.react.maps.MapsPackage; import com.learnium.RNDeviceInfo.RNDeviceInfo; import ui.materialshadows.RNMaterialShadowsPackage; import com.BV.LinearGradient.LinearGradientPackage; @@ -29,6 +30,7 @@ public class MainApplication extends Application implements ReactApplication { protected List getPackages() { return Arrays.asList( new MainReactPackage(), + new MapsPackage(), new RNDeviceInfo(), new RNMaterialShadowsPackage(), new LinearGradientPackage(), diff --git a/App/android/settings.gradle b/App/android/settings.gradle index 7c9cafb3..8dc9c679 100755 --- a/App/android/settings.gradle +++ b/App/android/settings.gradle @@ -1,4 +1,6 @@ rootProject.name = 'app' +include ':react-native-maps' +project(':react-native-maps').projectDir = new File(rootProject.projectDir, '../node_modules/react-native-maps/lib/android') include ':react-native-device-info' project(':react-native-device-info').projectDir = new File(rootProject.projectDir, '../node_modules/react-native-device-info/android') include ':react-native-material-shadows' @@ -11,5 +13,7 @@ include ':react-native-vector-icons' project(':react-native-vector-icons').projectDir = new File(rootProject.projectDir, '../node_modules/react-native-vector-icons/android') include ':react-native-gesture-handler' project(':react-native-gesture-handler').projectDir = new File(rootProject.projectDir, '../node_modules/react-native-gesture-handler/android') +include ':react-native-maps' +project(':react-native-maps').projectDir = new File(rootProject.projectDir, '../node_modules/react-native-maps/lib/android') include ':app' diff --git a/App/app/Router.js b/App/app/Router.js index 74783cfe..cdd6d7c8 100755 --- a/App/app/Router.js +++ b/App/app/Router.js @@ -3,16 +3,23 @@ import { TouchableOpacity, Text, View, - Image + Image, + } from 'react-native'; import { createStackNavigator, createAppContainer, createSwitchNavigator, - createBottomTabNavigator + createBottomTabNavigator, + HeaderBackButton } from 'react-navigation'; import * as Screens from './screens'; +/*Icons*/ +import Icon from "react-native-vector-icons/Ionicons" +import IconF from "react-native-vector-icons/Foundation" +import IconFA from "react-native-vector-icons/FontAwesome5" + import AuthLoadingScreen from './screens/AuthLoading' @@ -25,17 +32,18 @@ import Calendar from './screens/Calendar' import Home from './screens/Home' - -/*Icons*/ -import Icon from "react-native-vector-icons/Ionicons" -import IconF from "react-native-vector-icons/Foundation" -import IconFA from "react-native-vector-icons/FontAwesome5" import Profile from "./screens/Profile"; import editCalendar from './screens/editCalendar'; import choosePath from './screens/choosePath'; import calendarDetail from './screens/calendarDetail'; +const navigationOptions = ({navigation}) => ({ + headerLeft: navigation.goBack(null)}/>, + headerStyle: {backgroundColor: 'transparent', zIndex: 100 }, + +}); + const AppStack = createBottomTabNavigator( { Calendário: { @@ -48,15 +56,15 @@ const AppStack = createBottomTabNavigator( ) }, }, - + 'Jogo do...': { screen: Jogo, navigationOptions: { tabBarIcon: ({tintColor}) => ( - - + + ) }, }, @@ -71,8 +79,8 @@ const AppStack = createBottomTabNavigator( }, }, - - Eventos: { + + Eventos: { screen: Eventos, navigationOptions: { @@ -82,7 +90,7 @@ const AppStack = createBottomTabNavigator( ) }, }, - + Home: { screen: Home, navigationOptions: { @@ -94,7 +102,6 @@ const AppStack = createBottomTabNavigator( }, - }, { initialRouteName: 'Home', @@ -120,51 +127,56 @@ const Stack = createStackNavigator({ return { headerTitle: `${navigation.state.routes[index].routeName}`, headerRight: ( - navigation.navigate('Profile')}> - + navigation.navigate('Profile')}> + editar - + ) } } - else if(navigation.state.routes[index].routeName == 'Calendário'){ + else if (navigation.state.routes[index].routeName == 'Calendário') { return { headerTitle: 'Calendário', headerRight: ( - - navigation.navigate('Edit')}> - FAQ - - + + navigation.navigate('Edit')}> + FAQ + + + + navigation.navigate('choosePath')}> + Escolher + + - navigation.navigate('choosePath')}> - Escolher - - - ) } - } - else if(navigation.state.routes[index].routeName == 'choosePath'){ + } + else if (navigation.state.routes[index].routeName == 'choosePath') { return { headerTitle: 'Calendário', headerRight: ( - - navigation.navigate('Edit')}> - FAQ - - + + navigation.navigate('Edit')}> + FAQ + + + + navigation.navigate('choosePath')}> + Escolher + + - navigation.navigate('choosePath')}> - Escolher - - - ) } - } + } else { return { header: null @@ -175,17 +187,15 @@ const Stack = createStackNavigator({ Profile: { screen: Profile }, - Edit:{ + Edit: { screen: editCalendar }, - choosePath:{ + choosePath: { screen: choosePath }, - calendarDetail:{ - screen:calendarDetail - } - - + calendarDetail: { + screen: calendarDetail, + }, }); @@ -194,7 +204,7 @@ export default createAppContainer(createSwitchNavigator( { AuthLoading: AuthLoadingScreen, App: Stack, - + }, { diff --git a/App/app/components/Nav.js b/App/app/components/Nav.js new file mode 100644 index 00000000..eb06de50 --- /dev/null +++ b/App/app/components/Nav.js @@ -0,0 +1,99 @@ +import React, { Component } from 'react' +import { StyleSheet, Text, View } from 'react-native' +import { Icon } from 'react-native-elements' + +const styles = StyleSheet.create({ + centerRow: { + alignItems: 'flex-start', + backgroundColor: 'transparent', + flex: 3, + flexDirection: 'column', + justifyContent: 'center', + }, + + container: { + backgroundColor: 'transparent', + borderBottomWidth: 0, + elevation: 0, + flexDirection: 'row', + height: 55, + justifyContent: 'center', + left: 0, + marginLeft: 10, + marginRight: 10, + //marginTop: 22, + position: 'absolute', + right: 0, + zIndex: 100, + }, + icon: { + justifyContent: 'flex-start', + marginTop: 2.8, + }, + iconContainer: { + alignSelf: 'center', + }, + leftRow: { + backgroundColor: 'transparent', + flex: 1, + flexDirection: 'row', + justifyContent: 'flex-start', + }, + rightRow: { + alignItems: 'flex-end', + backgroundColor: 'transparent', + flex: 2, + flexDirection: 'row', + justifyContent: 'flex-end', + marginRight: 4, + }, + titleText: { + color: '#000', + fontSize: 24, + fontWeight: '600', + }, + subTitleText: { + color: '#000', + fontSize: 14, + fontWeight: '400', + }, +}); + +class Nav extends Component { + + + render() { + const { navigation, title} = this.props; + + return ( + + + + navigation.goBack(null)} + color= '#000' + iconStyle={styles.icon} + underlayColor="transparent" + underlineColorAndroid="transparent" + containerStyle={styles.iconContainer} + hitSlop={{ top: 15, bottom: 15, left: 15, right: 15 }} + /> + + + + {title} + + + + + + + + ) + } +} + +export default Nav \ No newline at end of file diff --git a/App/app/screens/Scan.js b/App/app/screens/Scan.js index 9eda08b8..fb0702ea 100644 --- a/App/app/screens/Scan.js +++ b/App/app/screens/Scan.js @@ -1,121 +1,174 @@ import React from 'react'; -import { View, Image, Vibration, Dimensions,Text ,Button ,TouchableOpacity } from 'react-native'; +import {View, Image, Vibration, Dimensions, Text, Button, TouchableOpacity, ActivityIndicator} from 'react-native'; import QRCodeScanner from 'react-native-qrcode-scanner'; import {UtilStyles} from '../assets/styles' import CodeInput from 'react-native-confirmation-code-input'; import Modal from "react-native-modal"; +import {TabView, TabBar, SceneMap} from 'react-native-tab-view'; + +import { + RkButton, + RkTheme, RkText +} from 'react-native-ui-kitten'; -import {RkButton, - RkTheme , RkText} from 'react-native-ui-kitten'; +import IconMI from "react-native-vector-icons/MaterialIcons" - const SCREEN_HEIGHT = Dimensions.get("window").height; - const SCREEN_WIDTH = Dimensions.get("window").width; + +const SCREEN_HEIGHT = Dimensions.get("window").height; +const SCREEN_WIDTH = Dimensions.get("window").width; export default class Scan extends React.Component { _toggleModal = () => - this.setState({ isModalVisible: !this.state.isModalVisible }); + this.setState({isModalVisible: !this.state.isModalVisible}); - _activate=()=>{ + _activate = () => { - this.setState({ isModalVisible: !this.state.isModalVisible ,reactivate:true}); + this.setState({isModalVisible: !this.state.isModalVisible, reactivate: true}); this.scanner.reactivate(); } onSuccess = (e) => { - this.setState({ isModalVisible: !this.state.isModalVisible ,isActive:false}); - this.setState({code:e.data}); - }; + this.setState({isModalVisible: !this.state.isModalVisible, isActive: false}); + this.setState({code: e.data}); + }; - state = { - isActive:true, - isRender: true, - reactivate:false, - isModalVisible: false, - code:'' - - } - componentDidMount() { + + state = { + isActive: true, + isRender: true, + reactivate: false, + isModalVisible: false, + code: '', + + index: 0, + routes: [ + {key: 'scan', title: 'Scan', icon: ''}, + {key: 'history', title: 'Histórico', icon: 'history'}, + {key: 'fav', title: 'Favoritos', icon: 'favorite'}, + ], + + }; + + componentDidMount() { this.props.navigation.addListener('willFocus', (route) => { - this.setState({ isRender: true }) + this.setState({isRender: true}) }); this.props.navigation.addListener('willBlur', (route) => { - this.setState({ isRender: false }) + this.setState({isRender: false}) }); - } - - render() { - - { + } - return ( + render() { - - - { this.state.isRender && - - ( + { this.scanner = node }} + ref={(node) => { + this.scanner = node + }} reactivate={false} - + cameraProps={{captureAudio: false}} onRead={this.onSuccess.bind(this)} - showMarker={true} - - cameraStyle={{ height: SCREEN_HEIGHT }} - + cameraStyle={{height: SCREEN_HEIGHT}} fadeIn={true} - customMarker={ - - - - - - - Qr code data: {this.state.code} -