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

Commit 7c975ff0 authored by Anton Potapov's avatar Anton Potapov
Browse files

Fix volume label position when its width is too short

The slider label should container size should wrap the label text when
its enabled instead of filling all available space

Flag: aconfig new_volume_panel TEAMFOOD
Test: manual on the phone and a tablet. Adjust the volume to for the
      label to change side.
Fixes: 330477873
Change-Id: Ia2fdd2479ee7594a6ad7a47868bbcf5f24e333f1
parent f58571ee
Loading
Loading
Loading
Loading
+8 −3
Original line number Diff line number Diff line
@@ -108,15 +108,20 @@ private class VolumeSliderContentMeasurePolicy(private val isEnabled: Boolean) :
            measurables
                .fastFirst { it.layoutId == VolumeSliderContentComponent.Label }
                .measure(constraints)
        val layoutWidth: Int = constraints.maxWidth
        val layoutWidth: Int =
            if (isEnabled) {
                labelPlaceable.width
            } else {
                constraints.maxWidth
            }
        val fullLayoutWidth: Int =
            if (isEnabled) {
                // PlatformSlider uses half of the available space for the enabled state.
                // This is using it to allow disabled message to take whole space when animating to
                // prevent it from jumping left to right
                layoutWidth * 2
                constraints.maxWidth * 2
            } else {
                layoutWidth
                constraints.maxWidth
            }

        val disabledMessagePlaceable =