Merge "Add rotary highlight to switches" into rvc-qpr-dev am: c28fb42e29
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/13211155 MUST ONLY BE SUBMITTED BY AUTOMERGER Change-Id: I3c85c22df09b85c1c7a051fa750014354923ba7c
This commit is contained in:
@@ -14,12 +14,15 @@
|
|||||||
See the License for the specific language governing permissions and
|
See the License for the specific language governing permissions and
|
||||||
limitations under the License.
|
limitations under the License.
|
||||||
-->
|
-->
|
||||||
|
<layer-list xmlns:android="http://schemas.android.com/apk/res/android">
|
||||||
<shape
|
<item android:gravity="center_vertical|fill_horizontal"
|
||||||
xmlns:android="http://schemas.android.com/apk/res/android"
|
android:top="@dimen/car_switch_thumb_margin_size"
|
||||||
android:shape="oval">
|
android:bottom="@dimen/car_switch_thumb_margin_size">
|
||||||
<solid android:color="@color/car_switch"/>
|
<shape android:shape="oval">
|
||||||
<size
|
<solid android:color="@color/car_switch"/>
|
||||||
android:width="@dimen/car_seekbar_thumb_size"
|
<size
|
||||||
android:height="@dimen/car_seekbar_thumb_size"/>
|
android:width="@dimen/car_switch_thumb_size"
|
||||||
</shape>
|
android:height="@dimen/car_switch_thumb_size"/>
|
||||||
|
</shape>
|
||||||
|
</item>
|
||||||
|
</layer-list>
|
||||||
|
|||||||
53
core/res/res/drawable-car/car_switch_track.xml
Normal file
53
core/res/res/drawable-car/car_switch_track.xml
Normal file
@@ -0,0 +1,53 @@
|
|||||||
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
|
<!--
|
||||||
|
Copyright 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">
|
||||||
|
<item
|
||||||
|
android:height="@dimen/car_touch_target_size_minus_one"
|
||||||
|
android:width="@dimen/car_touch_target_size_minus_one"
|
||||||
|
android:gravity="center">
|
||||||
|
<selector>
|
||||||
|
<item android:state_focused="true" android:state_pressed="true">
|
||||||
|
<shape android:shape="oval">
|
||||||
|
<solid android:color="#8A94CBFF"/>
|
||||||
|
<stroke android:width="4dp"
|
||||||
|
android:color="#94CBFF"/>
|
||||||
|
</shape>
|
||||||
|
</item>
|
||||||
|
<item android:state_focused="true">
|
||||||
|
<shape android:shape="oval">
|
||||||
|
<solid android:color="#3D94CBFF"/>
|
||||||
|
<stroke android:width="8dp"
|
||||||
|
android:color="#94CBFF"/>
|
||||||
|
</shape>
|
||||||
|
</item>
|
||||||
|
</selector>
|
||||||
|
</item>
|
||||||
|
<item android:gravity="center_vertical|fill_horizontal"
|
||||||
|
android:left="@dimen/car_switch_track_margin_size"
|
||||||
|
android:right="@dimen/car_switch_track_margin_size">
|
||||||
|
<shape
|
||||||
|
android:shape="rectangle"
|
||||||
|
android:tint="@color/switch_track_material">
|
||||||
|
<corners android:radius="7dp" />
|
||||||
|
<solid android:color="@color/white_disabled_material" />
|
||||||
|
<size android:height="14dp" />
|
||||||
|
<padding
|
||||||
|
android:right="@dimen/car_switch_track_margin_size"
|
||||||
|
android:left="@dimen/car_switch_track_margin_size"/>
|
||||||
|
</shape>
|
||||||
|
</item>
|
||||||
|
</layer-list>
|
||||||
@@ -84,6 +84,14 @@
|
|||||||
<dimen name="car_button_radius">@dimen/car_radius_1</dimen>
|
<dimen name="car_button_radius">@dimen/car_radius_1</dimen>
|
||||||
<dimen name="car_pill_button_size">56dp</dimen>
|
<dimen name="car_pill_button_size">56dp</dimen>
|
||||||
<dimen name="car_touch_target_size">76dp</dimen>
|
<dimen name="car_touch_target_size">76dp</dimen>
|
||||||
|
<dimen name="car_touch_target_size_minus_one">75dp</dimen>
|
||||||
|
|
||||||
|
<!-- Switch. -->
|
||||||
|
<!-- Thumb size + 2*thumb margin size must equal car_touch_target_size -->
|
||||||
|
<!-- 2 * Thumb size + 2*track margin size must equal car_touch_target_size -->
|
||||||
|
<dimen name="car_switch_thumb_size">24dp</dimen>
|
||||||
|
<dimen name="car_switch_thumb_margin_size">26dp</dimen>
|
||||||
|
<dimen name="car_switch_track_margin_size">14dp</dimen>
|
||||||
|
|
||||||
<!-- Seekbar -->
|
<!-- Seekbar -->
|
||||||
<dimen name="car_seekbar_height">6dp</dimen>
|
<dimen name="car_seekbar_height">6dp</dimen>
|
||||||
|
|||||||
Reference in New Issue
Block a user