ImportKeys: Hide key status icon until key is downloaded

This commit is contained in:
Andrea Torlaschi
2016-08-25 22:57:11 +02:00
parent d87813a9e9
commit 4d813179c4
2 changed files with 97 additions and 88 deletions

View File

@@ -37,49 +37,30 @@
android:paddingLeft="16dp"
android:paddingRight="16dp">
<RelativeLayout
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="horizontal">
android:orientation="vertical">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_alignParentLeft="true"
android:layout_toLeftOf="@+id/status"
android:orientation="vertical">
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:textAppearance="?android:attr/textAppearanceMedium"
app:keyRevokedOrExpired="@{entry.revokedOrExpired}"
app:keySecret="@{entry.secretKey}"
app:keyUserId="@{entry.primaryUserId.name}"
app:query="@{entry.query}" />
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="4dp"
android:textAppearance="?android:attr/textAppearanceSmall"
app:keyRevokedOrExpired="@{entry.revokedOrExpired}"
app:keyUserEmail="@{entry.primaryUserId.email}"
app:query="@{entry.query}" />
</LinearLayout>
<ImageView
android:id="@+id/status"
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentRight="true"
android:layout_centerVertical="true"
android:visibility="@{entry.revokedOrExpired ? V.VISIBLE : V.GONE}"
app:keyExpired="@{entry.expired}"
app:keyRevoked="@{entry.revoked}" />
android:textAppearance="?android:attr/textAppearanceMedium"
app:keyRevokedOrExpired="@{entry.revokedOrExpired}"
app:keySecret="@{entry.secretKey}"
app:keyUserId="@{entry.primaryUserId.name}"
app:query="@{entry.query}" />
</RelativeLayout>
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="4dp"
android:textAppearance="?android:attr/textAppearanceSmall"
app:keyRevokedOrExpired="@{entry.revokedOrExpired}"
app:keyUserEmail="@{entry.primaryUserId.email}"
app:query="@{entry.query}" />
</LinearLayout>
</LinearLayout>

View File

@@ -23,68 +23,96 @@
android:paddingLeft="8dp"
android:paddingRight="8dp">
<LinearLayout
<RelativeLayout
android:layout_width="match_parent"
android:layout_height="wrap_content">
android:layout_height="wrap_content"
android:orientation="horizontal">
<TextView
<LinearLayout
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="@string/label_key_id_colon"
android:textAppearance="?android:attr/textAppearanceSmall"
android:textColor="?attr/colorText" />
android:layout_alignParentLeft="true"
android:layout_toLeftOf="@+id/status"
android:orientation="vertical">
<TextView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginLeft="8dp"
android:textAppearance="?android:attr/textAppearanceSmall"
android:textColor="?attr/colorText"
app:keyId="@{entry.keyIdHex}" />
<LinearLayout
android:layout_width="wrap_content"
android:layout_height="wrap_content">
</LinearLayout>
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="@string/label_key_id_colon"
android:textAppearance="?android:attr/textAppearanceSmall"
android:textColor="?attr/colorText" />
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content">
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginLeft="8dp"
android:textAppearance="?android:attr/textAppearanceSmall"
android:textColor="?attr/colorText"
app:keyId="@{entry.keyIdHex}" />
<TextView
</LinearLayout>
<LinearLayout
android:layout_width="wrap_content"
android:layout_height="wrap_content">
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="@string/label_algorithm_colon"
android:textAppearance="?android:attr/textAppearanceSmall"
android:textColor="?attr/colorText" />
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginLeft="8dp"
android:text="@{entry.algorithm ?? @string/unknown}"
android:textAppearance="?android:attr/textAppearanceSmall"
android:textColor="?attr/colorText" />
</LinearLayout>
<LinearLayout
android:layout_width="wrap_content"
android:layout_height="wrap_content">
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="@string/label_creation_colon"
android:textAppearance="?android:attr/textAppearanceSmall"
android:textColor="?attr/colorText" />
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginLeft="8dp"
android:textAppearance="?android:attr/textAppearanceSmall"
android:textColor="?attr/colorText"
app:keyCreation="@{entry.date}" />
</LinearLayout>
</LinearLayout>
<ImageView
android:id="@+id/status"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="@string/label_algorithm_colon"
android:textAppearance="?android:attr/textAppearanceSmall"
android:textColor="?attr/colorText" />
android:layout_alignParentRight="true"
android:layout_centerVertical="true"
android:paddingLeft="8dp"
android:paddingRight="8dp"
android:visibility="@{entry.revokedOrExpired ? V.VISIBLE : V.GONE}"
app:keyExpired="@{entry.expired}"
app:keyRevoked="@{entry.revoked}" />
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginLeft="8dp"
android:text="@{entry.algorithm ?? @string/unknown}"
android:textAppearance="?android:attr/textAppearanceSmall"
android:textColor="?attr/colorText" />
</LinearLayout>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content">
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="@string/label_creation_colon"
android:textAppearance="?android:attr/textAppearanceSmall"
android:textColor="?attr/colorText" />
<TextView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginLeft="8dp"
android:textAppearance="?android:attr/textAppearanceSmall"
android:textColor="?attr/colorText"
app:keyCreation="@{entry.date}" />
</LinearLayout>
</RelativeLayout>
<LinearLayout
android:layout_width="match_parent"