feat(YouTube - Alternative Thumbnails): Add option to use DeArrow (#3378)
Co-authored-by: oSumAtrIX <johan.melkonyan1@web.de> Co-authored-by: LisoUseInAIKyrios <118716522+LisoUseInAIKyrios@users.noreply.github.com>
This commit is contained in:
@ -9,7 +9,7 @@ import org.w3c.dom.Element
|
||||
*
|
||||
* @param key The key of the preference.
|
||||
* @param title The title of the preference.
|
||||
* @param tag The tag of the preference.
|
||||
* @param tag The full class name for the preference.
|
||||
* @param summary The summary of the preference.
|
||||
*/
|
||||
abstract class BasePreference(
|
||||
|
@ -14,15 +14,21 @@ import org.w3c.dom.Element
|
||||
*
|
||||
* @param title The title of the preference.
|
||||
* @param summary The summary of the text preference.
|
||||
* @param selectable If this preference responds to tapping.
|
||||
* Setting to 'true' restores the horizontal dividers on the top and bottom,
|
||||
* but tapping will still do nothing since this Preference has no key.
|
||||
*/
|
||||
class NonInteractivePreference(
|
||||
title: StringResource,
|
||||
summary: StringResource,
|
||||
) : BasePreference(null, title, summary, "Preference") {
|
||||
summary: StringResource?,
|
||||
tag: String = "Preference",
|
||||
// If androidx.preference is later used, this can be changed to the show top/bottom dividers feature.
|
||||
val selectable: Boolean = false
|
||||
) : BasePreference(null, title, summary, tag) {
|
||||
override fun serialize(ownerDocument: Document, resourceCallback: (BaseResource) -> Unit): Element {
|
||||
return super.serialize(ownerDocument, resourceCallback).apply {
|
||||
addSummary(summary?.also { resourceCallback.invoke(it)
|
||||
setAttribute("android:selectable", false.toString())
|
||||
setAttribute("android:selectable", selectable.toString())
|
||||
})
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user