List of usage examples for android.support.v4.widget CompoundButtonCompat setButtonTintMode
public static void setButtonTintMode(@NonNull CompoundButton button, @Nullable PorterDuff.Mode tintMode)
From source file:android.support.v7.widget.AppCompatCompoundButtonHelper.java
void loadFromAttributes(AttributeSet attrs, int defStyleAttr) { TypedArray a = mView.getContext().obtainStyledAttributes(attrs, R.styleable.CompoundButton, defStyleAttr, 0);/*from www .j a va2 s.co m*/ try { if (a.hasValue(R.styleable.CompoundButton_android_button)) { final int resourceId = a.getResourceId(R.styleable.CompoundButton_android_button, 0); if (resourceId != 0) { mView.setButtonDrawable(mDrawableManager.getDrawable(mView.getContext(), resourceId)); } } if (a.hasValue(R.styleable.CompoundButton_buttonTint)) { CompoundButtonCompat.setButtonTintList(mView, a.getColorStateList(R.styleable.CompoundButton_buttonTint)); } if (a.hasValue(R.styleable.CompoundButton_buttonTintMode)) { CompoundButtonCompat.setButtonTintMode(mView, DrawableUtils.parseTintMode(a.getInt(R.styleable.CompoundButton_buttonTintMode, -1), null)); } } finally { a.recycle(); } }