3838import android .provider .MediaStore ;
3939import android .support .annotation .NonNull ;
4040import android .text .Html ;
41+ import android .text .SpannableString ;
42+ import android .text .style .UnderlineSpan ;
4143import android .util .Base64 ;
4244import android .util .Log ;
4345import android .view .SurfaceHolder ;
@@ -92,6 +94,7 @@ public class MainActivity extends Activity implements GLSurfaceView.Renderer {
9294 private static final int REQUEST_IMAGE_CAPTURE = 100 ;
9395 private static final int REQUEST_IMAGE_SELECT = 200 ;
9496 public static final int MEDIA_TYPE_IMAGE = 1 ;
97+ public static final String ACKNOWLEDGE_YOUR_CONTRIBUTIONS = "acknowledge your contributions!" ;
9598
9699
97100 String welcome = "This application let you participate in experiment crowdsourcing " +
@@ -569,8 +572,15 @@ private void loadCachedEmail() {
569572 email = read_one_string_file (pemail );
570573 if (email == null ) email = "" ;
571574 if (!email .equals ("" )) {
572- t_email .setText (email .trim ());
575+ SpannableString spanString = new SpannableString (email );
576+ spanString .setSpan (new UnderlineSpan (), 0 , spanString .length (), 0 );
577+ t_email .setText (spanString );
578+ } else {
579+ SpannableString spanString = new SpannableString (ACKNOWLEDGE_YOUR_CONTRIBUTIONS );
580+ spanString .setSpan (new UnderlineSpan (), 0 , spanString .length (), 0 );
581+ t_email .setText (spanString );
573582 }
583+
574584 }
575585
576586 private boolean updateEMail (String newEmailValue ) {
@@ -584,9 +594,10 @@ private boolean updateEMail(String newEmailValue) {
584594 log .append ("ERROR: can't write local configuration (" + pemail + "!" );
585595 return true ;
586596 }
587- t_email .setText (email .trim ());
597+ SpannableString spanString = new SpannableString (email .trim ());
598+ spanString .setSpan (new UnderlineSpan (), 0 , spanString .length (), 0 );
599+ t_email .setText (spanString );
588600 }
589- t_email .setText (emailTrimmed );
590601 return false ;
591602 }
592603
@@ -2341,11 +2352,12 @@ public void run() {
23412352 }
23422353 if (it == 0 ) {
23432354 // first iteration used for mobile warms up if it was in a low freq state
2355+ publishProgress ("\n Recognition time (warms up) " + processingTime + " ms \n " );
23442356 continue ;
23452357 }
2358+ publishProgress ("\n Recognition time " + it + ": " + processingTime + " ms \n " );
23462359 cpuFreqs .add (get_cpu_freqs ());
23472360 processingTimes .add (processingTime );
2348- publishProgress ("\n Recognition time " + it + ": " + processingTime + " ms \n " );
23492361 }
23502362 publishProgress ("\n Recognition result:\n " + recognitionResultText + "\n \n " );
23512363
0 commit comments