xref: /aosp_15_r20/development/samples/browseable/DrawableTinting/_index.jd (revision 90c8c64db3049935a07c6143d7fd006e26f8ecca)
1*90c8c64dSAndroid Build Coastguard Worker
2*90c8c64dSAndroid Build Coastguard Workerpage.tags="DrawableTinting"
3*90c8c64dSAndroid Build Coastguard Workersample.group=UI
4*90c8c64dSAndroid Build Coastguard Worker@jd:body
5*90c8c64dSAndroid Build Coastguard Worker
6*90c8c64dSAndroid Build Coastguard Worker<p>
7*90c8c64dSAndroid Build Coastguard Worker
8*90c8c64dSAndroid Build Coastguard Worker            Sample that shows applying tinting and color filters to Drawables both programmatically
9*90c8c64dSAndroid Build Coastguard Worker            and as Drawable resources in XML.
10*90c8c64dSAndroid Build Coastguard Worker            \n\nTinting is set on a nine-patch drawable through the "tint" and "tintMode" parameters.
11*90c8c64dSAndroid Build Coastguard Worker            A color state list is referenced as the tint color, which defines colors for different
12*90c8c64dSAndroid Build Coastguard Worker            states of a View (for example disabled/enabled, focused, pressed or selected).
13*90c8c64dSAndroid Build Coastguard Worker            \n\nProgrammatically, tinting is applied to a Drawable through its "setColorFilter" method,
14*90c8c64dSAndroid Build Coastguard Worker            with a reference to a color and a PorterDuff blend mode. The color and blend mode can be
15*90c8c64dSAndroid Build Coastguard Worker            changed from the UI to see the effect of different options.
16*90c8c64dSAndroid Build Coastguard Worker
17*90c8c64dSAndroid Build Coastguard Worker        </p>
18