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
This commit is contained in:
@@ -16,6 +16,39 @@
|
||||
-->
|
||||
<layer-list xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:paddingMode="stack">
|
||||
<item android:id="@android:id/background"
|
||||
android:gravity="center_vertical|fill_horizontal">
|
||||
<layer-list >
|
||||
<item>
|
||||
<shape android:shape="rectangle"
|
||||
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
|
||||
@@ -24,13 +57,4 @@
|
||||
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>
|
||||
@@ -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">
|
||||
<size android:height="48dp" />
|
||||
<solid android:color="@android:color/white" />
|
||||
<corners android:radius="24dp"/>
|
||||
</shape>
|
||||
<layer-list xmlns:android="http://schemas.android.com/apk/res/android">
|
||||
<item>
|
||||
<shape>
|
||||
<size android:height="48dp" />
|
||||
<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>
|
||||
@@ -14,10 +14,10 @@
|
||||
limitations under the License.
|
||||
-->
|
||||
<FrameLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_gravity="center"
|
||||
style="@style/BrightnessDialogContainer">
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_gravity="center"
|
||||
style="@style/BrightnessDialogContainer">
|
||||
|
||||
<com.android.systemui.settings.brightness.BrightnessSliderView
|
||||
android:id="@+id/brightness_slider"
|
||||
@@ -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>
|
||||
|
||||
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user