FileDocCategorySizeDatePackage
GalleryPickerItem.javaAPI DocAndroid 1.5 API2957Wed May 06 22:42:42 BST 2009com.android.camera

GalleryPickerItem

public 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
Constructors Summary
public GalleryPickerItem(android.content.Context context)

    
       
        this(context, null);
    
public GalleryPickerItem(android.content.Context context, android.util.AttributeSet attrs)

        this(context, attrs, 0);
    
public GalleryPickerItem(android.content.Context context, android.util.AttributeSet attrs, int defStyle)

        super(context, attrs, defStyle);
        
        mFrame = getResources().getDrawable(R.drawable.frame_gallery_preview);
        mFrame.setCallback(this);
    
Methods Summary
protected voiddrawableStateChanged()

        super.drawableStateChanged();
        if (mFrame != null) {
            int[] drawableState = getDrawableState();
            mFrame.setState(drawableState);
        }
    
protected voidonDraw(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 voidonSizeChanged(int w, int h, int oldw, int oldh)

        super.onSizeChanged(w, h, oldw, oldh);

        mFrameBounds.setEmpty();
    
public voidsetOverlay(int overlayId)

        if (overlayId >= 0) {
            mOverlay = getResources().getDrawable(overlayId);
            mFrameBounds.setEmpty();
        } else {
            mOverlay = null;
        }
    
protected booleanverifyDrawable(android.graphics.drawable.Drawable who)

        return super.verifyDrawable(who) || (who == mFrame) || (who == mOverlay);