Jan-Felix Schmakeit | ce9fa15 | 2014-09-08 17:36:29 +1000 | [diff] [blame] | 1 | <?xml version="1.0" encoding="UTF-8"?> |
| 2 | <!-- |
| 3 | Copyright 2014 The Android Open Source Project |
Jan-Felix Schmakeit | ce9fa15 | 2014-09-08 17:36:29 +1000 | [diff] [blame] | 4 | Licensed under the Apache License, Version 2.0 (the "License"); |
| 5 | you may not use this file except in compliance with the License. |
| 6 | You may obtain a copy of the License at |
| 7 | |
| 8 | http://www.apache.org/licenses/LICENSE-2.0 |
| 9 | |
| 10 | Unless required by applicable law or agreed to in writing, software |
| 11 | distributed under the License is distributed on an "AS IS" BASIS, |
| 12 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
| 13 | See the License for the specific language governing permissions and |
| 14 | limitations under the License. |
| 15 | --> |
Jan-Felix Schmakeit | ce9fa15 | 2014-09-08 17:36:29 +1000 | [diff] [blame] | 16 | <sample> |
| 17 | <name>DrawableTinting</name> |
| 18 | <group>UI</group> |
| 19 | <package>com.example.android.drawabletinting</package> |
Jan-Felix Schmakeit | ce9fa15 | 2014-09-08 17:36:29 +1000 | [diff] [blame] | 20 | <!-- change minSdk if needed--> |
Trevor Johns | 3403830 | 2014-10-16 02:33:29 -0700 | [diff] [blame] | 21 | <minSdk>21</minSdk> |
Jan-Felix Schmakeit | ce9fa15 | 2014-09-08 17:36:29 +1000 | [diff] [blame] | 22 | <strings> |
| 23 | <intro> |
| 24 | <![CDATA[ |
| 25 | Sample that shows applying tinting and color filters to Drawables both programmatically |
| 26 | and as Drawable resources in XML. |
Trevor Johns | c208bcc | 2014-09-16 12:03:00 -0700 | [diff] [blame] | 27 | \n\nTinting is set on a nine-patch drawable through the "tint" and "tintMode" parameters. |
| 28 | A color state list is referenced as the tint color, which defines colors for different |
Jan-Felix Schmakeit | ce9fa15 | 2014-09-08 17:36:29 +1000 | [diff] [blame] | 29 | states of a View (for example disabled/enabled, focused, pressed or selected). |
Trevor Johns | c208bcc | 2014-09-16 12:03:00 -0700 | [diff] [blame] | 30 | \n\nProgrammatically, tinting is applied to a Drawable through its "setColorFilter" method, |
Jan-Felix Schmakeit | ce9fa15 | 2014-09-08 17:36:29 +1000 | [diff] [blame] | 31 | with a reference to a color and a PorterDuff blend mode. The color and blend mode can be |
| 32 | changed from the UI to see the effect of different options. |
| 33 | ]]> |
| 34 | </intro> |
| 35 | </strings> |
Jan-Felix Schmakeit | ce9fa15 | 2014-09-08 17:36:29 +1000 | [diff] [blame] | 36 | <template src="base"/> |
| 37 | <template src="FragmentView"/> |
Jan-Felix Schmakeit | ce9fa15 | 2014-09-08 17:36:29 +1000 | [diff] [blame] | 38 | <common src="logger"/> |
| 39 | <common src="activities"/> |
Trevor Johns | ce73a61 | 2014-09-16 16:31:07 -0700 | [diff] [blame] | 40 | </sample> |