GalleryPickerItempublic class GalleryPickerItem extends android.widget.ImageView
Fields Summary |
---|
private android.graphics.drawable.Drawable | mFrame | private android.graphics.Rect | mFrameBounds | private android.graphics.drawable.Drawable | mOverlay |
Methods Summary |
---|
protected void | drawableStateChanged()
super.drawableStateChanged();
if (mFrame != null) {
int[] drawableState = getDrawableState();
mFrame.setState(drawableState);
}
| protected void | onDraw(android.graphics.Canvas canvas)
super.onDraw(canvas);
final Rect frameBounds = mFrameBounds;
if (frameBounds.isEmpty()) {
final int w = getWidth();
final int h = getHeight();
frameBounds.set(0, 0, w, h);
mFrame.setBounds(frameBounds);
if (mOverlay != null) {
mOverlay.setBounds(w - mOverlay.getIntrinsicWidth(),
h - mOverlay.getIntrinsicHeight(), w, h);
}
}
mFrame.draw(canvas);
if (mOverlay != null) {
mOverlay.draw(canvas);
}
| protected void | onSizeChanged(int w, int h, int oldw, int oldh)
super.onSizeChanged(w, h, oldw, oldh);
mFrameBounds.setEmpty();
| public void | setOverlay(int overlayId)
if (overlayId >= 0) {
mOverlay = getResources().getDrawable(overlayId);
mFrameBounds.setEmpty();
} else {
mOverlay = null;
}
| protected boolean | verifyDrawable(android.graphics.drawable.Drawable who)
return super.verifyDrawable(who) || (who == mFrame) || (who == mOverlay);
|
|