NumberPickerButtonpublic class NumberPickerButton extends android.widget.ImageButton This class exists purely to cancel long click events. |
Fields Summary |
---|
private NumberPicker | mNumberPicker |
Methods Summary |
---|
private void | cancelLongpress()
if (R.id.increment == getId()) {
mNumberPicker.cancelIncrement();
} else if (R.id.decrement == getId()) {
mNumberPicker.cancelDecrement();
}
| private void | cancelLongpressIfRequired(android.view.MotionEvent event)
if ((event.getAction() == MotionEvent.ACTION_CANCEL)
|| (event.getAction() == MotionEvent.ACTION_UP)) {
cancelLongpress();
}
| public boolean | onKeyUp(int keyCode, android.view.KeyEvent event)
if ((keyCode == KeyEvent.KEYCODE_DPAD_CENTER)
|| (keyCode == KeyEvent.KEYCODE_ENTER)) {
cancelLongpress();
}
return super.onKeyUp(keyCode, event);
| public boolean | onTouchEvent(android.view.MotionEvent event)
cancelLongpressIfRequired(event);
return super.onTouchEvent(event);
| public boolean | onTrackballEvent(android.view.MotionEvent event)
cancelLongpressIfRequired(event);
return super.onTrackballEvent(event);
| public void | setNumberPicker(NumberPicker picker)
mNumberPicker = picker;
|
|