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:paddingLeft="16dp"
android:paddingRight="16dp"> android:paddingRight="16dp">
<RelativeLayout <LinearLayout
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:orientation="horizontal"> android:orientation="vertical">
<LinearLayout <TextView
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"
android:layout_width="wrap_content" android:layout_width="wrap_content"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_alignParentRight="true" android:textAppearance="?android:attr/textAppearanceMedium"
android:layout_centerVertical="true" app:keyRevokedOrExpired="@{entry.revokedOrExpired}"
android:visibility="@{entry.revokedOrExpired ? V.VISIBLE : V.GONE}" app:keySecret="@{entry.secretKey}"
app:keyExpired="@{entry.expired}" app:keyUserId="@{entry.primaryUserId.name}"
app:keyRevoked="@{entry.revoked}" /> 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> </LinearLayout>

View File

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