本文整理汇总了Java中android.widget.NumberPicker.setMaxValue方法的典型用法代码示例。如果您正苦于以下问题:Java NumberPicker.setMaxValue方法的具体用法?Java NumberPicker.setMaxValue怎么用?Java NumberPicker.setMaxValue使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类android.widget.NumberPicker
的用法示例。
在下文中一共展示了NumberPicker.setMaxValue方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: onHeightClick
import android.widget.NumberPicker; //导入方法依赖的package包/类
@OnClick(R.id.custom_tile_height_size)
public void onHeightClick() {
final NumberPicker view = new NumberPicker(this);
view.setMinValue(24);
view.setMaxValue(64);
view.setWrapSelectorWheel(false);
view.setValue(currentTileHeight);
new AlertDialog.Builder(this)
.setView(view)
.setPositiveButton(android.R.string.ok, new DialogInterface.OnClickListener() {
@Override
public void onClick(@NonNull DialogInterface dialog, int which) {
currentTileHeight = view.getValue();
widget.setTileHeightDp(currentTileHeight);
}
})
.show();
}
示例2: onCreate
import android.widget.NumberPicker; //导入方法依赖的package包/类
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_study_mode_settings_page);
biologyButton = (ToggleButton) findViewById(R.id.biologyButton);
chemistryButton = (ToggleButton) findViewById(R.id.chemistryButton);
earthAndSpaceButton = (ToggleButton) findViewById(R.id.earthAndSpaceButton);
energyButton = (ToggleButton) findViewById(R.id.energyButton);
mathButton = (ToggleButton) findViewById(R.id.mathButton);
physicsButton = (ToggleButton) findViewById(R.id.physicsButton);
randomButton = (ToggleButton) findViewById(R.id.randomButton);
roundNumPicker = (NumberPicker) findViewById(R.id.roundNumPicker);
roundNumPicker.setMinValue(0);
roundNumPicker.setMaxValue(roundOptions.length-1);
roundNumPicker.setWrapSelectorWheel(false);
roundNumPicker.setDisplayedValues(roundOptions);
menuButton = (Button) findViewById(R.id.menuButton);
}
开发者ID:jakepolatty,项目名称:HighSchoolScienceBowlPractice-Android,代码行数:22,代码来源:StudyModeSettingsPage.java
示例3: onTileSizeClicked
import android.widget.NumberPicker; //导入方法依赖的package包/类
@OnClick(R.id.button_set_tile_size)
void onTileSizeClicked() {
final NumberPicker view = new NumberPicker(this);
view.setMinValue(24);
view.setMaxValue(64);
view.setWrapSelectorWheel(false);
view.setValue(currentTileSize);
new AlertDialog.Builder(this)
.setView(view)
.setPositiveButton(android.R.string.ok, new DialogInterface.OnClickListener() {
@Override
public void onClick(@NonNull DialogInterface dialog, int which) {
currentTileSize = view.getValue();
widget.setTileSizeDp(currentTileSize);
}
})
.show();
}
示例4: setupHourPicker
import android.widget.NumberPicker; //导入方法依赖的package包/类
/**
* Set the reference of hour picker, its digit format and register value change listener.
*
* @param pickerVisible if false, removes the spinner widget.
*/
@TargetApi(11)
protected void setupHourPicker(boolean pickerVisible) {
mHourPicker = (NumberPicker) findViewById(R.id.hour);
if (pickerVisible) {
mHourPicker.setMinValue(0);
mHourPicker.setMaxValue(10);
mHourPicker.setFormatter(TWO_DIGIT_FORMATTER);
mHourPicker.setOnValueChangedListener(new NumberPicker.OnValueChangeListener() {
@Override
public void onValueChange(NumberPicker picker, int oldVal, int newVal) {
mCurrentHour = newVal;
}
});
} else {
mHourPicker.setVisibility(View.GONE);
findViewById(R.id.hour_divider).setVisibility(View.GONE);
}
}
示例5: onViewCreated
import android.widget.NumberPicker; //导入方法依赖的package包/类
@Override
public void onViewCreated(View view, @Nullable Bundle savedInstanceState) {
//mConversationView = (ListView) view.findViewById(R.id.in);
mStartButton = (Button) view.findViewById(R.id.button_start);
mStopButton = (Button) view.findViewById(R.id.button_stop);
mDisconnectButton = (Button) view.findViewById(R.id.button_disconnect);
mLevel = (NumberPicker) view.findViewById(R.id.Level);
mLevel.setMaxValue(32);
mLevel.setMinValue(1);
mLevel.setValue(1);
mLevel.setWrapSelectorWheel(false);
mLevel.setDescendantFocusability(NumberPicker.FOCUS_BLOCK_DESCENDANTS);
mSpeedText = (TextView) view.findViewById(R.id.Speed);
mPowerText = (TextView) view.findViewById(R.id.Power);
mRPMText = (TextView) view.findViewById(R.id.RPM);
mDistanceText = (TextView) view.findViewById(R.id.Distance);
mCaloriesText = (TextView) view.findViewById(R.id.Calories);
mHFText = (TextView) view.findViewById(R.id.Heart);
mTimeText = (TextView) view.findViewById(R.id.Time);
}
示例6: initializeViews
import android.widget.NumberPicker; //导入方法依赖的package包/类
private void initializeViews(Dialog dialog) {
major = (ToggleButton) dialog.findViewById(R.id.major);
minor = (ToggleButton) dialog.findViewById(R.id.minor);
dialog.findViewById(R.id.major_parent).setOnClickListener(__ -> onMajorClicked());
dialog.findViewById(R.id.minor_parent).setOnClickListener(__ -> onMinorClicked());
keySigImage = (ImageView) dialog.findViewById(R.id.key_sig_image);
key = (NumberPicker) dialog.findViewById(R.id.key);
key.setWrapSelectorWheel(false);
key.setMinValue(0);
key.setMaxValue(KeySigHandler.FIFTHS.length - 1);
major.setChecked(false);
onMajorClicked();
key.setOnValueChangedListener(this);
key.setValue(6);
}
示例7: onCreate
import android.widget.NumberPicker; //导入方法依赖的package包/类
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_age);
final EditText ageEdit = (EditText) findViewById(R.id.age);
ageEdit.setOnFocusChangeListener(new View.OnFocusChangeListener() {
@Override
public void onFocusChange(View v, boolean hasFocus) {
if (!hasFocus) {
hideKeyboard(v);
ageEdit.setCursorVisible(false);
} else {
showKeyboard(v);
ageEdit.setCursorVisible(true);
}
}
});
NumberPicker numberPicker = (NumberPicker) findViewById(R.id.numberPicker);
numberPicker.setMaxValue(28);
numberPicker.setMinValue(1);
NumberPicker stringPicker = (NumberPicker) findViewById(R.id.stringPicker);
stringPicker.setMaxValue(2);
stringPicker.setMinValue(0);
stringPicker.setDisplayedValues( new String[] { "Days", "Months", "Years" } );
}
示例8: ListAdapterViewHolder
import android.widget.NumberPicker; //导入方法依赖的package包/类
public ListAdapterViewHolder(View view) {
super(view);
mTextView = (TextView) view.findViewById(R.id.tv_object_data);
removeButton = (Button) view.findViewById(R.id.remove_button);
numberPicker = (NumberPicker) view.findViewById(R.id.number_picker);
numberPicker.setMaxValue(99999);
numberPicker.setMinValue(0);
numberPicker.setOnScrollListener(this);
numberPicker.setOnValueChangedListener(this);
numberPicker.setOnLongClickListener(new View.OnLongClickListener() {
@Override
public boolean onLongClick(View v) {
v.performClick();
return true;
}
});
view.setOnClickListener(this);
}
示例9: onCreate
import android.widget.NumberPicker; //导入方法依赖的package包/类
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_reader_mode_settings_page);
setNumPicker = (NumberPicker) findViewById(R.id.setNumPicker);
setNumPicker.setMinValue(0);
setNumPicker.setMaxValue(setOptions.length-1);
setNumPicker.setWrapSelectorWheel(false);
setNumPicker.setDisplayedValues(setOptions);
roundNumPicker = (NumberPicker) findViewById(R.id.roundNumPicker);
roundNumPicker.setMinValue(0);
roundNumPicker.setMaxValue(roundOptions.length-1);
roundNumPicker.setWrapSelectorWheel(false);
roundNumPicker.setDisplayedValues(roundOptions);
tossupTimeSpinner = (Spinner) findViewById(R.id.tossupTimeSelector);
bonusTimeSpinner = (Spinner) findViewById(R.id.bonusTimeSelector);
menuButton = (Button) findViewById(R.id.menuButton);
}
开发者ID:jakepolatty,项目名称:HighSchoolScienceBowlPractice-Android,代码行数:23,代码来源:ReaderModeSettingsPage.java
示例10: setupSecondPicker
import android.widget.NumberPicker; //导入方法依赖的package包/类
/**
* Set the reference of seconds picker, its digit format and register value change listener.
*
* @param pickerVisible if false, removes the spinner widget.
*/
@TargetApi(11)
protected void setupSecondPicker(boolean pickerVisible) {
mSecondPicker = (NumberPicker) findViewById(R.id.seconds);
if (pickerVisible) {
mSecondPicker.setMinValue(0);
mSecondPicker.setMaxValue(59);
mSecondPicker.setFormatter(TWO_DIGIT_FORMATTER);
mSecondPicker.setOnValueChangedListener(new NumberPicker.OnValueChangeListener() {
@Override
public void onValueChange(NumberPicker picker, int oldVal, int newVal) {
mCurrentSecond = newVal;
}
});
} else {
mHourPicker.setVisibility(View.GONE);
}
}
示例11: onWidthClick
import android.widget.NumberPicker; //导入方法依赖的package包/类
@OnClick(R.id.custom_tile_width_size)
public void onWidthClick() {
final NumberPicker view = new NumberPicker(this);
view.setMinValue(24);
view.setMaxValue(64);
view.setWrapSelectorWheel(false);
view.setValue(currentTileWidth);
new AlertDialog.Builder(this)
.setView(view)
.setPositiveButton(android.R.string.ok, new DialogInterface.OnClickListener() {
@Override
public void onClick(@NonNull DialogInterface dialog, int which) {
currentTileWidth = view.getValue();
widget.setTileWidthDp(currentTileWidth);
}
})
.show();
}
示例12: onCreate
import android.widget.NumberPicker; //导入方法依赖的package包/类
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_dice);
mTextViewResult = (TextView)findViewById(R.id.textView_Result);
Button buttonThrow = (Button)findViewById(R.id.button_throw);
final NumberPicker numberPickerMin = (NumberPicker)findViewById(R.id.numberPickerMin);
final NumberPicker numberPickerMax = (NumberPicker)findViewById(R.id.numberPickerMax);
numberPickerMin.setMinValue(1);
numberPickerMin.setMaxValue(100);
numberPickerMax.setMinValue(1);
numberPickerMax.setMaxValue(100);
numberPickerMax.setValue(6);
buttonThrow.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
Dice d = new Dice(numberPickerMin.getValue(),numberPickerMax.getValue());
int result = d.diceGenerator();
mTextViewResult.setText("Result : " + result);
}
});
}
示例13: initPicker
import android.widget.NumberPicker; //导入方法依赖的package包/类
@Override
protected void initPicker() {
mProvincePicker = (NumberPicker) findViewById(R.id.province);
mCityPicker = (NumberPicker) findViewById(R.id.city);
mProvincePicker.setDisplayedValues(mProvinceNames);
mProvincePicker.setMinValue(0);
mProvincePicker.setMaxValue(mAreas.size() - 1);
mProvincePicker.setOnValueChangedListener(this);
int provinceIndex = getDefaultProvinceIndex(mProvince);
mProvincePicker.setValue(provinceIndex);
updateCityPicker(provinceIndex);
int cityIndex = getDefaultCityIndex(provinceIndex, mCity);
mCityPicker.setValue(cityIndex);
}
示例14: init
import android.widget.NumberPicker; //导入方法依赖的package包/类
private void init() {
inflate(getContext(), R.layout.stage_select_view, this);
if (!isInEditMode()) {
MainApplication.from(getContext()).getGraph().inject(this);
npStage = (NumberPicker) findViewById(R.id.npStage);
npDay = (NumberPicker) findViewById(R.id.npDay);
npHour = (NumberPicker) findViewById(R.id.npHour);
npStage.setMinValue(1);
npStage.setMaxValue(5);
npDay.setMinValue(1);
npDay.setMaxValue(7);
npHour.setMinValue(1);
npHour.setMaxValue(23);
npStage.setOnValueChangedListener(valueChangeListener);
npDay.setOnValueChangedListener(valueChangeListener);
npHour.setOnValueChangedListener(valueChangeListener);
findViewById(R.id.btnSetStageAsCurrentStage).setOnClickListener(buttonClickListener);
}
}
示例15: NumberPickerPreference
import android.widget.NumberPicker; //导入方法依赖的package包/类
@SuppressLint("RestrictedApi")
public NumberPickerPreference(Context context, AttributeSet attrs, int defStyleAttr, int defStyleRes) {
super(context, attrs, defStyleAttr, defStyleRes);
mNumberPicker = new NumberPicker(context);
TypedArray a;
a = context.obtainStyledAttributes(attrs, R.styleable.NumberPickerPreference);
mNumberPicker.setMinValue(a.getInt(R.styleable.NumberPickerPreference_min, 0));
mNumberPicker.setMaxValue(a.getInt(R.styleable.NumberPickerPreference_max, 100));
a = context.obtainStyledAttributes(attrs,
R.styleable.Preference, defStyleAttr, defStyleRes);
mSummary = TypedArrayUtils.getString(a, R.styleable.Preference_summary,
R.styleable.Preference_android_summary);
a.recycle();
}