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

Commit 6bcbf9dc authored by Chaohui Wang's avatar Chaohui Wang
Browse files

[Spa] Allow AnnotatedString to be used in summary

AnnotatedString is also CharSequence, so change the api to CharSequence.

Bug: 419002002
Flag: EXEMPT refactor
Test: manual - with gallery
Test: unit tests still pass
Change-Id: I8b9f18320b5b7d62737cdc5bfc1a21d459a0f6ee
parent c88c575f
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -30,7 +30,7 @@ import com.android.settingslib.spa.widget.ui.SettingsBody
@Composable
internal fun BasePreference(
    title: String,
    summary: () -> String,
    summary: () -> CharSequence,
    modifier: Modifier = Modifier,
    titleContentDescription: String? = null,
    summaryContentDescription: () -> String? = { null },
+1 −1
Original line number Diff line number Diff line
@@ -71,7 +71,7 @@ interface PreferenceModel {
    /**
     * The summary of this [Preference].
     */
    val summary: () -> String
    val summary: () -> CharSequence
        get() = { "" }

    /**
+2 −2
Original line number Diff line number Diff line
@@ -48,7 +48,7 @@ interface SwitchPreferenceModel {
    /**
     * The summary of this [SwitchPreference].
     */
    val summary: () -> String
    val summary: () -> CharSequence
        get() = { "" }

    /**
@@ -109,7 +109,7 @@ internal fun SwitchPreference(model: SwitchPreferenceModel, modifier: Modifier)
internal fun InternalSwitchPreference(
    title: String,
    modifier: Modifier = Modifier,
    summary: () -> String = { "" },
    summary: () -> CharSequence = { "" },
    icon: @Composable (() -> Unit)? = null,
    checked: Boolean?,
    changeable: Boolean = true,
+1 −1
Original line number Diff line number Diff line
@@ -24,7 +24,7 @@ import androidx.compose.ui.graphics.vector.ImageVector
@Composable
fun TwoTargetButtonPreference(
    title: String,
    summary: () -> String,
    summary: () -> CharSequence,
    icon: @Composable (() -> Unit)? = null,
    onClick: () -> Unit,
    buttonIcon: ImageVector,
+1 −1
Original line number Diff line number Diff line
@@ -41,7 +41,7 @@ import com.android.settingslib.spa.framework.util.wrapOnClickWithLog
@Composable
internal fun TwoTargetPreference(
    title: String,
    summary: () -> String,
    summary: () -> CharSequence,
    primaryEnabled: () -> Boolean = { true },
    primaryOnClick: (() -> Unit)?,
    icon: @Composable (() -> Unit)? = null,
Loading