front mostly functional
authorEugene Crosser <crosser@average.org>
Wed, 1 May 2013 20:02:22 +0000 (00:02 +0400)
committerEugene Crosser <crosser@average.org>
Wed, 1 May 2013 20:02:22 +0000 (00:02 +0400)
res/values/strings.xml
src/org/average/nfcauthcr/NFCAuthCREnroll.java

index d3d2fe83a581e0ac6cf19a540ffd0ba92754de40..0fa12b66802be0fad0cc93cdcfb42aead51d8300 100644 (file)
@@ -1,8 +1,9 @@
 <?xml version="1.0" encoding="utf-8"?>
 <resources>
-    <string name="app_name">NFC Auth</string>
-    <string name="enroll">Enroll</string>
-    <string name="select_slot">Select Slot</string>
-    <string name="slot_1">Slot 1</string>
-    <string name="slot_2">Slot 2</string>
+       <string name="app_name">NFC Auth</string>
+       <string name="enroll">Enroll</string>
+       <string name="select_slot">Select Slot</string>
+       <string name="slot_1">Slot 1</string>
+       <string name="slot_2">Slot 2</string>
+       <string name="enrollresult">Enrollment result:</string>
 </resources>
index 098011a558537164450c2846b6ea751a7ed567bb..6aae6f1970e4e38b30d10285ed3b1ab904abeafc 100644 (file)
@@ -2,11 +2,14 @@ package org.average.nfcauthcr;
 
 import android.os.Bundle;
 import android.app.Activity;
+import android.app.AlertDialog;
 import android.preference.PreferenceManager;
 import android.content.SharedPreferences;
 import android.content.SharedPreferences.Editor;
+import android.content.DialogInterface;
 import android.util.Log;
 import android.view.View;
+import android.widget.TextView;
 import android.widget.RadioButton;
 
 public class NFCAuthCREnroll extends Activity
@@ -69,6 +72,27 @@ public class NFCAuthCREnroll extends Activity
 
        public void onEnrollClicked(View view) {
                Log.v(TAG, "Enroll clicked");
-               if (!waitingForResult) { finish(); }
+               if (slot > 0) {
+                       showEnrollResult("<FIXME> using slot" + slot);
+               } else {
+                       showEnrollResult("Must specify which slot to use");
+               }
+       }
+
+       private void showEnrollResult(final String msg) {
+               Log.v(TAG, "Show result: \"" + msg + "\"");
+
+               AlertDialog.Builder builder = new AlertDialog.Builder(this);
+               builder.setTitle(R.string.enrollresult);
+               builder.setMessage(msg);
+               builder.setPositiveButton(android.R.string.ok,
+                               new DialogInterface.OnClickListener() {
+                       public void onClick(DialogInterface dialog, int which) {
+                               dialog.dismiss();
+                               if (!waitingForResult) { finish(); }
+                       }
+               });
+               AlertDialog dialog = builder.create();
+               dialog.show();
        }
 }