diff options
author | Alan Viverette <alanv@google.com> | 2014-07-22 16:11:01 -0700 |
---|---|---|
committer | Alan Viverette <alanv@google.com> | 2014-07-22 16:11:01 -0700 |
commit | 09be4b3c87998b9dca99383cb03c71c0889a01a7 (patch) | |
tree | f6c6ce9773aa29a7e65e0c919cd0f4bc69595121 | |
parent | 6d839875b74f1570e8807005c586298beb677413 (diff) | |
download | packages_apps_Settings-09be4b3c87998b9dca99383cb03c71c0889a01a7.tar.gz packages_apps_Settings-09be4b3c87998b9dca99383cb03c71c0889a01a7.tar.bz2 packages_apps_Settings-09be4b3c87998b9dca99383cb03c71c0889a01a7.zip |
Stop using framework-private switch asset
BUG: 16467249
Change-Id: I0829c3dea522cf59e0f92046ea7c6092d416ad4c
-rw-r--r-- | res/drawable/switch_inner.xml | 37 | ||||
-rw-r--r-- | res/drawable/switch_track.xml | 26 | ||||
-rw-r--r-- | res/layout/switch_bar.xml | 3 | ||||
-rw-r--r-- | res/values/themes.xml | 6 | ||||
-rw-r--r-- | src/com/android/settings/widget/SwitchBar.java | 3 |
5 files changed, 8 insertions, 67 deletions
diff --git a/res/drawable/switch_inner.xml b/res/drawable/switch_inner.xml deleted file mode 100644 index c6d39ef73..000000000 --- a/res/drawable/switch_inner.xml +++ /dev/null @@ -1,37 +0,0 @@ -<?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. ---> - -<selector xmlns:android="http://schemas.android.com/apk/res/android"> - <item android:state_enabled="false" android:state_checked="true"> - <bitmap android:src="@*android:drawable/btn_switch_to_off_mtrl_000" - android:tint="?android:attr/colorControlNormal" - android:alpha="?android:attr/disabledAlpha" /> - </item> - <item android:state_enabled="false"> - <bitmap android:src="@*android:drawable/btn_switch_to_on_mtrl_000" - android:tint="?android:attr/colorControlNormal" - android:alpha="?android:attr/disabledAlpha" /> - </item> - <item android:state_checked="true"> - <bitmap android:src="@*android:drawable/btn_switch_to_off_mtrl_000" - android:tint="@color/switch_accent_color" /> - </item> - <item> - <bitmap android:src="@*android:drawable/btn_switch_to_on_mtrl_000" - android:tint="?android:attr/colorControlNormal" /> - </item> -</selector> - diff --git a/res/drawable/switch_track.xml b/res/drawable/switch_track.xml deleted file mode 100644 index 2655da0df..000000000 --- a/res/drawable/switch_track.xml +++ /dev/null @@ -1,26 +0,0 @@ -<?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. ---> - -<selector xmlns:android="http://schemas.android.com/apk/res/android"> - <item android:state_checked="true"> - <nine-patch android:src="@*android:drawable/switch_track_mtrl_alpha" - android:tint="@color/switch_accent_color" /> - </item> - <item> - <nine-patch android:src="@*android:drawable/switch_track_mtrl_alpha" - android:tint="?android:attr/colorControlNormal" /> - </item> -</selector> diff --git a/res/layout/switch_bar.xml b/res/layout/switch_bar.xml index 6b37e4cf4..5dbeb5599 100644 --- a/res/layout/switch_bar.xml +++ b/res/layout/switch_bar.xml @@ -31,7 +31,8 @@ android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_gravity="center_vertical" - android:background="@null" /> + android:background="@null" + android:theme="@style/ThemeOverlay.SwitchBar" /> </merge> diff --git a/res/values/themes.xml b/res/values/themes.xml index d54819dea..898274f40 100644 --- a/res/values/themes.xml +++ b/res/values/themes.xml @@ -204,4 +204,10 @@ <item name="@android:numbersBackgroundColor">@android:color/white</item> </style> + <!-- Used to color the switch bar controls --> + <style name="ThemeOverlay.SwitchBar" parent="@android:style/ThemeOverlay"> + <!-- Used by controls, e.g. CheckBox, ProgressBar, etc. --> + <item name="android:colorAccent">@color/switch_accent_color</item> + </style> + </resources> diff --git a/src/com/android/settings/widget/SwitchBar.java b/src/com/android/settings/widget/SwitchBar.java index d974a9d62..e24d83fc6 100644 --- a/src/com/android/settings/widget/SwitchBar.java +++ b/src/com/android/settings/widget/SwitchBar.java @@ -97,9 +97,6 @@ public class SwitchBar extends LinearLayout implements CompoundButton.OnCheckedC } }); - mSwitch.setTrackResource(R.drawable.switch_track); - mSwitch.setThumbResource(R.drawable.switch_inner); - setOnClickListener(this); // Default is hide |