Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 8b056660 authored by Treehugger Robot's avatar Treehugger Robot Committed by Android (Google) Code Review
Browse files

Merge "[Catalyst] Introduce LongValuePreference" into main

parents 4370d139 50a4fae9
Loading
Loading
Loading
Loading
+1 −4
Original line number Diff line number Diff line
@@ -98,10 +98,7 @@ interface PreferenceHierarchyGenerator<T> {
    val defaultType: T

    /** Generates [PreferenceHierarchy] with given type. */
    suspend fun generatePreferenceHierarchy(
        context: Context,
        type: T = defaultType
    ): PreferenceHierarchy
    suspend fun generatePreferenceHierarchy(context: Context, type: T): PreferenceHierarchy
}

/**
+6 −0
Original line number Diff line number Diff line
@@ -49,6 +49,12 @@ interface IntRangeValuePreference : PersistentPreference<Int>, ValueDescriptor {
        index in getMinValue(context)..getMaxValue(context)
}

/** A persistent preference that has a long value. */
interface LongValuePreference : PersistentPreference<Long> {
    override val valueType: Class<Long>
        get() = Long::class.javaObjectType
}

/** A preference that provides a two-state toggleable option. */
open class SwitchPreference
@JvmOverloads