From 77960b9f6fd18d47b961e552a4d998471bc1aa1c Mon Sep 17 00:00:00 2001 From: M66B Date: Fri, 10 Jan 2020 13:50:12 +0100 Subject: [PATCH] Small a11y improvement --- .../eu/faircode/email/AdapterMessage.java | 20 +++++++++---------- .../java/eu/faircode/email/WorkerPoll.java | 2 +- 2 files changed, 11 insertions(+), 11 deletions(-) diff --git a/app/src/main/java/eu/faircode/email/AdapterMessage.java b/app/src/main/java/eu/faircode/email/AdapterMessage.java index cea542c7ca..42287ab830 100644 --- a/app/src/main/java/eu/faircode/email/AdapterMessage.java +++ b/app/src/main/java/eu/faircode/email/AdapterMessage.java @@ -3884,19 +3884,19 @@ public class AdapterMessage extends RecyclerView.Adapter 0) result.add(context.getString(R.string.title_accessibility_attachment)); - // For a11y purpose report addresses first in case of incoming message boolean outgoing = isOutgoing(message); - if (!outgoing || message.count > 1) - result.add(tvFrom.getText().toString()); - else + Address[] addresses = (outgoing && (viewType != ViewType.THREAD || !threading) ? message.to : message.senders); + String from = MessageHelper.formatAddresses(addresses, name_email, false); + // 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(tvTime.getText().toString()); - - if (outgoing && message.count == 1) - result.add(tvFrom.getText().toString()); - else + result.add(tvTime.getText().toString()); + result.add(from); + } else { + result.add(from); + result.add(tvTime.getText().toString()); result.add(message.subject); + } if (message.encrypted > 0) result.add(context.getString(R.string.title_legend_encrypted)); diff --git a/app/src/main/java/eu/faircode/email/WorkerPoll.java b/app/src/main/java/eu/faircode/email/WorkerPoll.java index d1af4db699..050acc3fec 100644 --- a/app/src/main/java/eu/faircode/email/WorkerPoll.java +++ b/app/src/main/java/eu/faircode/email/WorkerPoll.java @@ -57,7 +57,7 @@ public class WorkerPoll extends Worker { int pollInterval = prefs.getInt("poll_interval", 0); if (enabled && pollInterval > 0) { 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); PeriodicWorkRequest workRequest =