use of com.codetroopers.betterpickers.numberpicker.NumberPickerBuilder in project android-betterpickers by code-troopers.
the class SampleNumberBasicUsage method onCreate.
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.text_and_button);
mResultTextView = (TextView) findViewById(R.id.text);
Button button = (Button) findViewById(R.id.button);
mResultTextView.setText(R.string.no_value);
button.setText(R.string.number_picker_set);
button.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
NumberPickerBuilder npb = new NumberPickerBuilder().setFragmentManager(getSupportFragmentManager()).setStyleResId(R.style.BetterPickersDialogFragment);
npb.show();
}
});
}
use of com.codetroopers.betterpickers.numberpicker.NumberPickerBuilder in project android-betterpickers by code-troopers.
the class SampleNumberMaxValue method onCreate.
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.text_and_button);
mResultTextView = (TextView) findViewById(R.id.text);
Button button = (Button) findViewById(R.id.button);
final BigDecimal maxNumberAllowed = new BigDecimal("1227");
mResultTextView.setText(R.string.no_value);
button.setText("Set Number below " + maxNumberAllowed);
button.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
NumberPickerBuilder npb = new NumberPickerBuilder().setFragmentManager(getSupportFragmentManager()).setStyleResId(R.style.BetterPickersDialogFragment).setMaxNumber(maxNumberAllowed);
npb.show();
}
});
}
use of com.codetroopers.betterpickers.numberpicker.NumberPickerBuilder in project android-betterpickers by code-troopers.
the class SampleNumberMinValue method onCreate.
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.text_and_button);
mResultTextView = (TextView) findViewById(R.id.text);
Button button = (Button) findViewById(R.id.button);
final BigDecimal minNumberAllowed = new BigDecimal("1227");
mResultTextView.setText(R.string.no_value);
button.setText("Set Number above " + minNumberAllowed);
button.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
NumberPickerBuilder npb = new NumberPickerBuilder().setFragmentManager(getSupportFragmentManager()).setStyleResId(R.style.BetterPickersDialogFragment).setMinNumber(minNumberAllowed);
npb.show();
}
});
}
use of com.codetroopers.betterpickers.numberpicker.NumberPickerBuilder in project android-betterpickers by code-troopers.
the class SampleNumberWithOptions method onCreate.
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.text_and_three_buttons);
mResultTextView = (TextView) findViewById(R.id.text);
Button buttonOne = (Button) findViewById(R.id.button_one);
mButtonSetMin = (Button) findViewById(R.id.button_two);
mButtonSetMax = (Button) findViewById(R.id.button_three);
mResultTextView.setText(R.string.no_value);
buttonOne.setText(R.string.number_picker_set);
buttonOne.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
NumberPickerBuilder npb = new NumberPickerBuilder().setFragmentManager(getSupportFragmentManager()).setStyleResId(R.style.BetterPickersDialogFragment_Light).setPlusMinusVisibility(View.INVISIBLE).setDecimalVisibility(View.INVISIBLE).setReference(BUTTON_ONE_REFERENCE).setLabelText("LBS.");
if (mMin != null) {
npb.setMinNumber(mMin);
}
if (mMax != null) {
npb.setMaxNumber(mMax);
}
npb.show();
}
});
mButtonSetMin.setText("Set Min Number");
mButtonSetMin.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
NumberPickerBuilder npb = new NumberPickerBuilder().setFragmentManager(getSupportFragmentManager()).setStyleResId(R.style.BetterPickersDialogFragment_Light).setDecimalVisibility(View.INVISIBLE).setReference(BUTTON_TWO_REFERENCE).setLabelText("MIN NUMBER");
npb.show();
}
});
mButtonSetMax.setText("Set Max Number");
mButtonSetMax.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
NumberPickerBuilder npb = new NumberPickerBuilder().setFragmentManager(getSupportFragmentManager()).setStyleResId(R.style.BetterPickersDialogFragment_Light).setDecimalVisibility(View.INVISIBLE).setReference(BUTTON_THREE_REFERENCE).setLabelText("MAX NUMBER");
npb.show();
}
});
}
use of com.codetroopers.betterpickers.numberpicker.NumberPickerBuilder in project android-betterpickers by code-troopers.
the class SampleNumberFragment method onCreateView.
@Override
public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
View view = inflater.inflate(R.layout.text_and_button, container, false);
mResultTextView = (TextView) view.findViewById(R.id.text);
Button button = (Button) view.findViewById(R.id.button);
mResultTextView.setText(R.string.no_value);
button.setText(R.string.number_picker_set);
button.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
NumberPickerBuilder npb = new NumberPickerBuilder().setFragmentManager(getChildFragmentManager()).setStyleResId(R.style.BetterPickersDialogFragment).setTargetFragment(SampleNumberFragment.this);
npb.show();
}
});
return view;
}
Aggregations