use of com.codetroopers.betterpickers.recurrencepicker.RecurrencePickerDialogFragment in project android-betterpickers by code-troopers.
the class SampleRecurrenceDismissListener 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.recurrence_picker_set);
button.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
FragmentManager fm = getSupportFragmentManager();
Bundle bundle = new Bundle();
Time time = new Time();
time.setToNow();
bundle.putLong(RecurrencePickerDialogFragment.BUNDLE_START_TIME_MILLIS, time.toMillis(false));
bundle.putString(RecurrencePickerDialogFragment.BUNDLE_TIME_ZONE, time.timezone);
// may be more efficient to serialize and pass in EventRecurrence
bundle.putString(RecurrencePickerDialogFragment.BUNDLE_RRULE, mRrule);
RecurrencePickerDialogFragment rpd = (RecurrencePickerDialogFragment) fm.findFragmentByTag(FRAG_TAG_RECUR_PICKER);
if (rpd != null) {
rpd.dismiss();
}
rpd = new RecurrencePickerDialogFragment();
rpd.setArguments(bundle);
rpd.setOnRecurrenceSetListener(SampleRecurrenceDismissListener.this);
rpd.setOnDismissListener(SampleRecurrenceDismissListener.this);
rpd.show(fm, FRAG_TAG_RECUR_PICKER);
}
});
}
Aggregations