Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 8d96e044 authored by Isaac Katzenelson's avatar Isaac Katzenelson
Browse files

Fix content description of time in alarms list

Bug: 11169940
Change-Id: I90ae1606097e9e1ba218ae72e56a97d63da9e48e
parent 9e0c1782
Loading
Loading
Loading
Loading
+7 −0
Original line number Diff line number Diff line
@@ -30,6 +30,7 @@ public class TextTime extends TextView {
    private CharSequence mFormat12;
    private CharSequence mFormat24;
    private CharSequence mFormat;
    private String mContentDescriptionFormat;

    private boolean mAttached;

@@ -107,6 +108,7 @@ public class TextTime extends TextView {
        } else {
            mFormat = mFormat12 == null ? DEFAULT_FORMAT_12_HOUR : mFormat12;
        }
        mContentDescriptionFormat = mFormat.toString();
    }

    @Override
@@ -154,5 +156,10 @@ public class TextTime extends TextView {
        calendar.set(Calendar.HOUR_OF_DAY, mHour);
        calendar.set(Calendar.MINUTE, mMinute);
        setText(DateFormat.format(mFormat, calendar));
        if (mContentDescriptionFormat != null) {
            setContentDescription(DateFormat.format(mContentDescriptionFormat, calendar));
        } else {
            setContentDescription(DateFormat.format(mFormat, calendar));
        }
    }
}