mirror of
https://github.com/revanced/revanced-patches
synced 2024-08-31 03:26:23 +02:00
fix(youtube/theme): move options out of dependency patch
This commit is contained in:
parent
279b193b68
commit
a95344879c
@ -8,9 +8,7 @@ import app.revanced.patcher.data.BytecodeContext
|
||||
import app.revanced.patcher.data.toMethodWalker
|
||||
import app.revanced.patcher.extensions.addInstructions
|
||||
import app.revanced.patcher.extensions.instruction
|
||||
import app.revanced.patcher.patch.BytecodePatch
|
||||
import app.revanced.patcher.patch.PatchResult
|
||||
import app.revanced.patcher.patch.PatchResultSuccess
|
||||
import app.revanced.patcher.patch.*
|
||||
import app.revanced.patcher.patch.annotations.DependsOn
|
||||
import app.revanced.patcher.patch.annotations.Patch
|
||||
import app.revanced.patcher.util.proxy.mutableTypes.MutableMethod
|
||||
@ -71,7 +69,25 @@ class ThemeBytecodePatch : BytecodePatch(
|
||||
return PatchResultSuccess()
|
||||
}
|
||||
|
||||
private companion object {
|
||||
companion object : OptionsContainer() {
|
||||
private const val INTEGRATIONS_CLASS_DESCRIPTOR = "Lapp/revanced/integrations/patches/theme/ThemePatch;"
|
||||
|
||||
var darkThemeBackgroundColor: String? by option(
|
||||
PatchOption.StringOption(
|
||||
key = "darkThemeBackgroundColor",
|
||||
default = "@android:color/black",
|
||||
title = "Background color for the dark theme",
|
||||
description = "The background color of the dark theme. Can be a hex color or a resource reference.",
|
||||
)
|
||||
)
|
||||
|
||||
var lightThemeBackgroundColor: String? by option(
|
||||
PatchOption.StringOption(
|
||||
key = "lightThemeBackgroundColor",
|
||||
default = "@android:color/white",
|
||||
title = "Background color for the light theme",
|
||||
description = "The background color of the light theme. Can be a hex color or a resource reference.",
|
||||
)
|
||||
)
|
||||
}
|
||||
}
|
||||
|
@ -1,12 +1,17 @@
|
||||
package app.revanced.patches.youtube.layout.theme.resource
|
||||
|
||||
import app.revanced.patcher.data.ResourceContext
|
||||
import app.revanced.patcher.patch.*
|
||||
import app.revanced.patcher.patch.PatchResult
|
||||
import app.revanced.patcher.patch.PatchResultError
|
||||
import app.revanced.patcher.patch.PatchResultSuccess
|
||||
import app.revanced.patcher.patch.ResourcePatch
|
||||
import app.revanced.patcher.patch.annotations.DependsOn
|
||||
import app.revanced.patches.shared.mapping.misc.patch.ResourceMappingPatch
|
||||
import app.revanced.patches.shared.settings.preference.impl.InputType
|
||||
import app.revanced.patches.shared.settings.preference.impl.StringResource
|
||||
import app.revanced.patches.shared.settings.preference.impl.TextPreference
|
||||
import app.revanced.patches.youtube.layout.theme.bytecode.patch.ThemeBytecodePatch.Companion.darkThemeBackgroundColor
|
||||
import app.revanced.patches.youtube.layout.theme.bytecode.patch.ThemeBytecodePatch.Companion.lightThemeBackgroundColor
|
||||
import app.revanced.patches.youtube.misc.settings.bytecode.patch.SettingsPatch
|
||||
import app.revanced.util.resources.ResourceUtils
|
||||
import app.revanced.util.resources.ResourceUtils.copyResources
|
||||
@ -67,25 +72,7 @@ class ThemeResourcePatch : ResourcePatch {
|
||||
return PatchResultSuccess()
|
||||
}
|
||||
|
||||
companion object : OptionsContainer() {
|
||||
internal var inlineTimeBarColorizedBarPlayedColorDarkId = -1L
|
||||
|
||||
var darkThemeBackgroundColor: String? by option(
|
||||
PatchOption.StringOption(
|
||||
key = "darkThemeBackgroundColor",
|
||||
default = "@android:color/black",
|
||||
title = "Background color for the dark theme",
|
||||
description = "The background color of the dark theme. Can be a hex color or a resource reference.",
|
||||
)
|
||||
)
|
||||
|
||||
var lightThemeBackgroundColor: String? by option(
|
||||
PatchOption.StringOption(
|
||||
key = "lightThemeBackgroundColor",
|
||||
default = "@android:color/white",
|
||||
title = "Background color for the light theme",
|
||||
description = "The background color of the light theme. Can be a hex color or a resource reference.",
|
||||
)
|
||||
)
|
||||
internal companion object {
|
||||
var inlineTimeBarColorizedBarPlayedColorDarkId = -1L
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user