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

Commit ffb72af8 authored by Fabian Kozynski's avatar Fabian Kozynski Committed by Android (Google) Code Review
Browse files

Merge "Minor optimizations to BrightnessSlider" into main

parents 0cc6ccb5 2fa844b3
Loading
Loading
Loading
Loading
+4 −4
Original line number Diff line number Diff line
@@ -16,7 +16,7 @@

package com.android.systemui.brightness.ui.compose

import androidx.compose.animation.core.animateIntAsState
import androidx.compose.animation.core.animateFloatAsState
import androidx.compose.foundation.clickable
import androidx.compose.foundation.layout.fillMaxWidth
import androidx.compose.foundation.layout.size
@@ -57,12 +57,12 @@ private fun BrightnessSlider(
) {
    var value by remember(gammaValue) { mutableIntStateOf(gammaValue) }
    val animatedValue by
        animateIntAsState(targetValue = value, label = "BrightnessSliderAnimatedValue")
        animateFloatAsState(targetValue = value.toFloat(), label = "BrightnessSliderAnimatedValue")
    val floatValueRange = valueRange.first.toFloat()..valueRange.last.toFloat()
    val isRestricted = restriction is PolicyRestriction.Restricted
    val isRestricted = remember(restriction) { restriction is PolicyRestriction.Restricted }

    PlatformSlider(
        value = animatedValue.toFloat(),
        value = animatedValue,
        valueRange = floatValueRange,
        enabled = !isRestricted,
        onValueChange = {