本文整理匯總了Java中android.widget.NumberPicker.setOnLongPressUpdateInterval方法的典型用法代碼示例。如果您正苦於以下問題:Java NumberPicker.setOnLongPressUpdateInterval方法的具體用法?Java NumberPicker.setOnLongPressUpdateInterval怎麽用?Java NumberPicker.setOnLongPressUpdateInterval使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類android.widget.NumberPicker
的用法示例。
在下文中一共展示了NumberPicker.setOnLongPressUpdateInterval方法的3個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。
示例1: bindView
import android.widget.NumberPicker; //導入方法依賴的package包/類
@Override
public void bindView(Dialog dialog) {
textView = (TextView) dialog.findViewById(R.id.description);
numberPicker = (NumberPicker) dialog.findViewById(R.id.number_picker);
textView.setText(description);
numberPicker.setMaxValue(maxValue != null ? maxValue : 24);
numberPicker.setMinValue(minValue != null ? minValue : 1);
numberPicker.setOnLongPressUpdateInterval(100);
numberPicker.setWrapSelectorWheel(false);
if (currentValue != null) {
numberPicker.setValue(currentValue);
}
if (!canUseKeyBoard) {
numberPicker.setDescendantFocusability(NumberPicker.FOCUS_BLOCK_DESCENDANTS);
}
}
示例2: setupSpinner
import android.widget.NumberPicker; //導入方法依賴的package包/類
public NumberPicker setupSpinner(int id, int min, int max) {
NumberPicker mSpinner = (NumberPicker) findViewById(id);
mSpinner.setMinValue(min);
mSpinner.setMaxValue(max);
mSpinner.setOnValueChangedListener(mOnChangeListener);
mSpinner.setOnLongPressUpdateInterval(100);
return mSpinner;
}
示例3: DateTimePicker
import android.widget.NumberPicker; //導入方法依賴的package包/類
public DateTimePicker(Context context, long date, boolean is24HourView) {
super(context);
mDate = Calendar.getInstance();
mInitialising = true;
mIsAm = getCurrentHourOfDay() >= HOURS_IN_HALF_DAY;
inflate(context, R.layout.datetime_picker, this);
mDateSpinner = (NumberPicker) findViewById(R.id.date);
mDateSpinner.setMinValue(DATE_SPINNER_MIN_VAL);
mDateSpinner.setMaxValue(DATE_SPINNER_MAX_VAL);
mDateSpinner.setOnValueChangedListener(mOnDateChangedListener);
mHourSpinner = (NumberPicker) findViewById(R.id.hour);
mHourSpinner.setOnValueChangedListener(mOnHourChangedListener);
mMinuteSpinner = (NumberPicker) findViewById(R.id.minute);
mMinuteSpinner.setMinValue(MINUT_SPINNER_MIN_VAL);
mMinuteSpinner.setMaxValue(MINUT_SPINNER_MAX_VAL);
mMinuteSpinner.setOnLongPressUpdateInterval(100);
mMinuteSpinner.setOnValueChangedListener(mOnMinuteChangedListener);
String[] stringsForAmPm = new DateFormatSymbols().getAmPmStrings();
mAmPmSpinner = (NumberPicker) findViewById(R.id.amPm);
mAmPmSpinner.setMinValue(AMPM_SPINNER_MIN_VAL);
mAmPmSpinner.setMaxValue(AMPM_SPINNER_MAX_VAL);
mAmPmSpinner.setDisplayedValues(stringsForAmPm);
mAmPmSpinner.setOnValueChangedListener(mOnAmPmChangedListener);
// update controls to initial state
updateDateControl();
updateHourControl();
updateAmPmControl();
set24HourView(is24HourView);
// set to current time
setCurrentDate(date);
setEnabled(isEnabled());
// set the content descriptions
mInitialising = false;
}