Methods Summary |
---|
private void | draw(android.graphics.Canvas canvas, android.graphics.drawable.Drawable drawable)
if (drawable != null) {
drawable.setBounds(0, mClipTopAmount, getWidth(), mActualHeight);
drawable.draw(canvas);
}
|
public void | drawableHotspotChanged(float x, float y)
if (mBackground != null) {
mBackground.setHotspot(x, y);
}
|
protected void | drawableStateChanged()
drawableStateChanged(mBackground);
|
private void | drawableStateChanged(android.graphics.drawable.Drawable d)
if (d != null && d.isStateful()) {
d.setState(getDrawableState());
}
|
public int | getActualHeight()
return mActualHeight;
|
public boolean | hasOverlappingRendering()
// Prevents this view from creating a layer when alpha is animating.
return false;
|
protected void | onDraw(android.graphics.Canvas canvas)
draw(canvas, mBackground);
|
public void | setActualHeight(int actualHeight)
mActualHeight = actualHeight;
invalidate();
|
public void | setClipTopAmount(int clipTopAmount)
mClipTopAmount = clipTopAmount;
invalidate();
|
public void | setCustomBackground(android.graphics.drawable.Drawable background)Sets a background drawable. As we need to change our bounds independently of layout, we need
the notion of a background independently of the regular View background..
if (mBackground != null) {
mBackground.setCallback(null);
unscheduleDrawable(mBackground);
}
mBackground = background;
if (mBackground != null) {
mBackground.setCallback(this);
}
invalidate();
|
public void | setCustomBackground(int drawableResId)
final Drawable d = mContext.getDrawable(drawableResId);
setCustomBackground(d);
|
public void | setRippleColor(int color)
if (mBackground instanceof RippleDrawable) {
RippleDrawable ripple = (RippleDrawable) mBackground;
ripple.setColor(ColorStateList.valueOf(color));
}
|
public void | setState(int[] drawableState)
mBackground.setState(drawableState);
|
public void | setTint(int tintColor)
if (tintColor != 0) {
mBackground.setColorFilter(tintColor, PorterDuff.Mode.SRC_ATOP);
} else {
mBackground.clearColorFilter();
}
invalidate();
|
protected boolean | verifyDrawable(android.graphics.drawable.Drawable who)
return super.verifyDrawable(who) || who == mBackground;
|