本文整理汇总了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;
}