Commit 2d2df240 by jhrabal

radegast

parent 9cb25896
......@@ -20,10 +20,14 @@ public class RatingApiController {
@Autowired
private RatingService service;
//paged endpoint
@RequestMapping(path = "ratings", method = RequestMethod.POST)
@ResponseStatus(HttpStatus.CREATED)
public void bulkRating(@RequestBody Collection<Rating> ratings) {
service.saveBulk(ratings);
}
//stats endpoint
}
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;
......@@ -59,9 +59,6 @@ class App extends React.PureComponent {
}
});
//let responseJson = await response.text();
//return responseJson.movies;
} catch (error) {
//console.error(error);
// return to buffer
......@@ -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) {
return async () => {
let { buffer } = this.state;
......@@ -126,7 +101,24 @@ class App extends React.PureComponent {
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 {
content = this.renderResults();
break;
case 'info':
content = this.renderInfo();
break;
default:
content = this.renderRating();
......@@ -150,6 +140,7 @@ class App extends React.PureComponent {
return (
<View style={styles.container}>
<StatusBar hidden />
<Image source={ require('./assets/bg.jpg') } style={{width: '100%', height: '100%', position: 'absolute'}} imageStyle={{ resizeMode: 'stretch' }}/>
{ content }
</View>
);
......@@ -163,10 +154,36 @@ export default App;
const styles = StyleSheet.create({
container: {
center: {
flex: 1,
backgroundColor: '#fff',
alignItems: '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 @@
"web"
],
"version": "1.0.0",
"orientation": "portrait",
"orientation": "landscape",
"icon": "./assets/icon.png",
"splash": {
"image": "./assets/splash.png",
"image": "./assets/bg.jpg",
"resizeMode": "contain",
"backgroundColor": "#ffffff"
"backgroundColor": "#000000"
},
"updates": {
"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