From 4153312502bc997d042f75d6b17a22e460d020a5 Mon Sep 17 00:00:00 2001 From: M66B Date: Sun, 29 Dec 2019 12:51:19 +0100 Subject: [PATCH] Improved date header accessibility --- app/src/main/java/eu/faircode/email/FragmentMessages.java | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/app/src/main/java/eu/faircode/email/FragmentMessages.java b/app/src/main/java/eu/faircode/email/FragmentMessages.java index 1bd66b0ed1..8635ac2d2d 100644 --- a/app/src/main/java/eu/faircode/email/FragmentMessages.java +++ b/app/src/main/java/eu/faircode/email/FragmentMessages.java @@ -42,6 +42,7 @@ import android.net.Network; import android.net.NetworkCapabilities; import android.net.NetworkRequest; import android.net.Uri; +import android.os.Build; import android.os.Bundle; import android.os.Handler; import android.os.Parcel; @@ -622,6 +623,10 @@ public class FragmentMessages extends FragmentBase implements SharedPreferences. new Date().getTime(), DAY_IN_MILLIS, 0)); + header.setContentDescription(tvDate.getText().toString()); + if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.O) + header.setAccessibilityHeading(true); + header.measure(View.MeasureSpec.makeMeasureSpec(parent.getWidth(), View.MeasureSpec.EXACTLY), View.MeasureSpec.makeMeasureSpec(0, View.MeasureSpec.UNSPECIFIED)); header.layout(0, 0, header.getMeasuredWidth(), header.getMeasuredHeight());