当前位置: 首页>>代码示例>>Java>>正文


Java NumberPicker.setMinValue方法代码示例

本文整理汇总了Java中android.widget.NumberPicker.setMinValue方法的典型用法代码示例。如果您正苦于以下问题:Java NumberPicker.setMinValue方法的具体用法?Java NumberPicker.setMinValue怎么用?Java NumberPicker.setMinValue使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在android.widget.NumberPicker的用法示例。


在下文中一共展示了NumberPicker.setMinValue方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: 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

示例2: setupMinutePicker

import android.widget.NumberPicker; //导入方法依赖的package包/类
/**
 * Set the reference of minute picker, its digit format and register value change listener.
 *
 * @param pickerVisible if false, removes the spinner widget.
 */
@TargetApi(11)
protected void setupMinutePicker(boolean pickerVisible) {
    mMinutePicker = (NumberPicker) findViewById(R.id.minute);
    if (pickerVisible) {
        mMinutePicker.setMinValue(0);
        mMinutePicker.setMaxValue(59);
        mMinutePicker.setFormatter(TWO_DIGIT_FORMATTER);
        mMinutePicker.setOnValueChangedListener(new NumberPicker.OnValueChangeListener() {
            @Override
            public void onValueChange(NumberPicker spinner, int oldVal, int newVal) {
                mCurrentMinute = newVal;
            }
        });
    } else {
        mMinutePicker.setVisibility(View.GONE);
        findViewById(R.id.minute_divider).setVisibility(View.GONE);
    }
}
 
开发者ID:ChessCom,项目名称:android-chessclock,代码行数:24,代码来源:TimePickerView.java

示例3: 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();
}
 
开发者ID:weiwenqiang,项目名称:GitHub,代码行数:19,代码来源:CustomTileDimensions.java

示例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);
    }
}
 
开发者ID:ChessCom,项目名称:android-chessclock,代码行数:25,代码来源:TimePickerView.java

示例5: 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();
}
 
开发者ID:weiwenqiang,项目名称:GitHub,代码行数:19,代码来源:DynamicSettersActivity.java

示例6: 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" } );

}
 
开发者ID:smajko,项目名称:what_are_those_app,代码行数:30,代码来源:AgeScreen.java

示例7: 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

示例8: onCreate

import android.widget.NumberPicker; //导入方法依赖的package包/类
@Override
protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.activity_main);

    Toolbar toolbar = (Toolbar) findViewById(R.id.toolbar);
    toolbar.setTitle(R.string.app_name);

    NumberPicker stockNumberPicker = (NumberPicker) findViewById(R.id.stock);
    stockNumberPicker.setMinValue(0);
    stockNumberPicker.setMaxValue(10);

    FitterNumberPicker defaultNumberPicker = (FitterNumberPicker) findViewById(R.id.default_number_picker);
    FitterNumberPicker customNumberPicker = (FitterNumberPicker) findViewById(R.id.custom_number_picker);

    ViewConfiguration configuration = ViewConfiguration.get(this);
    //This would be a good value to start with, then / or * to adjust
    //By default, the velocity is divided by 8, so do what you want to adjust
    int maxFlingVelocity = configuration.getScaledMaximumFlingVelocity() / 6;
    customNumberPicker.setMaximumFlingVelocity(maxFlingVelocity);
}
 
开发者ID:Commit451,项目名称:FitterNumberPicker,代码行数:22,代码来源:MainActivity.java

示例9: onCreate

import android.widget.NumberPicker; //导入方法依赖的package包/类
@Override
protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.activity_main);
    controlToggle = (ToggleButton) findViewById(R.id.toggle_control);

    mStatusTextView = (TextView) findViewById(R.id.tv_status);
    mStatusTextView.setMovementMethod(new ScrollingMovementMethod());
    mResultProgress = (ProgressBar) findViewById(R.id.progress);
    mResultProgress.setMax(100);

    NumberPicker picker = (NumberPicker) findViewById(R.id.number_picker);
    picker.setDescendantFocusability(NumberPicker.FOCUS_BLOCK_DESCENDANTS);
    picker.setOnValueChangedListener(this);
    picker.setDisplayedValues(mSampleSizes);
    picker.setMinValue(0);
    picker.setMaxValue(mSampleSizes.length - 1);
    picker.setWrapSelectorWheel(true);
    picker.setValue(0);
    mSampleSize = 1;
    Logger.i("Sample size initial value: %s", mSampleSize);

    checkPermissions();

}
 
开发者ID:csarron,项目名称:MobiRNN-EMDL17,代码行数:26,代码来源:PhoneActivity.java

示例10: 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);
    }
}
 
开发者ID:coderswithoutborders,项目名称:deglancer,代码行数:27,代码来源:StageSelectView.java

示例11: onCreateView

import android.widget.NumberPicker; //导入方法依赖的package包/类
@Nullable
@Override
public View onCreateView(LayoutInflater inflater, @Nullable ViewGroup container, @Nullable Bundle savedInstanceState) {
    View view = inflater.inflate(R.layout.fragment_new_periodic_care, container, false);
    goalPicker = (NumberPicker) view.findViewById(R.id.goal_picker);
    punishmentPicker = (NumberPicker) view.findViewById(R.id.punishment_picker);
    lengthPicker = (NumberPicker) view.findViewById(R.id.length_picker);
    unitPicker = (NumberPicker) view.findViewById(R.id.unit_picker);
    goalPicker.setMaxValue(Integer.MAX_VALUE);
    goalPicker.setMinValue(1);
    goalPicker.setWrapSelectorWheel(false);
    punishmentPicker.setMaxValue(Integer.MAX_VALUE);
    punishmentPicker.setMinValue(0);
    punishmentPicker.setValue(1);
    punishmentPicker.setWrapSelectorWheel(false);
    lengthPicker.setMaxValue(Integer.MAX_VALUE);
    lengthPicker.setMinValue(1);
    lengthPicker.setWrapSelectorWheel(false);
    unitPicker.setDisplayedValues(getResources().getStringArray(R.array.period_units));
    unitPicker.setMaxValue(3);
    unitPicker.setMinValue(0);
    unitPicker.setValue(3);
    unitPicker.setWrapSelectorWheel(true);
    return view;
}
 
开发者ID:OneCivilization,项目名称:MyWorld,代码行数:26,代码来源:NewPeriodicCareFragment.java

示例12: SetSnoozePickerValues

import android.widget.NumberPicker; //导入方法依赖的package包/类
static void SetSnoozePickerValues(NumberPicker picker, boolean above, int default_snooze) {
    String[] values=new String[snoozeValues.length];
    for(int i=0;i<values.length;i++){
        values[i]=getNameFromTime(snoozeValues[i]);
    }

    picker.setMaxValue(values.length -1);
    picker.setMinValue(0);
    picker.setDisplayedValues(values);
    picker.setWrapSelectorWheel(false);
    if(default_snooze != 0) {
        picker.setValue(getSnoozeLocatoin(default_snooze));
    } else {
        picker.setValue(getSnoozeLocatoin(getDefaultSnooze(above)));
    }
}
 
开发者ID:NightscoutFoundation,项目名称:xDrip,代码行数:17,代码来源:SnoozeActivity.java

示例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);
}
 
开发者ID:fengyanjava,项目名称:msb-android,代码行数:19,代码来源:SelectCityDialogV11.java

示例14: showNumPick

import android.widget.NumberPicker; //导入方法依赖的package包/类
/** 弹出数字选择器 **/
private void showNumPick() {
	final NumberPicker picker = new NumberPicker(getActivity());
	picker.setMinValue(0);
	picker.setMaxValue(200);
	picker.setValue(mMinTime);
	new AlertDialog.Builder(getActivity()).setView(picker)
		.setPositiveButton(getResources().getString(R.string.ok), new OnClickListener() {
			
			@Override
			public void onClick(DialogInterface dialog, int which) {
				mMinTime = picker.getValue();
				tv_min_time.setText(getResources().getString(R.string.search_min_time, mMinTime));
			}
		}).show();
}
 
开发者ID:wangcantian,项目名称:Mobile-Office,代码行数:17,代码来源:MeetingFragment.java

示例15: initView

import android.widget.NumberPicker; //导入方法依赖的package包/类
private void initView() {
		View view = LayoutInflater.from(getContext()).inflate(R.layout.dialog_tech_number_picker, null);
		
		tv_name = (TextView) view.findViewById(R.id.tv_name);
		iv_tech = (ImageView) view.findViewById(R.id.iv_tech);
//		np_01 = (NumberPicker) view.findViewById(R.id.np_01);
//		np_02 = (NumberPicker) view.findViewById(R.id.np_02);
//		np_03 = (NumberPicker) view.findViewById(R.id.np_03);
		np_tech01 =  (NumberPicker) view.findViewById(R.id.np_tech01);
		np_tech02 =  (NumberPicker) view.findViewById(R.id.np_tech02);
		np_tech03 =  (NumberPicker) view.findViewById(R.id.np_tech03);
		np_tech01.setMaxValue(16);
		np_tech02.setMaxValue(16);
		np_tech03.setMaxValue(16);
		np_tech01.setMinValue(0);
		np_tech02.setMinValue(0);
		np_tech03.setMinValue(0);
		view.findViewById(R.id.btn_ok).setOnClickListener(this);
		view.findViewById(R.id.btn_close).setOnClickListener(this);
		this.addView(view);
	}
 
开发者ID:kituri,项目名称:TankMMBaseNew,代码行数:22,代码来源:DialogTechNumberPicker.java


注:本文中的android.widget.NumberPicker.setMinValue方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。