ImportKeys: Use data binding for extra informations about the key and refactoring

This commit is contained in:
Andrea Torlaschi
2016-08-04 15:29:33 +02:00
parent 6ecc53d0a6
commit efa651284e
7 changed files with 159 additions and 123 deletions

View File

@@ -6,7 +6,6 @@
<import type="org.sufficientlysecure.keychain.keyimport.ImportKeysListEntry" />
<variable name="nonInteractive" type="boolean" />
<variable name="entry" type="ImportKeysListEntry" />
</data>
@@ -67,13 +66,6 @@
app:keyUserEmail="@{entry.primaryUserId.email}"
app:query="@{entry.query}" />
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:textAppearance="?android:attr/textAppearanceSmall"
app:keyId="@{entry.keyIdHex}"
app:keyRevokedOrExpired="@{entry.revokedOrExpired}" />
</LinearLayout>
<ImageView
@@ -133,10 +125,12 @@
android:paddingTop="16dp"
android:visibility="gone">
<org.sufficientlysecure.keychain.ui.widget.ImportUserIdsView
android:id="@+id/extra_user_ids"
android:layout_width="match_parent"
android:layout_height="wrap_content" />
<include
layout="@layout/import_keys_list_item_extra"
app:keyIdHex="@{entry.keyIdHex}"
app:keyUserIds="@{entry.sortedUserIds}"
app:query="@{entry.query}"
app:revokedOrExpired="@{entry.revokedOrExpired}" />
</LinearLayout>

View File

@@ -0,0 +1,36 @@
<layout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto">
<data>
<import type="java.util.ArrayList" />
<variable name="keyIdHex" type="String" />
<variable name="keyUserIds" type="ArrayList" />
<variable name="query" type="String" />
<variable name="revokedOrExpired" type="boolean" />
</data>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="vertical">
<TextView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:textAppearance="?android:attr/textAppearanceSmall"
app:keyId="@{keyIdHex}"
app:keyRevokedOrExpired="@{revokedOrExpired}" />
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="4dp"
android:orientation="vertical"
app:keyRevokedOrExpired="@{revokedOrExpired}"
app:keyUserIds="@{keyUserIds}"
app:query="@{query}" />
</LinearLayout>
</layout>