Skip to content

Commit

Permalink
Revert "Feat: Add widgetContainer to SliderPreference"
Browse files Browse the repository at this point in the history
This reverts commit 2857e39.

Because it shouldn't have been added to such a dedicated preference.
  • Loading branch information
zhanghai committed Sep 10, 2024
1 parent c58fb29 commit 56992c0
Showing 1 changed file with 0 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,6 @@ inline fun LazyListScope.sliderPreference(
noinline icon: @Composable ((Float) -> Unit)? = null,
noinline summary: @Composable ((Float) -> Unit)? = null,
noinline valueText: @Composable ((Float) -> Unit)? = null,
noinline widgetContainer: @Composable ((Float) -> Unit)? = null,
) {
item(key = key, contentType = "SliderPreference") {
val state = rememberState()
Expand All @@ -75,7 +74,6 @@ inline fun LazyListScope.sliderPreference(
icon = icon?.let { { it(sliderValue) } },
summary = summary?.let { { it(sliderValue) } },
valueText = valueText?.let { { it(sliderValue) } },
widgetContainer = widgetContainer?.let { { it(sliderValue) } },
)
}
}
Expand All @@ -92,7 +90,6 @@ fun SliderPreference(
icon: @Composable (() -> Unit)? = null,
summary: @Composable (() -> Unit)? = null,
valueText: @Composable (() -> Unit)? = null,
widgetContainer: @Composable (() -> Unit)? = null,
) {
var value by state
var sliderValue by sliderState
Expand All @@ -109,7 +106,6 @@ fun SliderPreference(
icon = icon,
summary = summary,
valueText = valueText,
widgetContainer = widgetContainer,
)
}

Expand All @@ -127,7 +123,6 @@ fun SliderPreference(
icon: @Composable (() -> Unit)? = null,
summary: @Composable (() -> Unit)? = null,
valueText: @Composable (() -> Unit)? = null,
widgetContainer: @Composable (() -> Unit)? = null,
) {
var lastValue by remember { mutableFloatStateOf(value) }
SideEffect {
Expand Down Expand Up @@ -170,7 +165,6 @@ fun SliderPreference(
}
}
},
widgetContainer = widgetContainer,
)
}

Expand Down

0 comments on commit 56992c0

Please sign in to comment.