|
|
|
@ -14,12 +14,11 @@
|
|
|
|
|
* limitations under the License.
|
|
|
|
|
*/
|
|
|
|
|
|
|
|
|
|
package net.micode.notes.ui;
|
|
|
|
|
package org.net.micode.notes.ui;
|
|
|
|
|
|
|
|
|
|
import java.util.Calendar;
|
|
|
|
|
|
|
|
|
|
import net.micode.notes.R;
|
|
|
|
|
import net.micode.notes.ui.DateTimePicker;
|
|
|
|
|
import net.micode.notes.ui.DateTimePicker.OnDateTimeChangedListener;
|
|
|
|
|
|
|
|
|
|
import android.app.AlertDialog;
|
|
|
|
@ -36,7 +35,7 @@ public class DateTimePickerDialog extends AlertDialog implements OnClickListener
|
|
|
|
|
private OnDateTimeSetListener mOnDateTimeSetListener;
|
|
|
|
|
private DateTimePicker mDateTimePicker;
|
|
|
|
|
|
|
|
|
|
public interface OnDateTimeSetListener {
|
|
|
|
|
public interface onDateTimeSetListener {
|
|
|
|
|
void OnDateTimeSet(AlertDialog dialog, long date);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
@ -45,7 +44,7 @@ public class DateTimePickerDialog extends AlertDialog implements OnClickListener
|
|
|
|
|
mDateTimePicker = new DateTimePicker(context);
|
|
|
|
|
setView(mDateTimePicker);
|
|
|
|
|
mDateTimePicker.setOnDateTimeChangedListener(new OnDateTimeChangedListener() {
|
|
|
|
|
public void onDateTimeChanged(DateTimePicker view, int year, int month,
|
|
|
|
|
public void onDateTimeChanged( int year, int month,
|
|
|
|
|
int dayOfMonth, int hourOfDay, int minute) {
|
|
|
|
|
mDate.set(Calendar.YEAR, year);
|
|
|
|
|
mDate.set(Calendar.MONTH, month);
|
|
|
|
@ -81,10 +80,13 @@ public class DateTimePickerDialog extends AlertDialog implements OnClickListener
|
|
|
|
|
setTitle(DateUtils.formatDateTime(this.getContext(), date, flag));
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public void onClick(DialogInterface arg0, int arg1) {
|
|
|
|
|
if (mOnDateTimeSetListener != null) {
|
|
|
|
|
mOnDateTimeSetListener.OnDateTimeSet(this, mDate.getTimeInMillis());
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
/*
|
|
|
|
|
参数有问题
|
|
|
|
|
* public void onClick( ) {
|
|
|
|
|
* if (mOnDateTimeSetListener != null) {
|
|
|
|
|
* mOnDateTimeSetListener.OnDateTimeSet(this, mDate.getTimeInMillis());
|
|
|
|
|
* }
|
|
|
|
|
* }
|
|
|
|
|
*/
|
|
|
|
|
|
|
|
|
|
}
|