Skip to content

Commit

Permalink
Merge pull request #31 from gaiaresources/develop
Browse files Browse the repository at this point in the history
Develop
simon-gaia authored Feb 4, 2021
2 parents ec9f2a1 + d94a535 commit 2b51bf0
Showing 13 changed files with 92 additions and 35 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -34,3 +34,4 @@ $RECYCLE.BIN/
Thumbs.db
UserInterfaceState.xcuserstate
my-release-key.jks
*.apk
16 changes: 16 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -30,8 +30,24 @@ To run the app in a browser, within the project directory use:

```bash
ionic serve

#android
ionic cordova run android
```

On Android, it may create a corrupted /platforms/android/app/src/main/AndroidManifest.xml

To fix it, remove `<uses-feature android:name="android.hardware.location.gps" />` in AndroidManifest.xml AND
remove
```
{
"xml": "<uses-feature android:name=\"android.hardware.location.gps\" />",
"count": 1
}
```

from /platforms/android/android.json

### Apple App Store

This app was deployed using XCode 9.4 (9F1027a)
4 changes: 4 additions & 0 deletions android-build-prod.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
ionic cordova build --release android
~/Android/Sdk/build-tools/29.0.3/zipalign -v -p 4 platforms/android/app/build/outputs/apk/release/app-release-unsigned.apk $$.1.apk
~/Android/Sdk/build-tools/29.0.3/apksigner sign --ks my-release-key.jks --out `date +"%Y%m%d-%H%M%S"`.apk $$.1.apk
rm $$.1.apk
8 changes: 4 additions & 4 deletions config.xml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<?xml version='1.0' encoding='utf-8'?>
<widget android-versionCode="15" id="au.com.gaiaresources.mksas" ios-CFBundleVersion="19" version="1.0.4" xmlns="http://www.w3.org/ns/widgets" xmlns:cdv="http://cordova.apache.org/ns/1.0">
<widget android-versionCode="22" id="au.com.gaiaresources.mksas" ios-CFBundleVersion="25" version="1.0.5" xmlns="http://www.w3.org/ns/widgets" xmlns:cdv="http://cordova.apache.org/ns/1.0">
<name>Slug Sleuth</name>
<description>App for surveying slugs and snails</description>
<author email="[email protected]" href="https://www.gaiaresources.com.au">Gaia Resources</author>
@@ -14,8 +14,8 @@
<preference name="GOOGLE_MAPS_ANDROID_API_KEY" value="AIzaSyBAL66QBq-RH9pStWPUMyTdm9t05QtUmXg" />
<preference name="GOOGLE_MAPS_IOS_API_KEY" value="AIzaSyBAL66QBq-RH9pStWPUMyTdm9t05QtUmXg" />
<preference name="ScrollEnabled" value="false" />
<preference name="android-minSdkVersion" value="19" />
<preference name="android-targetSdkVersion" value="28" />
<preference name="android-minSdkVersion" value="29" />
<preference name="android-targetSdkVersion" value="29" />
<preference name="BackupWebStorage" value="none" />
<preference name="SplashMaintainAspectRatio" value="true" />
<preference name="FadeSplashScreenDuration" value="300" />
@@ -133,6 +133,6 @@
</plugin>
<plugin name="cordova-plugin-splashscreen" spec="5.0.2" />
<plugin name="cordova-plugin-app-version" spec="0.1.9" />
<engine name="android" spec="7.1.4" />
<engine name="ios" spec="5.1.1" />
<engine name="android" spec="7.1.4" />
</widget>
58 changes: 41 additions & 17 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

17 changes: 10 additions & 7 deletions package.json
Original file line number Diff line number Diff line change
@@ -41,10 +41,11 @@
"cordova-android": "7.1.4",
"cordova-browser": "5.0.3",
"cordova-ios": "5.1.1",
"cordova-plugin-app-version": "^0.1.9",
"cordova-plugin-app-version": "^0.1.12",
"cordova-plugin-camera": "^4.1.0",
"cordova-plugin-device": "^2.0.3",
"cordova-plugin-geolocation": "^4.0.2",
"cordova-plugin-file": "^6.0.2",
"cordova-plugin-geolocation": "^4.1.0",
"cordova-plugin-googlemaps": "^2.7.1",
"cordova-plugin-ionic-keyboard": "^2.2.0",
"cordova-plugin-ionic-webview": "^1.2.1",
@@ -74,25 +75,27 @@
"API_KEY_FOR_ANDROID": "AIzaSyBAL66QBq-RH9pStWPUMyTdm9t05QtUmXg",
"API_KEY_FOR_IOS": "AIzaSyBAL66QBq-RH9pStWPUMyTdm9t05QtUmXg",
"PLAY_SERVICES_VERSION": "15.0.1",
"ANDROID_SUPPORT_V4_VERSION": "26.1.0"
"ANDROID_SUPPORT_V4_VERSION": "27.+"
},
"cordova-plugin-camera": {
"ANDROID_SUPPORT_V4_VERSION": "27.+"
},
"cordova-plugin-geolocation": {
"GEOLOCATION_USAGE_DESCRIPTION": "To set observation locations"
"GEOLOCATION_USAGE_DESCRIPTION": "To set observation locations",
"GPS_REQUIRED": "true"
},
"cordova-plugin-whitelist": {},
"cordova-plugin-device": {},
"cordova-plugin-splashscreen": {},
"cordova-plugin-ionic-webview": {},
"cordova-plugin-ionic-keyboard": {},
"cordova-plugin-statusbar": {},
"cordova-plugin-app-version": {}
"cordova-plugin-app-version": {},
"cordova-plugin-advanced-http": {}
},
"platforms": [
"android",
"ios"
"ios",
"android"
]
},
"config": {
Binary file added src/assets/imgs/fab-gallery.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added src/assets/imgs/white_photo_library.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
6 changes: 5 additions & 1 deletion src/components/photo-gallery/photo-gallery.html
Original file line number Diff line number Diff line change
@@ -19,10 +19,14 @@
<p>
Use the camera button to add photos to your record.
<p>
<button class="fab-button" (click)="onClickedNewPhoto()">
<button class="fab-button" (click)="onClickedNewPhoto(true)">
<img class="fab-button__img" src="assets/imgs/fab-camera.png" alt="Koala Opportunistic Observation">
<span class="fab-button__text">Take a photo</span>
</button>
<button class="fab-button" (click)="onClickedNewPhoto(false)">
<img class="fab-button__img" src="assets/imgs/white_photo_library.png" alt="Koala Opportunistic Observation">
<span class="fab-button__text">Use an existing photo</span>
</button>
<p>
All photos relating to this record will be displayed here. You will be able
to view each photo using the left and right chevrons. Photos can be deleted
6 changes: 4 additions & 2 deletions src/components/photo-gallery/photo-gallery.ts
Original file line number Diff line number Diff line change
@@ -130,19 +130,21 @@ export class PhotoGalleryComponent {
}).present();
}

public onClickedNewPhoto() {
public onClickedNewPhoto(useCamera: boolean) {
if (this._photoIds.length >= 10) {
alert('Maximum number of photos reached');
return;
}

const options: CameraOptions = {
sourceType: useCamera ? this.camera.PictureSourceType.CAMERA : this.camera.PictureSourceType.PHOTOLIBRARY,
quality: 100,
targetWidth: 1024,
targetHeight: 1024,
destinationType: this.camera.DestinationType.DATA_URL,
encodingType: this.camera.EncodingType.JPEG,
mediaType: this.camera.MediaType.PICTURE
mediaType: this.camera.MediaType.PICTURE,
correctOrientation: true
};

this.camera.getPicture(options).then((base64) => {
2 changes: 1 addition & 1 deletion src/pages/about/about.html
Original file line number Diff line number Diff line change
@@ -42,7 +42,7 @@ <h1>{{APP_NAME}}</h1>
<p>
All data submitted via this app is made available through BioNet, NSW’s corporate biodiversity data repository.
BioNet data is accessible to researchers, land managers, government agencies and the public via
the <a href="https://www.bionet.nsw.gov.au/">BioNet website</a>
the <a href="https://www.environment.nsw.gov.au/wildlifeatlas/about.htm">BioNet website</a>
and the <a href="https://www.seed.nsw.gov.au/">SEED portal</a>.
</p>

5 changes: 4 additions & 1 deletion src/pages/observation/observation.html
Original file line number Diff line number Diff line change
@@ -42,9 +42,12 @@
</div>

<ion-fab [hidden]="readonly || showForm" bottom right>
<button aria-name="Add Photo" alt="Add Photo" ion-fab (click)="onClickedNewPhoto()" class="fab-census-tree">
<button aria-name="Add Photo From Camera" alt="Add Photo From Camera" ion-fab (click)="onClickedNewPhoto(true)" class="fab-census-tree">
<img alt="Add Photo" class="fab-img" src="assets/imgs/fab-camera.png">
</button>
<button aria-name="Add Photo From Gallery" alt="Add Photo From Gallery" ion-fab (click)="onClickedNewPhoto(false)" class="fab-census-tree">
<img alt="Add Photo" class="fab-img" src="assets/imgs/fab-gallery.png">
</button>
</ion-fab>

</ion-content>
4 changes: 2 additions & 2 deletions src/pages/observation/observation.ts
Original file line number Diff line number Diff line change
@@ -38,8 +38,8 @@ export class ObservationPage {
private alertController: AlertController) {
}

public onClickedNewPhoto() {
this.photoGallery.onClickedNewPhoto();
public onClickedNewPhoto(useCamera: boolean) {
this.photoGallery.onClickedNewPhoto(useCamera);
}

public ionViewWillEnter() {

0 comments on commit 2b51bf0

Please sign in to comment.