aboutsummaryrefslogtreecommitdiffstats
path: root/OpenPGP-Keychain/src
diff options
context:
space:
mode:
authorDominik Schürmann <dominik@dominikschuermann.de>2014-03-26 18:34:48 +0100
committerDominik Schürmann <dominik@dominikschuermann.de>2014-03-26 18:34:48 +0100
commitcc8fd35137d1c8e78727a76a5cceb5f92b234a0f (patch)
tree70dff87904885f7e7cba909a2194bd1fea5833d1 /OpenPGP-Keychain/src
parentac134790a0e2fef7a6c5cb44818d58deeaec0b62 (diff)
downloadopen-keychain-cc8fd35137d1c8e78727a76a5cceb5f92b234a0f.tar.gz
open-keychain-cc8fd35137d1c8e78727a76a5cceb5f92b234a0f.tar.bz2
open-keychain-cc8fd35137d1c8e78727a76a5cceb5f92b234a0f.zip
Show divider only when used
Diffstat (limited to 'OpenPGP-Keychain/src')
-rw-r--r--OpenPGP-Keychain/src/main/java/org/sufficientlysecure/keychain/ui/KeyListFragment.java6
-rw-r--r--OpenPGP-Keychain/src/main/res/layout/key_list_item.xml4
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>