diff options
author | Vincent Breitmoser <valodim@mugenguild.com> | 2014-03-15 19:58:17 +0100 |
---|---|---|
committer | Vincent Breitmoser <valodim@mugenguild.com> | 2014-03-15 19:58:17 +0100 |
commit | f192c701794716d3b780b635342cf0f2e8b18ef5 (patch) | |
tree | 14f151cdd1b0ac8f234934c797d38ec975c8cc6f /OpenPGP-Keychain/src | |
parent | 5c28da44d6e4dfa72e69fecbacce6f988d5f6eb3 (diff) | |
download | open-keychain-f192c701794716d3b780b635342cf0f2e8b18ef5.tar.gz open-keychain-f192c701794716d3b780b635342cf0f2e8b18ef5.tar.bz2 open-keychain-f192c701794716d3b780b635342cf0f2e8b18ef5.zip |
certs: green dots for verified status \o/
Diffstat (limited to 'OpenPGP-Keychain/src')
-rw-r--r-- | OpenPGP-Keychain/src/main/java/org/sufficientlysecure/keychain/ui/adapter/ViewKeyUserIdsAdapter.java | 12 | ||||
-rw-r--r-- | OpenPGP-Keychain/src/main/res/layout/view_key_userids_item.xml | 12 |
2 files changed, 21 insertions, 3 deletions
diff --git a/OpenPGP-Keychain/src/main/java/org/sufficientlysecure/keychain/ui/adapter/ViewKeyUserIdsAdapter.java b/OpenPGP-Keychain/src/main/java/org/sufficientlysecure/keychain/ui/adapter/ViewKeyUserIdsAdapter.java index 980c401da..4ae6131c9 100644 --- a/OpenPGP-Keychain/src/main/java/org/sufficientlysecure/keychain/ui/adapter/ViewKeyUserIdsAdapter.java +++ b/OpenPGP-Keychain/src/main/java/org/sufficientlysecure/keychain/ui/adapter/ViewKeyUserIdsAdapter.java @@ -25,6 +25,7 @@ import android.view.View; import android.view.ViewGroup; import android.widget.CheckBox; import android.widget.CompoundButton; +import android.widget.ImageView; import android.widget.TextView; import org.sufficientlysecure.keychain.R; import org.sufficientlysecure.keychain.pgp.PgpKeyHelper; @@ -90,18 +91,25 @@ public class ViewKeyUserIdsAdapter extends CursorAdapter { TextView vRank = (TextView) view.findViewById(R.id.rank); TextView vUserId = (TextView) view.findViewById(R.id.userId); TextView vAddress = (TextView) view.findViewById(R.id.address); + ImageView vVerified = (ImageView) view.findViewById(R.id.certified); vRank.setText(Integer.toString(cursor.getInt(mIndexRank))); String[] userId = PgpKeyHelper.splitUserId(cursor.getString(mIndexUserId)); - int verified = cursor.getInt(mVerifiedId); if (userId[0] != null) { - vUserId.setText(userId[0] + (verified > 0 ? " (ok)" : "(nope)")); + vUserId.setText(userId[0]); } else { vUserId.setText(R.string.user_id_no_name); } vAddress.setText(userId[1]); + int verified = cursor.getInt(mVerifiedId); + // TODO introduce own resource for this :) + if(verified > 0) + vVerified.setImageResource(android.R.drawable.presence_online); + else + vVerified.setImageResource(android.R.drawable.presence_invisible); + // don't care further if checkboxes aren't shown if(mCheckStates == null) return; diff --git a/OpenPGP-Keychain/src/main/res/layout/view_key_userids_item.xml b/OpenPGP-Keychain/src/main/res/layout/view_key_userids_item.xml index 2e8cfeb04..aa14e6d2f 100644 --- a/OpenPGP-Keychain/src/main/res/layout/view_key_userids_item.xml +++ b/OpenPGP-Keychain/src/main/res/layout/view_key_userids_item.xml @@ -24,7 +24,8 @@ <LinearLayout android:orientation="vertical" android:layout_width="fill_parent" - android:layout_height="wrap_content"> + android:layout_height="wrap_content" + android:layout_weight="1"> <TextView android:id="@+id/userId" @@ -40,6 +41,15 @@ android:text="@string/label_email" android:textAppearance="?android:attr/textAppearanceSmall" android:paddingLeft="10dp" /> + </LinearLayout> + <ImageView + android:layout_width="wrap_content" + android:layout_height="match_parent" + android:id="@+id/certified" + android:src="@android:drawable/presence_invisible" + android:layout_marginLeft="5dp" + android:layout_marginRight="5dp" /> + </LinearLayout> |