1 Android DrawableTinting Sample 2 =================================== 3 4 Sample that shows applying tinting and color filters to Drawables both programmatically 5 and as Drawable resources in XML. 6 7 Tinting is set on a nine-patch drawable through the "tint" and "tintMode" parameters. 8 A color state list is referenced as the tint color, which defines colors for different 9 states of a View (for example disabled/enabled, focused, pressed or selected). 10 11 Programmatically, tinting is applied to a Drawable through its "setColorFilter" method, 12 with a reference to a color and a PorterDuff blend mode. The color and blend mode can be 13 changed from the UI to see the effect of different options. 14 15 Pre-requisites 16 -------------- 17 18 - Android SDK v21 19 - Android Build Tools v21.1.1 20 - Android Support Repository 21 22 Getting Started 23 --------------- 24 25 This sample uses the Gradle build system. To build this project, use the 26 "gradlew build" command or use "Import Project" in Android Studio. 27 28 Support 29 ------- 30 31 - Google+ Community: https://plus.google.com/communities/105153134372062985968 32 - Stack Overflow: http://stackoverflow.com/questions/tagged/android 33 34 If you've found an error in this sample, please file an issue: 35 https://github.com/googlesamples/android-DrawableTinting 36 37 Patches are encouraged, and may be submitted by forking this project and 38 submitting a pull request through GitHub. Please see CONTRIBUTING.md for more details. 39 40 License 41 ------- 42 43 Copyright 2014 The Android Open Source Project, Inc. 44 45 Licensed to the Apache Software Foundation (ASF) under one or more contributor 46 license agreements. See the NOTICE file distributed with this work for 47 additional information regarding copyright ownership. The ASF licenses this 48 file to you under the Apache License, Version 2.0 (the "License"); you may not 49 use this file except in compliance with the License. You may obtain a copy of 50 the License at 51 52 http://www.apache.org/licenses/LICENSE-2.0 53 54 Unless required by applicable law or agreed to in writing, software 55 distributed under the License is distributed on an "AS IS" BASIS, WITHOUT 56 WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the 57 License for the specific language governing permissions and limitations under 58 the License. 59