From 5b599c5dda4b520fe35501d933602746b7060404 Mon Sep 17 00:00:00 2001 From: sherlockbeard Date: Sun, 4 Apr 2021 14:28:46 +0530 Subject: [PATCH] update --- .../fragments/detail/VideoDetailFragment.java | 7 ++--- .../drawable/not_available_monkey_black.xml | 27 +++++++++++++++++++ ...key.xml => not_available_monkey_white.xml} | 0 .../main/res/layout/fragment_video_detail.xml | 2 +- app/src/main/res/values/attrs.xml | 1 + app/src/main/res/values/styles.xml | 2 ++ 6 files changed, 35 insertions(+), 4 deletions(-) create mode 100644 app/src/main/res/drawable/not_available_monkey_black.xml rename app/src/main/res/drawable/{not_available_monkey.xml => not_available_monkey_white.xml} (100%) diff --git a/app/src/main/java/org/schabi/newpipe/fragments/detail/VideoDetailFragment.java b/app/src/main/java/org/schabi/newpipe/fragments/detail/VideoDetailFragment.java index 72e3300ed1d..f1d63a14fed 100644 --- a/app/src/main/java/org/schabi/newpipe/fragments/detail/VideoDetailFragment.java +++ b/app/src/main/java/org/schabi/newpipe/fragments/detail/VideoDetailFragment.java @@ -1325,9 +1325,10 @@ private void setErrorImage(final int imageResource) { if (binding == null || activity == null) { return; } - binding.detailThumbnailImageView.setImageDrawable( - AppCompatResources.getDrawable(requireContext(), imageResource)); + AppCompatResources.getDrawable(requireContext(), + ThemeHelper.resolveResourceIdFromAttr(requireContext(), + imageResource))); animate(binding.detailThumbnailImageView, false, 0, AnimationType.ALPHA, 0, () -> animate(binding.detailThumbnailImageView, true, 500)); } @@ -1335,7 +1336,7 @@ private void setErrorImage(final int imageResource) { @Override public void handleError() { super.handleError(); - setErrorImage(R.drawable.not_available_monkey); + setErrorImage(R.attr.not_available_monkey); if (binding.relatedStreamsLayout != null) { // hide related streams for tablets binding.relatedStreamsLayout.setVisibility(View.INVISIBLE); diff --git a/app/src/main/res/drawable/not_available_monkey_black.xml b/app/src/main/res/drawable/not_available_monkey_black.xml new file mode 100644 index 00000000000..34d4f2279f4 --- /dev/null +++ b/app/src/main/res/drawable/not_available_monkey_black.xml @@ -0,0 +1,27 @@ + + + + + + + \ No newline at end of file diff --git a/app/src/main/res/drawable/not_available_monkey.xml b/app/src/main/res/drawable/not_available_monkey_white.xml similarity index 100% rename from app/src/main/res/drawable/not_available_monkey.xml rename to app/src/main/res/drawable/not_available_monkey_white.xml diff --git a/app/src/main/res/layout/fragment_video_detail.xml b/app/src/main/res/layout/fragment_video_detail.xml index 28d30ebe809..7065ce72b08 100644 --- a/app/src/main/res/layout/fragment_video_detail.xml +++ b/app/src/main/res/layout/fragment_video_detail.xml @@ -42,7 +42,7 @@ android:layout_width="match_parent" android:layout_height="wrap_content" android:minHeight="200dp" - android:background="@android:color/transparent" + android:background="?windowBackground" android:contentDescription="@string/detail_thumbnail_view_description" android:scaleType="fitCenter" tools:ignore="RtlHardcoded" diff --git a/app/src/main/res/values/attrs.xml b/app/src/main/res/values/attrs.xml index 42fc7660ecf..628618c96f8 100644 --- a/app/src/main/res/values/attrs.xml +++ b/app/src/main/res/values/attrs.xml @@ -91,6 +91,7 @@ + diff --git a/app/src/main/res/values/styles.xml b/app/src/main/res/values/styles.xml index d7e7ab1dc3f..06ff8ea14ac 100644 --- a/app/src/main/res/values/styles.xml +++ b/app/src/main/res/values/styles.xml @@ -99,6 +99,7 @@ @drawable/ic_sort_black_24dp @drawable/ic_help_black_24dp @drawable/ic_arrow_back_black_24dp + @drawable/not_available_monkey_black @color/light_separator_color @color/light_contrast_background_color @@ -209,6 +210,7 @@ @drawable/ic_sort_white_24dp @drawable/ic_help_white_24dp @drawable/ic_arrow_back_white_24dp + @drawable/not_available_monkey_white @color/dark_separator_color @color/dark_contrast_background_color