Compare commits

...

21 Commits

Author SHA1 Message Date
czw0031whu 9523881bc8 删除了org
2 years ago
czw0031whu 881844c669 包名增加了org
2 years ago
czw0031whu 73da4c872f 删除掉注释
2 years ago
czw0031whu f874f2023c 注释掉了重复import的类
2 years ago
czw0031whu fcb2bc45b6 修改了interface的名字
2 years ago
czw0031whu 3e4e2cd8d1 修改了函数首字符为小写字母
2 years ago
czw0031whu 6be1dcd744 删除了新增的注释
2 years ago
czw0031whu 46c76a4357 删除了包名前的“org”
2 years ago
czw0031whu 71264aec25 删除了dateTimePickerDialog.java
2 years ago
czw0031whu 87430d2ee8 修改了文件名
2 years ago
czw0031whu 4af8dc7dfd 修改了程序中的“异味”
2 years ago
czw0031whu 24c1749012 修改了条件表达式
2 years ago
czw0031whu aa66d31e10 添加了DateTimePickerDialog.java
2 years ago
czw0031whu 3a7cc424fb 修改了d.txt,删除了第一行的777。
2 years ago
czw0031whu f78d3132a0 修改了d.txt,将777改成了000。
2 years ago
czw0031whu f87ed8ae16 修改了d.txt,把555改成了777。
2 years ago
czw0031whu a8a374e60f 修改了d.txt,增加了555。
2 years ago
czw0031whu 21bc7033a6 Merge branch 'develop' of https://bdgit.educoder.net/pzb5nr4ph/Wuchunxiang_Git_P2 into wu_branch
2 years ago
czw0031whu 8675d906fa develop修改了d.txt,删除了111,增加了444。
2 years ago
czw0031whu 49a4eed17b wu_branch修改了d.txt,增加了333
2 years ago
czw0031whu d003ac83a9 develop修改了d.txt,增加了222
2 years ago

@ -1 +1,2 @@
111 222
333

@ -0,0 +1,91 @@
/*
* Copyright (c) 2010-2011, The MiCode Open Source Community (www.micode.net)
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package net.micode.notes.ui;
import java.util.Calendar;
import net.micode.notes.R;
import net.micode.notes.ui.DateTimePicker.OnDateTimeChangedListener;
import android.app.AlertDialog;
import android.content.Context;
import android.content.DialogInterface.OnClickListener;
import android.text.format.DateFormat;
import android.text.format.DateUtils;
public class DateTimePickerDialog extends AlertDialog implements OnClickListener {
private Calendar mDate = Calendar.getInstance();
private boolean mIs24HourView;
private OnDateTimeSetListener mOnDateTimeSetListener;
private DateTimePicker mDateTimePicker;
public interface OnDateTimeSetListener {
void onDateTimeSet(AlertDialog dialog, long date);
}
public DateTimePickerDialog(Context context, long date) {
super(context);
mDateTimePicker = new DateTimePicker(context);
setView(mDateTimePicker);
mDateTimePicker.setOnDateTimeChangedListener(new OnDateTimeChangedListener() {
public void onDateTimeChanged( int year, int month,
int dayOfMonth, int hourOfDay, int minute) {
mDate.set(Calendar.YEAR, year);
mDate.set(Calendar.MONTH, month);
mDate.set(Calendar.DAY_OF_MONTH, dayOfMonth);
mDate.set(Calendar.HOUR_OF_DAY, hourOfDay);
mDate.set(Calendar.MINUTE, minute);
updateTitle(mDate.getTimeInMillis());
}
});
mDate.setTimeInMillis(date);
mDate.set(Calendar.SECOND, 0);
mDateTimePicker.setCurrentDate(mDate.getTimeInMillis());
setButton(context.getString(R.string.datetime_dialog_ok), this);
setButton2(context.getString(R.string.datetime_dialog_cancel), (OnClickListener)null);
set24HourView(DateFormat.is24HourFormat(this.getContext()));
updateTitle(mDate.getTimeInMillis());
}
public void set24HourView(boolean is24HourView) {
mIs24HourView = is24HourView;
}
public void setOnDateTimeSetListener(OnDateTimeSetListener callBack) {
mOnDateTimeSetListener = callBack;
}
private void updateTitle(long date) {
int flag =
DateUtils.FORMAT_SHOW_YEAR |
DateUtils.FORMAT_SHOW_DATE |
DateUtils.FORMAT_SHOW_TIME;
flag |= mIs24HourView ? DateUtils.FORMAT_24HOUR : DateUtils.FORMAT_12HOUR;
setTitle(DateUtils.formatDateTime(this.getContext(), date, flag));
}
public void onClick( ) {
if (mOnDateTimeSetListener != null) {
mOnDateTimeSetListener.OnDateTimeSet(this, mDate.getTimeInMillis());
}
}
}
Loading…
Cancel
Save