fix(Twitch - Settings): Fix missing style resources (#5970)
This commit is contained in:
parent
c5eb88bbf6
commit
8c229954d7
8 changed files with 37 additions and 36 deletions
|
|
@ -42,6 +42,8 @@ private val settingsResourcePatch = resourcePatch {
|
|||
|
||||
execute {
|
||||
|
||||
// Set the style for the ReVanced settings to follow the style of the music settings,
|
||||
// namely: action bar height, menu item padding and remove horizontal dividers.
|
||||
val targetResource = "values/styles.xml"
|
||||
inputStreamFromBundledResource(
|
||||
"settings/music",
|
||||
|
|
@ -53,7 +55,7 @@ private val settingsResourcePatch = resourcePatch {
|
|||
).close()
|
||||
}
|
||||
|
||||
// Remove horizontal divider from the settings Preferences.
|
||||
// Remove horizontal dividers from the music settings.
|
||||
val styleFile = get("res/values/styles.xml")
|
||||
styleFile.writeText(
|
||||
styleFile.readText()
|
||||
|
|
|
|||
|
|
@ -18,7 +18,9 @@ import app.revanced.util.returnEarly
|
|||
import org.w3c.dom.Node
|
||||
|
||||
// TODO: Delete this on next major version bump.
|
||||
@Deprecated("Use non deprecated settings patch function")
|
||||
@Deprecated("Use non deprecated settings patch function",
|
||||
ReplaceWith("settingsPatch(listOf(rootPreference), preferences)")
|
||||
)
|
||||
fun settingsPatch (
|
||||
rootPreference: Pair<IntentPreference, String>,
|
||||
preferences: Set<BasePreference>,
|
||||
|
|
@ -69,8 +71,8 @@ fun settingsPatch (
|
|||
ResourceGroup("drawable",
|
||||
// CustomListPreference resources.
|
||||
"revanced_ic_dialog_alert.xml",
|
||||
// Search resources.
|
||||
"revanced_settings_arrow_time.xml",
|
||||
"revanced_settings_cursor.xml",
|
||||
"revanced_settings_custom_checkmark.xml",
|
||||
"revanced_settings_search_icon.xml",
|
||||
"revanced_settings_search_remove.xml",
|
||||
|
|
|
|||
|
|
@ -95,20 +95,6 @@ private val settingsResourcePatch = resourcePatch {
|
|||
)
|
||||
)
|
||||
|
||||
// Copy style properties used to fix over-sized copy menu that appear in EditTextPreference.
|
||||
// For a full explanation of how this fixes the issue, see the comments in this style file
|
||||
// and the comments in the extension code.
|
||||
val targetResource = "values/styles.xml"
|
||||
inputStreamFromBundledResource(
|
||||
"settings/youtube",
|
||||
targetResource,
|
||||
)!!.let { inputStream ->
|
||||
"resources".copyXmlNode(
|
||||
document(inputStream),
|
||||
document("res/$targetResource"),
|
||||
).close()
|
||||
}
|
||||
|
||||
// Remove horizontal divider from the settings Preferences
|
||||
// To better match the appearance of the stock YouTube settings.
|
||||
document("res/values/styles.xml").use { document ->
|
||||
|
|
|
|||
|
|
@ -1,7 +0,0 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<shape xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:shape="rectangle"
|
||||
android:id="@+id/revanced_settings_cursor">
|
||||
<solid android:color="?android:attr/textColorPrimary" />
|
||||
<size android:width="1dp" />
|
||||
</shape>
|
||||
|
|
@ -46,7 +46,6 @@
|
|||
android:iconifiedByDefault="false"
|
||||
android:searchIcon="@null"
|
||||
android:queryBackground="@null"
|
||||
android:theme="@style/revanced_searchbar_cursor"
|
||||
android:padding="2dp" />
|
||||
|
||||
</FrameLayout>
|
||||
|
|
|
|||
|
|
@ -5,8 +5,4 @@
|
|||
<item name="android:listPreferredItemPaddingStart">@dimen/item_extra_extra_large_spacing</item>
|
||||
<item name="android:listDivider">@null</item>
|
||||
</style>
|
||||
<style name="revanced_searchbar_cursor">
|
||||
<item name="android:textCursorDrawable">@drawable/revanced_settings_cursor</item>
|
||||
<item name="android:textSize">16sp</item>
|
||||
</style>
|
||||
</resources>
|
||||
|
|
|
|||
|
|
@ -1,7 +0,0 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<resources>
|
||||
<style name="revanced_searchbar_cursor">
|
||||
<item name="android:textCursorDrawable">@drawable/revanced_settings_cursor</item>
|
||||
<item name="android:textSize">16sp</item>
|
||||
</style>
|
||||
</resources>
|
||||
Loading…
Add table
Add a link
Reference in a new issue