FileDocCategorySizeDatePackage
ZoomButton.javaAPI DocAndroid 1.5 API3014Wed May 06 22:41:56 BST 2009android.widget

ZoomButton

public class ZoomButton extends ImageButton implements android.view.View.OnLongClickListener

Fields Summary
private final android.os.Handler
mHandler
private final Runnable
mRunnable
private long
mZoomSpeed
private boolean
mIsInLongpress
Constructors Summary
public ZoomButton(android.content.Context context)

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

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

        super(context, attrs, defStyle);
        mHandler = new Handler();
        setOnLongClickListener(this);
    
Methods Summary
public booleandispatchUnhandledMove(android.view.View focused, int direction)

        clearFocus();
        return super.dispatchUnhandledMove(focused, direction);
    
public booleanonKeyUp(int keyCode, android.view.KeyEvent event)

        mIsInLongpress = false;
        return super.onKeyUp(keyCode, event);
    
public booleanonLongClick(android.view.View v)

        mIsInLongpress = true;
        mHandler.post(mRunnable);
        return true;
    
public booleanonTouchEvent(android.view.MotionEvent event)

        if ((event.getAction() == MotionEvent.ACTION_CANCEL)
                || (event.getAction() == MotionEvent.ACTION_UP)) {
            mIsInLongpress = false;
        }
        return super.onTouchEvent(event);
    
public voidsetEnabled(boolean enabled)

        if (!enabled) {
            
            /* If we're being disabled reset the state back to unpressed
             * as disabled views don't get events and therefore we won't
             * get the up event to reset the state.
             */
            setPressed(false);
        }
        super.setEnabled(enabled);
    
public voidsetZoomSpeed(long speed)

        mZoomSpeed = speed;