diff --git a/App/android/app/build.gradle b/App/android/app/build.gradle index fe0d7551..a1922356 100755 --- a/App/android/app/build.gradle +++ b/App/android/app/build.gradle @@ -149,6 +149,7 @@ android { } dependencies { + compile project(':react-native-material-shadows') compile project(':react-native-linear-gradient') compile project(':react-native-camera') compile project(':react-native-vector-icons') diff --git a/App/android/app/src/main/assets/fonts/AntDesign.ttf b/App/android/app/src/main/assets/fonts/AntDesign.ttf old mode 100755 new mode 100644 diff --git a/App/android/app/src/main/assets/fonts/Entypo.ttf b/App/android/app/src/main/assets/fonts/Entypo.ttf old mode 100755 new mode 100644 diff --git a/App/android/app/src/main/assets/fonts/EvilIcons.ttf b/App/android/app/src/main/assets/fonts/EvilIcons.ttf old mode 100755 new mode 100644 diff --git a/App/android/app/src/main/assets/fonts/FontAwesome.ttf b/App/android/app/src/main/assets/fonts/FontAwesome.ttf old mode 100755 new mode 100644 diff --git a/App/android/app/src/main/assets/fonts/FontAwesome5_Brands.ttf b/App/android/app/src/main/assets/fonts/FontAwesome5_Brands.ttf old mode 100755 new mode 100644 diff --git a/App/android/app/src/main/assets/fonts/FontAwesome5_Regular.ttf b/App/android/app/src/main/assets/fonts/FontAwesome5_Regular.ttf old mode 100755 new mode 100644 diff --git a/App/android/app/src/main/assets/fonts/FontAwesome5_Solid.ttf b/App/android/app/src/main/assets/fonts/FontAwesome5_Solid.ttf old mode 100755 new mode 100644 diff --git a/App/android/app/src/main/assets/fonts/Foundation.ttf b/App/android/app/src/main/assets/fonts/Foundation.ttf old mode 100755 new mode 100644 diff --git a/App/android/app/src/main/assets/fonts/MaterialCommunityIcons.ttf b/App/android/app/src/main/assets/fonts/MaterialCommunityIcons.ttf old mode 100755 new mode 100644 diff --git a/App/android/app/src/main/assets/fonts/MaterialIcons.ttf b/App/android/app/src/main/assets/fonts/MaterialIcons.ttf old mode 100755 new mode 100644 diff --git a/App/android/app/src/main/assets/fonts/Octicons.ttf b/App/android/app/src/main/assets/fonts/Octicons.ttf old mode 100755 new mode 100644 diff --git a/App/android/app/src/main/assets/fonts/SimpleLineIcons.ttf b/App/android/app/src/main/assets/fonts/SimpleLineIcons.ttf old mode 100755 new mode 100644 diff --git a/App/android/app/src/main/assets/fonts/Zocial.ttf b/App/android/app/src/main/assets/fonts/Zocial.ttf old mode 100755 new mode 100644 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 d96d65b4..4333e258 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 ui.materialshadows.RNMaterialShadowsPackage; import com.BV.LinearGradient.LinearGradientPackage; import org.reactnative.camera.RNCameraPackage; import com.oblador.vectoricons.VectorIconsPackage; @@ -27,6 +28,7 @@ public class MainApplication extends Application implements ReactApplication { protected List getPackages() { return Arrays.asList( new MainReactPackage(), + new RNMaterialShadowsPackage(), new LinearGradientPackage(), new RNCameraPackage(), new VectorIconsPackage(), diff --git a/App/android/build.gradle b/App/android/build.gradle index a1e80854..f2d56da7 100755 --- a/App/android/build.gradle +++ b/App/android/build.gradle @@ -3,7 +3,7 @@ buildscript { ext { buildToolsVersion = "27.0.3" - minSdkVersion = 16 + minSdkVersion = 21 compileSdkVersion = 27 targetSdkVersion = 26 supportLibVersion = "27.1.1" diff --git a/App/android/gradle.properties b/App/android/gradle.properties index 7e7af5c3..8429033d 100755 --- a/App/android/gradle.properties +++ b/App/android/gradle.properties @@ -22,4 +22,4 @@ android.enableAapt2=false MYAPP_RELEASE_STORE_FILE=my-release-key.keystore MYAPP_RELEASE_KEY_ALIAS=my-key-alias MYAPP_RELEASE_STORE_PASSWORD=aspire98H -MYAPP_RELEASE_KEY_PASSWORD=encontroINFORMATICA2019 \ No newline at end of file +MYAPP_RELEASE_KEY_PASSWORD=aspire98H \ No newline at end of file diff --git a/App/android/settings.gradle b/App/android/settings.gradle index 04320716..1993962a 100755 --- a/App/android/settings.gradle +++ b/App/android/settings.gradle @@ -1,4 +1,6 @@ rootProject.name = 'app' +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' project(':react-native-linear-gradient').projectDir = new File(rootProject.projectDir, '../node_modules/react-native-linear-gradient/android') include ':react-native-camera' diff --git a/App/app/App.js b/App/app/App.js index a499131f..44157fe4 100755 --- a/App/app/App.js +++ b/App/app/App.js @@ -14,7 +14,9 @@ import { ImageBackground, LinearGradient, TouchableOpacity, - TextInput + TextInput, + NetInfo, + Animated } from 'react-native'; @@ -24,7 +26,7 @@ import {connect} from 'react-redux'; import QRCodeScanner from 'react-native-qrcode-scanner'; import {UtilStyles} from './assets/styles' -import * as Actions from './store/actions'; //Import your actions +import * as Actions from './store/actions'; import {RkButton, RkTheme, RkText, RkTextInput} from 'react-native-ui-kitten'; @@ -39,7 +41,9 @@ const SCREEN_WIDTH = Dimensions.get("window").width; import Swiper from 'react-native-swiper'; - +function handleConnectivityChange() { + console.log("asdasd"); + } class App extends Component { _activate=()=>{ @@ -92,7 +96,15 @@ class App extends Component { checkValue=(e)=>{ console.log("check"+e) } + _handleConnectionChange = (isConnected) => { + this.props.connectionState(true); + }; + + componentDidMount() { + + NetInfo.isConnected.addEventListener('connectionChange', this.handleConnectivityChange); + this.setState({isModalVisible: false}) //verifica se o utilizador tem token guardado this.props.checkUser(); @@ -101,6 +113,10 @@ class App extends Component { } + componentWillUnmount() { + NetInfo.isConnected.removeEventListener('connectionChange', this.handleConnectivityChange); + } + _keyboardDidShow () { //alert('Keyboard Shown'); // this.setState({push:0}) @@ -119,7 +135,7 @@ class App extends Component { this.props.closeLoginQRScan(); this.setState({username:e.data}) - console.log("tentativa de login"); + console.log("QR code lido"); @@ -127,24 +143,25 @@ class App extends Component { render() { - if (this.props.onHold && !this.props.logged) { + if (!this.props.logged) { return ( - CARREGANDO {this.props.onHold} - + + ) } + else { - //console.log('token... '+ this.props.logged) + // console.log('token... '+ this.props.logged) //se existir token - if (this.props.logged) { + if (this.props.logged ) { return ( @@ -152,41 +169,8 @@ class App extends Component { ) } return ( - } - activeDot={} - - > + - - - - - - - - - - - - - - @@ -194,7 +178,7 @@ class App extends Component { - - + - - Manual de utilização - - - + + ); - { - - - //se não existir vai para o ecrã de scan QR - return ( - - { this.scanner = node }} - showMarker - - onRead={this.onSuccess.bind(this)} - cameraStyle={{height: SCREEN_HEIGHT}} - - customMarker={ - - - - - - - - - Introduza a password - - this.setState({text})} - clearButtonMode='always' - value={this.state.text} - clearTextOnFocus={true} - onSubmitEditing={Keyboard.dismiss} - /> - -