Skip to content

TintedView

ZieIony edited this page May 19, 2015 · 1 revision
public interface TintedView {
    void setTint(ColorStateList list);

    void setTint(int color);

    ColorStateList getTint();
}

Sample implementation

    ColorStateList tint;

    @Override
    public void setTint(ColorStateList list) {
        this.tint = list != null ? list : new ControlFocusedColorStateList(getContext());
        drawDivider = Color.alpha(tint.getDefaultColor()) != 0;
        updateLayout();
    }

    @Override
    public void setTint(int color) {
        setTint(ColorStateList.valueOf(color));
    }

    @Override
    public ColorStateList getTint() {
        return tint;
    }
Clone this wiki locally