CompoundButtonCompat
public final class CompoundButtonCompat
Helper for accessing CompoundButton.
Summary
Public methods |
|
|---|---|
static @Nullable Drawable |
getButtonDrawable(@NonNull CompoundButton button)Returns the drawable used as the compound button image |
static @Nullable ColorStateList |
getButtonTintList(@NonNull CompoundButton button)Returns the tint applied to the button drawable |
static @Nullable PorterDuff.Mode |
getButtonTintMode(@NonNull CompoundButton button)name android:buttonTintMode |
static void |
setButtonTintList(Applies a tint to the button drawable. |
static void |
setButtonTintMode(Specifies the blending mode used to apply the tint specified by |
Public methods
getButtonDrawable
public static @Nullable Drawable getButtonDrawable(@NonNull CompoundButton button)
Returns the drawable used as the compound button image
| See also | |
|---|---|
setButtonDrawable |
getButtonTintList
public static @Nullable ColorStateList getButtonTintList(@NonNull CompoundButton button)
Returns the tint applied to the button drawable
| See also | |
|---|---|
setButtonTintList |
getButtonTintMode
public static @Nullable PorterDuff.Mode getButtonTintMode(@NonNull CompoundButton button)
name android:buttonTintMode
| Returns | |
|---|---|
@Nullable PorterDuff.Mode |
the blending mode used to apply the tint to the button drawable |
| See also | |
|---|---|
setButtonTintMode |
setButtonTintList
public static void setButtonTintList(
@NonNull CompoundButton button,
@Nullable ColorStateList tint
)
Applies a tint to the button drawable. Does not modify the current tint mode, which is SRC_IN by default.
Subsequent calls to setButtonDrawable should automatically mutate the drawable and apply the specified tint and tint mode using setTintList.
| Parameters | |
|---|---|
@NonNull CompoundButton button |
button for which to apply the tint. |
@Nullable ColorStateList tint |
the tint to apply, may be |
| See also | |
|---|---|
setButtonTintList |
setButtonTintMode
public static void setButtonTintMode(
@NonNull CompoundButton button,
@Nullable PorterDuff.Mode tintMode
)
Specifies the blending mode used to apply the tint specified by setButtonTintList} to the button drawable. The default mode is SRC_IN.
| Parameters | |
|---|---|
@NonNull CompoundButton button |
button for which to apply the tint mode. |
@Nullable PorterDuff.Mode tintMode |
the blending mode used to apply the tint, may be |
| See also | |
|---|---|
getButtonTintMode |
|
setTintMode |