Methods Summary |
---|
public void | draw(android.graphics.Canvas canvas)
if (!isVisible() && mPaint.getAlpha() == 0) {
return;
}
final int alpha = mPaint.getAlpha();
mPaint.setColor(mOpts.backgroundColor);
mPaint.setAlpha(alpha);
canvas.drawRect(getBounds(), mPaint);
if (mInner != null) mInner.draw(canvas);
|
protected int | getCurrentAlpha()
return mPaint.getAlpha();
|
public android.graphics.drawable.Drawable | getInnerDrawable()
return mInner;
|
public int | getOpacity()
return 0;
|
public void | invalidateDrawable(android.graphics.drawable.Drawable who)
invalidateSelf();
|
protected void | onBoundsChange(android.graphics.Rect bounds)
super.onBoundsChange(bounds);
if (mInner == null) {
return;
}
if (bounds.isEmpty()) {
mInner.setBounds(0, 0, 0, 0);
} else {
final int l = bounds.left + (bounds.width() / 2) - (mInnerWidth / 2);
final int t = bounds.top + (bounds.height() / 2) - (mInnerHeight / 2);
mInner.setBounds(l, t, l + mInnerWidth, t + mInnerHeight);
}
|
protected boolean | onLevelChange(int level)
if (mInner != null)
return mInner.setLevel(level);
else {
return super.onLevelChange(level);
}
|
public void | reset()
setAlpha(0);
setVisible(false);
|
public void | scheduleDrawable(android.graphics.drawable.Drawable who, java.lang.Runnable what, long when)
scheduleSelf(what, when);
|
public void | setAlpha(int alpha)
final int old = mPaint.getAlpha();
mPaint.setAlpha(alpha);
setInnerAlpha(alpha);
if (alpha != old) {
invalidateSelf();
}
|
public void | setColorFilter(android.graphics.ColorFilter cf)
mPaint.setColorFilter(cf);
if (mInner != null) mInner.setColorFilter(cf);
|
public void | setInnerAlpha(int alpha)Changes the alpha on just the inner wrapped drawable.
if (mInner != null) mInner.setAlpha(alpha);
|
public boolean | setVisible(boolean visible)
return setVisible(visible, true /* dontcare */);
|
public boolean | setVisible(boolean visible, boolean restart)
if (mInner != null) mInner.setVisible(visible, restart);
final boolean changed = super.setVisible(visible, restart);
if (changed) {
if (isVisible()) {
// pop in (no-op)
// the transition will still be smooth if the previous state's layer fades out
mFadeOutAnimator.cancel();
setAlpha(255);
} else {
// fade out
if (mPaint.getAlpha() == 255) {
mFadeOutAnimator.start();
}
}
}
return changed;
|
public void | unscheduleDrawable(android.graphics.drawable.Drawable who, java.lang.Runnable what)
unscheduleSelf(what);
|