From 7d1bbd91cbe9151c51c2908390b63f0bee9be73a Mon Sep 17 00:00:00 2001 From: Floens Date: Thu, 23 Oct 2014 15:18:43 +0200 Subject: [PATCH] Add archived/locked message to status bar --- .../floens/chan/ui/adapter/PostAdapter.java | 18 ++++++++++++++---- Clover/app/src/main/res/values/strings.xml | 2 ++ 2 files changed, 16 insertions(+), 4 deletions(-) diff --git a/Clover/app/src/main/java/org/floens/chan/ui/adapter/PostAdapter.java b/Clover/app/src/main/java/org/floens/chan/ui/adapter/PostAdapter.java index 4091834d..fa39a1f1 100644 --- a/Clover/app/src/main/java/org/floens/chan/ui/adapter/PostAdapter.java +++ b/Clover/app/src/main/java/org/floens/chan/ui/adapter/PostAdapter.java @@ -350,12 +350,22 @@ public class PostAdapter extends BaseAdapter implements Filterable { if (error != null) { setText(error); } else { + String prefix = ""; + Post op = threadManager.getLoader().getOP(); + if (op != null) { + if (op.archived) { + prefix = context.getString(R.string.thread_archived) + " - "; + } else if (op.closed) { + prefix = context.getString(R.string.thread_closed) + " - "; + } + } + if (threadManager.shouldWatch()) { long time = loader.getTimeUntilLoadMore() / 1000L; if (time == 0) { - setText(context.getString(R.string.thread_refresh_now)); + setText(prefix + context.getString(R.string.thread_refresh_now)); } else { - setText(context.getString(R.string.thread_refresh_countdown, time)); + setText(prefix + context.getString(R.string.thread_refresh_countdown, time)); } new Handler().postDelayed(new Runnable() { @@ -368,9 +378,9 @@ public class PostAdapter extends BaseAdapter implements Filterable { }, 1000); } else { if (loader.getTimeUntilLoadMore() == 0) { - setText(context.getString(R.string.thread_refresh_now)); + setText(prefix + context.getString(R.string.thread_refresh_now)); } else { - setText(context.getString(R.string.thread_refresh_bar_inactive)); + setText(prefix + context.getString(R.string.thread_refresh_bar_inactive)); } } diff --git a/Clover/app/src/main/res/values/strings.xml b/Clover/app/src/main/res/values/strings.xml index f0ea4521..3856aef3 100644 --- a/Clover/app/src/main/res/values/strings.xml +++ b/Clover/app/src/main/res/values/strings.xml @@ -74,6 +74,8 @@ along with this program. If not, see . Loading Loading in %1$d Retry + Archived + Closed Board editor Add board