add the last bold resources

This commit is contained in:
LisoUseInAIKyrios
2025-10-20 22:18:05 +04:00
parent fc988fa078
commit 47f1a5f9c9
8 changed files with 99 additions and 15 deletions

View File

@@ -128,8 +128,10 @@ abstract class Check {
// Add icon to the dialog.
ImageView iconView = new ImageView(activity);
iconView.setImageResource(Utils.getResourceIdentifierOrThrow(
ResourceType.DRAWABLE, "revanced_ic_dialog_alert"));
iconView.setImageResource(Utils.getResourceIdentifierOrThrow(ResourceType.DRAWABLE,
BaseSettings.SETTINGS_DISABLE_BOLD_ICONS.get()
? "revanced_ic_dialog_alert"
: "revanced_ic_dialog_alert_bold"));
iconView.setColorFilter(Utils.getAppForegroundColor(), PorterDuff.Mode.SRC_IN);
iconView.setPadding(0, 0, 0, 0);
LinearLayout.LayoutParams iconParams = new LinearLayout.LayoutParams(

View File

@@ -22,6 +22,7 @@ import androidx.annotation.Nullable;
import app.revanced.extension.shared.ResourceType;
import app.revanced.extension.shared.Utils;
import app.revanced.extension.shared.settings.BaseSettings;
import app.revanced.extension.shared.ui.CustomDialog;
/**
@@ -39,6 +40,10 @@ public class CustomDialogListPreference extends ListPreference {
ResourceType.ID, "revanced_item_text");
public static final int LAYOUT_REVANCED_CUSTOM_LIST_ITEM_CHECKED = getResourceIdentifierOrThrow(
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 CharSequence[] highlightedEntriesForDialog = null;
@@ -126,9 +131,14 @@ public class CustomDialogListPreference extends ListPreference {
LayoutInflater inflater = LayoutInflater.from(getContext());
view = inflater.inflate(layoutResourceId, parent, false);
holder = new SubViewDataContainer();
holder.checkIcon = view.findViewById(ID_REVANCED_CHECK_ICON);
holder.placeholder = view.findViewById(ID_REVANCED_CHECK_ICON_PLACEHOLDER);
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);
} else {
holder = (SubViewDataContainer) view.getTag();

View File

@@ -42,6 +42,8 @@ public class SearchHistoryManager {
ResourceType.ID, "clear_history_button");
private static final int ID_HISTORY_TEXT = getResourceIdentifierOrThrow(
ResourceType.ID, "history_text");
private static final int ID_HISTORY_ICON = getResourceIdentifierOrThrow(
ResourceType.ID, "history_icon");
private static final int ID_DELETE_ICON = getResourceIdentifierOrThrow(
ResourceType.ID, "delete_icon");
private static final int ID_EMPTY_HISTORY_TITLE = getResourceIdentifierOrThrow(
@@ -62,6 +64,10 @@ public class SearchHistoryManager {
ResourceType.DRAWABLE, "revanced_settings_search_remove");
private static final int ID_SEARCH_REMOVE_ICON_BOLD = getResourceIdentifierOrThrow(
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 Activity activity;
@@ -103,7 +109,8 @@ public class SearchHistoryManager {
// Inflate search history layout.
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(
FrameLayout.LayoutParams.MATCH_PARENT,
FrameLayout.LayoutParams.MATCH_PARENT));
@@ -326,14 +333,22 @@ public class SearchHistoryManager {
public void notifyDataSetChanged() {
container.removeAllViews();
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);
historyText.setText(query);
// Set click listener for main item (select query).
view.setOnClickListener(v -> onSelectHistoryItemListener.onSelectHistoryItem(query));
// Set click listener for delete icon.
ImageView deleteIcon = view.findViewById(ID_DELETE_ICON);

View File

@@ -67,9 +67,12 @@ fun settingsPatch (
ResourceGroup("drawable",
// CustomListPreference resources.
"revanced_ic_dialog_alert.xml",
"revanced_ic_dialog_alert_bold.xml",
// Search resources.
"revanced_settings_arrow_time.xml",
"revanced_settings_arrow_time_bold.xml",
"revanced_settings_custom_checkmark.xml",
"revanced_settings_custom_checkmark_bold.xml",
"revanced_settings_search_icon.xml",
"revanced_settings_search_icon_bold.xml",
"revanced_settings_search_remove.xml",

View File

@@ -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>

View File

@@ -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>

View File

@@ -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>

View File

@@ -1,11 +1,4 @@
<?xml version="1.0" encoding="utf-8"?>
<!-- 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">-->
<!-- &lt;!&ndash; This is just a placeholder item to make the XML valid &ndash;&gt;-->
<!-- <item android:drawable="@android:color/transparent" />-->
<!--</selector>-->
<drawable xmlns:android="http://schemas.android.com/apk/res/android"
class="app.revanced.extension.youtube.patches.theme.ReVancedSettingsIconDynamicDrawable" />