From 07015973d27dd5191b6d7148cc0f04e5aa428fdc Mon Sep 17 00:00:00 2001 From: David Kramer Date: Fri, 24 Dec 2021 11:29:34 -0600 Subject: [PATCH] Added ability to see pinned comment --- .../holder/CommentsInfoItemHolder.java | 4 ++++ app/src/main/res/drawable-night/ic_pin.xml | 19 +++++++++++++++++++ app/src/main/res/drawable/ic_pin.xml | 18 ++++++++++++++++++ .../main/res/layout/list_comments_item.xml | 14 +++++++++++++- app/src/main/res/values-land/dimens.xml | 1 + app/src/main/res/values-sw600dp/dimens.xml | 1 + app/src/main/res/values/dimens.xml | 3 +++ app/src/main/res/values/strings.xml | 1 + 8 files changed, 60 insertions(+), 1 deletion(-) create mode 100644 app/src/main/res/drawable-night/ic_pin.xml create mode 100644 app/src/main/res/drawable/ic_pin.xml diff --git a/app/src/main/java/org/schabi/newpipe/info_list/holder/CommentsInfoItemHolder.java b/app/src/main/java/org/schabi/newpipe/info_list/holder/CommentsInfoItemHolder.java index fb144574a..4fc2d9f84 100644 --- a/app/src/main/java/org/schabi/newpipe/info_list/holder/CommentsInfoItemHolder.java +++ b/app/src/main/java/org/schabi/newpipe/info_list/holder/CommentsInfoItemHolder.java @@ -34,12 +34,14 @@ import org.schabi.newpipe.local.history.HistoryRecordManager; public class CommentsInfoItemHolder extends CommentsMiniInfoItemHolder { public final TextView itemTitleView; private final ImageView itemHeartView; + private final ImageView itemPinnedView; public CommentsInfoItemHolder(final InfoItemBuilder infoItemBuilder, final ViewGroup parent) { super(infoItemBuilder, R.layout.list_comments_item, parent); itemTitleView = itemView.findViewById(R.id.itemTitleView); itemHeartView = itemView.findViewById(R.id.detail_heart_image_view); + itemPinnedView = itemView.findViewById(R.id.detail_pinned_view); } @Override @@ -55,5 +57,7 @@ public class CommentsInfoItemHolder extends CommentsMiniInfoItemHolder { itemTitleView.setText(item.getUploaderName()); itemHeartView.setVisibility(item.isHeartedByUploader() ? View.VISIBLE : View.GONE); + + itemPinnedView.setVisibility(item.isPinned() ? View.VISIBLE : View.GONE); } } diff --git a/app/src/main/res/drawable-night/ic_pin.xml b/app/src/main/res/drawable-night/ic_pin.xml new file mode 100644 index 000000000..6fe406341 --- /dev/null +++ b/app/src/main/res/drawable-night/ic_pin.xml @@ -0,0 +1,19 @@ + + + + + + diff --git a/app/src/main/res/drawable/ic_pin.xml b/app/src/main/res/drawable/ic_pin.xml new file mode 100644 index 000000000..70578fbeb --- /dev/null +++ b/app/src/main/res/drawable/ic_pin.xml @@ -0,0 +1,18 @@ + + + + + + diff --git a/app/src/main/res/layout/list_comments_item.xml b/app/src/main/res/layout/list_comments_item.xml index f6ddc3924..c76444212 100644 --- a/app/src/main/res/layout/list_comments_item.xml +++ b/app/src/main/res/layout/list_comments_item.xml @@ -23,13 +23,25 @@ android:src="@drawable/buddy" tools:ignore="RtlHardcoded" /> + + 90dp 45dp + 8dp 8dp 4dp diff --git a/app/src/main/res/values-sw600dp/dimens.xml b/app/src/main/res/values-sw600dp/dimens.xml index da00b0c22..85ed7b5a9 100644 --- a/app/src/main/res/values-sw600dp/dimens.xml +++ b/app/src/main/res/values-sw600dp/dimens.xml @@ -18,6 +18,7 @@ 18sp 18sp + 10dp 10dp 14sp diff --git a/app/src/main/res/values/dimens.xml b/app/src/main/res/values/dimens.xml index 5c1d8aa70..f3d29b605 100644 --- a/app/src/main/res/values/dimens.xml +++ b/app/src/main/res/values/dimens.xml @@ -71,6 +71,8 @@ 12sp 32dp + 18sp + 18sp 16dp 18sp 18sp @@ -79,6 +81,7 @@ 35dp 60dp + 5dp 5dp 5dp 50dp diff --git a/app/src/main/res/values/strings.xml b/app/src/main/res/values/strings.xml index b4d46a3e2..a16ef26ed 100644 --- a/app/src/main/res/values/strings.xml +++ b/app/src/main/res/values/strings.xml @@ -712,6 +712,7 @@ Unlisted Private Internal + Pinned comment Hearted by creator Open website Tablet mode