Small a11y improvement

This commit is contained in:
M66B 2020-01-10 13:50:12 +01:00
parent afb4ac669d
commit 77960b9f6f
2 changed files with 11 additions and 11 deletions

View File

@ -3884,19 +3884,19 @@ public class AdapterMessage extends RecyclerView.Adapter<AdapterMessage.ViewHold
if (message.attachments > 0) if (message.attachments > 0)
result.add(context.getString(R.string.title_accessibility_attachment)); result.add(context.getString(R.string.title_accessibility_attachment));
// For a11y purpose report addresses first in case of incoming message
boolean outgoing = isOutgoing(message); boolean outgoing = isOutgoing(message);
if (!outgoing || message.count > 1) Address[] addresses = (outgoing && (viewType != ViewType.THREAD || !threading) ? message.to : message.senders);
result.add(tvFrom.getText().toString()); String from = MessageHelper.formatAddresses(addresses, name_email, false);
else // For a11y purpose subject is reported first when: user wishes so or this is a single outgoing message
if (subject_top || (outgoing && message.visible == 1)) {
result.add(message.subject); // Don't want to ellipsize for a11y result.add(message.subject); // Don't want to ellipsize for a11y
result.add(tvTime.getText().toString()); result.add(tvTime.getText().toString());
result.add(from);
if (outgoing && message.count == 1) } else {
result.add(tvFrom.getText().toString()); result.add(from);
else result.add(tvTime.getText().toString());
result.add(message.subject); result.add(message.subject);
}
if (message.encrypted > 0) if (message.encrypted > 0)
result.add(context.getString(R.string.title_legend_encrypted)); result.add(context.getString(R.string.title_legend_encrypted));

View File

@ -57,7 +57,7 @@ public class WorkerPoll extends Worker {
int pollInterval = prefs.getInt("poll_interval", 0); int pollInterval = prefs.getInt("poll_interval", 0);
if (enabled && pollInterval > 0) { if (enabled && pollInterval > 0) {
int min = (int) (new Date().getTime() / (60 * 1000L)); int min = (int) (new Date().getTime() / (60 * 1000L));
int delay = pollInterval - min % pollInterval; int delay = pollInterval - (min % pollInterval) + pollInterval;
Log.i("Queuing " + getName() + " every " + pollInterval + " minutes delay=" + delay); Log.i("Queuing " + getName() + " every " + pollInterval + " minutes delay=" + delay);
PeriodicWorkRequest workRequest = PeriodicWorkRequest workRequest =