Addresses mispronunciation of timestamps like 7m as meters instead of minutes.
This commit is contained in:
parent
77285c9966
commit
69c1b88ff4
|
@ -169,15 +169,25 @@ class StatusViewHolder extends RecyclerView.ViewHolder {
|
||||||
}
|
}
|
||||||
|
|
||||||
private void setCreatedAt(@Nullable Date createdAt) {
|
private void setCreatedAt(@Nullable Date createdAt) {
|
||||||
|
// This is the visible timestamp.
|
||||||
String readout;
|
String readout;
|
||||||
|
/* This one is for screen-readers. Frequently, they would mispronounce timestamps like "17m"
|
||||||
|
* as 17 meters instead of minutes. */
|
||||||
|
CharSequence readoutAloud;
|
||||||
if (createdAt != null) {
|
if (createdAt != null) {
|
||||||
long then = createdAt.getTime();
|
long then = createdAt.getTime();
|
||||||
long now = new Date().getTime();
|
long now = new Date().getTime();
|
||||||
readout = DateUtils.getRelativeTimeSpanString(then, now);
|
readout = DateUtils.getRelativeTimeSpanString(then, now);
|
||||||
|
readoutAloud = android.text.format.DateUtils.getRelativeTimeSpanString(then, now,
|
||||||
|
android.text.format.DateUtils.SECOND_IN_MILLIS,
|
||||||
|
android.text.format.DateUtils.FORMAT_ABBREV_RELATIVE);
|
||||||
} else {
|
} else {
|
||||||
readout = "?m"; // unknown minutes~
|
// unknown minutes~
|
||||||
|
readout = "?m";
|
||||||
|
readoutAloud = "? minutes";
|
||||||
}
|
}
|
||||||
sinceCreated.setText(readout);
|
sinceCreated.setText(readout);
|
||||||
|
sinceCreated.setContentDescription(readoutAloud);
|
||||||
}
|
}
|
||||||
|
|
||||||
private void setRebloggedByDisplayName(String name) {
|
private void setRebloggedByDisplayName(String name) {
|
||||||
|
|
Loading…
Reference in New Issue