diff options
author | Dominik Schürmann <dominik@dominikschuermann.de> | 2014-08-31 20:39:36 +0200 |
---|---|---|
committer | Dominik Schürmann <dominik@dominikschuermann.de> | 2014-08-31 20:39:36 +0200 |
commit | 9258fbfb744f2bf15debde0ea258cab4c04bbe55 (patch) | |
tree | 22d3081a621b49bcda413c5047f1733ab4bc6a74 /OpenKeychain/src | |
parent | bdf0436c9494f25cd1efaa64b6eb180b6d2673d6 (diff) | |
download | open-keychain-9258fbfb744f2bf15debde0ea258cab4c04bbe55.tar.gz open-keychain-9258fbfb744f2bf15debde0ea258cab4c04bbe55.tar.bz2 open-keychain-9258fbfb744f2bf15debde0ea258cab4c04bbe55.zip |
Cleanup keyspinner layout, key id typeface monospace
Diffstat (limited to 'OpenKeychain/src')
-rw-r--r-- | OpenKeychain/src/main/java/org/sufficientlysecure/keychain/ui/widget/KeySpinner.java | 19 | ||||
-rw-r--r-- | OpenKeychain/src/main/res/layout/keyspinner_key.xml | 68 |
2 files changed, 45 insertions, 42 deletions
diff --git a/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/ui/widget/KeySpinner.java b/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/ui/widget/KeySpinner.java index 2c198d4bf..cde22615c 100644 --- a/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/ui/widget/KeySpinner.java +++ b/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/ui/widget/KeySpinner.java @@ -19,7 +19,6 @@ package org.sufficientlysecure.keychain.ui.widget; import android.content.Context; import android.database.Cursor; -import android.os.Bundle; import android.support.v4.app.FragmentActivity; import android.support.v4.app.LoaderManager; import android.support.v4.content.Loader; @@ -140,9 +139,9 @@ public abstract class KeySpinner extends Spinner implements LoaderManager.Loader @Override public void bindView(View view, Context context, Cursor cursor) { String[] userId = KeyRing.splitUserId(cursor.getString(mIndexUserId)); - ((TextView) view.findViewById(android.R.id.title)).setText(userId[2] == null ? userId[0] : (userId[0] + " (" + userId[2] + ")")); - ((TextView) view.findViewById(android.R.id.text1)).setText(userId[1]); - ((TextView) view.findViewById(android.R.id.text2)).setText(PgpKeyHelper.convertKeyIdToHex(cursor.getLong(mIndexKeyId))); + ((TextView) view.findViewById(R.id.keyspinner_key_name)).setText(userId[2] == null ? userId[0] : (userId[0] + " (" + userId[2] + ")")); + ((TextView) view.findViewById(R.id.keyspinner_key_email)).setText(userId[1]); + ((TextView) view.findViewById(R.id.keyspinner_key_id)).setText(PgpKeyHelper.convertKeyIdToHex(cursor.getLong(mIndexKeyId))); } @Override @@ -194,7 +193,7 @@ public abstract class KeySpinner extends Spinner implements LoaderManager.Loader public View getView(int position, View convertView, ViewGroup parent) { try { View v = getDropDownView(position, convertView, parent); - v.findViewById(android.R.id.text1).setVisibility(View.GONE); + v.findViewById(R.id.keyspinner_key_email).setVisibility(View.GONE); return v; } catch (NullPointerException e) { // This is for the preview... @@ -211,13 +210,13 @@ public abstract class KeySpinner extends Spinner implements LoaderManager.Loader } else { v = convertView; } - ((TextView) v.findViewById(android.R.id.title)).setText("None"); - v.findViewById(android.R.id.text1).setVisibility(View.GONE); - v.findViewById(android.R.id.text2).setVisibility(View.GONE); + ((TextView) v.findViewById(R.id.keyspinner_key_name)).setText("None"); + v.findViewById(R.id.keyspinner_key_email).setVisibility(View.GONE); + v.findViewById(R.id.keyspinner_key_id).setVisibility(View.GONE); } else { v = inner.getView(position - 1, convertView, parent); - v.findViewById(android.R.id.text1).setVisibility(View.VISIBLE); - v.findViewById(android.R.id.text2).setVisibility(View.VISIBLE); + v.findViewById(R.id.keyspinner_key_email).setVisibility(View.VISIBLE); + v.findViewById(R.id.keyspinner_key_id).setVisibility(View.VISIBLE); } return v; } diff --git a/OpenKeychain/src/main/res/layout/keyspinner_key.xml b/OpenKeychain/src/main/res/layout/keyspinner_key.xml index 761566b75..346d09113 100644 --- a/OpenKeychain/src/main/res/layout/keyspinner_key.xml +++ b/OpenKeychain/src/main/res/layout/keyspinner_key.xml @@ -1,35 +1,39 @@ <?xml version="1.0" encoding="utf-8"?> - <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" - android:orientation="vertical" - android:layout_width="wrap_content" - android:padding="4dp" - android:minHeight="24dp" - android:layout_height="wrap_content"> - <TextView android:id="@android:id/title" - android:textColor="?android:attr/textColorSecondary" - android:textSize="18sp" - android:layout_width="wrap_content" - android:layout_height="wrap_content" - android:singleLine="true" - android:ellipsize="end" - /> - <TextView android:id="@android:id/text1" - android:textColor="?android:attr/textColorTertiary" - android:textSize="14sp" - android:layout_width="wrap_content" - android:layout_height="wrap_content" - android:singleLine="true" - android:ellipsize="end" - android:layout_marginTop="-4dip" - android:text=".com"/> - <TextView android:id="@android:id/text2" - android:textColor="?android:attr/textColorTertiary" - android:textSize="14sp" - android:layout_width="wrap_content" - android:layout_height="wrap_content" - android:singleLine="true" - android:ellipsize="end" - android:layout_marginTop="-4dip" - /> + android:orientation="vertical" + android:layout_width="wrap_content" + android:padding="4dp" + android:minHeight="24dp" + android:layout_height="wrap_content"> + + <TextView + android:id="@+id/keyspinner_key_name" + android:textColor="?android:attr/textColorSecondary" + android:textSize="18sp" + android:layout_width="wrap_content" + android:layout_height="wrap_content" + android:singleLine="true" + android:ellipsize="end" /> + + <TextView + android:id="@+id/keyspinner_key_email" + android:textColor="?android:attr/textColorTertiary" + android:textSize="14sp" + android:layout_width="wrap_content" + android:layout_height="wrap_content" + android:singleLine="true" + android:ellipsize="end" + android:layout_marginTop="-4dip" + android:text="alice@example.com" /> + + <TextView + android:id="@+id/keyspinner_key_id" + android:textColor="?android:attr/textColorTertiary" + android:textSize="14sp" + android:layout_width="wrap_content" + android:layout_height="wrap_content" + android:singleLine="true" + android:ellipsize="end" + android:typeface="monospace" + android:layout_marginTop="-4dip" /> </LinearLayout>
\ No newline at end of file |