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

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

Refactor ToggleSliderView

ToggleSliderView logic is refactored into a separate controller. A
factory that creates the controller inflates the correct view so the
behavior is transparent to consumers.

The new prototype for brightness slider is here.

Allows to switch between regular brightness slider and thick one:

`adb shell settings put secure sysui_thick_brightness X`

where X is one of:
0 - regular brightness slider
1 - thick brightness slider with mirror
2 - thick brightness slider without mirror

After changing restart device or sysui:
`adb shell am crash com.android.systemui`

Test: manual
Test: atest SystemUITest
Change-Id: Ica7b31d6880c3be831d3f99115945b330ba3d618
parent 971b0022
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -669,7 +669,7 @@
        </activity>

        <activity
            android:name=".settings.BrightnessDialog"
            android:name=".settings.brightness.BrightnessDialog"
            android:label="@string/quick_settings_brightness_dialog_title"
            android:theme="@*android:style/Theme.DeviceDefault.QuickSettings.Dialog"
            android:finishOnCloseSystemDialogs="true"
+36 −0
Original line number Diff line number Diff line
<?xml version="1.0" encoding="utf-8"?>
<!--
  ~ Copyright (C) 2020 The Android Open Source Project
  ~
  ~ Licensed under the Apache License, Version 2.0 (the "License");
  ~ you may not use this file except in compliance with the License.
  ~ You may obtain a copy of the License at
  ~
  ~      http://www.apache.org/licenses/LICENSE-2.0
  ~
  ~ Unless required by applicable law or agreed to in writing, software
  ~ distributed under the License is distributed on an "AS IS" BASIS,
  ~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  ~ See the License for the specific language governing permissions and
  ~ limitations under the License.
  -->
<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">
        <shape android:shape="rectangle"
               android:tint="?android:attr/colorControlNormal">
            <size android:height="48dp" />
            <solid android:color="@color/white_disabled" />
            <corners android:radius="24dp" />
        </shape>
    </item>
</layer-list>
 No newline at end of file
+24 −0
Original line number Diff line number Diff line
<?xml version="1.0" encoding="utf-8"?>
<!--
  ~ Copyright (C) 2020 The Android Open Source Project
  ~
  ~ Licensed under the Apache License, Version 2.0 (the "License");
  ~ you may not use this file except in compliance with the License.
  ~ You may obtain a copy of the License at
  ~
  ~      http://www.apache.org/licenses/LICENSE-2.0
  ~
  ~ Unless required by applicable law or agreed to in writing, software
  ~ distributed under the License is distributed on an "AS IS" BASIS,
  ~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  ~ See the License for the specific language governing permissions and
  ~ limitations under the License.
  -->

<shape xmlns:android="http://schemas.android.com/apk/res/android"
       android:shape="rectangle"
       android:tint="?android:attr/colorControlActivated">
    <size android:height="48dp" />
    <solid android:color="@android:color/white" />
    <corners android:radius="24dp"/>
</shape>
 No newline at end of file
+29 −0
Original line number Diff line number Diff line
<!--
Copyright (C) 2020 The Android Open Source Project

   Licensed under the Apache License, Version 2.0 (the "License");
    you may not use this file except in compliance with the License.
    You may obtain a copy of the License at

         http://www.apache.org/licenses/LICENSE-2.0

    Unless required by applicable law or agreed to in writing, software
    distributed under the License is distributed on an "AS IS" BASIS,
    WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
    See the License for the specific language governing permissions and
    limitations under the License.
-->
<vector xmlns:android="http://schemas.android.com/apk/res/android"
        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="#FFFFFF" />
</vector>
+1 −8
Original line number Diff line number Diff line
@@ -21,12 +21,5 @@
    android:layout_height="@dimen/brightness_mirror_height"
    android:layout_gravity="@integer/notification_panel_layout_gravity"
    android:visibility="invisible">
    <FrameLayout
        android:layout_width="match_parent"
        android:layout_height="match_parent"
        android:layout_marginLeft="@dimen/notification_side_paddings"
        android:layout_marginRight="@dimen/notification_side_paddings"
        android:background="@drawable/brightness_mirror_background">
        <include layout="@layout/quick_settings_brightness_dialog" />
    </FrameLayout>

</FrameLayout>
Loading