java.lang.Object | |
↳ | android.support.v4.widget.CompoundButtonCompat |
Helper for accessing CompoundButton
methods introduced after
API level 4 in a backwards compatible fashion.
XML Attributes | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
android:buttonTintMode | getButtonTintMode(CompoundButton) | Blending mode used to apply the button graphic tint. |
Public Methods | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
Returns the drawable used as the compound button image
| |||||||||||
Returns the tint applied to the button drawable
| |||||||||||
Applies a tint to the button drawable.
| |||||||||||
Specifies the blending mode used to apply the tint specified by
setButtonTintList(CompoundButton, ColorStateList) } to the button drawable.
|
[Expand]
Inherited Methods | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
From class
java.lang.Object
|
Blending mode used to apply the button graphic tint.
Must be one of the following constant values.
Constant | Value | Description |
---|---|---|
src_over | 3 | The tint is drawn on top of the drawable. [Sa + (1 - Sa)*Da, Rc = Sc + (1 - Sa)*Dc] |
src_in | 5 | The tint is masked by the alpha channel of the drawable. The drawable’s color channels are thrown out. [Sa * Da, Sc * Da] |
src_atop | 9 | The tint is drawn above the drawable, but with the drawable’s alpha channel masking the result. [Da, Sc * Da + (1 - Sa) * Dc] |
multiply | 14 | Multiplies the color and alpha channels of the drawable with those of the tint. [Sa * Da, Sc * Dc] |
screen | 15 | [Sa + Da - Sa * Da, Sc + Dc - Sc * Dc] |
add | 16 | Combines the tint and drawable color and alpha channels, clamping the result to valid color values. Saturate(S + D) |
This corresponds to the global attribute
resource symbol buttonTintMode
.
Returns the drawable used as the compound button image
Returns the tint applied to the button drawable
Applies a tint to the button drawable. Does not modify the current tint
mode, which is SRC_IN
by default.
Subsequent calls to setButtonDrawable(Drawable)
should
automatically mutate the drawable and apply the specified tint and tint
mode using setTintList(Drawable, ColorStateList)
.
tint | the tint to apply, may be null to clear tint |
---|
Specifies the blending mode used to apply the tint specified by
setButtonTintList(CompoundButton, ColorStateList)
} to the button drawable. The
default mode is SRC_IN
.
tintMode | the blending mode used to apply the tint, may be
null to clear tint |
---|