本文整理汇总了Java中com.wdullaer.materialdatetimepicker.date.DatePickerDialog.setMinDate方法的典型用法代码示例。如果您正苦于以下问题:Java DatePickerDialog.setMinDate方法的具体用法?Java DatePickerDialog.setMinDate怎么用?Java DatePickerDialog.setMinDate使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类com.wdullaer.materialdatetimepicker.date.DatePickerDialog
的用法示例。
在下文中一共展示了DatePickerDialog.setMinDate方法的8个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: showDatePickerDialog
import com.wdullaer.materialdatetimepicker.date.DatePickerDialog; //导入方法依赖的package包/类
public void showDatePickerDialog() {
Calendar c = Calendar.getInstance();
c.set(mYear, mMonth, mDay);
DatePickerDialog dialog = DatePickerDialog.newInstance((datePickerDialog, year, monthOfYear, dayOfMonth) -> {
mYear = year;
mMonth = monthOfYear;
mDay = dayOfMonth;
c.set(mYear, monthOfYear, mDay);
mPresenter.loadNews(true, true, c.getTimeInMillis());
}, c.get(Calendar.YEAR), c.get(Calendar.MONTH), c.get(Calendar.DAY_OF_MONTH));
dialog.setMaxDate(Calendar.getInstance());
Calendar minDate = Calendar.getInstance();
minDate.set(2013, 5, 20);
dialog.setMinDate(minDate);
dialog.vibrate(false);
dialog.show(getActivity().getFragmentManager(), ZhihuDailyFragment.class.getSimpleName());
}
示例2: showDatePickerDialog
import com.wdullaer.materialdatetimepicker.date.DatePickerDialog; //导入方法依赖的package包/类
public void showDatePickerDialog() {
DatePickerDialog dialog = DatePickerDialog.newInstance((datePickerDialog, year, monthOfYear, dayOfMonth) -> {
mYear = year;
mMonth = monthOfYear;
mDay = dayOfMonth;
Calendar c = Calendar.getInstance();
c.set(mYear, mMonth, mDay);
mPresenter.load(true, true, c.getTimeInMillis());
}, mYear, mMonth, mDay);
dialog.setMaxDate(Calendar.getInstance());
Calendar minDate = Calendar.getInstance();
minDate.set(2014, 5, 12);
dialog.setMinDate(minDate);
dialog.vibrate(false);
dialog.show(getActivity().getFragmentManager(), DoubanMomentFragment.class.getSimpleName());
}
示例3: showDateDialog
import com.wdullaer.materialdatetimepicker.date.DatePickerDialog; //导入方法依赖的package包/类
private void showDateDialog() {
Calendar now = Calendar.getInstance();
Date time = now.getTime();
long currentTime = time.getTime();
time.setTime(currentTime + 24 * 60 * 60);
DatePickerDialog dpd = DatePickerDialog.newInstance(
ActReleaseProductActivity.this,
now.get(Calendar.YEAR),
now.get(Calendar.MONTH),
now.get(Calendar.DAY_OF_MONTH)
);
now.setTime(time);
dpd.setMinDate(now);
dpd.show(getFragmentManager(), "Datepickerdialog");
}
示例4: showDateDialog
import com.wdullaer.materialdatetimepicker.date.DatePickerDialog; //导入方法依赖的package包/类
/**
* 时间选择
*/
private void showDateDialog() {
Calendar now = Calendar.getInstance();
Date time = now.getTime();
long currentTime = time.getTime();
time.setTime(currentTime + 24 * 60 * 60);
DatePickerDialog dpd = DatePickerDialog.newInstance(
ActReleaseRoadshowActivity.this,
now.get(Calendar.YEAR),
now.get(Calendar.MONTH),
now.get(Calendar.DAY_OF_MONTH)
);
now.setTime(time);
dpd.setMinDate(now);
dpd.show(getFragmentManager(), "Datepickerdialog");
}
示例5: chooseDate
import com.wdullaer.materialdatetimepicker.date.DatePickerDialog; //导入方法依赖的package包/类
private void chooseDate() {
Calendar first = Calendar.getInstance();
first.setTime(firstDate);
Calendar last = Calendar.getInstance();
last.setTime(lastDate);
Calendar now = Calendar.getInstance();
DatePickerDialog datePicker = DatePickerDialog.newInstance(
this,
now.get(Calendar.YEAR),
now.get(Calendar.MONTH),
now.get(Calendar.DAY_OF_MONTH)
);
datePicker.setMinDate(first);
datePicker.setMaxDate(last);
datePicker.show(getFragmentManager(), "Picker");
}
示例6: showPickDialog
import com.wdullaer.materialdatetimepicker.date.DatePickerDialog; //导入方法依赖的package包/类
public void showPickDialog() {
Calendar now = Calendar.getInstance();
now.set(mYear, mMonth, mDay);
DatePickerDialog dialog = DatePickerDialog.newInstance(new DatePickerDialog.OnDateSetListener() {
@Override
public void onDateSet(DatePickerDialog view, int year, int monthOfYear, int dayOfMonth) {
Calendar temp = Calendar.getInstance();
temp.clear();
temp.set(year, monthOfYear, dayOfMonth);
mYear = year;
mMonth = monthOfYear;
mDay = dayOfMonth;
presenter.loadPosts(temp.getTimeInMillis(), true);
}
}, now.get(Calendar.YEAR), now.get(Calendar.MONTH), now.get(Calendar.DAY_OF_MONTH));
dialog.setMaxDate(Calendar.getInstance());
Calendar minDate = Calendar.getInstance();
minDate.set(2014, 5, 12);
dialog.setMinDate(minDate);
// set the dialog not vibrate when date change, default value is true
dialog.vibrate(false);
dialog.show(getActivity().getFragmentManager(), "DatePickerDialog");
}
示例7: showPickDialog
import com.wdullaer.materialdatetimepicker.date.DatePickerDialog; //导入方法依赖的package包/类
public void showPickDialog() {
Calendar now = Calendar.getInstance();
now.set(mYear, mMonth, mDay);
DatePickerDialog dialog =
DatePickerDialog.newInstance(new DatePickerDialog.OnDateSetListener() {
@Override
public void onDateSet(DatePickerDialog view, int year, int monthOfYear, int dayOfMonth) {
mYear = year;
mMonth = monthOfYear;
mDay = dayOfMonth;
Calendar temp = Calendar.getInstance();
temp.clear();
temp.set(year, monthOfYear, dayOfMonth);
tvSelectTime.setText(year + "-" + (monthOfYear + 1) + "-" + dayOfMonth);
timeValue = year + "-" + (monthOfYear + 1) + "-" + dayOfMonth;
//presenter.loadPosts(temp.getTimeInMillis(), true);
}
}, now.get(Calendar.YEAR), now.get(Calendar.MONTH), now.get(Calendar.DAY_OF_MONTH));
dialog.setMaxDate(Calendar.getInstance());
Calendar minDate = Calendar.getInstance();
//
minDate.set(2014, 12, 31);
dialog.setMinDate(minDate);
dialog.vibrate(false);
dialog.show(this.getFragmentManager(), "DatePickerDialog");
}
示例8: dateOnClick
import com.wdullaer.materialdatetimepicker.date.DatePickerDialog; //导入方法依赖的package包/类
@OnClick(R.id.date)
public void dateOnClick(View v) {
hideKeyboard();
DatePickerDialog dpd = DatePickerDialog.newInstance(
CreateActivity.this,
mScheduledDate.get(Calendar.YEAR),
mScheduledDate.get(Calendar.MONTH),
mScheduledDate.get(Calendar.DAY_OF_MONTH)
);
dpd.setMinDate(Calendar.getInstance());
dpd.show(getFragmentManager(), Consts.FRAGMENT_TAG_DATETIME_PICKER);
}