Commit ee32c6e3 authored by p's avatar p
Browse files

Merge remote-tracking branch 'origin/master'

parents bdc3ac73 8dd36e05
import React from 'react';
import { Platform, StatusBar, StyleSheet, View } from 'react-native';
import { AppLoading, Asset, Font, Icon } from 'expo';
import AppNavigator from './navigation/AppNavigator';
import React from "react";
import { Platform, StatusBar, StyleSheet, View } from "react-native";
import { AppLoading, Asset, Font, Icon } from "expo";
import AppNavigator from "./navigation/AppNavigator";
import { NOTIFICATIONS } from "./constants/Data";
export default class App extends React.Component {
state = {
isLoadingComplete: false,
notifications: NOTIFICATIONS
};
componentDidMount() {
this.timer = setInterval(this.getNotifications, 7500);
}
componentWillUnmount() {
if (this.timer) {
clearInterval(this.timer);
}
}
getNotifications = () => {
console.log("Get Notifications now!!");
// const notifications treba nahradit za fetch a setState spustit iba v pripade ze sa data zmenia
// pretoze by default to re-renderuje celu aplikaciu
const notifications = [
...this.state.notifications,
NOTIFICATIONS[this.state.notifications.length - 5]
];
this.setState({ notifications });
};
render() {
......@@ -20,8 +43,8 @@ export default class App extends React.Component {
} else {
return (
<View style={styles.container}>
{Platform.OS === 'ios' && <StatusBar barStyle="default" />}
<AppNavigator />
{Platform.OS === "ios" && <StatusBar barStyle="default" />}
<AppNavigator screenProps={this.state} />
</View>
);
}
......@@ -30,16 +53,16 @@ export default class App extends React.Component {
_loadResourcesAsync = async () => {
return Promise.all([
Asset.loadAsync([
require('./assets/images/robot-dev.png'),
require('./assets/images/robot-prod.png'),
require("./assets/images/robot-dev.png"),
require("./assets/images/robot-prod.png")
]),
Font.loadAsync({
// This is the font that we are using for our tab bar
...Icon.Ionicons.font,
// We include SpaceMono because we use it in HomeScreen.js. Feel free
// to remove this if you are not using it in your app
'space-mono': require('./assets/fonts/SpaceMono-Regular.ttf'),
}),
"space-mono": require("./assets/fonts/SpaceMono-Regular.ttf")
})
]);
};
......@@ -57,6 +80,6 @@ export default class App extends React.Component {
const styles = StyleSheet.create({
container: {
flex: 1,
backgroundColor: '#fff',
},
backgroundColor: "#fff"
}
});
......@@ -4,23 +4,16 @@ import { StyleSheet } from "react-native";
import MapView, { Marker } from "react-native-maps";
class BranchesMap extends PureComponent {
state = {
region: {
atitude: 48.723221,
longitude: 21.256716,
render() {
const initialRegion = {
latitude: this.props.data.lat,
longitude: this.props.data.long,
latitudeDelta: 0.0922,
longitudeDelta: 0.0421
}
};
};
render() {
const { data } = this.props;
return (
<MapView
style={styles.map}
initialRegion={this.state.region}
loadingEnabled
>
<MapView style={styles.map} initialRegion={initialRegion} loadingEnabled>
<Marker
key="marker"
coordinate={{ latitude: data.lat, longitude: data.long }}
......
import React, { Component } from "react";
import { View, StyleSheet } from "react-native";
import { ButtonGroup } from "react-native-elements";
import { withNavigationFocus } from "react-navigation";
import NotificationList from "../components/notifications/NotificationList";
import { iOSColors } from "react-native-typography";
import { NOTIFICATIONS } from "../constants/Data";
export default class NotificationScreen extends Component {
class NotificationScreen extends Component {
static navigationOptions = {
title: "Upozornenia"
};
......@@ -19,6 +19,18 @@ export default class NotificationScreen extends Component {
};
}
shouldComponentUpdate() {
return this.props.isFocused;
}
componentDidUpdate(prevProps) {
const lastNotifications = prevProps.screenProps.notifications;
const currentNotifications = this.props.screenProps.notifications;
if (lastNotifications.length !== currentNotifications.length) {
this.setState({ data: currentNotifications });
}
}
updateIndex = selectedIndex => {
this.setState({ selectedIndex });
};
......@@ -59,3 +71,5 @@ const styles = StyleSheet.create({
},
disabledTextStyle: { color: iOSColors.blue, fontWeight: "bold" }
});
export default withNavigationFocus(NotificationScreen);
......@@ -7,6 +7,8 @@ Sentiment Phrase
1 Budem strielat!
1 Zabijem ta ked nieco skusis.
1 Peniaze do tasky.
1 Pozor zbran.
1 On ma pistol.
0 Pred tyzdnom som bol v banke.
0 Dajme vsetky peniaze na ucet.
0 Chceli by sme si otvorit spolocny ucet.
......
......@@ -2,7 +2,7 @@ Sentiment Phrase
1 Ruky hore!
1 Vsetci lahnut na zem.
1 Kazdy si teraz pomaly lahne.
1 Tvarou k zemi.
1 Ziadnu paniku.
1 Ruky drzte tak aby som ich videl.
1 Kazdy ticho a nikomu sa nic nestane.
1 Ticho lebo budem strielat.
......
Sentiment Phrase
1 Toto je prepad
1 Toto je prepad banky, vsetci ruky hore!
1 Vsetci dajte mobily do tejto tasky a lahnite si!
1 Dajte mi vsetky peniaze z trezoru!
1 Vsetci ostante ticho!
1 Nevolajte policiu, inak zastrelim niekoho!
1 Pomaly si vsetci lahnite.
1 Tasku s peniazmi polozte na stol.
0 Vedel si o tom, ze minule vylupili banku v Kosiciach?
0 Potrebujem neskor aj vybrat peniaze.
0 Minule v banke som stala v rade hodinu.
0 Si predstav co by sa stalo, keby teraz prisli vykradnut banku.
0 Musim ist kupit este rozky a maslo.
0 Som v banke, nemozem teraz hovorit.
0 Chcela by som vlozit peniaze.
0 Nasla som v bankomate 100 eur.
0 Nevykrikuj, v banke musis byt ticho.
0 Nech sa paci, dalsi.
0 Kolko by ste chceli vybrat?
0 Prosim zavolaj mi neskor, akurat ma volaju k priehradke v banke.
0 Chcela by som zmenit 50 eur na forinty.
0 Aky je teraz kurz na ceske koruny?
1 Tvarou na zem.
1 Ziadne varovne signaly.
1 Nikomu sa nic nestane.
1 Dajte mi vsetky peniaze do tasky!
1 Vsetci lahnut tvarou k zemi.
1 Kto neposluchne strelim ho.
1 Ak nebudete spolupracovat, niekto to schyta.
1 Nikto ani muk!
1 Pomoc!
1 Ma zbran.
0 Kolko mate rokov?
0 Pane tu nemozte fajcit, prosim vas chodte von.
0 Prepacte, uz budeme zatvarat.
0 Skuste prist zajtra, uz vas dnes bohuzial nevezmeme.
0 Dajte mi odporucanie.
0 Vasa poziadavka bude vybavena do troch pracovnych dni.
0 Nemusite sa bat, vsetko vyriesime.
0 Mozem vas poprosit o pomoc?
0 Samozrejme, hned sa vam venujem.
0 Velmi vam nerozumiem, mozte prosim hovorit hlasnejsie?
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment