Skip to content

Commit

Permalink
fix: allow using PreferenceScreen outside of current module
Browse files Browse the repository at this point in the history
  • Loading branch information
oSumAtrIX committed Aug 13, 2023
1 parent d8ef855 commit fe94013
Show file tree
Hide file tree
Showing 14 changed files with 15 additions and 15 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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
) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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") {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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") {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand All @@ -33,7 +33,7 @@ internal class Preference(
})
}

internal class Intent(
class Intent(
internal val targetPackage: String,
internal val data: String,
internal val targetClass: String
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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>,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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>,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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?,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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 {

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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")
Expand Down

0 comments on commit fe94013

Please sign in to comment.