Loading core/java/android/widget/NumberPicker.java +15 −4 Original line number Diff line number Diff line Loading @@ -574,10 +574,7 @@ public class NumberPicker extends LinearLayout { OnClickListener onClickListener = new OnClickListener() { public void onClick(View v) { InputMethodManager inputMethodManager = InputMethodManager.peekInstance(); if (inputMethodManager != null && inputMethodManager.isActive(mInputText)) { inputMethodManager.hideSoftInputFromWindow(getWindowToken(), 0); } hideSoftInput(); mInputText.clearFocus(); if (v.getId() == R.id.increment) { changeCurrentByOne(true); Loading @@ -589,6 +586,7 @@ public class NumberPicker extends LinearLayout { OnLongClickListener onLongClickListener = new OnLongClickListener() { public boolean onLongClick(View v) { hideSoftInput(); mInputText.clearFocus(); if (v.getId() == R.id.increment) { postChangeCurrentByOneFromLongPress(true); Loading Loading @@ -769,6 +767,7 @@ public class NumberPicker extends LinearLayout { } mBeginEditOnUpEvent = scrollersFinished; mAdjustScrollerOnUpEvent = true; hideSoftInput(); hideInputControls(); return true; } Loading @@ -778,6 +777,7 @@ public class NumberPicker extends LinearLayout { } mAdjustScrollerOnUpEvent = false; setSelectorWheelState(SELECTOR_WHEEL_STATE_LARGE); hideSoftInput(); hideInputControls(); return true; case MotionEvent.ACTION_MOVE: Loading @@ -787,6 +787,7 @@ public class NumberPicker extends LinearLayout { mBeginEditOnUpEvent = false; onScrollStateChange(OnScrollListener.SCROLL_STATE_TOUCH_SCROLL); setSelectorWheelState(SELECTOR_WHEEL_STATE_LARGE); hideSoftInput(); hideInputControls(); return true; } Loading Loading @@ -1044,6 +1045,16 @@ public class NumberPicker extends LinearLayout { invalidate(); } /** * Hides the soft input of it is active for the input text. */ private void hideSoftInput() { InputMethodManager inputMethodManager = InputMethodManager.peekInstance(); if (inputMethodManager != null && inputMethodManager.isActive(mInputText)) { inputMethodManager.hideSoftInputFromWindow(getWindowToken(), 0); } } /** * Computes the max width if no such specified as an attribute. */ Loading Loading
core/java/android/widget/NumberPicker.java +15 −4 Original line number Diff line number Diff line Loading @@ -574,10 +574,7 @@ public class NumberPicker extends LinearLayout { OnClickListener onClickListener = new OnClickListener() { public void onClick(View v) { InputMethodManager inputMethodManager = InputMethodManager.peekInstance(); if (inputMethodManager != null && inputMethodManager.isActive(mInputText)) { inputMethodManager.hideSoftInputFromWindow(getWindowToken(), 0); } hideSoftInput(); mInputText.clearFocus(); if (v.getId() == R.id.increment) { changeCurrentByOne(true); Loading @@ -589,6 +586,7 @@ public class NumberPicker extends LinearLayout { OnLongClickListener onLongClickListener = new OnLongClickListener() { public boolean onLongClick(View v) { hideSoftInput(); mInputText.clearFocus(); if (v.getId() == R.id.increment) { postChangeCurrentByOneFromLongPress(true); Loading Loading @@ -769,6 +767,7 @@ public class NumberPicker extends LinearLayout { } mBeginEditOnUpEvent = scrollersFinished; mAdjustScrollerOnUpEvent = true; hideSoftInput(); hideInputControls(); return true; } Loading @@ -778,6 +777,7 @@ public class NumberPicker extends LinearLayout { } mAdjustScrollerOnUpEvent = false; setSelectorWheelState(SELECTOR_WHEEL_STATE_LARGE); hideSoftInput(); hideInputControls(); return true; case MotionEvent.ACTION_MOVE: Loading @@ -787,6 +787,7 @@ public class NumberPicker extends LinearLayout { mBeginEditOnUpEvent = false; onScrollStateChange(OnScrollListener.SCROLL_STATE_TOUCH_SCROLL); setSelectorWheelState(SELECTOR_WHEEL_STATE_LARGE); hideSoftInput(); hideInputControls(); return true; } Loading Loading @@ -1044,6 +1045,16 @@ public class NumberPicker extends LinearLayout { invalidate(); } /** * Hides the soft input of it is active for the input text. */ private void hideSoftInput() { InputMethodManager inputMethodManager = InputMethodManager.peekInstance(); if (inputMethodManager != null && inputMethodManager.isActive(mInputText)) { inputMethodManager.hideSoftInputFromWindow(getWindowToken(), 0); } } /** * Computes the max width if no such specified as an attribute. */ Loading