Fix colors in PeerTube Settings Fragment

This commit is contained in:
krlvm 2021-03-28 19:36:07 +03:00
parent 0afdac5683
commit 67942a906a
No known key found for this signature in database
GPG Key ID: B8552A91FD265536
3 changed files with 14 additions and 2 deletions

View File

@ -3,6 +3,9 @@ package org.schabi.newpipe.settings;
import android.annotation.SuppressLint; import android.annotation.SuppressLint;
import android.content.Context; import android.content.Context;
import android.content.SharedPreferences; import android.content.SharedPreferences;
import android.graphics.Color;
import android.graphics.PorterDuff;
import android.graphics.drawable.Drawable;
import android.os.Bundle; import android.os.Bundle;
import android.text.InputType; import android.text.InputType;
import android.view.LayoutInflater; import android.view.LayoutInflater;
@ -145,8 +148,13 @@ public class PeertubeInstanceListFragment extends Fragment {
final MenuItem restoreItem = menu final MenuItem restoreItem = menu
.add(Menu.NONE, MENU_ITEM_RESTORE_ID, Menu.NONE, R.string.restore_defaults); .add(Menu.NONE, MENU_ITEM_RESTORE_ID, Menu.NONE, R.string.restore_defaults);
restoreItem.setShowAsAction(MenuItem.SHOW_AS_ACTION_ALWAYS); restoreItem.setShowAsAction(MenuItem.SHOW_AS_ACTION_ALWAYS);
restoreItem.setIcon(AppCompatResources.getDrawable(requireContext(), final Drawable icon = AppCompatResources.getDrawable(requireContext(),
R.drawable.ic_settings_backup_restore)); R.drawable.ic_settings_backup_restore);
if (icon != null) {
icon.mutate();
icon.setColorFilter(Color.WHITE, PorterDuff.Mode.SRC_ATOP);
}
restoreItem.setIcon(icon);
} }
@Override @Override

View File

@ -44,6 +44,7 @@
android:layout_marginBottom="16dp" android:layout_marginBottom="16dp"
android:clickable="true" android:clickable="true"
android:focusable="true" android:focusable="true"
android:tint="@color/white"
app:backgroundTint="?attr/colorPrimary" app:backgroundTint="?attr/colorPrimary"
app:fabSize="auto" app:fabSize="auto"
app:srcCompat="@drawable/ic_add" /> app:srcCompat="@drawable/ic_add" />

View File

@ -57,12 +57,15 @@
<style name="WhiteTintTheme"> <style name="WhiteTintTheme">
<item name="tint">@color/white</item> <item name="tint">@color/white</item>
<item name="iconTint">@color/white</item>
</style> </style>
<style name="DarkTintTheme"> <style name="DarkTintTheme">
<item name="tint">@color/black</item> <item name="tint">@color/black</item>
<item name="iconTint">@color/black</item>
</style> </style>
<style name="ContrastTintTheme"> <style name="ContrastTintTheme">
<item name="tint">@color/contrastColor</item> <item name="tint">@color/contrastColor</item>
<item name="iconTint">@color/contrastColor</item>
</style> </style>
</resources> </resources>