summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAlan Viverette <alanv@google.com>2014-07-22 23:23:21 +0000
committerAndroid (Google) Code Review <android-gerrit@google.com>2014-07-22 20:33:22 +0000
commit47d27bd629838ded2d217f238b6e3b21d18485da (patch)
treeda67277a51964823d79230f25286a4aea3d6b364
parent3f3426e0d95aed9ab651a703a3a7e33833cd4741 (diff)
parent09be4b3c87998b9dca99383cb03c71c0889a01a7 (diff)
downloadpackages_apps_Settings-47d27bd629838ded2d217f238b6e3b21d18485da.zip
packages_apps_Settings-47d27bd629838ded2d217f238b6e3b21d18485da.tar.gz
packages_apps_Settings-47d27bd629838ded2d217f238b6e3b21d18485da.tar.bz2
Merge "Stop using framework-private switch asset" into lmp-dev
-rw-r--r--res/drawable/switch_inner.xml37
-rw-r--r--res/drawable/switch_track.xml26
-rw-r--r--res/layout/switch_bar.xml3
-rw-r--r--res/values/themes.xml6
-rw-r--r--src/com/android/settings/widget/SwitchBar.java3
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 c6d39ef..0000000
--- 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 2655da0..0000000
--- 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 6b37e4c..5dbeb55 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 d54819d..898274f 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 d974a9d..e24d83f 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