Skip to content

Commit 6ed4104

Browse files
author
Daniil Efremov
committed
Some minor fixes for the new version #30
- wrap text at edit email dialog - add recoginition result after warms up
1 parent dc9941d commit 6ed4104

File tree

1 file changed

+7
-44
lines changed

1 file changed

+7
-44
lines changed

app/src/main/java/openscience/crowdsource/video/experiments/MainActivity.java

Lines changed: 7 additions & 44 deletions
Original file line numberDiff line numberDiff line change
@@ -178,47 +178,6 @@ public class MainActivity extends Activity implements GLSurfaceView.Renderer {
178178
*/
179179
private GoogleApiClient client2;
180180

181-
/**
182-
* Create a file Uri for saving an image or video
183-
*/
184-
private static Uri getOutputMediaFileUri(int type) {
185-
return Uri.fromFile(getOutputMediaFile(type));
186-
}
187-
188-
/**
189-
* Create a File for saving an image or video
190-
*/
191-
private static File getOutputMediaFile(int type) {
192-
// To be safe, you should check that the SDCard is mounted
193-
// using Environment.getExternalStorageState() before doing this.
194-
195-
File mediaStorageDir = new File(Environment.getExternalStoragePublicDirectory(
196-
Environment.DIRECTORY_PICTURES), "Caffe-Android-Demo");
197-
// This location works best if you want the created images to be shared
198-
// between applications and persist after your app has been uninstalled.
199-
200-
201-
// Create the storage directory if it does not exist
202-
if (!mediaStorageDir.exists()) {
203-
if (!mediaStorageDir.mkdirs()) {
204-
Log.d("MyCameraApp", "failed to create directory");
205-
return null;
206-
}
207-
}
208-
209-
// Create a media file name
210-
String timeStamp = new SimpleDateFormat("yyyyMMdd_HHmmss").format(new Date());
211-
File mediaFile;
212-
if (type == MEDIA_TYPE_IMAGE) {
213-
mediaFile = new File(mediaStorageDir.getPath() + File.separator +
214-
"IMG_" + timeStamp + ".jpg");
215-
} else {
216-
return null;
217-
}
218-
219-
return mediaFile;
220-
}
221-
222181
Camera camera;
223182
boolean isCameraStarted = false;
224183
SurfaceView surfaceView;
@@ -480,13 +439,16 @@ public void onClick(DialogInterface dialog, int id) {
480439
});
481440
final AlertDialog clarifyDialog = clarifyDialogBuilder.create();
482441

483-
clarifyDialog.setMessage("");
484-
clarifyDialog.setTitle("(OPTIONAL) Please enter your email if you would like to acknowledge your contributions (will be publicly visible):");
442+
clarifyDialog.setTitle("");
443+
clarifyDialog.setMessage(Html.fromHtml("Please enter your email (OPTIONAL) <br>if you would like to acknowledge your contributions <br>(will be publicly visible):"));
444+
445+
SpannableString spanString = new SpannableString(email.trim());
446+
spanString.setSpan(new UnderlineSpan(), 0, spanString.length(), 0);
447+
485448
clarifyDialog.setView(edittext);
486449
clarifyDialog.show();
487450
}
488451
});
489-
// t_email.bringToFront();
490452

491453
btnSelect = (ImageButton) findViewById(R.id.btnSelect);
492454
btnSelect.setOnClickListener(new Button.OnClickListener() {
@@ -2353,6 +2315,7 @@ public void run() {
23532315
if (it == 0) {
23542316
// first iteration used for mobile warms up if it was in a low freq state
23552317
publishProgress("\nRecognition time (warms up) " + processingTime + " ms \n");
2318+
publishProgress("\nRecognition result (warms up):\n " + recognitionResultText + "\n\n");
23562319
continue;
23572320
}
23582321
publishProgress("\nRecognition time " + it + ": " + processingTime + " ms \n");

0 commit comments

Comments
 (0)