add the last bold resources
This commit is contained in:
parent
fc988fa078
commit
47f1a5f9c9
8 changed files with 99 additions and 15 deletions
|
|
@ -128,8 +128,10 @@ abstract class Check {
|
||||||
|
|
||||||
// Add icon to the dialog.
|
// Add icon to the dialog.
|
||||||
ImageView iconView = new ImageView(activity);
|
ImageView iconView = new ImageView(activity);
|
||||||
iconView.setImageResource(Utils.getResourceIdentifierOrThrow(
|
iconView.setImageResource(Utils.getResourceIdentifierOrThrow(ResourceType.DRAWABLE,
|
||||||
ResourceType.DRAWABLE, "revanced_ic_dialog_alert"));
|
BaseSettings.SETTINGS_DISABLE_BOLD_ICONS.get()
|
||||||
|
? "revanced_ic_dialog_alert"
|
||||||
|
: "revanced_ic_dialog_alert_bold"));
|
||||||
iconView.setColorFilter(Utils.getAppForegroundColor(), PorterDuff.Mode.SRC_IN);
|
iconView.setColorFilter(Utils.getAppForegroundColor(), PorterDuff.Mode.SRC_IN);
|
||||||
iconView.setPadding(0, 0, 0, 0);
|
iconView.setPadding(0, 0, 0, 0);
|
||||||
LinearLayout.LayoutParams iconParams = new LinearLayout.LayoutParams(
|
LinearLayout.LayoutParams iconParams = new LinearLayout.LayoutParams(
|
||||||
|
|
|
||||||
|
|
@ -22,6 +22,7 @@ import androidx.annotation.Nullable;
|
||||||
|
|
||||||
import app.revanced.extension.shared.ResourceType;
|
import app.revanced.extension.shared.ResourceType;
|
||||||
import app.revanced.extension.shared.Utils;
|
import app.revanced.extension.shared.Utils;
|
||||||
|
import app.revanced.extension.shared.settings.BaseSettings;
|
||||||
import app.revanced.extension.shared.ui.CustomDialog;
|
import app.revanced.extension.shared.ui.CustomDialog;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
@ -39,6 +40,10 @@ public class CustomDialogListPreference extends ListPreference {
|
||||||
ResourceType.ID, "revanced_item_text");
|
ResourceType.ID, "revanced_item_text");
|
||||||
public static final int LAYOUT_REVANCED_CUSTOM_LIST_ITEM_CHECKED = getResourceIdentifierOrThrow(
|
public static final int LAYOUT_REVANCED_CUSTOM_LIST_ITEM_CHECKED = getResourceIdentifierOrThrow(
|
||||||
ResourceType.LAYOUT, "revanced_custom_list_item_checked");
|
ResourceType.LAYOUT, "revanced_custom_list_item_checked");
|
||||||
|
public static final int DRAWABLE_CHECKMARK = getResourceIdentifierOrThrow(
|
||||||
|
ResourceType.DRAWABLE, "revanced_settings_custom_checkmark");
|
||||||
|
public static final int DRAWABLE_CHECKMARK_BOLD = getResourceIdentifierOrThrow(
|
||||||
|
ResourceType.DRAWABLE, "revanced_settings_custom_checkmark_bold");
|
||||||
|
|
||||||
private String staticSummary = null;
|
private String staticSummary = null;
|
||||||
private CharSequence[] highlightedEntriesForDialog = null;
|
private CharSequence[] highlightedEntriesForDialog = null;
|
||||||
|
|
@ -126,9 +131,14 @@ public class CustomDialogListPreference extends ListPreference {
|
||||||
LayoutInflater inflater = LayoutInflater.from(getContext());
|
LayoutInflater inflater = LayoutInflater.from(getContext());
|
||||||
view = inflater.inflate(layoutResourceId, parent, false);
|
view = inflater.inflate(layoutResourceId, parent, false);
|
||||||
holder = new SubViewDataContainer();
|
holder = new SubViewDataContainer();
|
||||||
holder.checkIcon = view.findViewById(ID_REVANCED_CHECK_ICON);
|
|
||||||
holder.placeholder = view.findViewById(ID_REVANCED_CHECK_ICON_PLACEHOLDER);
|
holder.placeholder = view.findViewById(ID_REVANCED_CHECK_ICON_PLACEHOLDER);
|
||||||
holder.itemText = view.findViewById(ID_REVANCED_ITEM_TEXT);
|
holder.itemText = view.findViewById(ID_REVANCED_ITEM_TEXT);
|
||||||
|
holder.checkIcon = view.findViewById(ID_REVANCED_CHECK_ICON);
|
||||||
|
holder.checkIcon.setImageResource(
|
||||||
|
BaseSettings.SETTINGS_DISABLE_BOLD_ICONS.get()
|
||||||
|
? DRAWABLE_CHECKMARK
|
||||||
|
: DRAWABLE_CHECKMARK_BOLD
|
||||||
|
);
|
||||||
view.setTag(holder);
|
view.setTag(holder);
|
||||||
} else {
|
} else {
|
||||||
holder = (SubViewDataContainer) view.getTag();
|
holder = (SubViewDataContainer) view.getTag();
|
||||||
|
|
|
||||||
|
|
@ -42,6 +42,8 @@ public class SearchHistoryManager {
|
||||||
ResourceType.ID, "clear_history_button");
|
ResourceType.ID, "clear_history_button");
|
||||||
private static final int ID_HISTORY_TEXT = getResourceIdentifierOrThrow(
|
private static final int ID_HISTORY_TEXT = getResourceIdentifierOrThrow(
|
||||||
ResourceType.ID, "history_text");
|
ResourceType.ID, "history_text");
|
||||||
|
private static final int ID_HISTORY_ICON = getResourceIdentifierOrThrow(
|
||||||
|
ResourceType.ID, "history_icon");
|
||||||
private static final int ID_DELETE_ICON = getResourceIdentifierOrThrow(
|
private static final int ID_DELETE_ICON = getResourceIdentifierOrThrow(
|
||||||
ResourceType.ID, "delete_icon");
|
ResourceType.ID, "delete_icon");
|
||||||
private static final int ID_EMPTY_HISTORY_TITLE = getResourceIdentifierOrThrow(
|
private static final int ID_EMPTY_HISTORY_TITLE = getResourceIdentifierOrThrow(
|
||||||
|
|
@ -62,6 +64,10 @@ public class SearchHistoryManager {
|
||||||
ResourceType.DRAWABLE, "revanced_settings_search_remove");
|
ResourceType.DRAWABLE, "revanced_settings_search_remove");
|
||||||
private static final int ID_SEARCH_REMOVE_ICON_BOLD = getResourceIdentifierOrThrow(
|
private static final int ID_SEARCH_REMOVE_ICON_BOLD = getResourceIdentifierOrThrow(
|
||||||
ResourceType.DRAWABLE, "revanced_settings_search_remove_bold");
|
ResourceType.DRAWABLE, "revanced_settings_search_remove_bold");
|
||||||
|
private static final int ID_SEARCH_ARROW_TIME_ICON = getResourceIdentifierOrThrow(
|
||||||
|
ResourceType.DRAWABLE, "revanced_settings_arrow_time");
|
||||||
|
private static final int ID_SEARCH_ARROW_TIME_ICON_BOLD = getResourceIdentifierOrThrow(
|
||||||
|
ResourceType.DRAWABLE, "revanced_settings_arrow_time_bold");
|
||||||
|
|
||||||
private final Deque<String> searchHistory;
|
private final Deque<String> searchHistory;
|
||||||
private final Activity activity;
|
private final Activity activity;
|
||||||
|
|
@ -103,7 +109,8 @@ public class SearchHistoryManager {
|
||||||
|
|
||||||
// Inflate search history layout.
|
// Inflate search history layout.
|
||||||
LayoutInflater inflater = LayoutInflater.from(activity);
|
LayoutInflater inflater = LayoutInflater.from(activity);
|
||||||
View historyView = inflater.inflate(LAYOUT_REVANCED_PREFERENCE_SEARCH_HISTORY_SCREEN, searchHistoryContainer, false);
|
View historyView = inflater.inflate(LAYOUT_REVANCED_PREFERENCE_SEARCH_HISTORY_SCREEN,
|
||||||
|
searchHistoryContainer, false);
|
||||||
searchHistoryContainer.addView(historyView, new FrameLayout.LayoutParams(
|
searchHistoryContainer.addView(historyView, new FrameLayout.LayoutParams(
|
||||||
FrameLayout.LayoutParams.MATCH_PARENT,
|
FrameLayout.LayoutParams.MATCH_PARENT,
|
||||||
FrameLayout.LayoutParams.MATCH_PARENT));
|
FrameLayout.LayoutParams.MATCH_PARENT));
|
||||||
|
|
@ -326,14 +333,22 @@ public class SearchHistoryManager {
|
||||||
public void notifyDataSetChanged() {
|
public void notifyDataSetChanged() {
|
||||||
container.removeAllViews();
|
container.removeAllViews();
|
||||||
for (String query : history) {
|
for (String query : history) {
|
||||||
View view = inflater.inflate(LAYOUT_REVANCED_PREFERENCE_SEARCH_HISTORY_ITEM, container, false);
|
View view = inflater.inflate(LAYOUT_REVANCED_PREFERENCE_SEARCH_HISTORY_ITEM,
|
||||||
|
container, false);
|
||||||
|
// Set click listener for main item (select query).
|
||||||
|
view.setOnClickListener(v -> onSelectHistoryItemListener.onSelectHistoryItem(query));
|
||||||
|
|
||||||
|
// Set history icon.
|
||||||
|
ImageView historyIcon = view.findViewById(ID_HISTORY_ICON);
|
||||||
|
historyIcon.setImageResource(
|
||||||
|
BaseSettings.SETTINGS_DISABLE_BOLD_ICONS.get()
|
||||||
|
? ID_SEARCH_ARROW_TIME_ICON
|
||||||
|
: ID_SEARCH_ARROW_TIME_ICON_BOLD
|
||||||
|
);
|
||||||
|
|
||||||
TextView historyText = view.findViewById(ID_HISTORY_TEXT);
|
TextView historyText = view.findViewById(ID_HISTORY_TEXT);
|
||||||
historyText.setText(query);
|
historyText.setText(query);
|
||||||
|
|
||||||
// Set click listener for main item (select query).
|
|
||||||
view.setOnClickListener(v -> onSelectHistoryItemListener.onSelectHistoryItem(query));
|
|
||||||
|
|
||||||
// Set click listener for delete icon.
|
// Set click listener for delete icon.
|
||||||
ImageView deleteIcon = view.findViewById(ID_DELETE_ICON);
|
ImageView deleteIcon = view.findViewById(ID_DELETE_ICON);
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -67,9 +67,12 @@ fun settingsPatch (
|
||||||
ResourceGroup("drawable",
|
ResourceGroup("drawable",
|
||||||
// CustomListPreference resources.
|
// CustomListPreference resources.
|
||||||
"revanced_ic_dialog_alert.xml",
|
"revanced_ic_dialog_alert.xml",
|
||||||
|
"revanced_ic_dialog_alert_bold.xml",
|
||||||
// Search resources.
|
// Search resources.
|
||||||
"revanced_settings_arrow_time.xml",
|
"revanced_settings_arrow_time.xml",
|
||||||
|
"revanced_settings_arrow_time_bold.xml",
|
||||||
"revanced_settings_custom_checkmark.xml",
|
"revanced_settings_custom_checkmark.xml",
|
||||||
|
"revanced_settings_custom_checkmark_bold.xml",
|
||||||
"revanced_settings_search_icon.xml",
|
"revanced_settings_search_icon.xml",
|
||||||
"revanced_settings_search_icon_bold.xml",
|
"revanced_settings_search_icon_bold.xml",
|
||||||
"revanced_settings_search_remove.xml",
|
"revanced_settings_search_remove.xml",
|
||||||
|
|
|
||||||
|
|
@ -0,0 +1,11 @@
|
||||||
|
<vector xmlns:android="http://schemas.android.com/apk/res/android"
|
||||||
|
android:width="24dp"
|
||||||
|
android:height="24dp"
|
||||||
|
android:viewportWidth="24"
|
||||||
|
android:viewportHeight="24">
|
||||||
|
|
||||||
|
<path
|
||||||
|
android:fillColor="#000000"
|
||||||
|
android:fillType="evenOdd"
|
||||||
|
android:pathData="M22.1641,5.24609 L36.5547,30.168 C37.5156,31.8359,36.3164,33.918,34.3906,33.918 L5.60938,33.918 C3.68359,33.918,2.48438,31.8359,3.44531,30.168 L17.8359,5.24609 C18.7969,3.58203,21.2031,3.58203,22.1641,5.24609 Z M20,25 C19.0781,25,18.332,25.7461,18.332,26.668 C18.332,27.5898,19.0781,28.332,20,28.332 C20.9219,28.332,21.668,27.5898,21.668,26.668 C21.668,25.7461,20.9219,25,20,25 Z M20,13.332 C19.1445,13.332,18.4414,13.9766,18.3438,14.8047 L18.332,15 L18.332,21.668 C18.332,22.5898,19.0781,23.332,20,23.332 C20.8555,23.332,21.5586,22.6875,21.6563,21.8633 L21.668,21.668 L21.668,15 C21.668,14.0781,20.9219,13.332,20,13.332 Z M20,13.332" />
|
||||||
|
</vector>
|
||||||
|
|
@ -0,0 +1,25 @@
|
||||||
|
<!--
|
||||||
|
Copyright 2022 Google
|
||||||
|
|
||||||
|
Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
|
you may not use this file except in compliance with the License.
|
||||||
|
You may obtain a copy of the License at
|
||||||
|
|
||||||
|
http://www.apache.org/licenses/LICENSE-2.0
|
||||||
|
|
||||||
|
Unless required by applicable law or agreed to in writing, software
|
||||||
|
distributed under the License is distributed on an "AS IS" BASIS,
|
||||||
|
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||||
|
See the License for the specific language governing permissions and
|
||||||
|
limitations under the License.
|
||||||
|
-->
|
||||||
|
<vector xmlns:android="http://schemas.android.com/apk/res/android"
|
||||||
|
android:width="24dp"
|
||||||
|
android:height="24dp"
|
||||||
|
android:viewportWidth="24"
|
||||||
|
android:viewportHeight="24">
|
||||||
|
|
||||||
|
<path
|
||||||
|
android:fillColor="?android:attr/textColorPrimary"
|
||||||
|
android:pathData="M8.76,1.487a11,11 0,1 1,-7.54 12.706,1 1,0 0,1 1.96,-0.4 9,9 0,0 0,14.254 5.38A9,9 0,0 0,16.79 4.38,9 9,0 0,0 4.518,7H7a1,1 0,0 1,0 2H1V3a1,1 0,0 1,2 0v2.678a11,11 0,0 1,5.76 -4.192ZM12,6a1,1 0,0 0,-1 1v5.58l0.504,0.288 3.5,2a1,1 0,1 0,0.992 -1.736L13,11.42V7a1,1 0,0 0,-1 -1Z" />
|
||||||
|
</vector>
|
||||||
|
|
@ -0,0 +1,25 @@
|
||||||
|
<!--
|
||||||
|
Copyright 2022 Google
|
||||||
|
|
||||||
|
Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
|
you may not use this file except in compliance with the License.
|
||||||
|
You may obtain a copy of the License at
|
||||||
|
|
||||||
|
http://www.apache.org/licenses/LICENSE-2.0
|
||||||
|
|
||||||
|
Unless required by applicable law or agreed to in writing, software
|
||||||
|
distributed under the License is distributed on an "AS IS" BASIS,
|
||||||
|
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||||
|
See the License for the specific language governing permissions and
|
||||||
|
limitations under the License.
|
||||||
|
-->
|
||||||
|
<vector xmlns:android="http://schemas.android.com/apk/res/android"
|
||||||
|
android:width="24dp"
|
||||||
|
android:height="24dp"
|
||||||
|
android:viewportWidth="24"
|
||||||
|
android:viewportHeight="24">
|
||||||
|
|
||||||
|
<path
|
||||||
|
android:fillColor="?android:attr/textColorPrimary"
|
||||||
|
android:pathData="M19.793,5.793 L8.5,17.086l-4.293,-4.293a1,1 0,1 0,-1.414 1.414L8.5,19.914 21.207,7.207a1,1 0,1 0,-1.414 -1.414Z" />
|
||||||
|
</vector>
|
||||||
|
|
@ -1,11 +1,4 @@
|
||||||
<?xml version="1.0" encoding="utf-8"?>
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
<!-- Copyright 2024 ReVanced. Not licensed under GPL. See https://github.com/ReVanced/revanced-branding -->
|
<!-- Copyright 2024 ReVanced. Not licensed under GPL. See https://github.com/ReVanced/revanced-branding -->
|
||||||
<!--<selector xmlns:android="http://schemas.android.com/apk/res/android"-->
|
|
||||||
<!-- class="app.revanced.extension.youtube.patches.theme.ReVancedSettingsIconDynamicDrawable">-->
|
|
||||||
|
|
||||||
<!-- <!– This is just a placeholder item to make the XML valid –>-->
|
|
||||||
<!-- <item android:drawable="@android:color/transparent" />-->
|
|
||||||
|
|
||||||
<!--</selector>-->
|
|
||||||
<drawable xmlns:android="http://schemas.android.com/apk/res/android"
|
<drawable xmlns:android="http://schemas.android.com/apk/res/android"
|
||||||
class="app.revanced.extension.youtube.patches.theme.ReVancedSettingsIconDynamicDrawable" />
|
class="app.revanced.extension.youtube.patches.theme.ReVancedSettingsIconDynamicDrawable" />
|
||||||
Loading…
Add table
Add a link
Reference in a new issue