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

Commit fe6c2094 authored by Matt Pietal's avatar Matt Pietal
Browse files

Controls UI - Constrain status to increment of stepValue

When dragging, the value displayed should always be an increment of
the stepValue, and never anything in between.

Fixes: 157728714
Test: drag on range controls
Change-Id: Ib2af5d915ece584bab52a2e256cfa2150d5a6c61
parent bc109d01
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -268,7 +268,7 @@ class ToggleRangeBehavior : Behavior {

    private fun format(primaryFormat: String, backupFormat: String, value: Float): String {
        return try {
            String.format(primaryFormat, value)
            String.format(primaryFormat, findNearestStep(value))
        } catch (e: IllegalFormatException) {
            Log.w(ControlsUiController.TAG, "Illegal format in range template", e)
            if (backupFormat == "") {