mirror of
https://github.com/revanced/revanced-patches
synced 2024-09-04 13:35:30 +02:00
fix: allow using PreferenceScreen
outside of current module
This commit is contained in:
parent
d8ef855d5d
commit
fe94013a22
@ -12,7 +12,7 @@ import org.w3c.dom.Element
|
||||
* @param tag The tag of the preference.
|
||||
* @param summary The summary of the preference.
|
||||
*/
|
||||
internal abstract class BasePreference(
|
||||
abstract class BasePreference(
|
||||
val key: String?,
|
||||
val title: StringResource,
|
||||
val summary: StringResource? = null,
|
||||
|
@ -9,7 +9,7 @@ import org.w3c.dom.Element
|
||||
* @param name The name of the resource.
|
||||
* @param tag The tag of the resource.
|
||||
*/
|
||||
internal abstract class BaseResource(
|
||||
abstract class BaseResource(
|
||||
val name: String,
|
||||
val tag: String
|
||||
) {
|
||||
|
@ -12,7 +12,7 @@ import org.w3c.dom.Document
|
||||
* @param summary The summary of the preference.
|
||||
* @param default The default value of the preference.
|
||||
*/
|
||||
internal abstract class DefaultBasePreference<T>(
|
||||
abstract class DefaultBasePreference<T>(
|
||||
key: String?,
|
||||
title: StringResource,
|
||||
summary: StringResource? = null,
|
||||
|
@ -10,7 +10,7 @@ import org.w3c.dom.Document
|
||||
* @param name The name of the array resource.
|
||||
* @param items The items of the array resource.
|
||||
*/
|
||||
internal class ArrayResource(
|
||||
class ArrayResource(
|
||||
name: String,
|
||||
val items: List<StringResource>
|
||||
) : BaseResource(name, "string-array") {
|
||||
|
@ -15,7 +15,7 @@ import org.w3c.dom.Document
|
||||
* @param summary The summary of the list preference.
|
||||
* @param default The default entry value of the list preference.
|
||||
*/
|
||||
internal class ListPreference(
|
||||
class ListPreference(
|
||||
key: String,
|
||||
title: StringResource,
|
||||
val entries: ArrayResource,
|
||||
|
@ -15,7 +15,7 @@ import org.w3c.dom.Element
|
||||
* @param title The title of the preference.
|
||||
* @param summary The summary of the text preference.
|
||||
*/
|
||||
internal class NonInteractivePreference(
|
||||
class NonInteractivePreference(
|
||||
title: StringResource,
|
||||
summary: StringResource,
|
||||
) : BasePreference(null, title, summary, "Preference") {
|
||||
|
@ -12,7 +12,7 @@ import org.w3c.dom.Document
|
||||
* @param summary The summary of the text preference.
|
||||
* @param intent The intent of the preference.
|
||||
*/
|
||||
internal class Preference(
|
||||
class Preference(
|
||||
key: String,
|
||||
title: StringResource,
|
||||
summary: StringResource,
|
||||
@ -33,7 +33,7 @@ internal class Preference(
|
||||
})
|
||||
}
|
||||
|
||||
internal class Intent(
|
||||
class Intent(
|
||||
internal val targetPackage: String,
|
||||
internal val data: String,
|
||||
internal val targetClass: String
|
||||
|
@ -11,7 +11,7 @@ import org.w3c.dom.Document
|
||||
* @param title The title of the preference.
|
||||
* @param preferences Child preferences of this category.
|
||||
*/
|
||||
internal open class PreferenceCategory(
|
||||
open class PreferenceCategory(
|
||||
key: String,
|
||||
title: StringResource,
|
||||
var preferences: List<BasePreference>,
|
||||
|
@ -13,7 +13,7 @@ import org.w3c.dom.Document
|
||||
* @param preferences Child preferences of this screen.
|
||||
* @param summary The summary of the text preference.
|
||||
*/
|
||||
internal open class PreferenceScreen(
|
||||
open class PreferenceScreen(
|
||||
key: String,
|
||||
title: StringResource,
|
||||
var preferences: List<BasePreference>,
|
||||
|
@ -11,7 +11,7 @@ import org.w3c.dom.Document
|
||||
* @param value The value of the string.
|
||||
* @param formatted If the string is formatted. If false, the attribute will be set.
|
||||
*/
|
||||
internal class StringResource(
|
||||
class StringResource(
|
||||
name: String,
|
||||
val value: String,
|
||||
val formatted: Boolean = true
|
||||
|
@ -18,7 +18,7 @@ import org.w3c.dom.Element
|
||||
* @param userDialogMessage The message to show in a dialog when the user toggles the preference.
|
||||
* @param default The default value of the switch.
|
||||
*/
|
||||
internal class SwitchPreference(
|
||||
class SwitchPreference(
|
||||
key: String, title: StringResource,
|
||||
val summaryOn: StringResource,
|
||||
val summaryOff: StringResource,
|
||||
|
@ -13,7 +13,7 @@ import org.w3c.dom.Document
|
||||
* @param summary The summary of the text preference.
|
||||
* @param default The default value of the text preference.
|
||||
*/
|
||||
internal class TextPreference(
|
||||
class TextPreference(
|
||||
key: String?,
|
||||
title: StringResource,
|
||||
summary: StringResource?,
|
||||
|
@ -6,7 +6,7 @@ import app.revanced.patches.shared.settings.preference.impl.PreferenceScreen
|
||||
import app.revanced.patches.shared.settings.preference.impl.StringResource
|
||||
import java.io.Closeable
|
||||
|
||||
internal abstract class AbstractPreferenceScreen(
|
||||
abstract class AbstractPreferenceScreen(
|
||||
private val root: MutableList<Screen> = mutableListOf()
|
||||
) : Closeable {
|
||||
|
||||
|
@ -123,7 +123,7 @@ class SettingsPatch : BytecodePatch(
|
||||
/**
|
||||
* Preference screens patches should add their settings to.
|
||||
*/
|
||||
internal object PreferenceScreen : AbstractPreferenceScreen() {
|
||||
object PreferenceScreen : AbstractPreferenceScreen() {
|
||||
val ADS = Screen("ads", "Ads", "Ad related settings")
|
||||
val INTERACTIONS = Screen("interactions", "Interaction", "Settings related to interactions")
|
||||
val LAYOUT = Screen("layout", "Layout", "Settings related to the layout")
|
||||
|
Loading…
Reference in New Issue
Block a user