public void onValueChange(android.widget.NumberPicker spinner, int oldVal, int newVal ) { this._enclosing.updateInputState(); int minValue = this._enclosing.mMinuteSpinner.getMinValue(); int maxValue = this._enclosing.mMinuteSpinner.getMaxValue(); if (oldVal == maxValue && newVal == minValue) { int newHour = this._enclosing.mHourSpinner.getValue() + 1; if (!this._enclosing.is24HourView() && newHour == android.widget.TimePicker.HOURS_IN_HALF_DAY) { this._enclosing.mIsAm = !this._enclosing.mIsAm; this._enclosing.updateAmPmControl(); } this._enclosing.mHourSpinner.setValue(newHour); } else { if (oldVal == minValue && newVal == maxValue) { int newHour = this._enclosing.mHourSpinner.getValue() - 1; if (!this._enclosing.is24HourView() && newHour == android.widget.TimePicker.HOURS_IN_HALF_DAY - 1) { this._enclosing.mIsAm = !this._enclosing.mIsAm; this._enclosing.updateAmPmControl(); } this._enclosing.mHourSpinner.setValue(newHour); } } this._enclosing.onTimeChanged(); }
public void onValueChange(android.widget.NumberPicker picker, int oldVal, int newVal ) { this._enclosing.updateInputState(); picker.requestFocus(); this._enclosing.mIsAm = !this._enclosing.mIsAm; this._enclosing.updateAmPmControl(); }
public void onValueChange(android.widget.NumberPicker spinner, int oldVal, int newVal ) { this._enclosing.updateInputState(); if (!this._enclosing.is24HourView()) { if ((oldVal == android.widget.TimePicker.HOURS_IN_HALF_DAY - 1 && newVal == android.widget.TimePicker .HOURS_IN_HALF_DAY) || (oldVal == android.widget.TimePicker.HOURS_IN_HALF_DAY && newVal == android.widget.TimePicker.HOURS_IN_HALF_DAY - 1)) { this._enclosing.mIsAm = !this._enclosing.mIsAm; this._enclosing.updateAmPmControl(); } } this._enclosing.onTimeChanged(); }
public TimePicker(android.content.Context context, android.util.AttributeSet attrs , int defStyle) : base(context, attrs, defStyle) { setCurrentLocale(System.Globalization.CultureInfo.CurrentCulture); android.content.res.TypedArray attributesArray = context.obtainStyledAttributes(attrs , [email protected], defStyle, 0); int layoutResourceId = attributesArray.getResourceId([email protected] .TimePicker_layout, [email protected]_picker); attributesArray.recycle(); android.view.LayoutInflater inflater = (android.view.LayoutInflater)context.getSystemService (android.content.Context.LAYOUT_INFLATER_SERVICE); inflater.inflate(layoutResourceId, this, true); mHourSpinner = (android.widget.NumberPicker)findViewById([email protected] ); mHourSpinner.setOnValueChangedListener(new _OnValueChangeListener_147(this)); mHourSpinnerInput = (android.widget.EditText)mHourSpinner.findViewById([email protected] .id.numberpicker_input); mHourSpinnerInput.setImeOptions(android.view.inputmethod.EditorInfo.IME_ACTION_NEXT ); mDivider = (android.widget.TextView)findViewById([email protected]); if (mDivider != null) { mDivider.setText([email protected][email protected]_picker_separator); } mMinuteSpinner = (android.widget.NumberPicker)findViewById([email protected] .minute); mMinuteSpinner.setMinValue(0); mMinuteSpinner.setMaxValue(59); mMinuteSpinner.setOnLongPressUpdateInterval(100); mMinuteSpinner.setFormatter(android.widget.NumberPicker.TWO_DIGIT_FORMATTER); mMinuteSpinner.setOnValueChangedListener(new _OnValueChangeListener_175(this)); mMinuteSpinnerInput = (android.widget.EditText)mMinuteSpinner.findViewById([email protected] .id.numberpicker_input); mMinuteSpinnerInput.setImeOptions(android.view.inputmethod.EditorInfo.IME_ACTION_NEXT ); mAmPmStrings = new java.text.DateFormatSymbols().getAmPmStrings(); android.view.View amPmView = findViewById([email protected]); if (amPmView is android.widget.Button) { mAmPmSpinner = null; mAmPmSpinnerInput = null; mAmPmButton = (android.widget.Button)amPmView; mAmPmButton.setOnClickListener(new _OnClickListener_210(this)); } else { mAmPmButton = null; mAmPmSpinner = (android.widget.NumberPicker)amPmView; mAmPmSpinner.setMinValue(0); mAmPmSpinner.setMaxValue(1); mAmPmSpinner.setDisplayedValues(mAmPmStrings); mAmPmSpinner.setOnValueChangedListener(new _OnValueChangeListener_223(this)); mAmPmSpinnerInput = (android.widget.EditText)mAmPmSpinner.findViewById([email protected] .id.numberpicker_input); mAmPmSpinnerInput.setImeOptions(android.view.inputmethod.EditorInfo.IME_ACTION_DONE ); } // update controls to initial state updateHourControl(); updateAmPmControl(); setOnTimeChangedListener(NO_OP_CHANGE_LISTENER); // set to current time setCurrentHour(mTempCalendar.get(java.util.Calendar.HOUR_OF_DAY)); setCurrentMinute(mTempCalendar.get(java.util.Calendar.MINUTE)); if (!isEnabled()) { setEnabled(false); } // set the content descriptions setContentDescriptions(); }
private void setImeOptions(android.widget.NumberPicker spinner, int spinnerCount, int spinnerIndex) { throw new System.NotImplementedException(); }