From 9fdeb46fcadc7eb430d0f435ecf8679378189c3d Mon Sep 17 00:00:00 2001 From: Thodoris1999 Date: Sat, 7 Jul 2018 19:22:54 +0300 Subject: [PATCH 1/2] change unread dot color to accent --- .../java/gr/thmmy/mthmmy/activities/board/BoardAdapter.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/src/main/java/gr/thmmy/mthmmy/activities/board/BoardAdapter.java b/app/src/main/java/gr/thmmy/mthmmy/activities/board/BoardAdapter.java index 90a98e53..667e6853 100644 --- a/app/src/main/java/gr/thmmy/mthmmy/activities/board/BoardAdapter.java +++ b/app/src/main/java/gr/thmmy/mthmmy/activities/board/BoardAdapter.java @@ -233,7 +233,7 @@ class BoardAdapter extends RecyclerView.Adapter { topicViewHolder.topicSubject.setTypeface(Typeface.createFromAsset(context.getAssets() , "fonts/fontawesome-webfont.ttf")); String lockedSticky = topic.isUnread() ? - Html.fromHtml("" + context.getString(R.string.fa_circle) + " ").toString() : ""; + Html.fromHtml("" + context.getString(R.string.fa_circle) + " ").toString() : ""; lockedSticky += topic.getSubject(); if (topic.isLocked()) lockedSticky += " " + context.getResources().getString(R.string.fa_lock); From 6ab26b55e20b3390d8593e4efe12189b31f250f2 Mon Sep 17 00:00:00 2001 From: Thodoris1999 Date: Sat, 7 Jul 2018 22:33:44 +0300 Subject: [PATCH 2/2] do dot thing properly --- .../thmmy/mthmmy/activities/board/BoardAdapter.java | 11 ++++++----- app/src/main/res/layout/activity_board_topic.xml | 13 +++++++++++++ 2 files changed, 19 insertions(+), 5 deletions(-) diff --git a/app/src/main/java/gr/thmmy/mthmmy/activities/board/BoardAdapter.java b/app/src/main/java/gr/thmmy/mthmmy/activities/board/BoardAdapter.java index 667e6853..816da71a 100644 --- a/app/src/main/java/gr/thmmy/mthmmy/activities/board/BoardAdapter.java +++ b/app/src/main/java/gr/thmmy/mthmmy/activities/board/BoardAdapter.java @@ -6,7 +6,6 @@ import android.graphics.Typeface; import android.os.Build; import android.os.Bundle; import android.support.v7.widget.RecyclerView; -import android.text.Html; import android.view.LayoutInflater; import android.view.View; import android.view.ViewGroup; @@ -232,9 +231,10 @@ class BoardAdapter extends RecyclerView.Adapter { }); topicViewHolder.topicSubject.setTypeface(Typeface.createFromAsset(context.getAssets() , "fonts/fontawesome-webfont.ttf")); - String lockedSticky = topic.isUnread() ? - Html.fromHtml("" + context.getString(R.string.fa_circle) + " ").toString() : ""; - lockedSticky += topic.getSubject(); + topicViewHolder.topicUnreadDot.setTypeface(Typeface.createFromAsset(context.getAssets(), "fonts/fontawesome-webfont.ttf")); + if (topic.isUnread()) + topicViewHolder.topicUnreadDot.setVisibility(View.VISIBLE); + String lockedSticky = topic.getSubject(); if (topic.isLocked()) lockedSticky += " " + context.getResources().getString(R.string.fa_lock); if (topic.isSticky()) { @@ -290,7 +290,7 @@ class BoardAdapter extends RecyclerView.Adapter { private static class TopicViewHolder extends RecyclerView.ViewHolder { final LinearLayout topicRow, topicExpandable; - final TextView topicSubject, topicStartedBy, topicStats, topicLastPost; + final TextView topicSubject, topicStartedBy, topicStats, topicLastPost, topicUnreadDot; final ImageButton showHideExpandable; TopicViewHolder(View topic) { @@ -298,6 +298,7 @@ class BoardAdapter extends RecyclerView.Adapter { topicRow = topic.findViewById(R.id.topic_row_linear); topicExpandable = topic.findViewById(R.id.topic_expandable); showHideExpandable = topic.findViewById(R.id.topic_expand_collapse_button); + topicUnreadDot = topic.findViewById(R.id.topic_unread_dot); topicSubject = topic.findViewById(R.id.topic_subject); topicStartedBy = topic.findViewById(R.id.topic_started_by); topicStats = topic.findViewById(R.id.topic_stats); diff --git a/app/src/main/res/layout/activity_board_topic.xml b/app/src/main/res/layout/activity_board_topic.xml index 141f3876..2ea99c95 100644 --- a/app/src/main/res/layout/activity_board_topic.xml +++ b/app/src/main/res/layout/activity_board_topic.xml @@ -1,5 +1,6 @@ + +