From 1e33cd3a1a2960409fae9a06228e45b1f096c5ca Mon Sep 17 00:00:00 2001 From: Andrea Torlaschi Date: Tue, 23 Aug 2016 16:59:42 +0200 Subject: [PATCH] ImportKeys: Show single key card for files with only one key --- .../keychain/ui/ImportKeysListFragment.java | 2 +- .../src/main/res/layout/import_keys_list_fragment.xml | 11 +++++++---- 2 files changed, 8 insertions(+), 5 deletions(-) diff --git a/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/ui/ImportKeysListFragment.java b/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/ui/ImportKeysListFragment.java index 2849002ea..ad6c41f2c 100644 --- a/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/ui/ImportKeysListFragment.java +++ b/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/ui/ImportKeysListFragment.java @@ -283,7 +283,7 @@ public class ImportKeysListFragment extends Fragment implements mAdapter.setData(data.getResult()); int size = mAdapter.getItemCount(); - mBindingBasic.setNumber(size); + mBinding.setNumber(size); mBinding.setStatus(size > 0 ? STATUS_LOADED : STATUS_EMPTY); GetKeyResult getKeyResult = (GetKeyResult) data.getOperationResult(); diff --git a/OpenKeychain/src/main/res/layout/import_keys_list_fragment.xml b/OpenKeychain/src/main/res/layout/import_keys_list_fragment.xml index 6393d6ab1..6712a5132 100644 --- a/OpenKeychain/src/main/res/layout/import_keys_list_fragment.xml +++ b/OpenKeychain/src/main/res/layout/import_keys_list_fragment.xml @@ -1,11 +1,13 @@ - + + @@ -45,11 +47,12 @@ + android:visibility="@{advanced || (number == 1) ? V.GONE : V.VISIBLE}"> + layout="@layout/import_keys_list_basic_item" + app:number="@{number}" /> @@ -58,7 +61,7 @@ android:layout_width="match_parent" android:layout_height="match_parent" android:scrollbars="vertical" - android:visibility="@{advanced ? V.VISIBLE : V.GONE}" /> + android:visibility="@{advanced || (number == 1) ? V.VISIBLE : V.GONE}" />