feat(YouTube - Settings): Add a color picker (#4981)
Co-authored-by: LisoUseInAIKyrios <118716522+LisoUseInAIKyrios@users.noreply.github.com>
This commit is contained in:
@ -2,7 +2,6 @@ package app.revanced.extension.tiktok;
|
||||
|
||||
import static app.revanced.extension.shared.Utils.isDarkModeEnabled;
|
||||
|
||||
import android.content.Context;
|
||||
import android.graphics.Color;
|
||||
import android.view.View;
|
||||
import android.widget.TextView;
|
||||
@ -43,8 +42,8 @@ public class Utils {
|
||||
private static final @ColorInt int TEXT_LIGHT_MODE_SUMMARY
|
||||
= Color.argb(255, 80, 80, 80);
|
||||
|
||||
public static void setTitleAndSummaryColor(Context context, View view) {
|
||||
final boolean darkModeEnabled = isDarkModeEnabled(context);
|
||||
public static void setTitleAndSummaryColor(View view) {
|
||||
final boolean darkModeEnabled = isDarkModeEnabled();
|
||||
|
||||
TextView title = view.findViewById(android.R.id.title);
|
||||
title.setTextColor(darkModeEnabled
|
||||
|
@ -101,7 +101,7 @@ public class DownloadPathPreference extends DialogPreference {
|
||||
protected void onBindView(View view) {
|
||||
super.onBindView(view);
|
||||
|
||||
Utils.setTitleAndSummaryColor(getContext(), view);
|
||||
Utils.setTitleAndSummaryColor(view);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -22,6 +22,6 @@ public class InputTextPreference extends EditTextPreference {
|
||||
protected void onBindView(View view) {
|
||||
super.onBindView(view);
|
||||
|
||||
Utils.setTitleAndSummaryColor(getContext(), view);
|
||||
Utils.setTitleAndSummaryColor(view);
|
||||
}
|
||||
}
|
||||
|
@ -127,7 +127,7 @@ public class RangeValuePreference extends DialogPreference {
|
||||
protected void onBindView(View view) {
|
||||
super.onBindView(view);
|
||||
|
||||
Utils.setTitleAndSummaryColor(getContext(), view);
|
||||
Utils.setTitleAndSummaryColor(view);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -48,6 +48,6 @@ public class ReVancedTikTokAboutPreference extends ReVancedAboutPreference {
|
||||
protected void onBindView(View view) {
|
||||
super.onBindView(view);
|
||||
|
||||
Utils.setTitleAndSummaryColor(getContext(), view);
|
||||
Utils.setTitleAndSummaryColor(view);
|
||||
}
|
||||
}
|
||||
|
@ -22,6 +22,6 @@ public class TogglePreference extends SwitchPreference {
|
||||
protected void onBindView(View view) {
|
||||
super.onBindView(view);
|
||||
|
||||
Utils.setTitleAndSummaryColor(getContext(), view);
|
||||
Utils.setTitleAndSummaryColor(view);
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user