ImportKeys: Show single key card for files with only one key
This commit is contained in:
@@ -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();
|
||||
|
||||
@@ -1,11 +1,13 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<layout xmlns:android="http://schemas.android.com/apk/res/android">
|
||||
<layout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
xmlns:app="http://schemas.android.com/apk/res-auto">
|
||||
|
||||
<data>
|
||||
<import type="android.view.View" alias="V" />
|
||||
<import type="org.sufficientlysecure.keychain.ui.ImportKeysListFragment" alias="I" />
|
||||
|
||||
<variable name="status" type="int" />
|
||||
<variable name="number" type="int" />
|
||||
<variable name="advanced" type="boolean" />
|
||||
</data>
|
||||
|
||||
@@ -45,11 +47,12 @@
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:visibility="@{advanced ? V.GONE : V.VISIBLE}">
|
||||
android:visibility="@{advanced || (number == 1) ? V.GONE : V.VISIBLE}">
|
||||
|
||||
<include
|
||||
android:id="@+id/basic"
|
||||
layout="@layout/import_keys_list_basic_item" />
|
||||
layout="@layout/import_keys_list_basic_item"
|
||||
app:number="@{number}" />
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
@@ -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}" />
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
|
||||
Reference in New Issue
Block a user