Addresses mispronunciation of timestamps like 7m as meters instead of minutes.

main
Vavassor 8 years ago
parent 77285c9966
commit 69c1b88ff4
  1. 12
      app/src/main/java/com/keylesspalace/tusky/StatusViewHolder.java

@ -169,15 +169,25 @@ class StatusViewHolder extends RecyclerView.ViewHolder {
}
private void setCreatedAt(@Nullable Date createdAt) {
// This is the visible timestamp.
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) {
long then = createdAt.getTime();
long now = new Date().getTime();
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 {
readout = "?m"; // unknown minutes~
// unknown minutes~
readout = "?m";
readoutAloud = "? minutes";
}
sinceCreated.setText(readout);
sinceCreated.setContentDescription(readoutAloud);
}
private void setRebloggedByDisplayName(String name) {

Loading…
Cancel
Save