use of android.widget.Button in project android-betterpickers by code-troopers.
the class SampleDateMultipleReferences method onDialogDateSet.
@Override
public void onDialogDateSet(int reference, int year, int monthOfYear, int dayOfMonth) {
Button buttonToSet;
switch(reference) {
case BUTTON_ONE_REFERENCE:
buttonToSet = buttonOne;
break;
case BUTTON_TWO_REFERENCE:
buttonToSet = buttonTwo;
break;
case BUTTON_THREE_REFERENCE:
buttonToSet = buttonThree;
break;
case BUTTON_FOUR_REFERENCE:
buttonToSet = buttonFour;
break;
default:
buttonToSet = buttonOne;
}
buttonToSet.setText(getString(R.string.date_picker_result_value, year, monthOfYear, dayOfMonth));
}
use of android.widget.Button in project android-betterpickers by code-troopers.
the class SampleDateThemeCustom 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.date_picker_set);
button.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
DatePickerBuilder dpb = new DatePickerBuilder().setFragmentManager(getSupportFragmentManager()).setStyleResId(R.style.MyCustomBetterPickerTheme);
dpb.show();
}
});
}
use of android.widget.Button in project android-betterpickers by code-troopers.
the class SampleDateThemeLight 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.date_picker_set);
button.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
DatePickerBuilder dpb = new DatePickerBuilder().setFragmentManager(getSupportFragmentManager()).setStyleResId(R.style.BetterPickersDialogFragment_Light);
dpb.show();
}
});
}
use of android.widget.Button in project android-betterpickers by code-troopers.
the class SampleDateYearOptional 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.date_picker_set);
button.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
DatePickerBuilder dpb = new DatePickerBuilder().setFragmentManager(getSupportFragmentManager()).setStyleResId(R.style.BetterPickersDialogFragment).setYearOptional(true);
dpb.show();
}
});
}
use of android.widget.Button in project android-betterpickers by code-troopers.
the class SampleExpirationDismissListener 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.expiration_picker_set);
button.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
ExpirationPickerBuilder epb = new ExpirationPickerBuilder().setFragmentManager(getSupportFragmentManager()).setStyleResId(R.style.BetterPickersDialogFragment).setOnDismissListener(SampleExpirationDismissListener.this);
epb.show();
}
});
}
Aggregations