Skip to content

Commit

Permalink
Merge
Browse files Browse the repository at this point in the history
  • Loading branch information
yanokwa committed May 17, 2013
2 parents a4739bd + cc5259b commit d90afc0
Show file tree
Hide file tree
Showing 7 changed files with 434 additions and 31 deletions.
9 changes: 8 additions & 1 deletion AndroidManifest.xml
Original file line number Diff line number Diff line change
Expand Up @@ -119,7 +119,14 @@
android:label="@string/app_name" />
<activity
android:name=".activities.InstanceUploaderList"
android:label="@string/app_name" />
android:label="@string/app_name">
<intent-filter>
<action android:name="android.intent.action.VIEW" />
<action android:name="android.intent.action.EDIT" />

<category android:name="android.intent.category.DEFAULT" />
</intent-filter>
</activity>
<activity
android:name=".activities.InstanceUploaderActivity"
android:label="@string/app_name" />
Expand Down
26 changes: 26 additions & 0 deletions src/org/odk/collect/android/activities/FormEntryActivity.java
Original file line number Diff line number Diff line change
Expand Up @@ -136,6 +136,7 @@ public class FormEntryActivity extends Activity implements AnimationListener,
public static final int DRAW_IMAGE = 13;
public static final int SIGNATURE_CAPTURE = 14;
public static final int ANNOTATE_IMAGE = 15;
public static final int ALIGNED_IMAGE = 16;

// Extra returned from gp activity
public static final String LOCATION_RESULT = "LOCATION_RESULT";
Expand Down Expand Up @@ -601,6 +602,31 @@ protected void onActivityResult(int requestCode, int resultCode,
+ nf.getAbsolutePath());
}

((ODKView) mCurrentView).setBinaryData(nf);
saveAnswersForCurrentScreen(DO_NOT_EVALUATE_CONSTRAINTS);
break;
case ALIGNED_IMAGE:
/*
* We saved the image to the tempfile_path; the app returns the
* full path to the saved file in the EXTRA_OUTPUT extra. Take
* that file and move it into the instance folder.
*/
String path = intent.getStringExtra(android.provider.MediaStore.EXTRA_OUTPUT);
fi = new File(path);
mInstanceFolder = formController.getInstancePath()
.getParent();
s = mInstanceFolder + File.separator
+ System.currentTimeMillis() + ".jpg";

nf = new File(s);
if (!fi.renameTo(nf)) {
Log.e(t, "Failed to rename " + fi.getAbsolutePath());
} else {
Log.i(t,
"renamed " + fi.getAbsolutePath() + " to "
+ nf.getAbsolutePath());
}

((ODKView) mCurrentView).setBinaryData(nf);
saveAnswersForCurrentScreen(DO_NOT_EVALUATE_CONSTRAINTS);
break;
Expand Down
Loading

0 comments on commit d90afc0

Please sign in to comment.