From 2b62fc2224c42da024fd64602346ff30613517c0 Mon Sep 17 00:00:00 2001 From: MarcaD <152095496+MarcaDian@users.noreply.github.com> Date: Sun, 22 Jun 2025 14:21:00 +0300 Subject: [PATCH] fix: Add scrollable content to modern style settings dialogs (#5211) --- .../app/revanced/extension/shared/Utils.java | 120 ++++++++++-------- .../extension/shared/checks/Check.java | 3 +- .../preference/ColorPickerPreference.java | 32 +++-- .../CustomDialogListPreference.java | 46 ++----- .../preference/ReVancedAboutPreference.java | 5 +- .../settings/SearchViewController.java | 16 ++- .../SegmentCategoryListPreference.java | 58 +++++---- .../drawable/revanced_ic_dialog_alert.xml | 10 +- 8 files changed, 152 insertions(+), 138 deletions(-) diff --git a/extensions/shared/library/src/main/java/app/revanced/extension/shared/Utils.java b/extensions/shared/library/src/main/java/app/revanced/extension/shared/Utils.java index 1b1b4e280..36d7f8d97 100644 --- a/extensions/shared/library/src/main/java/app/revanced/extension/shared/Utils.java +++ b/extensions/shared/library/src/main/java/app/revanced/extension/shared/Utils.java @@ -42,6 +42,7 @@ import android.widget.EditText; import android.widget.FrameLayout; import android.widget.LinearLayout; import android.widget.RelativeLayout; +import android.widget.ScrollView; import android.widget.TextView; import android.widget.Toast; import android.widget.Toolbar; @@ -773,16 +774,15 @@ public class Utils { Dialog dialog = new Dialog(context); dialog.requestWindowFeature(Window.FEATURE_NO_TITLE); // Remove default title bar. - // Create main layout. - LinearLayout mainLayout = new LinearLayout(context); - mainLayout.setOrientation(LinearLayout.VERTICAL); - // Preset size constants. final int dip4 = dipToPixels(4); final int dip8 = dipToPixels(8); final int dip16 = dipToPixels(16); final int dip24 = dipToPixels(24); + // Create main layout. + LinearLayout mainLayout = new LinearLayout(context); + mainLayout.setOrientation(LinearLayout.VERTICAL); mainLayout.setPadding(dip24, dip16, dip24, dip24); // Set rounded rectangle background. ShapeDrawable mainBackground = new ShapeDrawable(new RoundRectShape( @@ -802,55 +802,71 @@ public class Utils { ViewGroup.LayoutParams.MATCH_PARENT, ViewGroup.LayoutParams.WRAP_CONTENT ); - layoutParams.setMargins(0, 0, 0, dip8); + layoutParams.setMargins(0, 0, 0, dip16); titleView.setLayoutParams(layoutParams); mainLayout.addView(titleView); } - // Message (if not replaced by EditText). - if (editText == null && message != null) { - TextView messageView = new TextView(context); - messageView.setText(message); // Supports Spanned (HTML). - messageView.setTextSize(16); - messageView.setTextColor(getAppForegroundColor()); - // Enable HTML link clicking if the message contains links. - if (message instanceof Spanned) { - messageView.setMovementMethod(LinkMovementMethod.getInstance()); + // Create content container (message/EditText) inside a ScrollView only if message or editText is provided. + ScrollView contentScrollView = null; + LinearLayout contentContainer = null; + if (message != null || editText != null) { + contentScrollView = new ScrollView(context); + contentScrollView.setVerticalScrollBarEnabled(false); // Disable the vertical scrollbar. + contentScrollView.setOverScrollMode(View.OVER_SCROLL_NEVER); + if (editText != null) { + ShapeDrawable scrollViewBackground = new ShapeDrawable(new RoundRectShape( + createCornerRadii(10), null, null)); + scrollViewBackground.getPaint().setColor(getEditTextBackground()); + contentScrollView.setPadding(dip8, dip8, dip8, dip8); + contentScrollView.setBackground(scrollViewBackground); + contentScrollView.setClipToOutline(true); } - LinearLayout.LayoutParams messageParams = new LinearLayout.LayoutParams( + LinearLayout.LayoutParams contentParams = new LinearLayout.LayoutParams( ViewGroup.LayoutParams.MATCH_PARENT, - ViewGroup.LayoutParams.WRAP_CONTENT + 0, + 1.0f // Weight to take available space. ); - messageParams.setMargins(0, dip8, 0, dip16); - messageView.setLayoutParams(messageParams); - mainLayout.addView(messageView); - } + contentScrollView.setLayoutParams(contentParams); + contentContainer = new LinearLayout(context); + contentContainer.setOrientation(LinearLayout.VERTICAL); + contentScrollView.addView(contentContainer); - // EditText (if provided). - if (editText != null) { - // Remove EditText from its current parent, if any. - ViewGroup parent = (ViewGroup) editText.getParent(); - if (parent != null) { - parent.removeView(editText); + // Message (if not replaced by EditText). + if (editText == null && message != null) { + TextView messageView = new TextView(context); + messageView.setText(message); // Supports Spanned (HTML). + messageView.setTextSize(16); + messageView.setTextColor(getAppForegroundColor()); + // Enable HTML link clicking if the message contains links. + if (message instanceof Spanned) { + messageView.setMovementMethod(LinkMovementMethod.getInstance()); + } + LinearLayout.LayoutParams messageParams = new LinearLayout.LayoutParams( + ViewGroup.LayoutParams.MATCH_PARENT, + ViewGroup.LayoutParams.WRAP_CONTENT + ); + messageView.setLayoutParams(messageParams); + contentContainer.addView(messageView); } - // Style the EditText to match the dialog theme. - editText.setTextColor(getAppForegroundColor()); - editText.setBackgroundColor(isDarkModeEnabled() ? Color.BLACK : Color.WHITE); - editText.setPadding(dip8, dip8, dip8, dip8); - ShapeDrawable editTextBackground = new ShapeDrawable(new RoundRectShape( - createCornerRadii(10), null, null)); - editTextBackground.getPaint().setColor(getEditTextBackground()); // Background color for EditText. - editText.setBackground(editTextBackground); - LinearLayout.LayoutParams editTextParams = new LinearLayout.LayoutParams( - LinearLayout.LayoutParams.MATCH_PARENT, - LinearLayout.LayoutParams.WRAP_CONTENT - ); - editTextParams.setMargins(0, dip8, 0, dip16); - // Prevent buttons from moving off the screen by fixing the height of the EditText. - final int maxHeight = (int) (context.getResources().getDisplayMetrics().heightPixels * 0.6); - editText.setMaxHeight(maxHeight); - mainLayout.addView(editText, 1, editTextParams); + // EditText (if provided). + if (editText != null) { + // Remove EditText from its current parent, if any. + ViewGroup parent = (ViewGroup) editText.getParent(); + if (parent != null) { + parent.removeView(editText); + } + // Style the EditText to match the dialog theme. + editText.setTextColor(getAppForegroundColor()); + editText.setBackgroundColor(Color.TRANSPARENT); + editText.setPadding(0, 0, 0, 0); + LinearLayout.LayoutParams editTextParams = new LinearLayout.LayoutParams( + LinearLayout.LayoutParams.MATCH_PARENT, + LinearLayout.LayoutParams.WRAP_CONTENT + ); + contentContainer.addView(editText, editTextParams); + } } // Button container. @@ -861,7 +877,7 @@ public class Utils { LinearLayout.LayoutParams.MATCH_PARENT, LinearLayout.LayoutParams.WRAP_CONTENT ); - buttonContainerParams.setMargins(0, dip8, 0, 0); + buttonContainerParams.setMargins(0, dip16, 0, 0); buttonContainer.setLayoutParams(buttonContainerParams); // Lists to track buttons. @@ -1036,25 +1052,29 @@ public class Utils { } } + // Add ScrollView to main layout only if content exist. + if (contentScrollView != null) { + mainLayout.addView(contentScrollView); + } mainLayout.addView(buttonContainer); dialog.setContentView(mainLayout); // Set dialog window attributes. Window window = dialog.getWindow(); if (window != null) { - setDialogWindowParameters(context, window); + setDialogWindowParameters(window); } return new Pair<>(dialog, mainLayout); } - public static void setDialogWindowParameters(Context context, Window window) { + public static void setDialogWindowParameters(Window window) { WindowManager.LayoutParams params = window.getAttributes(); - Resources resources = context.getResources(); - DisplayMetrics displayMetrics = resources.getDisplayMetrics(); + DisplayMetrics displayMetrics = Resources.getSystem().getDisplayMetrics(); int portraitWidth = (int) (displayMetrics.widthPixels * 0.9); - if (resources.getConfiguration().orientation == Configuration.ORIENTATION_LANDSCAPE) { + + if (Resources.getSystem().getConfiguration().orientation == Configuration.ORIENTATION_LANDSCAPE) { portraitWidth = (int) Math.min(portraitWidth, displayMetrics.heightPixels * 0.9); } params.width = portraitWidth; @@ -1199,7 +1219,7 @@ public class Utils { return darkColor == Color.BLACK // Lighten the background a little if using AMOLED dark theme // as the dialogs are almost invisible. - ? 0xFF0D0D0D + ? 0xFF080808 // 3% : darkColor; } return getThemeLightColor(); diff --git a/extensions/shared/library/src/main/java/app/revanced/extension/shared/checks/Check.java b/extensions/shared/library/src/main/java/app/revanced/extension/shared/checks/Check.java index 3420c56db..7c0c09a0f 100644 --- a/extensions/shared/library/src/main/java/app/revanced/extension/shared/checks/Check.java +++ b/extensions/shared/library/src/main/java/app/revanced/extension/shared/checks/Check.java @@ -129,8 +129,7 @@ abstract class Check { ImageView iconView = new ImageView(activity); iconView.setImageResource(Utils.getResourceIdentifier("revanced_ic_dialog_alert", "drawable")); iconView.setColorFilter(Utils.getAppForegroundColor(), PorterDuff.Mode.SRC_IN); - final int dip8 = dipToPixels(8); - iconView.setPadding(0, dip8, 0, dip8); + iconView.setPadding(0, 0, 0, 0); LinearLayout.LayoutParams iconParams = new LinearLayout.LayoutParams( LinearLayout.LayoutParams.WRAP_CONTENT, LinearLayout.LayoutParams.WRAP_CONTENT diff --git a/extensions/shared/library/src/main/java/app/revanced/extension/shared/settings/preference/ColorPickerPreference.java b/extensions/shared/library/src/main/java/app/revanced/extension/shared/settings/preference/ColorPickerPreference.java index 81d372f03..a70a66e72 100644 --- a/extensions/shared/library/src/main/java/app/revanced/extension/shared/settings/preference/ColorPickerPreference.java +++ b/extensions/shared/library/src/main/java/app/revanced/extension/shared/settings/preference/ColorPickerPreference.java @@ -24,10 +24,7 @@ import android.view.LayoutInflater; import android.view.View; import android.view.ViewGroup; import android.view.ViewParent; -import android.widget.Button; -import android.widget.EditText; -import android.widget.LinearLayout; -import android.widget.TextView; +import android.widget.*; import androidx.annotation.ColorInt; @@ -298,7 +295,6 @@ public class ColorPickerPreference extends EditTextPreference { // Horizontal layout for preview and EditText. LinearLayout inputLayout = new LinearLayout(context); inputLayout.setOrientation(LinearLayout.HORIZONTAL); - inputLayout.setPadding(0, 0, 0, dipToPixels(10)); dialogColorPreview = new TextView(context); LinearLayout.LayoutParams previewParams = new LinearLayout.LayoutParams( @@ -338,11 +334,23 @@ public class ColorPickerPreference extends EditTextPreference { paddingView.setLayoutParams(params); inputLayout.addView(paddingView); - // Create main container for color picker and input layout. - LinearLayout container = new LinearLayout(context); - container.setOrientation(LinearLayout.VERTICAL); - container.addView(colorPicker); - container.addView(inputLayout); + // Create content container for color picker and input layout. + LinearLayout contentContainer = new LinearLayout(context); + contentContainer.setOrientation(LinearLayout.VERTICAL); + contentContainer.addView(colorPicker); + contentContainer.addView(inputLayout); + + // Create ScrollView to wrap the content container. + ScrollView contentScrollView = new ScrollView(context); + contentScrollView.setVerticalScrollBarEnabled(false); // Disable vertical scrollbar. + contentScrollView.setOverScrollMode(View.OVER_SCROLL_NEVER); // Disable overscroll effect. + LinearLayout.LayoutParams scrollViewParams = new LinearLayout.LayoutParams( + LinearLayout.LayoutParams.MATCH_PARENT, + 0, + 1.0f + ); + contentScrollView.setLayoutParams(scrollViewParams); + contentScrollView.addView(contentContainer); // Create custom dialog. final int originalColor = currentColor & 0x00FFFFFF; @@ -391,9 +399,9 @@ public class ColorPickerPreference extends EditTextPreference { false // Do not dismiss dialog when onNeutralClick. ); - // Add the custom container to the dialog's main layout. + // Add the ScrollView to the dialog's main layout. LinearLayout dialogMainLayout = dialogPair.second; - dialogMainLayout.addView(container, 1); + dialogMainLayout.addView(contentScrollView, dialogMainLayout.getChildCount() - 1); // Set up color picker listener with debouncing. // Add listener last to prevent callbacks from set calls above. diff --git a/extensions/shared/library/src/main/java/app/revanced/extension/shared/settings/preference/CustomDialogListPreference.java b/extensions/shared/library/src/main/java/app/revanced/extension/shared/settings/preference/CustomDialogListPreference.java index 2f85f4d37..46ed1815b 100644 --- a/extensions/shared/library/src/main/java/app/revanced/extension/shared/settings/preference/CustomDialogListPreference.java +++ b/extensions/shared/library/src/main/java/app/revanced/extension/shared/settings/preference/CustomDialogListPreference.java @@ -11,11 +11,7 @@ import android.util.Pair; import android.view.LayoutInflater; import android.view.View; import android.view.ViewGroup; -import android.widget.ArrayAdapter; -import android.widget.ImageView; -import android.widget.LinearLayout; -import android.widget.ListView; -import android.widget.TextView; +import android.widget.*; import androidx.annotation.NonNull; @@ -107,14 +103,16 @@ public class CustomDialogListPreference extends ListPreference { @Override protected void showDialog(Bundle state) { + Context context = getContext(); + // Create ListView. - ListView listView = new ListView(getContext()); + ListView listView = new ListView(context); listView.setId(android.R.id.list); listView.setChoiceMode(ListView.CHOICE_MODE_SINGLE); // Create custom adapter for the ListView. ListPreferenceArrayAdapter adapter = new ListPreferenceArrayAdapter( - getContext(), + context, Utils.getResourceIdentifier("revanced_custom_list_item_checked", "layout"), getEntries(), getEntryValues(), @@ -137,7 +135,7 @@ public class CustomDialogListPreference extends ListPreference { // Create the custom dialog without OK button. Pair dialogPair = Utils.createCustomDialog( - getContext(), + context, getTitle() != null ? getTitle().toString() : "", null, null, @@ -149,35 +147,13 @@ public class CustomDialogListPreference extends ListPreference { true ); - Dialog dialog = dialogPair.first; + // Add the ListView to the main layout. LinearLayout mainLayout = dialogPair.second; - - // Measure content height before adding ListView to layout. - // Otherwise, the ListView will push the buttons off the screen. - int totalHeight = 0; - int widthSpec = View.MeasureSpec.makeMeasureSpec( - getContext().getResources().getDisplayMetrics().widthPixels, - View.MeasureSpec.AT_MOST - ); - int heightSpec = View.MeasureSpec.makeMeasureSpec(0, View.MeasureSpec.UNSPECIFIED); - - for (int i = 0; i < adapter.getCount(); i++) { - View listItem = adapter.getView(i, null, listView); - listItem.measure(widthSpec, heightSpec); - totalHeight += listItem.getMeasuredHeight(); - } - - // Cap the height at maxHeight. - int maxHeight = (int) (getContext().getResources().getDisplayMetrics().heightPixels * 0.6); - int finalHeight = Math.min(totalHeight, maxHeight); - - // Add ListView to the main layout with calculated height. LinearLayout.LayoutParams listViewParams = new LinearLayout.LayoutParams( LinearLayout.LayoutParams.MATCH_PARENT, - finalHeight // Use calculated height directly. + 0, + 1.0f ); - final int marginHorizontal = dipToPixels(8); - listViewParams.setMargins(0, marginHorizontal, 0, marginHorizontal); mainLayout.addView(listView, mainLayout.getChildCount() - 1, listViewParams); // Handle item click to select value and dismiss dialog. @@ -188,10 +164,10 @@ public class CustomDialogListPreference extends ListPreference { adapter.setSelectedValue(selectedValue); adapter.notifyDataSetChanged(); } - dialog.dismiss(); + dialogPair.first.dismiss(); }); // Show the dialog. - dialog.show(); + dialogPair.first.show(); } } diff --git a/extensions/shared/library/src/main/java/app/revanced/extension/shared/settings/preference/ReVancedAboutPreference.java b/extensions/shared/library/src/main/java/app/revanced/extension/shared/settings/preference/ReVancedAboutPreference.java index 0a06cfcaa..d639d39be 100644 --- a/extensions/shared/library/src/main/java/app/revanced/extension/shared/settings/preference/ReVancedAboutPreference.java +++ b/extensions/shared/library/src/main/java/app/revanced/extension/shared/settings/preference/ReVancedAboutPreference.java @@ -17,6 +17,7 @@ import android.os.Handler; import android.os.Looper; import android.preference.Preference; import android.util.AttributeSet; +import android.view.View; import android.view.Window; import android.webkit.WebView; import android.webkit.WebViewClient; @@ -216,6 +217,8 @@ class WebViewDialog extends Dialog { // Create WebView. WebView webView = new WebView(getContext()); + webView.setVerticalScrollBarEnabled(false); // Disable the vertical scrollbar. + webView.setOverScrollMode(View.OVER_SCROLL_NEVER); webView.getSettings().setJavaScriptEnabled(true); webView.setWebViewClient(new OpenLinksExternallyWebClient()); webView.loadDataWithBaseURL(null, htmlContent, "text/html", "utf-8", null); @@ -228,7 +231,7 @@ class WebViewDialog extends Dialog { // Set dialog window attributes Window window = getWindow(); if (window != null) { - Utils.setDialogWindowParameters(getContext(), window); + Utils.setDialogWindowParameters(window); } } diff --git a/extensions/youtube/src/main/java/app/revanced/extension/youtube/settings/SearchViewController.java b/extensions/youtube/src/main/java/app/revanced/extension/youtube/settings/SearchViewController.java index 1dbb550e5..c194108a8 100644 --- a/extensions/youtube/src/main/java/app/revanced/extension/youtube/settings/SearchViewController.java +++ b/extensions/youtube/src/main/java/app/revanced/extension/youtube/settings/SearchViewController.java @@ -19,6 +19,7 @@ import android.widget.SearchView; import android.widget.TextView; import android.widget.Toolbar; +import androidx.annotation.ColorInt; import androidx.annotation.NonNull; import java.util.ArrayList; @@ -58,11 +59,7 @@ public class SearchViewController { GradientDrawable background = new GradientDrawable(); background.setShape(GradientDrawable.RECTANGLE); background.setCornerRadius(28 * context.getResources().getDisplayMetrics().density); // 28dp corner radius. - int baseColor = Utils.getAppBackgroundColor(); - int adjustedColor = Utils.isDarkModeEnabled() - ? Utils.adjustColorBrightness(baseColor, 1.11f) // Lighten for dark theme. - : Utils.adjustColorBrightness(baseColor, 0.95f); // Darken for light theme. - background.setColor(adjustedColor); + background.setColor(getSearchViewBackground()); return background; } @@ -72,10 +69,17 @@ public class SearchViewController { private static GradientDrawable createSuggestionBackgroundDrawable(Context context) { GradientDrawable background = new GradientDrawable(); background.setShape(GradientDrawable.RECTANGLE); - background.setCornerRadius(8 * context.getResources().getDisplayMetrics().density); // 8dp corner radius. + background.setColor(getSearchViewBackground()); return background; } + @ColorInt + public static int getSearchViewBackground() { + return Utils.isDarkModeEnabled() + ? Utils.adjustColorBrightness(Utils.getDialogBackgroundColor(), 1.11f) + : Utils.adjustColorBrightness(Utils.getThemeLightColor(), 0.95f); + } + /** * Adds search view components to the activity. */ diff --git a/extensions/youtube/src/main/java/app/revanced/extension/youtube/sponsorblock/objects/SegmentCategoryListPreference.java b/extensions/youtube/src/main/java/app/revanced/extension/youtube/sponsorblock/objects/SegmentCategoryListPreference.java index df5acd1c8..ee3c1c138 100644 --- a/extensions/youtube/src/main/java/app/revanced/extension/youtube/sponsorblock/objects/SegmentCategoryListPreference.java +++ b/extensions/youtube/src/main/java/app/revanced/extension/youtube/sponsorblock/objects/SegmentCategoryListPreference.java @@ -18,12 +18,7 @@ import android.text.TextWatcher; import android.util.Pair; import android.view.LayoutInflater; import android.view.View; -import android.widget.EditText; -import android.widget.GridLayout; -import android.widget.LinearLayout; -import android.widget.RadioButton; -import android.widget.RadioGroup; -import android.widget.TextView; +import android.widget.*; import androidx.annotation.ColorInt; @@ -88,8 +83,6 @@ public class SegmentCategoryListPreference extends ListPreference { // Create the main layout for the dialog content. LinearLayout contentLayout = new LinearLayout(context); contentLayout.setOrientation(LinearLayout.VERTICAL); - final int dip10 = dipToPixels(10); - contentLayout.setPadding(0, 0, 0, dip10); // Add behavior selection radio buttons. RadioGroup radioGroup = new RadioGroup(context); @@ -103,7 +96,7 @@ public class SegmentCategoryListPreference extends ListPreference { radioGroup.addView(radioButton); } radioGroup.setOnCheckedChangeListener((group, checkedId) -> selectedDialogEntryIndex = checkedId); - radioGroup.setPadding(dip10, 0, 0, 0); + radioGroup.setPadding(dipToPixels(10), 0, 0, 0); contentLayout.addView(radioGroup); // Inflate the color picker view. @@ -131,7 +124,7 @@ public class SegmentCategoryListPreference extends ListPreference { gridParams = new GridLayout.LayoutParams(); gridParams.rowSpec = GridLayout.spec(0); // First row. gridParams.columnSpec = GridLayout.spec(1); // Second column. - gridParams.setMargins(0, 0, dip10, 0); + gridParams.setMargins(0, 0, dipToPixels(10), 0); dialogColorDotView = new TextView(context); dialogColorDotView.setLayoutParams(gridParams); gridLayout.addView(dialogColorDotView); @@ -250,20 +243,17 @@ public class SegmentCategoryListPreference extends ListPreference { contentLayout.addView(gridLayout); - // Set up color picker listener. - // Do last to prevent listener callbacks while setting up view. - dialogColorPickerView.setOnColorChangedListener(color -> { - if (categoryColor == color) { - return; - } - categoryColor = color; - String hexColor = getColorString(color); - Logger.printDebug(() -> "onColorChanged: " + hexColor); - - updateCategoryColorDot(); - dialogColorEditText.setText(hexColor); - dialogColorEditText.setSelection(hexColor.length()); - }); + // Create ScrollView to wrap the content layout. + ScrollView contentScrollView = new ScrollView(context); + contentScrollView.setVerticalScrollBarEnabled(false); // Disable vertical scrollbar. + contentScrollView.setOverScrollMode(View.OVER_SCROLL_NEVER); // Disable overscroll effect. + LinearLayout.LayoutParams scrollViewParams = new LinearLayout.LayoutParams( + LinearLayout.LayoutParams.MATCH_PARENT, + 0, + 1.0f + ); + contentScrollView.setLayoutParams(scrollViewParams); + contentScrollView.addView(contentLayout); // Create the custom dialog. Pair dialogPair = Utils.createCustomDialog( @@ -309,13 +299,27 @@ public class SegmentCategoryListPreference extends ListPreference { false // Do not dismiss dialog on Neutral button click. ); - dialog = dialogPair.first; + // Add the ScrollView to the dialog's main layout. LinearLayout dialogMainLayout = dialogPair.second; + dialogMainLayout.addView(contentScrollView, dialogMainLayout.getChildCount() - 1); - // Add the custom content to the dialog's main layout. - dialogMainLayout.addView(contentLayout, 1); // Add after title, before buttons. + // Set up color picker listener. + // Do last to prevent listener callbacks while setting up view. + dialogColorPickerView.setOnColorChangedListener(color -> { + if (categoryColor == color) { + return; + } + categoryColor = color; + String hexColor = getColorString(color); + Logger.printDebug(() -> "onColorChanged: " + hexColor); + + updateCategoryColorDot(); + dialogColorEditText.setText(hexColor); + dialogColorEditText.setSelection(hexColor.length()); + }); // Show the dialog. + dialog = dialogPair.first; dialog.show(); } catch (Exception ex) { Logger.printException(() -> "showDialog failure", ex); diff --git a/patches/src/main/resources/settings/drawable/revanced_ic_dialog_alert.xml b/patches/src/main/resources/settings/drawable/revanced_ic_dialog_alert.xml index 6c6b7cb3a..d308d6f8c 100644 --- a/patches/src/main/resources/settings/drawable/revanced_ic_dialog_alert.xml +++ b/patches/src/main/resources/settings/drawable/revanced_ic_dialog_alert.xml @@ -1,10 +1,10 @@ + android:width="40dp" + android:height="40dp" + android:viewportWidth="40" + android:viewportHeight="40"> + 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" />