Commit 2d2df240 by jhrabal

radegast

parent 9cb25896
...@@ -20,10 +20,14 @@ public class RatingApiController { ...@@ -20,10 +20,14 @@ public class RatingApiController {
@Autowired @Autowired
private RatingService service; private RatingService service;
@RequestMapping(path = "ratings", method = RequestMethod.POST) //paged endpoint
@RequestMapping(path = "ratings", method = RequestMethod.POST)
@ResponseStatus(HttpStatus.CREATED) @ResponseStatus(HttpStatus.CREATED)
public void bulkRating(@RequestBody Collection<Rating> ratings) { public void bulkRating(@RequestBody Collection<Rating> ratings) {
service.saveBulk(ratings); service.saveBulk(ratings);
} }
//stats endpoint
} }
import React from 'react'; import React from 'react';
import { StyleSheet, Text, View, TouchableOpacity, AsyncStorage, Alert, StatusBar } from 'react-native'; import { StyleSheet, Text, View, TouchableOpacity, AsyncStorage, Alert, StatusBar, ImageBackground, Image } from 'react-native';
const SEND_DATA_TIMER = 10000; const SEND_DATA_TIMER = 60000;
const INFO_TIMER = 1000; const INFO_TIMER = 1000;
...@@ -59,9 +59,6 @@ class App extends React.PureComponent { ...@@ -59,9 +59,6 @@ class App extends React.PureComponent {
} }
}); });
//let responseJson = await response.text();
//return responseJson.movies;
} catch (error) { } catch (error) {
//console.error(error); //console.error(error);
// return to buffer // return to buffer
...@@ -75,28 +72,6 @@ class App extends React.PureComponent { ...@@ -75,28 +72,6 @@ class App extends React.PureComponent {
} }
renderRating() {
const buttons = [];
for (let i = 5; i; i--) {
let text = "";
for (let j = 0; j < i; j++) {
text += "*";
}
buttons.push(<TouchableOpacity key={ i } onPress={ this.onPress(i) }>
<Text>{ text }</Text>
</TouchableOpacity>
);
}
return (
<View style={styles.container}>
<Text>Radegast Zóna</Text>
{ buttons }
</View>
);
}
onPress(r) { onPress(r) {
return async () => { return async () => {
let { buffer } = this.state; let { buffer } = this.state;
...@@ -126,7 +101,24 @@ class App extends React.PureComponent { ...@@ -126,7 +101,24 @@ class App extends React.PureComponent {
renderInfo() { renderInfo() {
return <View><Text>Děkujeme za hodnocení</Text></View> return <View style={styles.center}><Text>Děkujeme za hodnocení</Text></View>
}
renderRating() {
const buttons = [];
for (let i = 1; i <= 10; i++) {
buttons.push(<TouchableOpacity key={ i } onPress={ this.onPress(i) }>
<Text style={styles.rating}>{ i }</Text>
</TouchableOpacity>
);
}
return (
<View style={styles.ratingsContainer}>
{ buttons }
</View>
);
} }
...@@ -140,8 +132,6 @@ class App extends React.PureComponent { ...@@ -140,8 +132,6 @@ class App extends React.PureComponent {
content = this.renderResults(); content = this.renderResults();
break; break;
case 'info': case 'info':
content = this.renderInfo();
break;
default: default:
content = this.renderRating(); content = this.renderRating();
...@@ -150,6 +140,7 @@ class App extends React.PureComponent { ...@@ -150,6 +140,7 @@ class App extends React.PureComponent {
return ( return (
<View style={styles.container}> <View style={styles.container}>
<StatusBar hidden /> <StatusBar hidden />
<Image source={ require('./assets/bg.jpg') } style={{width: '100%', height: '100%', position: 'absolute'}} imageStyle={{ resizeMode: 'stretch' }}/>
{ content } { content }
</View> </View>
); );
...@@ -163,10 +154,36 @@ export default App; ...@@ -163,10 +154,36 @@ export default App;
const styles = StyleSheet.create({ const styles = StyleSheet.create({
container: { center: {
flex: 1, flex: 1,
backgroundColor: '#fff',
alignItems: 'center', alignItems: 'center',
justifyContent: 'center', justifyContent: 'center',
}, },
ratingsContainer: {
position: 'absolute',
left: 0,
top: '35%',
width: '100%',
flexDirection: 'row',
alignItems: 'center',
justifyContent: 'space-around',
color: '#FFFFFF',
paddingLeft: '5%',
paddingRight: '5%'
},
rating: {
backgroundColor: '#FFFFFF',
fontSize: 20,
borderRadius: 14,
width: 28,
height: 28,
textAlign: 'center'
},
container: {
flex: 1,
backgroundColor: '#000000'
},
}); });
...@@ -10,12 +10,12 @@ ...@@ -10,12 +10,12 @@
"web" "web"
], ],
"version": "1.0.0", "version": "1.0.0",
"orientation": "portrait", "orientation": "landscape",
"icon": "./assets/icon.png", "icon": "./assets/icon.png",
"splash": { "splash": {
"image": "./assets/splash.png", "image": "./assets/bg.jpg",
"resizeMode": "contain", "resizeMode": "contain",
"backgroundColor": "#ffffff" "backgroundColor": "#000000"
}, },
"updates": { "updates": {
"fallbackToCacheTimeout": 0 "fallbackToCacheTimeout": 0
......
Markdown is supported
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