import org.xmlpull.v1.XmlPullParserException;
import java.io.IOException;
-import java.util.ArrayList;
/**
* Documentation pending.
protected boolean onStateChange(int[] stateSet) {
super.onStateChange(stateSet);
- if (mRipplePaint != null) {
+ if (mRipplePaint != null && mState.mTint != null) {
final ColorStateList stateList = mState.mTint;
final int newColor = stateList.getColorForState(stateSet, 0);
final int oldColor = mRipplePaint.getColor();
@Override
public boolean isStateful() {
- return super.isStateful() || mState.mTint.isStateful();
+ return super.isStateful() || mState.mTint != null && mState.mTint.isStateful();
}
@Override
if (themeAttrs == null || themeAttrs[R.styleable.TouchFeedbackDrawable_tint] == 0) {
mState.mTint = a.getColorStateList(R.styleable.TouchFeedbackDrawable_tint);
-
- if (mState.mTint == null) {
- throw new RuntimeException("<touch-feedback> tag requires a 'tint' attribute");
- }
}
if (themeAttrs == null || themeAttrs[R.styleable.TouchFeedbackDrawable_tintMode] == 0) {
if (mRipplePaint == null) {
mRipplePaint = new Paint();
mRipplePaint.setAntiAlias(true);
-
- final int color = mState.mTint.getColorForState(getState(), Color.TRANSPARENT);
- mRipplePaint.setColor(color);
+
+ if (mState.mTint != null) {
+ final int color = mState.mTint.getColorForState(getState(), Color.TRANSPARENT);
+ mRipplePaint.setColor(color);
+ }
}
return mRipplePaint;
}