Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merge bug fixes into master #19

Merged
merged 57 commits into from
Nov 30, 2018
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
57 commits
Select commit Hold shift + click to select a range
065e10a
Added a parameter for fetching species within a three month window fr…
albullington Nov 19, 2018
ad5f3c1
Updated location header to use Loading... text while activity wheel i…
albullington Nov 19, 2018
58f1817
Added error message if challenges don't loaddue to network error
albullington Nov 19, 2018
b786988
Added error message when computervision suggestions can't load
albullington Nov 19, 2018
033693c
Small styling tweaks
albullington Nov 19, 2018
e7e1592
Created a marker on species map when species was already collected
albullington Nov 19, 2018
3393c6e
Added conditional for NavBar to show in different colors based on whe…
albullington Nov 20, 2018
9682002
Updated styling on challenge grid & added ellipses to long names
albullington Nov 20, 2018
3425f52
Updated styling on results screen
albullington Nov 20, 2018
5fd7417
Committing custom fonts to source control.
albullington Nov 20, 2018
9351150
Styling fixes on Android, including fonts & line heights
albullington Nov 20, 2018
8f9d079
Updated line heights so text isn't cut off on Android
albullington Nov 20, 2018
cdce841
Updated warnings styles on Android/iOS to prevent text from being cut…
albullington Nov 20, 2018
2301066
Updated styling on taxon picker so header isn't cut off on Android, t…
albullington Nov 21, 2018
c08c4fb
Updated collection screen to allow scrolling & add shadows to species…
albullington Nov 21, 2018
9e97add
Minor tweaks
albullington Nov 21, 2018
3342ddc
Updated Realm to capitalize species names before saving
albullington Nov 21, 2018
913c77c
Truncating coordinates before saving to Realm
albullington Nov 21, 2018
b518b92
Updated species detail page so headers and logos are not cut off
albullington Nov 21, 2018
88b49a6
Moved taxonIds into a dictionary object
albullington Nov 21, 2018
681ce9b
Exploring tab navigator in react-navigation for Camera Nav
albullington Nov 21, 2018
326c867
Passing CameraTopNav into react-navigation camera stack
albullington Nov 21, 2018
d725edc
Tab navigator allows navigation between camera and photos
albullington Nov 21, 2018
dd73dda
Updated photo gallery to use flex instead of height
albullington Nov 21, 2018
d431ad9
Updated loading wheel color to show up on gallery view
albullington Nov 21, 2018
e224a84
Simplified loading wheel styling
albullington Nov 21, 2018
593b014
Added loading wheel after camera button pressed to indicate that phot…
albullington Nov 21, 2018
436906c
Reverted to camera header separate from react-navigation
albullington Nov 26, 2018
4b9c95d
Removed absolute position from magic plus button
albullington Nov 26, 2018
9ff4db1
Moved functions that don't affect state into helper file
albullington Nov 27, 2018
df85cae
Passing props from species clicked to results screen
albullington Nov 27, 2018
4b235d8
Updated size of location picker marker
albullington Nov 27, 2018
f0aaef3
Added Ionicicons icon for reversing camera
albullington Nov 27, 2018
677bea2
Removed cameraTypeText from state
albullington Nov 27, 2018
c304d94
Added custom font library for icons in iOS/Android
albullington Nov 27, 2018
267c123
Updated all icons in camera using external library
albullington Nov 27, 2018
1b50ec7
Updated location picker marker to use vector icon
albullington Nov 27, 2018
3309801
Updated marker for species detail map
albullington Nov 27, 2018
2bb1c5a
Added styles to custom header titles
albullington Nov 27, 2018
4252c34
Created button for CC on photos in species detail screen
albullington Nov 27, 2018
d37ff9d
Attribution is given to each photo in species detail screen
albullington Nov 27, 2018
945848a
Moved key in photos array to View component instead of Image component
albullington Nov 27, 2018
b20e351
Added plus icon to Found It button on species detail page
albullington Nov 27, 2018
ef22d6e
Used navigation.push instead of navigation.navigate when sending user…
albullington Nov 27, 2018
8cc90c1
Changed location picker and taxon picker back to navigate, since they…
albullington Nov 27, 2018
4c68a0a
Updated iOS code for production build
albullington Nov 28, 2018
f5391de
Removed footer on species detail page when species already collected
albullington Nov 28, 2018
212538a
Code cleanup for toggleFlash
albullington Nov 28, 2018
16a64e2
Code cleanup for toggleCamera
albullington Nov 28, 2018
bcc747d
Updated flash buttons to display at right time
albullington Nov 28, 2018
d2223c9
Removed console logs
albullington Nov 28, 2018
05b212c
Updated styling in challenge results to center captions under images
albullington Nov 28, 2018
257573a
Updated error screen
albullington Nov 28, 2018
ad408b3
Added error conditions for species chart & about section
albullington Nov 29, 2018
2c43459
Removed map marker from species detail page on error
albullington Nov 29, 2018
8fe5695
Updated gradle for release build
albullington Nov 29, 2018
f37397b
Updated android files for release build
albullington Nov 29, 2018
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Updated collection screen to allow scrolling & add shadows to species…
… grid
  • Loading branch information
albullington committed Nov 21, 2018
commit c08c4fbd6e6ec5674918465fdec3ae0ac4e0b385
175 changes: 89 additions & 86 deletions components/YourCollection.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
import React, { Component } from "react";
import {
FlatList,
ScrollView,
Alert,
Image,
TouchableOpacity,
Expand Down Expand Up @@ -61,105 +62,107 @@ class YourCollection extends Component {

return (
<View style={styles.container}>
<View style={styles.badges}>
<View style={styles.header}>
<Text style={styles.headerText}>Recent Badges</Text>
<TouchableOpacity
style={styles.button}
onPress={() => navigation.navigate( "Badges" )}
>
<Text style={styles.text}>
View All
</Text>
</TouchableOpacity>
</View>
<View style={styles.taxonGrid}>
<FlatList
data={ badges }
keyExtractor={ badge => badge.name }
scrollEnabled={false}
numColumns={ 3 }
renderItem={ ( { item } ) => {
let badgeIcon;
let msg = item.infoText;
if ( item.earned ) {
msg = `${msg} You earned this badge.`;
badgeIcon = badgeImages[item.earnedIconName];
} else {
badgeIcon = badgeImages[item.unearnedIconName];
<ScrollView>
<View style={styles.badges}>
<View style={styles.header}>
<Text style={styles.headerText}>Recent Badges</Text>
<TouchableOpacity
style={styles.button}
onPress={() => navigation.navigate( "Badges" )}
>
<Text style={styles.text}>
View All
</Text>
</TouchableOpacity>
</View>
<View style={styles.taxonGrid}>
<FlatList
data={ badges }
scrollEnabled={false}
keyExtractor={ badge => badge.name }
numColumns={ 3 }
renderItem={ ( { item } ) => {
let badgeIcon;
let msg = item.infoText;
if ( item.earned ) {
msg = `${msg} You earned this badge.`;
badgeIcon = badgeImages[item.earnedIconName];
} else {
badgeIcon = badgeImages[item.unearnedIconName];
}
return (
<View style={ styles.gridCell }>
<TouchableOpacity
onPress={ () => Alert.alert(
item.name,
msg,
[
{
text: "Got it!"
}
],
{ cancelable: false }
)}
>
<View style={ styles.badgeCellContents }>
<Image
source={badgeIcon}
style={styles.badgeIcon}
/>
<View style={ styles.badgeTitle }>
<Text style={ styles.cellTitleText }>
{item.name}
</Text>
</View>
</View>
</TouchableOpacity>
</View>
);
}
return (
}
/>
</View>
</View>
<View style={styles.species}>
<Text style={styles.headerText}>Species You&#39;ve Seen ({observations.length})</Text>
<View style={styles.taxonGrid}>
<FlatList
data={ observations }
scrollEnabled={false}
keyExtractor={ t => t.taxon.id }
numColumns={ 3 }
renderItem={ ( { item } ) => (
<View style={ styles.gridCell }>
<TouchableOpacity
onPress={ () => Alert.alert(
item.name,
msg,
[
{
text: "Got it!"
}
],
{ cancelable: false }
)}
onPress={ () => navigation.navigate( "Species", {
id: item.taxon.id,
latitude: item.latitude,
longitude: item.longitude,
location: item.placeName,
seen: true
} )}
>
<View style={ styles.gridCellContents }>
<Image
source={badgeIcon}
style={styles.badgeIcon}
style={ {
width: "100%",
aspectRatio: 1.1
} }
source={ { uri: item.taxon.defaultPhoto.mediumUrl } }
/>
<View style={ styles.badgeTitle }>
<Text style={ styles.cellTitleText }>
{item.name}
<View style={ styles.cellTitle }>
<Text style={ styles.cellTitleText } numberOfLines={2}>
{ item.taxon.preferredCommonName || item.taxon.name }
</Text>
</View>
</View>
</TouchableOpacity>
</View>
);
}
}
/>
</View>
</View>
<View style={styles.species}>
<Text style={styles.headerText}>Species You&#39;ve Seen ({observations.length})</Text>
<View style={styles.taxonGrid}>
<FlatList
data={ observations }
scrollEnabled={false}
keyExtractor={ t => t.taxon.id }
numColumns={ 3 }
renderItem={ ( { item } ) => (
<View style={ styles.gridCell }>
<TouchableOpacity
onPress={ () => navigation.navigate( "Species", {
id: item.taxon.id,
latitude: item.latitude,
longitude: item.longitude,
location: item.placeName,
seen: true
} )}
>
<View style={ styles.gridCellContents }>
<Image
style={ {
width: "100%",
aspectRatio: 1.1
} }
source={ { uri: item.taxon.defaultPhoto.mediumUrl } }
/>
<View style={ styles.cellTitle }>
<Text style={ styles.cellTitleText }>
{ item.taxon.preferredCommonName || item.taxon.name }
</Text>
</View>
</View>
</TouchableOpacity>
</View>
) }
/>
) }
/>
</View>
</View>
</View>
</ScrollView>
</View>
);
}
Expand Down
39 changes: 25 additions & 14 deletions styles/collection.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { Dimensions, StyleSheet } from "react-native";
import { StyleSheet } from "react-native";
import {
colors,
fonts,
Expand All @@ -7,8 +7,6 @@ import {
padding
} from "./global";

const { width } = Dimensions.get( "screen" );

export default StyleSheet.create( {
container: {
flex: 1
Expand All @@ -25,41 +23,54 @@ export default StyleSheet.create( {
fontSize: fontSize.buttonText,
fontFamily: fonts.book,
alignItems: "flex-start",
marginLeft: margins.medium
marginLeft: margins.medium,
marginTop: margins.medium
},
button: {
marginTop: margins.medium,
position: "absolute",
right: 0,
paddingRight: padding.large
},
text: {
fontSize: fontSize.text
fontSize: fontSize.text,
fontFamily: fonts.default
},
species: {
flex: 3,
backgroundColor: colors.white
backgroundColor: colors.white,
paddingBottom: padding.medium
},
taxonGrid: {
flex: 4,
flex: 1,
alignItems: "center",
justifyContent: "center",
marginBottom: margins.medium
justifyContent: "center"
},
badgeIcon: {
width: 70,
height: 70,
alignSelf: "center"
},
badgeCellContents: {
borderRadius: 5,
overflow: "hidden"
},
gridCell: {
width: width / 3 - 3,
height: width / 3 - 3,
width: 105,
height: 138,
paddingHorizontal: padding.medium,
marginTop: margins.medium,
marginBottom: margins.small
marginTop: margins.medium
},
gridCellContents: {
borderRadius: 5,
overflow: "hidden"
elevation: 2,
shadowOpacity: 0.3,
shadowColor: colors.darkGray,
shadowRadius: 3,
shadowOffset: {
height: 2,
width: 0
}
},
badgeTitle: {
height: 45,
Expand Down