NumberPicker setMinValue - top ranked examples from Open Source projects

These code examples were ranked by Codota’s semantic indexing as the best open source examples for NumberPicker setMinValue method.

This code example shows how to use the following methods:getMaxValue, getMinValue, setDisplayedValues, setMaxValue, setMinValue
8
CodeRank
This code example shows how to use the following methods:setDisplayedValues, setMaxValue, setMinValue, setValue, setWrapSelectorWheel
 
    /** 
     * This method should be subclassed to update the spinners based on mCurrentDate. 
     */ 
    protected void updateSpinners() { 
        mPositionInYearSpinner.setDisplayedValues(null);
 
        // set the spinner ranges respecting the min and max dates 
        mPositionInYearSpinner.setMinValue(getMinPositionInYear());
        mPositionInYearSpinner.setMaxValue(getMaxPositionInYear());
        mPositionInYearSpinner.setWrapSelectorWheel(
                !mCurrentDate.equals(mMinDate) && !mCurrentDate.equals(mMaxDate));
 
        // year spinner range does not change based on the current date 
        mYearSpinner.setMinValue(getMinYear());
        mYearSpinner.setMaxValue(getMaxYear());
        mYearSpinner.setWrapSelectorWheel(false);
 
        // set the spinner values 
        mYearSpinner.setValue(getYear());

7
CodeRank
This code example shows how to use the following methods:getMaxValue, getMinValue, setDisplayedValues, setMaxValue, setMinValue
This code example shows how to use the following methods:setFocusable, setFocusableInTouchMode, setLayoutParams, setFormatter, setMaxValue
     * @return NumberPicker The that represents the number picker 
     */ 
    private NumberPicker createNumberPicker(
            int maxValue, TextView toAlignWith, TextView toHeightOf, final String format) {
        // Create the NumberPicker 
        NumberPicker digit = new NumberPicker(getContext());
        LayoutParams params = new RelativeLayout.LayoutParams(
                android.view.ViewGroup.LayoutParams.WRAP_CONTENT,
                android.view.ViewGroup.LayoutParams.WRAP_CONTENT);
        params.addRule(RelativeLayout.ALIGN_LEFT, toAlignWith.getId());
        params.addRule(RelativeLayout.ALIGN_RIGHT, toAlignWith.getId());
        params.addRule(RelativeLayout.ALIGN_TOP, toHeightOf.getId());
        params.addRule(RelativeLayout.ALIGN_BOTTOM, toHeightOf.getId());
        digit.setLayoutParams(params);
        digit.setMinValue(0);
        digit.setMaxValue(maxValue);
        digit.setValue(0);
        digit.setWrapSelectorWheel(false);
        digit.setFocusable(false);
        digit.setFocusableInTouchMode(false);

6
CodeRank
This code example shows how to use the following methods:setDisplayedValues, setMaxValue, setMinValue, setValue, setWrapSelectorWheel
 
    /** 
     * This method should be subclassed to update the spinners based on mCurrentDate. 
     */ 
    protected void updateSpinners() { 
        mPositionInYearSpinner.setDisplayedValues(null);
 
        // set the spinner ranges respecting the min and max dates 
        mPositionInYearSpinner.setMinValue(getMinPositionInYear());
        mPositionInYearSpinner.setMaxValue(getMaxPositionInYear());
        mPositionInYearSpinner.setWrapSelectorWheel(
                !mCurrentDate.equals(mMinDate) && !mCurrentDate.equals(mMaxDate));
 
        // year spinner range does not change based on the current date 
        mYearSpinner.setMinValue(getMinYear());
        mYearSpinner.setMaxValue(getMaxYear());
        mYearSpinner.setWrapSelectorWheel(false);
 
        // set the spinner values 
        mYearSpinner.setValue(getYear());

6
CodeRank
This code example shows how to use the following methods:setMaxValue, setMinValue, setOnValueChangedListener, setValue
    setButton(-1, localContext.getText(2131493337), this);
    setIcon(0);
    View localView = ((LayoutInflater)localContext.getSystemService("layout_inflater")).inflate(2130903181, null);
    setView(localView);
    this.a = ((NumberPicker)localView.findViewById(2131165624));
    this.a.setMinValue(paramInt3);
    this.a.setMaxValue(paramInt4);
    this.a.setValue(paramInt2);
    this.a.setOnValueChangedListener(this);
    setTitle(paramString);
  } 
 
  public m(Context paramContext, n paramn, int paramInt1, int paramInt2, int paramInt3, String paramString)
  { 
    this(paramContext, 0, paramn, paramInt1, paramInt2, paramInt3, paramString);
  } 
 
  private void a() 
  { 
    if (this.b != null)
6
CodeRank
This code example shows how to use the following methods:setMaxValue, setMinValue, setOnValueChangedListener, setValue
        @Override  
        protected View onCreateDialogView() {
            //Create Views 
            LinearLayout dialogLayout = new LinearLayout(mCtx);
            mTvDialogMessage = new TextView(mCtx);
            mNumberPicker = new NumberPicker(mCtx);
 
            //Set View attributes 
            dialogLayout.setOrientation(LinearLayout.VERTICAL);
            if (mDialogMessage!=null)
                mTvDialogMessage.setText(mDialogMessage);
            dialogLayout.addView(mTvDialogMessage);
            mNumberPicker.setOnValueChangedListener(this);
            dialogLayout.addView(mNumberPicker, new LinearLayout.LayoutParams(LinearLayout.LayoutParams.MATCH_PARENT, LinearLayout.LayoutParams.WRAP_CONTENT));
            if (shouldPersist()) 
                mValue = getPersistedInt(mDefault);
            mNumberPicker.setMaxValue(mMax);
            mNumberPicker.setMinValue(1);
            mNumberPicker.setValue(mValue);
             

6
CodeRank
This code example shows how to use the following methods:setEnabled, setMaxValue, setMinValue, setValue, setWrapSelectorWheel
	public int initializeStuff() { 
		int maxVolume = audioManager.getStreamMaxVolume(AudioManager.STREAM_MUSIC);
		 
		npHeadphone.setMaxValue(maxVolume);
		npHeadphone.setMinValue(1);
		npSpeaker.setMaxValue(maxVolume);
		npSpeaker.setMinValue(1);
		npHeadphone.setWrapSelectorWheel(false);
		npSpeaker.setWrapSelectorWheel(false);
		 
		npHeadphone.setValue(maxVolume/2); //initalize value in the picker
		npSpeaker.setValue(maxVolume/2);
		 
		//npHeadphone.setEnabled(false); //disable changes for headphone on initialization 
		npSpeaker.setEnabled(false);
		 
		return maxVolume;
		 
	} 
	 
6
CodeRank
This code example shows how to use the following methods:setContentDescription, setMaxValue, setMinValue
 
		CheckBox chkMobileData = new CheckBox(this);
		chkMobileData.setText("Activate Mobile Data automatically");
		chkMobileData.setContentDescription("Activate Mobile Data to send the location and turn off again");
		 
		NumberPicker periodicity = new NumberPicker(this);
		periodicity.setContentDescription("Defines the frequency that the location is send (in minutes)");
		periodicity.setMinValue(0);
		periodicity.setMaxValue(60);
		 
		Button btnActivate = new Button(this);
		btnActivate.setText("Activate");
		 
		LinearLayout layout = new LinearLayout(this);
		layout.setOrientation(LinearLayout.VERTICAL);
        layout.setLayoutParams(new LayoutParams(LayoutParams.MATCH_PARENT, LayoutParams.MATCH_PARENT));
		layout.addView(txt);
		layout.addView(chkWifi);
		layout.addView(chkMobileData);
		layout.addView(periodicity);
6
CodeRank
This code example shows how to use the following methods:setFocusable, setFocusableInTouchMode, setOnFocusChangeListener, clearFocus, hasFocus
6
CodeRank

Related NumberPicker setMinValue Questions & Answers:

setMinValue Method Overview
Sets the min value of the picker.
See Code Examples for other Android NumberPicker Methods: