Commit 29d0d746 authored by Amit Kumar's avatar Amit Kumar

Style Switch widget

Change-Id: I399f1df187d29f8c2b4d3998b482fce9e0960c8f
parent f4957c1b
......@@ -863,7 +863,7 @@ public class Switch extends CompoundButton {
}
final int switchWidth = Math.max(mSwitchMinWidth,
2 * mThumbWidth + paddingLeft + paddingRight);
(int) (1.8 * mThumbWidth) + paddingLeft + paddingRight);
final int switchHeight = Math.max(trackHeight, thumbHeight);
mSwitchWidth = switchWidth;
mSwitchHeight = switchHeight;
......
......@@ -16,9 +16,9 @@
<selector xmlns:android="http://schemas.android.com/apk/res/android">
<item android:state_enabled="false"
android:color="?attr/colorForeground"
android:alpha="?attr/disabledAlpha" />
android:color="#C8CED0"
android:alpha="0.75" />
<item android:state_checked="true"
android:color="?attr/colorControlActivated" />
<item android:color="?attr/colorForeground" />
android:color="#ff38D874" />
<item android:color="#C8CED0" />
</selector>
<?xml version="1.0" encoding="utf-8"?>
<!-- Copyright (C) 2014 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>
<shape xmlns:android="http://schemas.android.com/apk/res/android"
android:shape="oval">
<solid android:color="#05757575"/>
<size android:width="25dp" android:height="25dp"/>
</shape>
</item>
<item
android:top="0.2dp"
android:bottom="0.2dp"
android:left="0.2dp"
android:right="0.2dp">
<shape xmlns:android="http://schemas.android.com/apk/res/android"
android:shape="oval">
<solid android:color="#05757575"/>
<size android:width="25dp" android:height="25dp"/>
</shape>
</item>
<item
android:top="0.4dp"
android:bottom="0.4dp"
android:left="0.4dp"
android:right="0.4dp">
<shape xmlns:android="http://schemas.android.com/apk/res/android"
android:shape="oval">
<solid android:color="#05757575"/>
<size android:width="25dp" android:height="25dp"/>
</shape>
</item>
<item
android:top="0.6dp"
android:bottom="0.6dp"
android:left="0.6dp"
android:right="0.6dp">
<shape xmlns:android="http://schemas.android.com/apk/res/android"
android:shape="oval">
<solid android:color="#05757575"/>
<size android:width="25dp" android:height="25dp"/>
</shape>
</item>
<item
android:top="0.8dp"
android:bottom="0.8dp"
android:left="0.8dp"
android:right="0.8dp">
<shape xmlns:android="http://schemas.android.com/apk/res/android"
android:shape="oval">
<solid android:color="#05757575"/>
<size android:width="25dp" android:height="25dp"/>
</shape>
</item>
<item
android:top="1.0dp"
android:bottom="1.0dp"
android:left="1.0dp"
android:right="1.0dp">
<shape xmlns:android="http://schemas.android.com/apk/res/android"
android:shape="oval">
<solid android:color="#05757575"/>
<size android:width="25dp" android:height="25dp"/>
</shape>
</item>
<item
android:top="1.2dp"
android:bottom="1.2dp"
android:left="1.2dp"
android:right="1.2dp">
<shape xmlns:android="http://schemas.android.com/apk/res/android"
android:shape="oval">
<solid android:color="#05757575"/>
<size android:width="25dp" android:height="25dp"/>
</shape>
</item>
<item
android:top="1.4dp"
android:bottom="1.4dp"
android:left="1.4dp"
android:right="1.4dp">
<shape xmlns:android="http://schemas.android.com/apk/res/android"
android:shape="oval">
<solid android:color="#05757575"/>
<size android:width="25dp" android:height="25dp"/>
</shape>
</item>
<item
android:top="1.6dp"
android:bottom="1.6dp"
android:left="1.6dp"
android:right="1.6dp">
<shape xmlns:android="http://schemas.android.com/apk/res/android"
android:shape="oval">
<solid android:color="#05757575"/>
<size android:width="25dp" android:height="25dp"/>
</shape>
</item>
<item
android:top="1.8dp"
android:bottom="1.8dp"
android:left="1.8dp"
android:right="1.8dp">
<shape xmlns:android="http://schemas.android.com/apk/res/android"
android:shape="oval">
<solid android:color="#05757575"/>
<size android:width="25dp" android:height="25dp"/>
</shape>
</item>
<item android:top="2dp"
android:bottom="2dp"
android:left="2dp"
android:right="2dp">
<shape xmlns:android="http://schemas.android.com/apk/res/android"
android:shape="oval">
<solid android:color="#ffffff"/>
<size android:width="24dp" android:height="24dp"/>
</shape>
</item>
</layer-list>
<?xml version="1.0" encoding="utf-8"?>
<!-- Copyright (C) 2015 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:gravity="center_vertical|fill_horizontal">
<shape android:shape="rectangle"
android:tint="@color/switch_track_material">
<corners android:radius="14dp" />
<solid android:color="#FFF" />
<size android:height="28dp" />
</shape>
</item>
</layer-list>
......@@ -646,8 +646,8 @@ please see styles_device_defaults.xml.
</style>
<style name="Widget.Material.CompoundButton.Switch">
<item name="track">@drawable/switch_track_material</item>
<item name="thumb">@drawable/switch_thumb_material_anim</item>
<item name="track">@drawable/switch_track_eelo</item>
<item name="thumb">@drawable/switch_thumb_eelo</item>
<item name="switchTextAppearance">@style/TextAppearance.Material.Widget.Switch</item>
<item name="textOn">@string/capital_on</item>
<item name="textOff">@string/capital_off</item>
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment