diff options
Diffstat (limited to 'OpenPGP-Keychain/src/main/java/org/sufficientlysecure/keychain/ui/KeyListFragment.java')
-rw-r--r-- | OpenPGP-Keychain/src/main/java/org/sufficientlysecure/keychain/ui/KeyListFragment.java | 19 |
1 files changed, 16 insertions, 3 deletions
diff --git a/OpenPGP-Keychain/src/main/java/org/sufficientlysecure/keychain/ui/KeyListFragment.java b/OpenPGP-Keychain/src/main/java/org/sufficientlysecure/keychain/ui/KeyListFragment.java index 38fce0f0a..3e2c96464 100644 --- a/OpenPGP-Keychain/src/main/java/org/sufficientlysecure/keychain/ui/KeyListFragment.java +++ b/OpenPGP-Keychain/src/main/java/org/sufficientlysecure/keychain/ui/KeyListFragment.java @@ -50,6 +50,7 @@ import android.widget.AbsListView.MultiChoiceModeListener; import android.widget.AdapterView; import android.widget.Button; import android.widget.FrameLayout; +import android.widget.ImageView; import android.widget.ListView; import android.widget.TextView; import com.beardedhen.androidbootstrap.BootstrapButton; @@ -251,13 +252,15 @@ public class KeyListFragment extends Fragment KeyRings.MASTER_KEY_ID, KeyRings.USER_ID, KeyRings.IS_REVOKED, + KeyRings.VERIFIED, KeyRings.HAS_SECRET }; static final int INDEX_MASTER_KEY_ID = 1; static final int INDEX_USER_ID = 2; static final int INDEX_IS_REVOKED = 3; - static final int INDEX_HAS_SECRET = 4; + static final int INDEX_VERIFIED = 4; + static final int INDEX_HAS_SECRET = 5; @Override public Loader<Cursor> onCreateLoader(int id, Bundle args) { @@ -491,12 +494,14 @@ public class KeyListFragment extends Fragment FrameLayout statusLayout = (FrameLayout) view.findViewById(R.id.status_layout); Button button = (Button) view.findViewById(R.id.edit); TextView revoked = (TextView) view.findViewById(R.id.revoked); + ImageView verified = (ImageView) view.findViewById(R.id.verified); if (cursor.getInt(KeyListFragment.INDEX_HAS_SECRET) != 0) { // this is a secret key - show the edit button statusDivider.setVisibility(View.VISIBLE); statusLayout.setVisibility(View.VISIBLE); revoked.setVisibility(View.GONE); + verified.setVisibility(View.GONE); button.setVisibility(View.VISIBLE); final long id = cursor.getLong(INDEX_MASTER_KEY_ID); @@ -514,8 +519,16 @@ public class KeyListFragment extends Fragment button.setVisibility(View.GONE); boolean isRevoked = cursor.getInt(INDEX_IS_REVOKED) > 0; - statusLayout.setVisibility(isRevoked ? View.VISIBLE : View.GONE); - revoked.setVisibility(isRevoked ? View.VISIBLE : View.GONE); + if(isRevoked) { + statusLayout.setVisibility(isRevoked ? View.VISIBLE : View.GONE); + revoked.setVisibility(isRevoked ? View.VISIBLE : View.GONE); + verified.setVisibility(View.GONE); + } else { + boolean isVerified = cursor.getInt(INDEX_VERIFIED) > 0; + statusLayout.setVisibility(isVerified ? View.VISIBLE : View.GONE); + revoked.setVisibility(View.GONE); + verified.setVisibility(isVerified ? View.VISIBLE : View.GONE); + } } } |