]> Pileus Git - ~andy/freeotp/commitdiff
Display text when no keys are installed.
authorNathaniel McCallum <npmccallum@redhat.com>
Thu, 4 Jul 2013 21:57:20 +0000 (17:57 -0400)
committerNathaniel McCallum <npmccallum@redhat.com>
Thu, 4 Jul 2013 21:57:20 +0000 (17:57 -0400)
res/layout/main.xml [new file with mode: 0644]
res/values/strings.xml
src/org/fedorahosted/freeotp/MainActivity.java

diff --git a/res/layout/main.xml b/res/layout/main.xml
new file mode 100644 (file)
index 0000000..e89c1b4
--- /dev/null
@@ -0,0 +1,24 @@
+<?xml version="1.0" encoding="utf-8"?>
+<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
+       android:orientation="vertical"
+       android:layout_width="match_parent"
+       android:layout_height="match_parent"
+       >
+
+    <TextView
+        android:id="@android:id/empty"
+        android:layout_width="match_parent"
+        android:layout_height="match_parent"
+        android:padding="8dp"
+        android:gravity="center"
+        android:text="@string/no_keys"
+        />
+
+    <ListView
+        android:id="@android:id/list"
+        android:layout_width="match_parent"
+        android:layout_height="0dp"
+        android:layout_weight="1"
+        android:drawSelectorOnTop="false"
+        />
+</LinearLayout>
\ No newline at end of file
index bece3d222fb1ddcd6550032d5fddc2cddeb89cd2..c0034084b833b0f345933223ab907d5c7fc270b3 100644 (file)
@@ -9,4 +9,5 @@
     <string name="no">No</string>
     <string name="install_title">Install Barcode Scanner?</string>
     <string name="install_message">Barcode Scanner is required. Would you like to install it?</string>
+    <string name="no_keys">No OTP keys installed.</string>
 </resources>
index c54950c1220c0184eee24712412068e40218e859..e8451d0c21728313dc6e539a5a658437c158cd92 100644 (file)
@@ -85,7 +85,7 @@ public class MainActivity extends ListActivity {
     @Override
     protected void onCreate(Bundle savedInstanceState) {
         super.onCreate(savedInstanceState);
-        
+        setContentView(R.layout.main);
         ta = new TokenAdapter(this);
         setListAdapter(ta);
     }