Skip to content

Commit

Permalink
Merge branch 'release/2.2.8'
Browse files Browse the repository at this point in the history
  • Loading branch information
muloem committed Nov 9, 2016
2 parents e3a9719 + 55f52cb commit 5bda1c2
Show file tree
Hide file tree
Showing 17 changed files with 380 additions and 96 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ Building the app

License
-------
Copyright (C) 2010-2014 Stichting Akvo (Akvo Foundation)
Copyright (C) 2010-2016 Stichting Akvo (Akvo Foundation)

Akvo FLOW is free software: you can redistribute it and modify it under the terms of the GNU Affero General Public License (AGPL) as published by the Free Software Foundation, either version 3 of the License or any later version.

Expand Down
17 changes: 17 additions & 0 deletions RELEASE_NOTES.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,22 @@
Akvo FLOW app release notes
===========================
# ver 2.2.8
Date: 8 November 2016

# New and noteworthy
* **Nepali translations** [#330] - We have introduced Nepali as a new language in the app, and in addition updated translations in a number of the other languages [#478]

* **Use new Flow app icon** [#466] - We have updated the Flow icon in line with the new Akvo-wide design guidelines

* **Caddisfly question type** [#421] - As part of the [integration of the Akvo Caddisfly app with Akvo Flow](https://github.com/akvo/akvo-product-design/issues/5), the app now recognises a `caddisfly question` as a new question type

# Resolved issues
* **Do not check for new surveys before Device ID is set** [#454] - This fixes the issue where it was not possible to identify a device in the dashboard because it was missing the user-defined device identifier. This was caused by the app connecting to the dashboard *before* the identifier was setup correctly within the app, and as a result, transmitting an empty field instead of the device identifier

* **Remove unused geopoint code** [#461] - A cleanup of the system to remove unused parts of the application


---------------
# ver 2.2.7
Date: 20 July 2016

Expand Down
4 changes: 2 additions & 2 deletions app/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="org.akvo.flow"
android:versionCode="1"
android:versionName="2.2.7" >
android:versionCode="2"
android:versionName="2.2.8" >

<uses-sdk
android:minSdkVersion="10"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -255,7 +255,7 @@ public void onClick(DialogInterface dialog, int which) {
identTextView.setText(s);
database.savePreference(
ConstantUtil.DEVICE_IDENT_KEY, s);
// Trigger the SurveySync Service, in order to force
// Trigger the SurveyDownload Service, in order to force
// a backend connection with the new Device ID
startService(new Intent(PreferencesActivity.this,
SurveyDownloadService.class));
Expand Down
15 changes: 11 additions & 4 deletions app/src/main/java/org/akvo/flow/activity/SurveyActivity.java
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright (C) 2015 Stichting Akvo (Akvo Foundation)
* Copyright (C) 2016 Stichting Akvo (Akvo Foundation)
*
* This file is part of Akvo FLOW.
*
Expand Down Expand Up @@ -127,12 +127,14 @@ public void onDrawerOpened(View drawerView) {
}

// Start the setup Activity if necessary.
boolean noDevIdYet = false;
if (!Prefs.getBoolean(this, Prefs.KEY_SETUP, false)) {
noDevIdYet = true;
startActivityForResult(new Intent(this, AddUserActivity.class), REQUEST_ADD_USER);
}

displaySelectedUser();
startServices();
startServices(noDevIdYet);
}

@Override
Expand All @@ -144,6 +146,9 @@ protected void onActivityResult (int requestCode, int resultCode, Intent data) {
if (resultCode == RESULT_OK) {
displaySelectedUser();
Prefs.setBoolean(this, Prefs.KEY_SETUP, true);
// Trigger the SurveyDownload Service, so the first
// backend connection uses the new Device ID
startService(new Intent(this, SurveyDownloadService.class));
} else if (!Prefs.getBoolean(this, Prefs.KEY_SETUP, false)) {
finish();
}
Expand Down Expand Up @@ -186,7 +191,7 @@ public void setTitle(CharSequence title) {
getSupportActionBar().setTitle(mTitle);
}

private void startServices() {
private void startServices(boolean waitForDeviceId) {
if (!StatusUtil.hasExternalStorage()) {
ViewUtil.showConfirmDialog(R.string.checksd, R.string.sdmissing, this,
false,
Expand All @@ -198,7 +203,9 @@ public void onClick(DialogInterface dialog, int which) {
},
null);
} else {
startService(new Intent(this, SurveyDownloadService.class));
if (!waitForDeviceId) {
startService(new Intent(this, SurveyDownloadService.class));
}
startService(new Intent(this, LocationService.class));
startService(new Intent(this, BootstrapService.class));
startService(new Intent(this, ExceptionReportingService.class));
Expand Down
1 change: 1 addition & 0 deletions app/src/main/java/org/akvo/flow/domain/Question.java
Original file line number Diff line number Diff line change
Expand Up @@ -399,6 +399,7 @@ public static Question copy(Question question, String questionId) {
q.altTextMap = question.getAltTextMap();// Shallow copy
q.scoringRules = question.getScoringRules();// Shallow copy
q.levels = question.getLevels();// Shallow copy
q.caddisflyRes = question.getCaddisflyRes();

// Deep-copy dependencies
if (question.dependencies != null) {
Expand Down
67 changes: 0 additions & 67 deletions app/src/main/java/org/akvo/flow/util/GeoUtil.java
Original file line number Diff line number Diff line change
Expand Up @@ -16,79 +16,12 @@

package org.akvo.flow.util;

import android.location.Location;

import com.google.android.maps.GeoPoint;

import java.text.DecimalFormat;

/**
* simple utility class for handling Locations
*
* @author Christopher Fagiani
*/
public class GeoUtil {
/**
* converts lat/lon values into a GeoPoint
*
* @param lat
* @param lon
* @return
*/
public static GeoPoint convertToPoint(String lat, String lon) {
Double latitude = Double.parseDouble(lat) * 1E6;
Double longitude = Double.parseDouble(lon) * 1E6;
return new GeoPoint(latitude.intValue(), longitude.intValue());
}

/**
* converts lat/lon values into a GeoPoint
*
* @param lat
* @param lon
* @return
*/
public static GeoPoint convertToPoint(Double lat, Double lon) {
Double latitude = lat * 1E6;
Double longitude = lon * 1E6;
return new GeoPoint(latitude.intValue(), longitude.intValue());
}

/**
* converts a Location object to a GeoPoint
*
* @param loc
* @return
*/
public static GeoPoint convertToPoint(Location loc) {
Double latitude = loc.getLatitude() * 1E6;
Double longitude = loc.getLongitude() * 1E6;
return new GeoPoint(latitude.intValue(), longitude.intValue());
}

/**
* decodes a lat/lon pair from a single integer
*
* @param val
* @return
*/
public static String decodeLocation(int val) {
return "" + ((double) val / (double) 1E6);
}

/**
* computes as-the-crow-flies distance between 2 points
*
* @param point1
* @param point2
* @return
*/
public static double computeDistance(GeoPoint point1, GeoPoint point2) {
return Math.sqrt(Math.pow(point1.getLatitudeE6()
- point2.getLatitudeE6(), 2d)
+ Math.pow(point1.getLongitudeE6() - point2.getLongitudeE6(),
2d));
}

public static String getDisplayLength(double distance) {
// default: km
Expand Down
Binary file modified app/src/main/res/drawable-hdpi/app_icon.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: 6 additions & 0 deletions app/src/main/res/values-es/strings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
<string name="accuracy">Prec</string>
<string name="searching">Buscando...</string>
<string name="ready">Listo</string>
<string name="timeout">Tiempo de espera</string>
<string name="nocardspacetitle">No hay espacio de almacenamiento</string>
<string name="lowcardspacetitle">Poco espacio de almacenamiento</string>
<string name="nocardspacedialog">La tarjeta SD está llena y no se pueden recopilar más datos. Debe liberar espacio para poder continuar.</string>
Expand Down Expand Up @@ -149,6 +150,8 @@ Version</string>
<string name="error_answer_match">Las respuestas no son iguales</string>
<string name="error_img_preview">La imagen no pude ser cargada</string>
<string name="use_external_source">Utilizar aplicación externa</string>
<string name="caddisfly_test">Ir a la prueba</string>
<string name="caddisfly_response">Prueba capturada correctamente</string>
<string name="error_empty_form">Un formulario sin respuestas no puede ser enviado. Por favor, responda a las preguntas antes de enviar.</string>
<string name="select">por favor, seleccione</string>
<string name="clear_value_msg">¿Está seguro de que quiere borrar este valor?</string>
Expand All @@ -169,6 +172,9 @@ Version</string>
<string name="add_signature">Añadir firma</string>
<string name="signed_by">Firmado por:</string>
<string name="signature_terms">Entiendo que esta es una representación electrónica de mi firma</string>
<string name="image_location_unknown">Geolocalización no conocida</string>
<string name="image_location_reading">Leyendo geolocalización</string>
<string name="image_location_saved">Geolocalización guardada</string>
<!--RecordList Activity-->
<string name="add_data_point">Añadir punto de datos</string>
<string name="stats_total">Número total de puntos de datos:</string>
Expand Down
6 changes: 6 additions & 0 deletions app/src/main/res/values-fr/strings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
<string name="accuracy">Préc</string>
<string name="searching">Recherche...</string>
<string name="ready">Prêt</string>
<string name="timeout">Temps épuisé</string>
<string name="nocardspacetitle">Il n\'y a pas d\'espace de stockage</string>
<string name="lowcardspacetitle">Faible espace de stockage</string>
<string name="nocardspacedialog">La carte SD sur cet appareil est pleine et vous ne pouvez plus stocker de données. Vous devez effacer des données de la carte SD pour être en mesure de continuer.</string>
Expand Down Expand Up @@ -146,6 +147,8 @@
<string name="error_answer_match">Les réponses ne correspondent pas</string>
<string name="error_img_preview">Impossible de charger l\'image</string>
<string name="use_external_source">Utiliser source externe</string>
<string name="caddisfly_test">Aller à tester</string>
<string name="caddisfly_response">Test effectué avec succès</string>
<string name="error_empty_form">Les formulaires vides ne peuvent être envoyés. Veuillez répondre aux questions.</string>
<string name="select">Veuillez sélectionner</string>
<string name="clear_value_msg">Voulez-vous supprimer cette valeur?</string>
Expand All @@ -166,6 +169,9 @@
<string name="add_signature">Ajouter une signature</string>
<string name="signed_by">Signé par:</string>
<string name="signature_terms">Je comprends que ceci est une image éléctronique représentant ma signature</string>
<string name="image_location_unknown">Géolocalisation non connue</string>
<string name="image_location_reading">Lecture de la géolocalisation</string>
<string name="image_location_saved">Géolocalisation enregistrée</string>
<!--RecordList Activity-->
<string name="add_data_point">Créer un point de donnée</string>
<string name="stats_total">Total de points:</string>
Expand Down
Loading

0 comments on commit 5bda1c2

Please sign in to comment.