From 67942a906ab422511d3343579e58548d5c529379 Mon Sep 17 00:00:00 2001
From: krlvm <51774833+krlvm@users.noreply.github.com>
Date: Sun, 28 Mar 2021 19:36:07 +0300
Subject: [PATCH] Fix colors in PeerTube Settings Fragment
---
.../settings/PeertubeInstanceListFragment.java | 12 ++++++++++--
app/src/main/res/layout/fragment_instance_list.xml | 1 +
app/src/main/res/values/styles_misc.xml | 3 +++
3 files changed, 14 insertions(+), 2 deletions(-)
diff --git a/app/src/main/java/org/schabi/newpipe/settings/PeertubeInstanceListFragment.java b/app/src/main/java/org/schabi/newpipe/settings/PeertubeInstanceListFragment.java
index 74585e12b..e4da3b14d 100644
--- a/app/src/main/java/org/schabi/newpipe/settings/PeertubeInstanceListFragment.java
+++ b/app/src/main/java/org/schabi/newpipe/settings/PeertubeInstanceListFragment.java
@@ -3,6 +3,9 @@ package org.schabi.newpipe.settings;
import android.annotation.SuppressLint;
import android.content.Context;
import android.content.SharedPreferences;
+import android.graphics.Color;
+import android.graphics.PorterDuff;
+import android.graphics.drawable.Drawable;
import android.os.Bundle;
import android.text.InputType;
import android.view.LayoutInflater;
@@ -145,8 +148,13 @@ public class PeertubeInstanceListFragment extends Fragment {
final MenuItem restoreItem = menu
.add(Menu.NONE, MENU_ITEM_RESTORE_ID, Menu.NONE, R.string.restore_defaults);
restoreItem.setShowAsAction(MenuItem.SHOW_AS_ACTION_ALWAYS);
- restoreItem.setIcon(AppCompatResources.getDrawable(requireContext(),
- R.drawable.ic_settings_backup_restore));
+ final Drawable icon = AppCompatResources.getDrawable(requireContext(),
+ R.drawable.ic_settings_backup_restore);
+ if (icon != null) {
+ icon.mutate();
+ icon.setColorFilter(Color.WHITE, PorterDuff.Mode.SRC_ATOP);
+ }
+ restoreItem.setIcon(icon);
}
@Override
diff --git a/app/src/main/res/layout/fragment_instance_list.xml b/app/src/main/res/layout/fragment_instance_list.xml
index 33cfde908..a4aa1bda5 100644
--- a/app/src/main/res/layout/fragment_instance_list.xml
+++ b/app/src/main/res/layout/fragment_instance_list.xml
@@ -44,6 +44,7 @@
android:layout_marginBottom="16dp"
android:clickable="true"
android:focusable="true"
+ android:tint="@color/white"
app:backgroundTint="?attr/colorPrimary"
app:fabSize="auto"
app:srcCompat="@drawable/ic_add" />
diff --git a/app/src/main/res/values/styles_misc.xml b/app/src/main/res/values/styles_misc.xml
index cad7ce904..74a173abc 100644
--- a/app/src/main/res/values/styles_misc.xml
+++ b/app/src/main/res/values/styles_misc.xml
@@ -57,12 +57,15 @@