diff --git a/RapidFTR-Android/res/layout/form_photo_thumbnail.xml b/RapidFTR-Android/res/layout/form_photo_thumbnail.xml
deleted file mode 100644
index 2ae9e888..00000000
--- a/RapidFTR-Android/res/layout/form_photo_thumbnail.xml
+++ /dev/null
@@ -1,15 +0,0 @@
-
-
-
-
-
-
-
\ No newline at end of file
diff --git a/RapidFTR-Android/res/layout/form_photo_upload_box.xml b/RapidFTR-Android/res/layout/form_photo_upload_box.xml
index c4b9613f..e3e0bc17 100644
--- a/RapidFTR-Android/res/layout/form_photo_upload_box.xml
+++ b/RapidFTR-Android/res/layout/form_photo_upload_box.xml
@@ -4,12 +4,19 @@
xmlns:android="http://schemas.android.com/apk/res/android"
android:orientation="vertical"
android:layout_width="fill_parent"
- android:layout_height="wrap_content">
+ android:layout_height="fill_parent"
+ android:scrollbars="vertical">
-
+
diff --git a/RapidFTR-Android/res/layout/form_section.xml b/RapidFTR-Android/res/layout/form_section.xml
index 3bec908e..a612041f 100644
--- a/RapidFTR-Android/res/layout/form_section.xml
+++ b/RapidFTR-Android/res/layout/form_section.xml
@@ -6,7 +6,8 @@
+ android:layout_height="fill_parent"
+ android:scrollbars="vertical">
@@ -14,7 +15,8 @@
+ android:layout_height="fill_parent"
+ android:scrollbars="vertical"/>
diff --git a/RapidFTR-Android/res/menu/image_menu.xml b/RapidFTR-Android/res/menu/image_menu.xml
new file mode 100644
index 00000000..b9409228
--- /dev/null
+++ b/RapidFTR-Android/res/menu/image_menu.xml
@@ -0,0 +1,6 @@
+
+
+
\ No newline at end of file
diff --git a/RapidFTR-Android/res/values-ar/strings.xml b/RapidFTR-Android/res/values-ar/strings.xml
index ed1bcf63..892f235c 100644
--- a/RapidFTR-Android/res/values-ar/strings.xml
+++ b/RapidFTR-Android/res/values-ar/strings.xml
@@ -48,6 +48,7 @@
حدث خطأ عند تحميل الصورة
لم يتم إلتقاط صورة للسجل
غير قادر على مسح الصورة. الرجاء الذهاب إلى الأستوديو و مسحها يدويا
+ Set as primary photo
تزامن الكل
إلغاء تزامن الكل
diff --git a/RapidFTR-Android/res/values-es/strings.xml b/RapidFTR-Android/res/values-es/strings.xml
index f6d9b23b..ac560646 100644
--- a/RapidFTR-Android/res/values-es/strings.xml
+++ b/RapidFTR-Android/res/values-es/strings.xml
@@ -48,6 +48,7 @@
An error occurred while loading the photo
No photo captured for the record
Unable to delete photo from Gallery. Please go to Gallery and delete it manually
+ Set as primary photo
Synchronize All
Cancel Synchronize All
diff --git a/RapidFTR-Android/res/values-fr/strings.xml b/RapidFTR-Android/res/values-fr/strings.xml
index 45c7d0a3..cd6e30c5 100644
--- a/RapidFTR-Android/res/values-fr/strings.xml
+++ b/RapidFTR-Android/res/values-fr/strings.xml
@@ -49,6 +49,7 @@
An error occurred while loading the photo
No photo captured for the record
Unable to delete photo from Gallery. Please go to Gallery and delete it manually
+ Set as primary photo
Synchronize All
Cancel Synchronize All
diff --git a/RapidFTR-Android/res/values-ru/strings.xml b/RapidFTR-Android/res/values-ru/strings.xml
index 844eb182..ac9c38bb 100644
--- a/RapidFTR-Android/res/values-ru/strings.xml
+++ b/RapidFTR-Android/res/values-ru/strings.xml
@@ -48,6 +48,7 @@
An error occurred while loading the photo
No photo captured for the record
Unable to delete photo from Gallery. Please go to Gallery and delete it manually
+ Set as primary photo
Synchronize All
Cancel Synchronize All
diff --git a/RapidFTR-Android/res/values-zh/strings.xml b/RapidFTR-Android/res/values-zh/strings.xml
index 899d164f..fc814962 100644
--- a/RapidFTR-Android/res/values-zh/strings.xml
+++ b/RapidFTR-Android/res/values-zh/strings.xml
@@ -48,6 +48,7 @@
An error occurred while loading the photo
No photo captured for the record
Unable to delete photo from Gallery. Please go to Gallery and delete it manually
+ Set as primary photo
Synchronize All
Cancel Synchronize All
diff --git a/RapidFTR-Android/res/values/strings.xml b/RapidFTR-Android/res/values/strings.xml
index 2ff87a6d..1e3f7772 100644
--- a/RapidFTR-Android/res/values/strings.xml
+++ b/RapidFTR-Android/res/values/strings.xml
@@ -49,6 +49,8 @@
An error occurred while loading the photo
No photo captured for the record
Unable to delete photo from Gallery. Please go to Gallery and delete it manually
+ Set as primary photo
+
Synchronize All
Cancel Synchronize All
diff --git a/RapidFTR-Android/src/main/java/com/rapidftr/activity/ViewPhotoActivity.java b/RapidFTR-Android/src/main/java/com/rapidftr/activity/ViewPhotoActivity.java
index cebba6f8..dd5371e0 100644
--- a/RapidFTR-Android/src/main/java/com/rapidftr/activity/ViewPhotoActivity.java
+++ b/RapidFTR-Android/src/main/java/com/rapidftr/activity/ViewPhotoActivity.java
@@ -1,7 +1,9 @@
package com.rapidftr.activity;
+import android.content.Intent;
import android.os.Bundle;
import android.view.Menu;
+import android.view.MenuItem;
import android.widget.ImageView;
import com.rapidftr.R;
import com.rapidftr.utils.PhotoCaptureHelper;
@@ -19,9 +21,24 @@ protected void onCreate(Bundle savedInstanceState) {
@Override
public boolean onCreateOptionsMenu(Menu menu) {
- return true;
+ if (getIntent().getBooleanExtra("enabled", false)) {
+ getMenuInflater().inflate(R.menu.image_menu, menu);
+ return true;
+ }
+ return false;
}
+ @Override
+ public boolean onOptionsItemSelected(MenuItem item) {
+ switch (item.getItemId()) {
+ case R.id.set_as_primary:
+ Intent intent = new Intent();
+ intent.putExtra("file_name", getIntent().getStringExtra("file_name"));
+ setResult(RESULT_OK, intent);
+ finish();
+ }
+ return true;
+ }
protected ImageView getImageView() {
return (ImageView) findViewById(R.id.photo);
diff --git a/RapidFTR-Android/src/main/java/com/rapidftr/adapter/ChildViewAdapter.java b/RapidFTR-Android/src/main/java/com/rapidftr/adapter/ChildViewAdapter.java
index aa2e8e26..3c90d03f 100644
--- a/RapidFTR-Android/src/main/java/com/rapidftr/adapter/ChildViewAdapter.java
+++ b/RapidFTR-Android/src/main/java/com/rapidftr/adapter/ChildViewAdapter.java
@@ -47,11 +47,11 @@ public View getView(int position, View convertView, ViewGroup parent) {
if (child != null) {
TextView uniqueIdView = (TextView) view.findViewById(R.id.row_child_unique_id);
TextView nameView = (TextView) view.findViewById(R.id.row_child_name);
-// ImageView imageView = (ImageView) view.findViewById(R.id.thumbnail);
+ ImageView imageView = (ImageView) view.findViewById(R.id.thumbnail);
try {
setFields(String.valueOf(child.getShortId()), uniqueIdView);
setFields(String.valueOf(child.optString("name")), nameView);
-// assignThumbnail(child, imageView);
+ assignThumbnail(child, imageView);
view.setOnClickListener(clickListener(child));
} catch (JSONException e) {
diff --git a/RapidFTR-Android/src/main/java/com/rapidftr/adapter/ImageAdapter.java b/RapidFTR-Android/src/main/java/com/rapidftr/adapter/ImageAdapter.java
index 526aeb0c..1b0fa247 100644
--- a/RapidFTR-Android/src/main/java/com/rapidftr/adapter/ImageAdapter.java
+++ b/RapidFTR-Android/src/main/java/com/rapidftr/adapter/ImageAdapter.java
@@ -53,6 +53,8 @@ public View getView(int position, View convertView, ViewGroup parent) {
try {
bitmap = photoCaptureHelper.getThumbnailOrDefault(photoKeys.get(position).toString());
imageView = new ImageView(context);
+ imageView.setPadding(0,0,0,0);
+ imageView.setAdjustViewBounds(true);
imageView.setImageBitmap(bitmap);
} catch (JSONException e) {
throw new RuntimeException(e);
diff --git a/RapidFTR-Android/src/main/java/com/rapidftr/service/ChildService.java b/RapidFTR-Android/src/main/java/com/rapidftr/service/ChildService.java
index 5dede6bb..f486e2a4 100644
--- a/RapidFTR-Android/src/main/java/com/rapidftr/service/ChildService.java
+++ b/RapidFTR-Android/src/main/java/com/rapidftr/service/ChildService.java
@@ -32,6 +32,7 @@
import static com.google.common.collect.Iterables.transform;
import static com.google.common.collect.Lists.newArrayList;
import static com.rapidftr.database.Database.ChildTableColumn.internal_id;
+import static com.rapidftr.view.fields.PhotoUploadBox.PHOTO_KEYS;
import static java.util.Arrays.asList;
public class ChildService {
@@ -96,11 +97,15 @@ private void setChildAttributes(Child child) throws JSONException {
}
private void addMultiMediaFilesToTheRequest(Child child) throws JSONException {
- if (child.opt("current_photo_key") != null && !child.optString("current_photo_key").equals("")) {
- List