Better content descriptions for the account list items

Signed-off-by: Peter Vágner <pvdeejay@gmail.com>
pull/171/head
Peter Vágner 5 years ago committed by M66B
parent 5050a8f0a8
commit 76ece08d8f

@ -135,6 +135,7 @@ public class AdapterAccount extends RecyclerView.Adapter<AdapterAccount.ViewHold
vwColor.setVisibility(ActivityBilling.isPro(context) ? View.VISIBLE : View.INVISIBLE); vwColor.setVisibility(ActivityBilling.isPro(context) ? View.VISIBLE : View.INVISIBLE);
ivSync.setImageResource(account.synchronize ? R.drawable.baseline_sync_24 : R.drawable.baseline_sync_disabled_24); ivSync.setImageResource(account.synchronize ? R.drawable.baseline_sync_24 : R.drawable.baseline_sync_disabled_24);
ivSync.setContentDescription(context.getString(account.synchronize ? R.string.title_legend_synchronize_on : R.string.title_legend_synchronize_off));
ivOAuth.setVisibility( ivOAuth.setVisibility(
settings && account.auth_type != MailService.AUTH_TYPE_PASSWORD ? View.VISIBLE : View.GONE); settings && account.auth_type != MailService.AUTH_TYPE_PASSWORD ? View.VISIBLE : View.GONE);
@ -155,14 +156,19 @@ public class AdapterAccount extends RecyclerView.Adapter<AdapterAccount.ViewHold
tvUser.setText(account.user); tvUser.setText(account.user);
if ("connected".equals(account.state)) if ("connected".equals(account.state)) {
ivState.setImageResource(R.drawable.baseline_cloud_24); ivState.setImageResource(R.drawable.baseline_cloud_24);
else if ("connecting".equals(account.state)) ivState.setContentDescription(context.getString(R.string.title_legend_connected));
} else if ("connecting".equals(account.state)) {
ivState.setImageResource(R.drawable.baseline_cloud_queue_24); ivState.setImageResource(R.drawable.baseline_cloud_queue_24);
else if ("closing".equals(account.state)) ivState.setContentDescription(context.getString(R.string.title_legend_connecting));
} else if ("closing".equals(account.state)) {
ivState.setImageResource(R.drawable.baseline_close_24); ivState.setImageResource(R.drawable.baseline_close_24);
else ivState.setContentDescription(context.getString(R.string.title_legend_closing));
} else {
ivState.setImageResource(R.drawable.baseline_cloud_off_24); ivState.setImageResource(R.drawable.baseline_cloud_off_24);
ivState.setContentDescription(context.getString(R.string.title_legend_disconnected));
}
ivState.setVisibility(account.synchronize || account.state != null ? View.VISIBLE : View.INVISIBLE); ivState.setVisibility(account.synchronize || account.state != null ? View.VISIBLE : View.INVISIBLE);
tvHost.setText(String.format("%s:%d", account.host, account.port)); tvHost.setText(String.format("%s:%d", account.host, account.port));

@ -38,7 +38,7 @@
android:layout_height="24dp" android:layout_height="24dp"
android:layout_marginStart="6dp" android:layout_marginStart="6dp"
android:layout_marginEnd="6dp" android:layout_marginEnd="6dp"
android:contentDescription="@string/title_legend_connection_state" android:contentDescription="@string/title_legend_disconnected"
app:layout_constraintBottom_toBottomOf="@+id/tvName" app:layout_constraintBottom_toBottomOf="@+id/tvName"
app:layout_constraintStart_toEndOf="@id/vwColor" app:layout_constraintStart_toEndOf="@id/vwColor"
app:layout_constraintTop_toTopOf="@+id/tvName" app:layout_constraintTop_toTopOf="@+id/tvName"
@ -49,7 +49,7 @@
android:layout_width="24dp" android:layout_width="24dp"
android:layout_height="24dp" android:layout_height="24dp"
android:layout_marginStart="6dp" android:layout_marginStart="6dp"
android:contentDescription="@string/title_legend_primary" android:contentDescription="@string/title_legend_oauth"
app:layout_constraintBottom_toBottomOf="@+id/tvName" app:layout_constraintBottom_toBottomOf="@+id/tvName"
app:layout_constraintStart_toEndOf="@id/ivState" app:layout_constraintStart_toEndOf="@id/ivState"
app:layout_constraintTop_toTopOf="@+id/tvName" app:layout_constraintTop_toTopOf="@+id/tvName"
@ -98,7 +98,7 @@
android:layout_width="24dp" android:layout_width="24dp"
android:layout_height="24dp" android:layout_height="24dp"
android:layout_marginEnd="6dp" android:layout_marginEnd="6dp"
android:contentDescription="@string/title_legend_sync_state" android:contentDescription="@string/title_legend_synchronize_on"
app:layout_constraintBottom_toBottomOf="@+id/tvName" app:layout_constraintBottom_toBottomOf="@+id/tvName"
app:layout_constraintEnd_toEndOf="parent" app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintTop_toTopOf="@+id/tvName" app:layout_constraintTop_toTopOf="@+id/tvName"

Loading…
Cancel
Save