From 46a5c17fd9d22f7253033c81b8b24162c9f0297d Mon Sep 17 00:00:00 2001 From: Lastw <11007604@qq.com> Date: Thu, 8 Aug 2024 11:59:43 +0800 Subject: [PATCH 1/5] 222 --- 1.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/1.txt b/1.txt index 8a200a1..c5ddc08 100644 --- a/1.txt +++ b/1.txt @@ -1,3 +1,3 @@ -111 +222 branch1 branch2 \ No newline at end of file -- 2.34.1 From c18ed6b5461d968a025d3219de204fe2cc6dc754 Mon Sep 17 00:00:00 2001 From: Lastw <11007604@qq.com> Date: Thu, 8 Aug 2024 13:50:43 +0800 Subject: [PATCH 2/5] 222+222 --- 1.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/1.txt b/1.txt index 79c1945..524023b 100644 --- a/1.txt +++ b/1.txt @@ -1,4 +1,4 @@ -222 +222+222 branch1 branch2 pull request \ No newline at end of file -- 2.34.1 From 802546bb2473a280ebfe3a35cd4c08a601ba9724 Mon Sep 17 00:00:00 2001 From: Lastw <11007604@qq.com> Date: Fri, 9 Aug 2024 11:29:45 +0800 Subject: [PATCH 3/5] scr java --- scr/DateTimePickerDialog.java | 90 +++++++++++++++++++++++++++++++++++ 1 file changed, 90 insertions(+) create mode 100644 scr/DateTimePickerDialog.java diff --git a/scr/DateTimePickerDialog.java b/scr/DateTimePickerDialog.java new file mode 100644 index 0000000..2c47ba4 --- /dev/null +++ b/scr/DateTimePickerDialog.java @@ -0,0 +1,90 @@ +/* + * 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; +import net.micode.notes.ui.DateTimePicker.OnDateTimeChangedListener; + +import android.app.AlertDialog; +import android.content.Context; +import android.content.DialogInterface; +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(DateTimePicker view, 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_24HOUR; + setTitle(DateUtils.formatDateTime(this.getContext(), date, flag)); + } + + public void onClick(DialogInterface arg0, int arg1) { + if (mOnDateTimeSetListener != null) { + mOnDateTimeSetListener.OnDateTimeSet(this, mDate.getTimeInMillis()); + } + } + +} \ No newline at end of file -- 2.34.1 From 215a89eb7c4a0b4c892db60efb8464444702ebc9 Mon Sep 17 00:00:00 2001 From: Lastw <11007604@qq.com> Date: Fri, 9 Aug 2024 11:45:41 +0800 Subject: [PATCH 4/5] scrscr --- {scr => scrscr}/DateTimePickerDialog.java | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename {scr => scrscr}/DateTimePickerDialog.java (100%) diff --git a/scr/DateTimePickerDialog.java b/scrscr/DateTimePickerDialog.java similarity index 100% rename from scr/DateTimePickerDialog.java rename to scrscr/DateTimePickerDialog.java -- 2.34.1 From 9b77dc3a1c3835509623adaca0b05796c82a495a Mon Sep 17 00:00:00 2001 From: Lastw <11007604@qq.com> Date: Fri, 9 Aug 2024 11:47:55 +0800 Subject: [PATCH 5/5] 111 --- scrscr/DateTimePickerDialog.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scrscr/DateTimePickerDialog.java b/scrscr/DateTimePickerDialog.java index 2c47ba4..1135e1b 100644 --- a/scrscr/DateTimePickerDialog.java +++ b/scrscr/DateTimePickerDialog.java @@ -11,7 +11,7 @@ * 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. + * limitations under the License. 1111 */ package net.micode.notes.ui; -- 2.34.1