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

Commit 93307cdb authored by Matthew Fritze's avatar Matthew Fritze
Browse files

Make Settings Slider Slices one row

To unify all Settings slices into one row, we change
Settings Slider from user a header and a input range to
only using an Input Range.

Change-Id: I61715a45b29b6a52a47711811e5c6b2c83d50901
Fixes: 80430118
Test: robotests
parent 2e0709b3
Loading
Loading
Loading
Loading
+2 −3
Original line number Diff line number Diff line
@@ -287,11 +287,10 @@ public class SliceBuilderUtils {

        return new ListBuilder(context, sliceData.getUri(), ListBuilder.INFINITY)
                .setAccentColor(color)
                .setHeader(builder -> builder
                .addInputRange(builder -> builder
                        .setTitle(sliceData.getTitle())
                        .setSubtitle(subtitleText)
                        .setPrimaryAction(primaryAction))
                .addInputRange(builder -> builder
                        .setPrimaryAction(primaryAction)
                        .setMax(sliderController.getMaxSteps())
                        .setValue(sliderController.getSliderPosition())
                        .setInputAction(actionIntent))
+4 −0
Original line number Diff line number Diff line
@@ -43,6 +43,7 @@ import androidx.slice.SliceMetadata;
import androidx.slice.builders.ListBuilder;
import androidx.slice.core.SliceAction;
import androidx.slice.core.SliceQuery;
import androidx.slice.widget.EventInfo;

import android.support.v4.graphics.drawable.IconCompat;

@@ -159,6 +160,9 @@ public class SliceTester {
        final long sliceTTL = metadata.getExpiry();
        assertThat(sliceTTL).isEqualTo(ListBuilder.INFINITY);

        final int headerType = metadata.getHeaderType();
        assertThat(headerType).isEqualTo(EventInfo.ROW_TYPE_SLIDER);

        // Check primary intent
        final PendingIntent primaryPendingIntent = primaryAction.getAction();
        assertThat(primaryPendingIntent).isEqualTo(