diff options
-rw-r--r-- | OpenPGP-Keychain/src/main/java/org/sufficientlysecure/keychain/ui/KeyListFragment.java | 6 | ||||
-rw-r--r-- | OpenPGP-Keychain/src/main/res/layout/key_list_item.xml | 4 |
2 files changed, 8 insertions, 2 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 daf455c03..957c822d2 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 @@ -498,11 +498,15 @@ public class KeyListFragment extends Fragment } { // set edit button and revoked info, specific by key type + View statusDivider = (View) view.findViewById(R.id.status_divider); + 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); if (cursor.getInt(KeyListFragment.INDEX_TYPE) == KeyTypes.SECRET) { // this is a secret key - show the edit button + statusDivider.setVisibility(View.VISIBLE); + statusLayout.setVisibility(View.VISIBLE); revoked.setVisibility(View.GONE); button.setVisibility(View.VISIBLE); @@ -519,9 +523,11 @@ public class KeyListFragment extends Fragment }); } else { // this is a public key - hide the edit button, show if it's revoked + statusDivider.setVisibility(View.GONE); 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); } } diff --git a/OpenPGP-Keychain/src/main/res/layout/key_list_item.xml b/OpenPGP-Keychain/src/main/res/layout/key_list_item.xml index bee56ddfe..0abae8bbb 100644 --- a/OpenPGP-Keychain/src/main/res/layout/key_list_item.xml +++ b/OpenPGP-Keychain/src/main/res/layout/key_list_item.xml @@ -39,6 +39,7 @@ </LinearLayout> <View + android:id="@+id/status_divider" android:layout_width="1dip" android:layout_height="match_parent" android:layout_marginBottom="8dp" @@ -46,6 +47,7 @@ android:background="?android:attr/listDivider" /> <FrameLayout + android:id="@+id/status_layout" android:layout_width="80dp" android:layout_height="match_parent"> @@ -55,7 +57,6 @@ android:layout_height="match_parent" android:id="@+id/edit" android:focusable="false" - android:visibility="visible" android:enabled="true" android:textAppearance="?android:attr/textAppearanceSmall" android:textColor="@color/black" @@ -71,7 +72,6 @@ android:textAppearance="?android:attr/textAppearanceSmall" android:text="@string/revoked" android:textColor="#e00" - android:visibility="visible" android:layout_gravity="center" /> </FrameLayout> |