ZoomButtonpublic 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 |
Methods Summary |
---|
public boolean | dispatchUnhandledMove(android.view.View focused, int direction)
clearFocus();
return super.dispatchUnhandledMove(focused, direction);
| public boolean | onKeyUp(int keyCode, android.view.KeyEvent event)
mIsInLongpress = false;
return super.onKeyUp(keyCode, event);
| public boolean | onLongClick(android.view.View v)
mIsInLongpress = true;
mHandler.post(mRunnable);
return true;
| public boolean | onTouchEvent(android.view.MotionEvent event)
if ((event.getAction() == MotionEvent.ACTION_CANCEL)
|| (event.getAction() == MotionEvent.ACTION_UP)) {
mIsInLongpress = false;
}
return super.onTouchEvent(event);
| public void | setEnabled(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 void | setZoomSpeed(long speed)
mZoomSpeed = speed;
|
|