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

Commit 21107584 authored by Fabian Kozynski's avatar Fabian Kozynski
Browse files

Fix colors of thick brightness slider

More pleasant colors for the background and icon of the slider. Also,
have the icon change color as the slider passes by.

There doesn't seem to be an easy way to use a vector drawable as an item
while at the same time changing the tint and alpha.

Test: manual
Fixes: 17476414

Change-Id: Ie545c3b681885ea8372808aae8804f58c85f2f67
parent 83eeb33c
Loading
Loading
Loading
Loading
+33 −9
Original line number Diff line number Diff line
@@ -16,21 +16,45 @@
  -->
<layer-list xmlns:android="http://schemas.android.com/apk/res/android"
            android:paddingMode="stack">
    <item android:id="@android:id/progress"
          android:gravity="center_vertical|fill_horizontal">
        <clip
            android:drawable="@drawable/brightness_progress_full_drawable"
            android:clipOrientation="horizontal"
            android:gravity="left"
        />
    </item>
    <item android:id="@android:id/background"
        android:gravity="center_vertical|fill_horizontal">
        <layer-list >
            <item>
                <shape android:shape="rectangle"
               android:tint="?android:attr/colorControlNormal">
                    android:tint="?android:attr/colorControlActivated"
                    android:alpha="0.5">
                    <size android:height="48dp" />
                    <solid android:color="@color/white_disabled" />
                    <corners android:radius="24dp" />
                </shape>
            </item>
            <item
                android:gravity="center_vertical|start"
                android:start="32dp">
                <!-- Copied from drawables/ic_brightness -->
            <vector
                android:width="24dp"
                android:height="24dp"
                android:viewportWidth="24.0"
                android:viewportHeight="24.0">

                <path
                    android:pathData="M18,14.48V18h-3.52L12,20.48L9.52,18H6v-3.52L3.52,12L6,9.52V6h3.52L12,3.52L14.48,6H18v3.52L20.48,12L18,14.48z"
                    />

                <path
                    android:pathData=" M20,8.69 V4h-4.69L12,0.69L8.69,4H4v4.69L0.69,12L4,15.31V20h4.69L12,23.31L15.31,20H20v-4.69L23.31,12L20,8.69z M18,14.48V18h-3.52L12,20.48L9.52,18H6v-3.52L3.52,12L6,9.52V6h3.52L12,3.52L14.48,6H18v3.52L20.48,12L18,14.48z M12,7c-2.76,0 -5,2.24 -5,5s2.24,5 5,5s5,-2.24 5,-5S14.76,7 12,7z"
                    android:fillColor="?android:attr/colorControlActivated" />
            </vector>
            </item>
        </layer-list>
    </item>
    <item android:id="@android:id/progress"
          android:gravity="center_vertical|fill_horizontal">
        <clip
            android:drawable="@drawable/brightness_progress_full_drawable"
            android:clipOrientation="horizontal"
            android:gravity="left"
        />
    </item>
</layer-list>
 No newline at end of file
+29 −7
Original line number Diff line number Diff line
@@ -15,10 +15,32 @@
  ~ limitations under the License.
  -->

<shape xmlns:android="http://schemas.android.com/apk/res/android"
       android:shape="rectangle"
       android:tint="?android:attr/colorControlActivated">
<layer-list xmlns:android="http://schemas.android.com/apk/res/android">
    <item>
        <shape>
            <size android:height="48dp" />
    <solid android:color="@android:color/white" />
            <solid android:color="?android:attr/colorControlActivated" />
            <corners android:radius="24dp"/>
        </shape>
    </item>
    <item
        android:gravity="center_vertical|start"
        android:start="32dp">
        <!-- Copied from drawables/ic_brightness -->
        <vector
            android:width="24dp"
            android:height="24dp"
            android:viewportWidth="24.0"
            android:viewportHeight="24.0"
            android:alpha="0.8">

            <path
                android:pathData="M18,14.48V18h-3.52L12,20.48L9.52,18H6v-3.52L3.52,12L6,9.52V6h3.52L12,3.52L14.48,6H18v3.52L20.48,12L18,14.48z"
                />

            <path
                android:pathData=" M20,8.69 V4h-4.69L12,0.69L8.69,4H4v4.69L0.69,12L4,15.31V20h4.69L12,23.31L15.31,20H20v-4.69L23.31,12L20,8.69z M18,14.48V18h-3.52L12,20.48L9.52,18H6v-3.52L3.52,12L6,9.52V6h3.52L12,3.52L14.48,6H18v3.52L20.48,12L18,14.48z M12,7c-2.76,0 -5,2.24 -5,5s2.24,5 5,5s5,-2.24 5,-5S14.76,7 12,7z"
                android:fillColor="?android:attr/colorBackground" />
        </vector>
    </item>
</layer-list>
 No newline at end of file
+4 −15
Original line number Diff line number Diff line
@@ -38,16 +38,5 @@
            android:progressDrawable="@drawable/brightness_progress_drawable_thick"
            android:splitTrack="false"
        />

        <ImageView
            android:id="@+id/image"
            android:layout_width="24dp"
            android:layout_height="24dp"
            android:layout_marginLeft="48dp"
            android:layout_gravity="center_vertical"
            android:src="@drawable/ic_brightness"
            android:tint="?android:attr/textColorTertiary"
            android:visibility="visible"
        />
    </com.android.systemui.settings.brightness.BrightnessSliderView>
</FrameLayout>
+1 −1
Original line number Diff line number Diff line
@@ -273,7 +273,7 @@ public class BrightnessSlider
        }

        /** Get the layout to inflate based on what slider to use */
        public int getLayout() {
        private int getLayout() {
            return mSettings.useThickSlider()
                    ? R.layout.quick_settings_brightness_dialog_thick
                    : R.layout.quick_settings_brightness_dialog;