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