List of usage examples for android.app DatePickerDialog DatePickerDialog
public DatePickerDialog(@NonNull Context context, @Nullable OnDateSetListener listener, int year, int month, int dayOfMonth)
From source file:com.fullmeadalchemist.mustwatch.ui.common.DatePickerFragment.java
@NonNull @Override//from w w w .ja v a 2s .c om public Dialog onCreateDialog(Bundle savedInstanceState) { // Use the current time as the default values for the picker Calendar c = Calendar.getInstance(); int year = c.get(Calendar.YEAR); int month = c.get(Calendar.MONTH); int day = c.get(Calendar.DAY_OF_MONTH); // Create a new instance of TimePickerDialog and return it return new DatePickerDialog(getActivity(), this, year, month, day); }
From source file:com.jefftharris.passwdsafe.view.DatePickerDialogFragment.java
@NonNull @Override/*from w w w .j a v a 2s .c o m*/ public Dialog onCreateDialog(Bundle savedInstanceState) { Bundle args = getArguments(); Calendar now = Calendar.getInstance(); int year = args.getInt("year", now.get(Calendar.YEAR)); int monthOfYear = args.getInt("monthOfYear", now.get(Calendar.MONTH)); int dayOfMonth = args.getInt("dayOfMonth", now.get(Calendar.DAY_OF_MONTH)); return new DatePickerDialog(getContext(), this, year, monthOfYear, dayOfMonth); }
From source file:net.alexjf.tmm.fragments.DatePickerFragment.java
@Override public Dialog onCreateDialog(Bundle savedInstanceState) { if (savedInstanceState != null) { try {//from www .j a va2s.co m String savedDate = savedInstanceState.getString(KEY_CURRENTDATE); date.setTime(dateFormat.parse(savedDate)); } catch (ParseException e) { Log.e("TMM", "Error parsing saved date", e); } } // Use the current date as the default date in the picker int year = date.get(Calendar.YEAR); int month = date.get(Calendar.MONTH); int day = date.get(Calendar.DAY_OF_MONTH); // Create a new instance of DatePickerDialog and return it return new DatePickerDialog(getActivity(), listener, year, month, day); }
From source file:com.mifos.mifosxdroid.uihelpers.MFDatePicker.java
@Override public Dialog onCreateDialog(Bundle savedInstanceState) { DatePickerDialog dialog = new DatePickerDialog(getActivity(), this, calendar.get(Calendar.YEAR), calendar.get(Calendar.MONTH), calendar.get(Calendar.DAY_OF_MONTH)); dialog.getDatePicker().setMaxDate(new Date().getTime()); return dialog; }
From source file:se.chalmers.watchme.ui.DatePickerFragment.java
@Override public Dialog onCreateDialog(Bundle savedInstanceState) { // Use the current date as the default date in the picker pickedDate = Calendar.getInstance(); int year = pickedDate.get(Calendar.YEAR); int month = pickedDate.get(Calendar.MONTH); int day = pickedDate.get(Calendar.DAY_OF_MONTH); DatePickerDialog datePickerDialog = new DatePickerDialog(getActivity(), this, year, month, day); // Disallow any earlier dates than today's date datePickerDialog.getDatePicker().setMinDate(pickedDate.getTimeInMillis()); // Create a new instance of DatePickerDialog and return it return datePickerDialog; }
From source file:pl.selvin.android.listsyncsample.app.DatePickerFragment.java
@Override @NonNull/*from w w w . j a v a 2 s . c o m*/ public Dialog onCreateDialog(Bundle savedInstanceState) { final Calendar calendar = getCalendar(); return new DatePickerDialog(getActivity(), this, calendar.get(Calendar.YEAR), calendar.get(Calendar.MONTH), calendar.get(Calendar.DAY_OF_MONTH)); }
From source file:com.example.android.DateTimePickers.DatePickerFragment.java
/** * Creates the date picker dialog with the current date from Calendar. * @param savedInstanceState Saved instance * @return DatePickerDialog The date picker dialog *//*from www.j av a2 s . com*/ @NonNull @Override public Dialog onCreateDialog(Bundle savedInstanceState) { // Use the current date as the default date in the picker. final Calendar c = Calendar.getInstance(); int year = c.get(Calendar.YEAR); int month = c.get(Calendar.MONTH); int day = c.get(Calendar.DAY_OF_MONTH); // Create a new instance of DatePickerDialog and return it. return new DatePickerDialog(getActivity(), this, year, month, day); }
From source file:com.itcorea.coreonwallet.DatePickerDialogFragment.java
@TargetApi(11) @Override/*from w w w .j a v a 2 s. c o m*/ public Dialog onCreateDialog(Bundle savedInstanceState) { Bundle b = getArguments(); int y = b.getInt(YEAR); int m = b.getInt(MONTH); int d = b.getInt(DATE); final DatePickerDialog picker = new DatePickerDialog(getActivity(), getConstructorListener(), y, m, d); if (hasJellyBeanAndAbove()) { picker.setButton(DialogInterface.BUTTON_POSITIVE, getActivity().getString(android.R.string.ok), new DialogInterface.OnClickListener() { @Override public void onClick(DialogInterface dialog, int which) { DatePicker dp = picker.getDatePicker(); mListener.onDateSet(dp, dp.getYear(), dp.getMonth(), dp.getDayOfMonth()); } }); picker.setButton(DialogInterface.BUTTON_NEGATIVE, getActivity().getString(android.R.string.cancel), new DialogInterface.OnClickListener() { @Override public void onClick(DialogInterface dialog, int which) { } }); } return picker; }
From source file:de.uni_koblenz_landau.apow.dialogs.DateDialogFragment.java
@NonNull @Override// www. ja v a2 s . c o m public Dialog onCreateDialog(Bundle savedInstanceState) { setRetainInstance(true); mTarget = this.getTag(); DatePickerDialog dialog = new DatePickerDialog(getActivity(), dateSetListener, mCalendar.get(Calendar.YEAR), mCalendar.get(Calendar.MONTH), mCalendar.get(Calendar.DAY_OF_MONTH)); dialog.getDatePicker().setMaxDate(new Date().getTime()); return dialog; }
From source file:br.org.funcate.dynamicforms.FormDatePickerFragment.java
@Override public Dialog onCreateDialog(Bundle savedInstanceState) { return new DatePickerDialog(getActivity(), this, year, month, day); }