Skip to content

Commit

Permalink
style change and bug fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
hiseen committed Mar 20, 2019
1 parent 635b73a commit 84a6193
Show file tree
Hide file tree
Showing 4 changed files with 30 additions and 21 deletions.
13 changes: 7 additions & 6 deletions new-gui/.expo/packager-info.json
Original file line number Diff line number Diff line change
@@ -1,9 +1,10 @@
{
"expoServerPort": 19000,
"expoServerNgrokUrl": "https://as-km5.anonymous.new-gui.exp.direct",
"packagerNgrokUrl": "https://packager.as-km5.anonymous.new-gui.exp.direct",
"ngrokPid": 6436,
"expoServerPort": null,
"expoServerNgrokUrl": null,
"packagerNgrokUrl": null,
"ngrokPid": null,
"devToolsPort": 19002,
"packagerPort": 19001,
"packagerPid": 15228
"packagerPort": null,
"packagerPid": null,
"webpackServerPort": null
}
2 changes: 1 addition & 1 deletion new-gui/src/commons/serverRequest/index.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
//const HOST = "52.39.77.219";
const HOST = "192.168.1.8";
const HOST = "174.77.40.238";
export const SERVER_URL = "http://" + HOST + ":8080";
34 changes: 21 additions & 13 deletions new-gui/src/components/ClickSuggestionPanel/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import React, { Component } from "react";
import { View, StyleSheet, AsyncStorage, Platform,
StatusBar, Dimensions, Animated, Image, PanResponder, Alert } from "react-native";
import { SERVER_URL } from "../../commons/serverRequest";
import { Button, Text } from "react-native-elements";
import { Button, Text, AirbnbRating } from "react-native-elements";

import { connect } from "react-redux";
import { SafeAreaView, withNavigation } from "react-navigation";
Expand Down Expand Up @@ -57,13 +57,13 @@ class ClickSuggestionComponent extends Component {

this.likeOpacity = this.position.x.interpolate({
inputRange: [-SCREEN_WIDTH/2, 0, SCREEN_WIDTH/2],
outputRange: [0, 0, 1],
outputRange: [0, 0, 0.9],
extrapolate: 'clamp'
});

this.dislikeOpacity = this.position.x.interpolate({
inputRange: [-SCREEN_WIDTH/2, 0, SCREEN_WIDTH/2],
outputRange: [1, 0, 0],
outputRange: [0.9, 0, 0],
extrapolate: 'clamp'
});

Expand Down Expand Up @@ -269,6 +269,7 @@ class ClickSuggestionComponent extends Component {
<Text style={styles.imageLabel}>
{item.title}
</Text>
{item.avg_ratings===0?null:<AirbnbRating defaultRating={item.avg_ratings} size={15} showRating={false} isDisabled={true}/>}
</View>

<Animated.View style={{ opacity: this.likeOpacity, transform: [{rotate: '-30deg'}],
Expand Down Expand Up @@ -303,6 +304,7 @@ class ClickSuggestionComponent extends Component {
<Text style={styles.imageLabel}>
{item.title}
</Text>
{item.avg_ratings===0?null:<AirbnbRating defaultRating={item.avg_ratings} size={15} showRating={false} isDisabled={true}/>}
</View>

<Image
Expand Down Expand Up @@ -453,32 +455,38 @@ const styles = StyleSheet.create({
resizeMode:"cover"
},
likeAnimatedText: {
borderWidth: 1,
borderColor: 'green',
color:'green',
borderWidth: 2,
borderColor: 'white',
backgroundColor: "lightgreen",
color:'white',
fontSize: 32,
fontWeight:'800',
padding: 10
},
disLikeAnimatedText: {
borderWidth: 1,
borderColor: 'red',
color:'red',
borderWidth: 2,
borderColor: 'white',
backgroundColor: "crimson",
color:'white',
fontSize: 32,
fontWeight:'800',
padding: 10
},
imageLabelView: {
padding: 2,
flex:1,
backgroundColor: 'rgba(164, 166, 164, 0.6)',
alignItems:"center",
justifyContent:'center',
position: 'absolute',
top: 40,
left: 40,
zIndex: 1000,
width: 300,
backgroundColor: 'rgba(164, 166, 164, 0.6)'
width: 300
},
imageLabel: {
fontWeight: 'bold',
fontSize: 28
fontWeight: 'bold',
fontSize: 28,
textAlign:"center"
}
})
Original file line number Diff line number Diff line change
Expand Up @@ -125,7 +125,7 @@ else if(cal_target>cal_need*0.3)
// filter out all foods that is allergic to user

for (String allergy: allergies) {
filterlist.add(not(regex("allergies",Pattern.compile("^.*"+ allergy +".*$", Pattern.CASE_INSENSITIVE))));
filterlist.add(not(regex("ingredients",Pattern.compile("^.*"+ allergy +".*$", Pattern.CASE_INSENSITIVE))));
}

//System.out.println(and(filterlist).toBsonDocument(BsonDocument.class, com.mongodb.MongoClient.getDefaultCodecRegistry()));
Expand Down

0 comments on commit 84a6193

Please sign in to comment.