Skip to content

Commit

Permalink
Slightly tweak Preference.PreferenceItem.CustomPreference
Browse files Browse the repository at this point in the history
  • Loading branch information
AntsyLich committed Nov 20, 2024
1 parent 9aef08c commit 81effea
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -162,12 +162,12 @@ sealed class Preference {

data class CustomPreference(
override val title: String,
val content: @Composable (PreferenceItem<String>) -> Unit,
) : PreferenceItem<String>() {
val content: @Composable () -> Unit,
) : PreferenceItem<Unit>() {
override val enabled: Boolean = true
override val subtitle: String? = null
override val icon: ImageVector? = null
override val onValueChanged: suspend (newValue: String) -> Boolean = { true }
override val onValueChanged: suspend (newValue: Unit) -> Boolean = { true }
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -167,7 +167,7 @@ internal fun PreferenceItem(
InfoWidget(text = item.title)
}
is Preference.PreferenceItem.CustomPreference -> {
item.content(item)
item.content()
}
}
}
Expand Down

0 comments on commit 81effea

Please sign in to comment.