mirror of
https://github.com/M66B/FairEmail.git
synced 2025-03-14 16:10:39 +00:00
Added accessibility descriptions
This commit is contained in:
parent
fd919d6436
commit
c1e59c912e
4 changed files with 15 additions and 4 deletions
|
@ -782,6 +782,8 @@ public class AdapterMessage extends RecyclerView.Adapter<AdapterMessage.ViewHold
|
|||
if (ibExpander.getTag() == null || (boolean) ibExpander.getTag() != expanded) {
|
||||
ibExpander.setTag(expanded);
|
||||
ibExpander.setImageLevel(expanded ? 0 /* less */ : 1 /* more */);
|
||||
ibExpander.setContentDescription(context.getString(
|
||||
expanded ? R.string.title_accessibility_expanded : R.string.title_accessibility_collapsed));
|
||||
}
|
||||
if (viewType == ViewType.THREAD)
|
||||
ibExpander.setVisibility(EntityFolder.DRAFTS.equals(message.folderType) ? View.INVISIBLE : View.VISIBLE);
|
||||
|
@ -799,6 +801,8 @@ public class AdapterMessage extends RecyclerView.Adapter<AdapterMessage.ViewHold
|
|||
ivEncrypted.setVisibility(message.encrypted > 0 ? View.VISIBLE : View.GONE);
|
||||
tvFrom.setText(MessageHelper.formatAddresses(addresses, name_email, false));
|
||||
tvFrom.setPaintFlags(tvFrom.getPaintFlags() & ~Paint.UNDERLINE_TEXT_FLAG);
|
||||
tvFrom.setContentDescription(context.getString(
|
||||
message.unseen > 0 ? R.string.title_accessibility_unseen : R.string.title_accessibility_seen));
|
||||
tvSize.setText(message.totalSize == null ? null : Helper.humanReadableByteCount(message.totalSize, true));
|
||||
tvSize.setVisibility(message.totalSize != null && "size".equals(sort) ? View.VISIBLE : View.GONE);
|
||||
tvTime.setText(date && "time".equals(sort)
|
||||
|
@ -1026,6 +1030,8 @@ public class AdapterMessage extends RecyclerView.Adapter<AdapterMessage.ViewHold
|
|||
int color = (message.color == null || !pro ? colorAccent : message.color);
|
||||
|
||||
ibFlagged.setImageResource(flagged > 0 ? R.drawable.baseline_star_24 : R.drawable.baseline_star_border_24);
|
||||
ibFlagged.setContentDescription(context.getString(
|
||||
flagged > 0 ? R.string.title_accessibility_flagged : R.string.title_accessibility_unflagged));
|
||||
ibFlagged.setImageTintList(ColorStateList.valueOf(flagged > 0 ? color : textColorSecondary));
|
||||
ibFlagged.setEnabled(message.uid != null || message.accountProtocol != EntityAccount.TYPE_IMAP);
|
||||
|
||||
|
@ -2532,6 +2538,8 @@ public class AdapterMessage extends RecyclerView.Adapter<AdapterMessage.ViewHold
|
|||
|
||||
ibExpander.setTag(expanded);
|
||||
ibExpander.setImageLevel(expanded ? 0 /* less*/ : 1 /* more */);
|
||||
ibExpander.setContentDescription(context.getString(
|
||||
expanded ? R.string.title_accessibility_expanded : R.string.title_accessibility_collapsed));
|
||||
|
||||
if (expanded)
|
||||
bindExpanded(message, true);
|
||||
|
|
|
@ -29,7 +29,6 @@
|
|||
android:layout_gravity="center_vertical|center_horizontal"
|
||||
android:layout_marginStart="6dp"
|
||||
android:background="?android:attr/selectableItemBackgroundBorderless"
|
||||
android:contentDescription="@string/title_legend_expander"
|
||||
android:visibility="visible"
|
||||
app:layout_constraintBottom_toBottomOf="@+id/paddingBottom"
|
||||
app:layout_constraintStart_toEndOf="@id/vwColor"
|
||||
|
@ -249,7 +248,6 @@
|
|||
android:layout_height="36dp"
|
||||
android:layout_marginEnd="6dp"
|
||||
android:background="?android:attr/selectableItemBackgroundBorderless"
|
||||
android:contentDescription="@string/title_legend_flagged"
|
||||
android:paddingTop="6dp"
|
||||
android:paddingBottom="6dp"
|
||||
android:visibility="visible"
|
||||
|
|
|
@ -27,7 +27,6 @@
|
|||
android:layout_gravity="center_vertical|center_horizontal"
|
||||
android:layout_marginStart="6dp"
|
||||
android:background="?android:attr/selectableItemBackgroundBorderless"
|
||||
android:contentDescription="@string/title_legend_expander"
|
||||
android:visibility="visible"
|
||||
app:layout_constraintBottom_toBottomOf="@+id/paddingBottom"
|
||||
app:layout_constraintStart_toEndOf="@id/vwColor"
|
||||
|
@ -175,7 +174,6 @@
|
|||
android:layout_width="42dp"
|
||||
android:layout_height="42dp"
|
||||
android:background="?android:attr/selectableItemBackgroundBorderless"
|
||||
android:contentDescription="@string/title_legend_flagged"
|
||||
android:padding="6dp"
|
||||
android:visibility="visible"
|
||||
app:layout_constraintBottom_toBottomOf="@+id/tvFolder"
|
||||
|
|
|
@ -1016,6 +1016,13 @@
|
|||
<string name="title_widget_unseen">Unread messages only</string>
|
||||
<string name="title_widget_flagged">Starred messages only</string>
|
||||
|
||||
<string name="title_accessibility_collapsed">Collapsed</string>
|
||||
<string name="title_accessibility_expanded">Expanded</string>
|
||||
<string name="title_accessibility_seen">Read</string>
|
||||
<string name="title_accessibility_unseen">Unread</string>
|
||||
<string name="title_accessibility_flagged">Starred</string>
|
||||
<string name="title_accessibility_unflagged">Unstarred</string>
|
||||
|
||||
<string-array name="pollIntervalNames">
|
||||
<item>Always</item>
|
||||
<item>Every 15 minutes</item>
|
||||
|
|
Loading…
Add table
Reference in a new issue