fix(Twitch - Settings): Fix missing style resources (#5970)
This commit is contained in:
@@ -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 ->
|
||||
|
||||
Reference in New Issue
Block a user