FileDocCategorySizeDatePackage
ZoomButton.javaAPI DocAndroid 5.1 API3679Thu Mar 12 22:22:10 GMT 2015android.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 defStyleAttr)

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

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

        clearFocus();
        return super.dispatchUnhandledMove(focused, direction);
    
public voidonInitializeAccessibilityEvent(android.view.accessibility.AccessibilityEvent event)

        super.onInitializeAccessibilityEvent(event);
        event.setClassName(ZoomButton.class.getName());
    
public voidonInitializeAccessibilityNodeInfo(android.view.accessibility.AccessibilityNodeInfo info)

        super.onInitializeAccessibilityNodeInfo(info);
        info.setClassName(ZoomButton.class.getName());
    
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;