Show identity sign key id

pull/164/head
M66B 5 years ago
parent a3fbf0760c
commit 09d56c2713

@ -71,6 +71,7 @@ public class AdapterIdentity extends RecyclerView.Adapter<AdapterIdentity.ViewHo
private TextView tvHost;
private ImageView ivState;
private TextView tvAccount;
private TextView tvSignKeyId;
private TextView tvLast;
private TextView tvError;
@ -88,6 +89,7 @@ public class AdapterIdentity extends RecyclerView.Adapter<AdapterIdentity.ViewHo
tvHost = itemView.findViewById(R.id.tvHost);
ivState = itemView.findViewById(R.id.ivState);
tvAccount = itemView.findViewById(R.id.tvAccount);
tvSignKeyId = itemView.findViewById(R.id.tvSignKeyId);
tvLast = itemView.findViewById(R.id.tvLast);
tvError = itemView.findViewById(R.id.tvError);
}
@ -123,6 +125,9 @@ public class AdapterIdentity extends RecyclerView.Adapter<AdapterIdentity.ViewHo
tvHost.setText(String.format("%s:%d", identity.host, identity.port));
tvAccount.setText(identity.accountName);
tvSignKeyId.setText(identity.sign_key == null ? null
: context.getString(R.string.title_sign_key, Long.toHexString(identity.sign_key)));
tvSignKeyId.setVisibility(identity.sign_key == null ? View.GONE : View.VISIBLE);
tvLast.setText(context.getString(R.string.title_last_connected,
identity.last_connected == null ? "-" : DTF.format(identity.last_connected)));

@ -123,6 +123,20 @@
app:layout_constraintStart_toEndOf="@id/tvHost"
app:layout_constraintTop_toTopOf="@id/tvHost" />
<TextView
android:id="@+id/tvSignKeyId"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_marginStart="6dp"
android:layout_marginEnd="6dp"
android:ellipsize="start"
android:singleLine="true"
android:text="@string/title_sign_key"
android:textAppearance="@style/TextAppearance.AppCompat.Small"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toEndOf="@+id/ivState"
app:layout_constraintTop_toBottomOf="@id/tvHost" />
<TextView
android:id="@+id/tvLast"
android:layout_width="0dp"
@ -135,7 +149,7 @@
android:textAppearance="@style/TextAppearance.AppCompat.Small"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toEndOf="@+id/ivState"
app:layout_constraintTop_toBottomOf="@id/tvHost" />
app:layout_constraintTop_toBottomOf="@id/tvSignKeyId" />
<TextView
android:id="@+id/tvError"

@ -458,6 +458,7 @@
<string name="title_account_delete">Delete this account permanently?</string>
<string name="title_identity_delete">Delete this identity permanently?</string>
<string name="title_edit_html">Edit as HTML</string>
<string name="title_sign_key">Sign key: %1$s</string>
<string name="title_last_connected">Last connected: %1$s</string>
<string name="title_pop_support">The POP3 protocol supports downloading and deleting messages from the inbox only. POP3 cannot mark messages as read, move messages, etc. POP3 will use more battery power and data than IMAP. So, consider using the IMAP protocol whenever possible.</string>
<string name="title_activesync_support">ActiveSync is not supported</string>

Loading…
Cancel
Save