diff --git a/.gitignore b/.gitignore index c34fb51e..81e27181 100755 --- a/.gitignore +++ b/.gitignore @@ -84,4 +84,5 @@ typings/ bin/ obj/ -.vscode/ \ No newline at end of file +.vscode/ +*.cache diff --git a/App/android/app/build.gradle b/App/android/app/build.gradle index a1922356..2b2f7adc 100755 --- a/App/android/app/build.gradle +++ b/App/android/app/build.gradle @@ -149,6 +149,7 @@ android { } dependencies { + compile project(':react-native-device-info') compile project(':react-native-material-shadows') compile project(':react-native-linear-gradient') compile project(':react-native-camera') 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 4333e258..8b11f16a 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.learnium.RNDeviceInfo.RNDeviceInfo; import ui.materialshadows.RNMaterialShadowsPackage; import com.BV.LinearGradient.LinearGradientPackage; import org.reactnative.camera.RNCameraPackage; @@ -28,6 +29,7 @@ public class MainApplication extends Application implements ReactApplication { protected List getPackages() { return Arrays.asList( new MainReactPackage(), + new RNDeviceInfo(), new RNMaterialShadowsPackage(), new LinearGradientPackage(), new RNCameraPackage(), diff --git a/App/android/settings.gradle b/App/android/settings.gradle index 1993962a..7c9cafb3 100755 --- a/App/android/settings.gradle +++ b/App/android/settings.gradle @@ -1,4 +1,6 @@ rootProject.name = 'app' +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' project(':react-native-material-shadows').projectDir = new File(rootProject.projectDir, '../node_modules/react-native-material-shadows/android') include ':react-native-linear-gradient' diff --git a/App/app/App.js b/App/app/App.js index 44157fe4..b4f401ee 100755 --- a/App/app/App.js +++ b/App/app/App.js @@ -40,12 +40,16 @@ const SCREEN_HEIGHT = Dimensions.get("window").height; const SCREEN_WIDTH = Dimensions.get("window").width; import Swiper from 'react-native-swiper'; +var TimerMixin = require('react-timer-mixin'); function handleConnectivityChange() { console.log("asdasd"); } + class App extends Component { - + handleConnectivityChange = isConnected => { + this.setState({ isConnected }); + } _activate=()=>{ this.setState({ isModalVisible: !this.state.isModalVisible}); @@ -84,8 +88,9 @@ class App extends Component { username:'QR code', failedAttempt: false, push:4, - UI_loginScannerActive:false - + UI_loginScannerActive:false, + userDetails:{username:'', password:''}, + isConnected: true }; } @@ -102,19 +107,19 @@ class App extends Component { componentDidMount() { - - NetInfo.isConnected.addEventListener('connectionChange', this.handleConnectivityChange); + this.props.hold(); + NetInfo.isConnected.addEventListener('connectionChange', this.handleConnectivityChange); this.setState({isModalVisible: false}) //verifica se o utilizador tem token guardado - this.props.checkUser(); + this.props.checkUser(this.props.userDetails); this.keyboardDidShowListener = Keyboard.addListener('keyboardDidShow', this._keyboardDidShow); this.keyboardDidHideListener = Keyboard.addListener('keyboardDidHide', this._keyboardDidHide); } componentWillUnmount() { - NetInfo.isConnected.removeEventListener('connectionChange', this.handleConnectivityChange); + NetInfo.isConnected.removeEventListener('connectionChange', this.handleConnectivityChange); } _keyboardDidShow () { @@ -130,9 +135,9 @@ class App extends Component { } onSuccess = (e) => { - // this.setState({ isModalVisible: !this.state.isModalVisible }); - // this.props.login(e.data, 'f8908cc0'); - this.props.closeLoginQRScan(); + // this.setState({ isModalVisible: !this.state.isModalVisible }); + // this.props.login(e.data, 'f8908cc0'); + this.props.closeLoginQRScan(); this.setState({username:e.data}) console.log("QR code lido"); @@ -142,8 +147,14 @@ class App extends Component { }; render() { - - if (!this.props.logged) { + if (!this.state.isConnected) { + return ( + + cenas da vida + + ); + } + if (!this.props.logged && this.props.onHold) { return ( @@ -530,7 +541,8 @@ mapStateToProps = (state, props) => { onHold: state.apiReducer.onHold, logged: state.apiReducer.logged, failedAttempt:state.apiReducer.failedAttempt, - UI_loginScannerActive: state.uiReducer.UI_loginScannerActive + UI_loginScannerActive: state.uiReducer.UI_loginScannerActive, + userDetails: state.apiReducer.userDetails, } }; diff --git a/App/app/Router.js b/App/app/Router.js index 351b8b7f..74783cfe 100755 --- a/App/app/Router.js +++ b/App/app/Router.js @@ -2,7 +2,8 @@ import React from 'react'; import { TouchableOpacity, Text, - View + View, + Image } from 'react-native'; import { createStackNavigator, @@ -17,7 +18,7 @@ import AuthLoadingScreen from './screens/AuthLoading' import Eventos from './screens/Eventos' -import Social from './screens/Social' +import Jogo from './screens/Jogo' import Scan from './screens/Scan' import Calendar from './screens/Calendar' @@ -37,7 +38,7 @@ import calendarDetail from './screens/calendarDetail'; const AppStack = createBottomTabNavigator( { - Calendar: { + Calendário: { screen: Calendar, navigationOptions: { @@ -48,13 +49,14 @@ const AppStack = createBottomTabNavigator( }, }, - Social: { - screen: Social, + 'Jogo do...': { + screen: Jogo, navigationOptions: { tabBarIcon: ({tintColor}) => ( - + + ) }, }, @@ -100,7 +102,7 @@ const AppStack = createBottomTabNavigator( tabBarOptions: { showLabel: true, // hide labels activeTintColor: '#CC1A17', // active icon color - inactiveTintColor: '#d8d6c9', // inactive icon color + inactiveTintColor: 'black', // inactive icon color style: { backgroundColor: '#fff' // TabBar background } @@ -127,7 +129,25 @@ const Stack = createStackNavigator({ ) } } - else if(navigation.state.routes[index].routeName == 'Calendar'){ + else if(navigation.state.routes[index].routeName == 'Calendário'){ + return { + headerTitle: 'Calendário', + headerRight: ( + + navigation.navigate('Edit')}> + FAQ + + + + navigation.navigate('choosePath')}> + Escolher + + + + ) + } + } + else if(navigation.state.routes[index].routeName == 'choosePath'){ return { headerTitle: 'Calendário', headerRight: ( @@ -145,7 +165,6 @@ const Stack = createStackNavigator({ ) } } - else { return { header: null diff --git a/App/app/assets/53060147_934731486858214_2889790267471167488_o.jpg b/App/app/assets/53060147_934731486858214_2889790267471167488_o.jpg new file mode 100644 index 00000000..effc11c7 Binary files /dev/null and b/App/app/assets/53060147_934731486858214_2889790267471167488_o.jpg differ diff --git a/App/app/assets/altice.png b/App/app/assets/altice.png new file mode 100644 index 00000000..17bdf0de Binary files /dev/null and b/App/app/assets/altice.png differ diff --git a/App/app/assets/altice_logo.png b/App/app/assets/altice_logo.png new file mode 100644 index 00000000..cde50fb0 Binary files /dev/null and b/App/app/assets/altice_logo.png differ diff --git a/App/app/assets/img/bg-4.png b/App/app/assets/img/bg-4.png new file mode 100644 index 00000000..6745f558 Binary files /dev/null and b/App/app/assets/img/bg-4.png differ diff --git a/App/app/assets/img/jogo/critical.png b/App/app/assets/img/jogo/critical.png new file mode 100644 index 00000000..adbe201e Binary files /dev/null and b/App/app/assets/img/jogo/critical.png differ diff --git a/App/app/assets/img/jogo/enei.png b/App/app/assets/img/jogo/enei.png new file mode 100644 index 00000000..0405e324 Binary files /dev/null and b/App/app/assets/img/jogo/enei.png differ diff --git a/App/app/assets/img/jogo/enei_black.png b/App/app/assets/img/jogo/enei_black.png new file mode 100644 index 00000000..a007debf Binary files /dev/null and b/App/app/assets/img/jogo/enei_black.png differ diff --git a/App/app/assets/img/jogo/enei_black_2.png b/App/app/assets/img/jogo/enei_black_2.png new file mode 100644 index 00000000..b0453234 Binary files /dev/null and b/App/app/assets/img/jogo/enei_black_2.png differ diff --git a/App/app/assets/img/jogo/novabase.png b/App/app/assets/img/jogo/novabase.png new file mode 100644 index 00000000..3191fac4 Binary files /dev/null and b/App/app/assets/img/jogo/novabase.png differ diff --git a/App/app/assets/img/jogo/ubiwhere.png b/App/app/assets/img/jogo/ubiwhere.png new file mode 100644 index 00000000..34536eec Binary files /dev/null and b/App/app/assets/img/jogo/ubiwhere.png differ diff --git a/App/app/assets/img/logo_trans.png b/App/app/assets/img/logo_trans.png new file mode 100644 index 00000000..32698a3c Binary files /dev/null and b/App/app/assets/img/logo_trans.png differ diff --git a/App/app/assets/img/logos/ubiwhere.png b/App/app/assets/img/logos/ubiwhere.png new file mode 100644 index 00000000..51ced13c Binary files /dev/null and b/App/app/assets/img/logos/ubiwhere.png differ diff --git a/App/app/assets/logo_black.jpg b/App/app/assets/logo_black.jpg new file mode 100644 index 00000000..d2a13fe6 Binary files /dev/null and b/App/app/assets/logo_black.jpg differ diff --git a/App/app/assets/novabase-logo.svg b/App/app/assets/novabase-logo.svg new file mode 100644 index 00000000..a95c8ce5 --- /dev/null +++ b/App/app/assets/novabase-logo.svg @@ -0,0 +1,101 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/App/app/screens/Home.js b/App/app/screens/Home.js index ce16bc7a..ff426610 100755 --- a/App/app/screens/Home.js +++ b/App/app/screens/Home.js @@ -11,7 +11,8 @@ import { StyleSheet, Image, ImageBackground, - NetInfo + NetInfo, + AppState } from 'react-native'; import {Shadow} from 'react-native-shadow' @@ -38,10 +39,14 @@ const SCREEN_WIDTH = Dimensions.get("window").width; import {Card, Divider} from 'react-native-elements' import RNMaterialShadows from 'react-native-material-shadows'; - + + class Home extends Component { - + _handleConnectionChange = (isConnected) => { + // this.props.dispatch(connectionState({ status: isConnected })); + console.log("fck that") + }; _refresh() { return new Promise((resolve) => { setTimeout(()=>{resolve()}, 2000) @@ -60,21 +65,27 @@ class Home extends Component { token: {valid: false}, logged: true, onHold: true, - user: {Name: ''} + user: {Name: ''}, + userDetails:{}, + appState: AppState.currentState, }; } - handleConnectivityChange = () => { + handleConnectivityChange = () => { console.log("asdasdasdasdasd"); } - componentDidMount() { - NetInfo.isConnected.addEventListener('connectionChange', this.handleConnectivityChange); - this.props.hold(); + componentDidMount() { + + // NetInfo.isConnected.addEventListener('connectionChange', this.handleConnectivityChange); + + // this.props.hold(); + console.log("hold"+ this.props.onHold) //this.props.logoutUser(); //console.log(this.props.token); - this.props.getUserInfo(this.props.token); + + this.props.getUserInfo(this.props.userDetails.token); //console.log('logged:'+this.props.logged); @@ -85,7 +96,7 @@ class Home extends Component { } componentWillUnmount() { - NetInfo.isConnected.removeEventListener('connectionChange', this.handleConnectivityChange); + } bClick() { @@ -101,8 +112,8 @@ class Home extends Component { //var navigate = this.props.navigation.navigate } _update=()=>{ - if(this.props.token!= undefined) - this.props.getUserInfo(this.props.token); + + this.props.getUserInfo(this.props.userDetails.token); } @@ -173,36 +184,6 @@ _update=()=>{ - - - - {this.props.user.Job} - - - - - {this.props.user.Email} - - - - - {this.props.user.Mobile} - - - - - {this.props.user.Address}, {this.props.user.City} - - - - - O meu Curriculo - - - - - - @@ -342,7 +323,9 @@ function mapStateToProps(state, props) { token: state.apiReducer.token, user: state.apiReducer.user, - logged: state.apiReducer.logged + logged: state.apiReducer.logged, + userDetails: state.apiReducer.userDetails, + onHold: state.apiReducer.onHold } } diff --git a/App/app/screens/Jogo.js b/App/app/screens/Jogo.js new file mode 100644 index 00000000..26738857 --- /dev/null +++ b/App/app/screens/Jogo.js @@ -0,0 +1,722 @@ +import React from 'react'; +import { + StyleSheet, + Text, + View, + ImageBackground, + Dimensions, + Button, + TouchableOpacity +} from 'react-native'; +import ProgressBarAnimated from 'react-native-progress-bar-animated'; +import Modal from "react-native-modal"; + + +import IconF from "react-native-vector-icons/Foundation" +import IconFA from "react-native-vector-icons/FontAwesome5" +import { ScrollView, ViewPagerAndroid } from 'react-native-gesture-handler'; + + +const SCREEN_HEIGHT = Dimensions.get("window").height; +const SCREEN_WIDTH = Dimensions.get("window").width; + +import FitImage from 'react-native-fit-image'; +export default class Jogo extends React.Component { +state = { + progress: 20, + progressWithOnComplete: 0, + progressCustomized: 0, + isModalVisible: false, + } ; + increase = (key, value) => { + this.setState({ + [key]: this.state[key] + value, + }); + } + + _toggleModal = () =>{ + this.setState({ isModalVisible: !this.state.isModalVisible }); + console.log("assd") + } + + render() { + + const { navigate } = this.props.navigation; + + + const progressCustomStyles = { + backgroundColor: 'red', + borderRadius: 0, + borderColor: 'orange', + }; + + const barWidth = Dimensions.get('screen').width - 30; + + + + + + return ( + + + + + + + + + + + +