|
|
|
@ -177,14 +177,35 @@ public class DateTimePicker extends FrameLayout {
|
|
|
|
|
}
|
|
|
|
|
};
|
|
|
|
|
public interface OnDateTimeChangedListener {
|
|
|
|
|
void onDateTimeChanged(DateTimePicker view, int year, int month,
|
|
|
|
|
int dayOfMonth, int hourOfDay, int minute);
|
|
|
|
|
/**
|
|
|
|
|
* 当日期时间发生变化时调用
|
|
|
|
|
*
|
|
|
|
|
* @param view 当前的 DateTimePicker 对象
|
|
|
|
|
* @param year 年份
|
|
|
|
|
* @param month 月份,范围为 0-11,0 表示一月
|
|
|
|
|
* @param dayOfMonth 日期
|
|
|
|
|
* @param hourOfDay 小时,根据是否为 24 小时制可能为 0-23 或 1-12
|
|
|
|
|
* @param minute 分钟
|
|
|
|
|
*/
|
|
|
|
|
void onDateTimeChanged(DateTimePicker view, int year, int month, int dayOfMonth, int hourOfDay, int minute);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* 构造方法,创建一个 DateTimePicker 对象,并将当前时间设置为系统当前时间
|
|
|
|
|
*
|
|
|
|
|
* @param context 上下文环境
|
|
|
|
|
*/
|
|
|
|
|
public DateTimePicker(Context context) {
|
|
|
|
|
this(context, System.currentTimeMillis());
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* 构造方法,创建一个 DateTimePicker 对象,并设置指定的日期时间和小时制
|
|
|
|
|
*
|
|
|
|
|
* @param context 上下文环境
|
|
|
|
|
* @param date 指定的日期时间,以毫秒为单位
|
|
|
|
|
* @param is24HourView 是否为 24 小时制显示
|
|
|
|
|
*/
|
|
|
|
|
public DateTimePicker(Context context, long date) {
|
|
|
|
|
this(context, date, DateFormat.is24HourFormat(context));
|
|
|
|
|
}
|
|
|
|
|