+
+
\ No newline at end of file
diff --git a/.idea/misc.xml b/.idea/misc.xml
new file mode 100644
index 0000000..722a63c
--- /dev/null
+++ b/.idea/misc.xml
@@ -0,0 +1,26 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/.idea/runConfigurations.xml b/.idea/runConfigurations.xml
new file mode 100644
index 0000000..16660f1
--- /dev/null
+++ b/.idea/runConfigurations.xml
@@ -0,0 +1,17 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/.idea/vcs.xml b/.idea/vcs.xml
new file mode 100644
index 0000000..94a25f7
--- /dev/null
+++ b/.idea/vcs.xml
@@ -0,0 +1,6 @@
+
+
+
+
+
+
\ No newline at end of file
diff --git a/app/.gitignore b/app/.gitignore
new file mode 100644
index 0000000..42afabf
--- /dev/null
+++ b/app/.gitignore
@@ -0,0 +1 @@
+/build
\ No newline at end of file
diff --git a/app/build.gradle b/app/build.gradle
new file mode 100644
index 0000000..66c073f
--- /dev/null
+++ b/app/build.gradle
@@ -0,0 +1,39 @@
+plugins {
+ id 'com.android.application'
+}
+
+android {
+ compileSdk 32
+
+ defaultConfig {
+ applicationId "com.example.aaa"
+ minSdk 25
+ targetSdk 32
+ versionCode 1
+ versionName "1.0"
+
+ testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
+ }
+
+ buildTypes {
+ release {
+ minifyEnabled false
+ proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
+ }
+ }
+ compileOptions {
+ sourceCompatibility JavaVersion.VERSION_1_8
+ targetCompatibility JavaVersion.VERSION_1_8
+ }
+}
+
+dependencies {
+
+ implementation 'androidx.appcompat:appcompat:1.3.0'
+
+ implementation 'com.google.android.material:material:1.4.0'
+ implementation 'androidx.constraintlayout:constraintlayout:2.0.4'
+ testImplementation 'junit:junit:4.13.2'
+ androidTestImplementation 'androidx.test.ext:junit:1.1.3'
+ androidTestImplementation 'androidx.test.espresso:espresso-core:3.4.0'
+}
\ No newline at end of file
diff --git a/app/proguard-rules.pro b/app/proguard-rules.pro
new file mode 100644
index 0000000..481bb43
--- /dev/null
+++ b/app/proguard-rules.pro
@@ -0,0 +1,21 @@
+# Add project specific ProGuard rules here.
+# You can control the set of applied configuration files using the
+# proguardFiles setting in build.gradle.
+#
+# For more details, see
+# http://developer.android.com/guide/developing/tools/proguard.html
+
+# If your project uses WebView with JS, uncomment the following
+# and specify the fully qualified class name to the JavaScript interface
+# class:
+#-keepclassmembers class fqcn.of.javascript.interface.for.webview {
+# public *;
+#}
+
+# Uncomment this to preserve the line number information for
+# debugging stack traces.
+#-keepattributes SourceFile,LineNumberTable
+
+# If you keep the line number information, uncomment this to
+# hide the original source file name.
+#-renamesourcefileattribute SourceFile
\ No newline at end of file
diff --git a/app/src/androidTest/java/com/example/aaa/ExampleInstrumentedTest.java b/app/src/androidTest/java/com/example/aaa/ExampleInstrumentedTest.java
new file mode 100644
index 0000000..cbe0e70
--- /dev/null
+++ b/app/src/androidTest/java/com/example/aaa/ExampleInstrumentedTest.java
@@ -0,0 +1,26 @@
+package com.example.aaa;
+
+import android.content.Context;
+
+import androidx.test.platform.app.InstrumentationRegistry;
+import androidx.test.ext.junit.runners.AndroidJUnit4;
+
+import org.junit.Test;
+import org.junit.runner.RunWith;
+
+import static org.junit.Assert.*;
+
+/**
+ * Instrumented test, which will execute on an Android device.
+ *
+ * @see Testing documentation
+ */
+@RunWith(AndroidJUnit4.class)
+public class ExampleInstrumentedTest {
+ @Test
+ public void useAppContext() {
+ // Context of the app under test.
+ Context appContext = InstrumentationRegistry.getInstrumentation().getTargetContext();
+ assertEquals("com.example.aaa", appContext.getPackageName());
+ }
+}
\ No newline at end of file
diff --git a/app/src/main/AndroidManifest.xml b/app/src/main/AndroidManifest.xml
new file mode 100644
index 0000000..4356414
--- /dev/null
+++ b/app/src/main/AndroidManifest.xml
@@ -0,0 +1,38 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/app/src/main/java/com/example/aaa/AddActivity.java b/app/src/main/java/com/example/aaa/AddActivity.java
new file mode 100644
index 0000000..e84f09a
--- /dev/null
+++ b/app/src/main/java/com/example/aaa/AddActivity.java
@@ -0,0 +1,307 @@
+package com.example.aaa;
+
+
+import android.app.AlarmManager;
+import android.app.DatePickerDialog;
+import android.app.PendingIntent;
+import android.app.TimePickerDialog;
+import android.content.Intent;
+import android.content.SharedPreferences;
+import android.icu.util.Calendar;
+import android.icu.util.TimeZone;
+import android.os.Bundle;
+import android.text.TextUtils;
+import android.view.View;
+import android.widget.AdapterView;
+import android.widget.ArrayAdapter;
+import android.widget.Button;
+import android.widget.CheckBox;
+import android.widget.DatePicker;
+import android.widget.EditText;
+import android.widget.ImageView;
+import android.widget.Spinner;
+import android.widget.TextView;
+import android.widget.TimePicker;
+import android.widget.Toast;
+
+import androidx.appcompat.app.AppCompatActivity;
+
+
+public class AddActivity extends AppCompatActivity implements View.OnClickListener {
+ private Button back; //返回按钮
+ private CheckBox notif; //返回按钮
+ private EditText title; //标题
+ private EditText content; //内容
+ private ImageView BGTime;//开始时间
+ private ImageView FNTime;//结束时间
+ private TextView BG_Time_content;
+ private TextView FN_Time_content;
+ private Spinner sp_dropdown;
+ private String strBGTime;
+ private String strBGDate;
+ private String strBG;
+ private String strFNTime;
+ private String strFNDate;
+ private String strFN;
+ private int statu;
+ private int Hour;
+ private int Minute;
+
+ private String[] learingSiteArrar = {"学习", "工作", "日常", "生活", "社交", "购物"};
+
+ private int TongzhiId = 1;
+
+ private Button finish; //完成按钮
+ private String get_title;
+ private String get_content;
+ private String get_createTime;
+ private String get_finishTime;
+ private String get_statu;
+ private AdapterView.OnItemSelectedListener onItemSelectedListener = new AdapterView.OnItemSelectedListener() {
+
+ @Override
+ public void onItemSelected(AdapterView> adapterView, View view, int postion, long I) {
+ switch (adapterView.getId()) {
+ case R.id.sp_dropdown:
+ //记住点击的选项
+ statu = postion;
+ break;
+ }
+ }
+
+ @Override
+ public void onNothingSelected(AdapterView> adapterView) {
+ }
+ };
+
+ @Override
+ protected void onCreate(Bundle savedInstanceState) {
+ super.onCreate(savedInstanceState);
+ setContentView(R.layout.activity_add);
+
+ back = (Button) findViewById(R.id.back_add);
+ notif = (CheckBox) findViewById(R.id.notif);
+ title = (EditText) findViewById(R.id.title_add);
+ content = (EditText) findViewById(R.id.context_add);
+ finish = (Button) findViewById(R.id.finish);
+ BGTime = (ImageView) findViewById(R.id.BG_Time_Right_jv);
+ FNTime = (ImageView) findViewById(R.id.FN_Time_Right_jv);
+ BG_Time_content = (TextView) findViewById(R.id.BG_Time_content);
+ FN_Time_content = (TextView) findViewById(R.id.FN_Time_content);
+ sp_dropdown = (Spinner) findViewById(R.id.sp_dropdown);
+
+ finish.setOnClickListener(this);
+ back.setOnClickListener(this);
+ BGTime.setOnClickListener(this);
+ FNTime.setOnClickListener(this);
+
+
+ intiDropdownSpinner();
+ }
+
+ private void intiDropdownSpinner() {
+ //初始化AdapterView
+ Spinner sp_dropdown = (Spinner) findViewById(R.id.sp_dropdown);
+ sp_dropdown.setPrompt("请选择待办类型");
+ ArrayAdapter learningSiteAdapter = new ArrayAdapter(this,
+ R.layout.item_select, learingSiteArrar);
+ sp_dropdown.setAdapter(learningSiteAdapter);
+ sp_dropdown.setSelection(0);
+ sp_dropdown.setOnItemSelectedListener(onItemSelectedListener);
+ }
+
+ @Override
+ public void onClick(View view) {
+ switch (view.getId()) {
+ case R.id.finish: {
+ NoteOperator noteOperator = new NoteOperator(AddActivity.this);
+ get_title = title.getText().toString().trim();
+ get_content = content.getText().toString().trim();
+ get_createTime = BG_Time_content.getText().toString();
+ get_finishTime = FN_Time_content.getText().toString();
+ get_statu = statu + "";
+ //判断输入是否有空项
+ if (TextUtils.isEmpty(get_title) || TextUtils.isEmpty(get_content) || TextUtils.isEmpty(strBG)
+ || TextUtils.isEmpty(strFN) || TextUtils.isEmpty(get_statu)) {
+ Toast.makeText(AddActivity.this, "不能有空项", Toast.LENGTH_SHORT).show();
+ } else {
+ Note note = new Note();
+ note.title = get_title;
+ note.context = get_content;
+ note.createTime = get_createTime;
+ note.finishTime = get_finishTime;
+ note.statu = statu + "";
+
+ boolean add = noteOperator.insert(note);
+ //如果添加数据成功,跳到待办事项界面,并通过传值,让目标界面进行刷新
+ if (add) {
+ //Toast.makeText(AddActivity.this,"添加成功",Toast.LENGTH_SHORT).show();
+ Intent intent = new Intent();
+ intent.setClass(AddActivity.this, MainActivity.class);
+ intent.putExtra("Insert", 1);
+ Toast.makeText(AddActivity.this, "添加成功", Toast.LENGTH_SHORT).show();
+ startActivity(intent);
+ //将设置的标题和内容存入文件,待会通知会去取值
+ SharedPreferences sp = getSharedPreferences("notif", MODE_PRIVATE);
+ SharedPreferences.Editor editor = sp.edit();
+ editor.putString("Title", get_title);
+ editor.putString("Content", get_content);
+ editor.commit();
+
+ finish();
+ } else {
+ Toast.makeText(AddActivity.this, "添加失败", Toast.LENGTH_SHORT).show();
+ }
+ }
+
+ //通过判断是否选择来发送通知
+ if (notif.isChecked()) {
+ Intent intent = new Intent(AddActivity.this, AlarmReceiver.class);
+ AlarmReceiver.title = get_title;
+ AlarmReceiver.content = get_content;
+ startRemind();
+ }
+
+
+ }
+ break;
+
+ case R.id.BG_Time_Right_jv: {
+
+ strBGDate = null;
+ strBGTime = null;
+ strBG = "";
+ Calendar cal = Calendar.getInstance();
+ //得到小时
+ int hourOfDay = cal.get(Calendar.HOUR_OF_DAY);
+ //得到分钟
+ int minute = cal.get(Calendar.MINUTE);
+ new TimePickerDialog(AddActivity.this, new TimePickerDialog.OnTimeSetListener() {
+ @Override
+ public void onTimeSet(TimePicker view, int hourOfDay, int minute) {
+ Hour = hourOfDay;
+ Minute = minute;
+ strBGTime = " " + hourOfDay + ":" + minute;
+ if (strBGDate != null && strBGTime != null) {
+ strBG = strBGDate + strBGTime;
+
+ } else {
+ strBG = "";
+ }
+ //将选择的时间设置到TextView
+ BG_Time_content.setText(strBG);
+ }
+ }, hourOfDay, minute, true).show();
+
+ //得到年月日
+ int year = cal.get(Calendar.YEAR);
+ int month = cal.get(Calendar.MONTH);
+ int day = cal.get(Calendar.DAY_OF_MONTH);
+ new DatePickerDialog(AddActivity.this, new DatePickerDialog.OnDateSetListener() {
+ @Override
+ public void onDateSet(DatePicker datePicker, int year, int month, int day) {
+ strBGDate = year + "/" + (month + 1) + "/" + day + "";
+
+ }
+ }, year, month, day).show();
+
+
+ }
+ break;
+
+ case R.id.FN_Time_Right_jv: {
+
+ strFNDate = null;
+ strFNTime = null;
+ strFN = null;
+
+ Calendar cal = Calendar.getInstance();
+ int hourOfDay = cal.get(Calendar.HOUR_OF_DAY); //得到小时
+ int minute = cal.get(Calendar.MINUTE); //得到分钟
+ new TimePickerDialog(AddActivity.this, new TimePickerDialog.OnTimeSetListener() {
+ @Override
+ public void onTimeSet(TimePicker view, int hourOfDay, int minute) {
+ strFNTime = " " + hourOfDay + ":" + minute;
+ if (strFNDate != null && strFNTime != null) {
+ strFN = strFNDate + strFNTime;
+
+ } else {
+ strFN = "";
+ }
+ FN_Time_content.setText(strFN);
+ }
+ }, hourOfDay, minute, true).show();
+
+ //得到年月日
+ int year = cal.get(Calendar.YEAR);
+ int month = cal.get(Calendar.MONTH);
+ int day = cal.get(Calendar.DAY_OF_MONTH);
+ new DatePickerDialog(AddActivity.this, new DatePickerDialog.OnDateSetListener() {
+ @Override
+ public void onDateSet(DatePicker datePicker, int year, int month, int day) {
+ strFNDate = year + "/" + (month + 1) + "/" + day + "";
+
+ }
+ }, year, month, day).show();
+
+
+ }
+ break;
+
+ case R.id.back_add: {
+ //返回按钮,返回主页面
+ Intent intent = new Intent(AddActivity.this, MainActivity.class);
+ startActivity(intent);
+ finish();
+ }
+ break;
+
+ default:
+ break;
+
+
+ }
+
+ }
+
+ //启动定时通知方法
+ public void startRemind() {
+ Calendar mCalendar = Calendar.getInstance();
+ mCalendar.setTimeInMillis(System.currentTimeMillis());
+ //获取当前毫秒值
+ long systemTime = System.currentTimeMillis();
+ //是设置日历的时间,主要是让日历的年月日和当前同步
+ mCalendar.setTimeInMillis(System.currentTimeMillis());
+ // 这里时区需要设置一下,不然可能个别手机会有8个小时的时间差
+ mCalendar.setTimeZone(TimeZone.getTimeZone("GMT+8"));
+ //设置在几点提醒 设置的为选定的Hour
+ mCalendar.set(Calendar.HOUR_OF_DAY, Hour);
+ //设置在几分提醒 设置的为选定的Minute分
+ mCalendar.set(Calendar.MINUTE, Minute);
+ mCalendar.set(Calendar.SECOND, 0);
+ mCalendar.set(Calendar.MILLISECOND, 0);
+ //上面设置的就是小时和分钟的时间点
+ //获取上面设置的时间
+ long selectTime = mCalendar.getTimeInMillis();
+
+ // 如果当前时间大于设置的时间,那么就从第二天的设定时间开始
+ if (systemTime > selectTime) {
+ mCalendar.add(Calendar.DAY_OF_MONTH, 1);
+ }
+ //AlarmReceiver.class为广播接受者
+ Intent intent = new Intent(AddActivity.this, AlarmReceiver.class);
+ PendingIntent pi = PendingIntent.getBroadcast(AddActivity.this, 0, intent, 0);
+ //得到AlarmManager实例
+ AlarmManager am = (AlarmManager) getSystemService(ALARM_SERVICE);
+ /**
+ * 单次提醒
+ * mCalendar.getTimeInMillis() 上面设置的时间点毫秒值
+ */
+ am.set(AlarmManager.RTC_WAKEUP, mCalendar.getTimeInMillis(), pi);
+
+ }
+}
+
+
+
+
diff --git a/app/src/main/java/com/example/aaa/AlarmReceiver.java b/app/src/main/java/com/example/aaa/AlarmReceiver.java
new file mode 100644
index 0000000..05ace10
--- /dev/null
+++ b/app/src/main/java/com/example/aaa/AlarmReceiver.java
@@ -0,0 +1,52 @@
+package com.example.aaa;
+
+
+import static android.content.Context.NOTIFICATION_SERVICE;
+
+import android.app.Notification;
+import android.app.NotificationManager;
+import android.app.PendingIntent;
+import android.content.BroadcastReceiver;
+import android.content.Context;
+import android.content.Intent;
+import android.content.SharedPreferences;
+import android.graphics.BitmapFactory;
+
+
+public class AlarmReceiver extends BroadcastReceiver {
+
+
+ //定义通知标题和内容,避免魔法字符串
+ public static String title = "ToDo";
+ public static String content = "content";
+ public static String news = "您设置的ToDo开始时间到啦";
+
+ @Override
+ public void onReceive(Context context, Intent intent) {
+ //将设置好的标题的内容取出来
+ SharedPreferences sp = context.getSharedPreferences("notif", context.MODE_PRIVATE);
+ title = (sp.getString("Title", title));
+ content = (sp.getString("Content", content));
+
+ //初始调用
+ NotificationManager manager = (NotificationManager) context.getSystemService(NOTIFICATION_SERVICE);
+ Notification.Builder builder = new Notification.Builder(context);
+ builder.setSmallIcon(R.drawable.notif);
+ builder.setContentTitle(title);
+ builder.setContentText(content);
+ builder.setTicker(news);
+ builder.setLargeIcon(BitmapFactory.decodeResource(context.getResources(), R.drawable.logo));
+ builder.setContentInfo("附加消息");
+ //全部效果展示(震动,铃声,呼吸灯)
+ builder.setDefaults(Notification.DEFAULT_ALL);
+ //点击页面跳转
+ intent = new Intent(context, MainActivity.class);
+ PendingIntent activity = PendingIntent.getActivity(context, 100, intent, PendingIntent.FLAG_ONE_SHOT);
+ builder.setContentIntent(activity);
+ //悬浮显示
+ builder.setFullScreenIntent(activity, true);
+ manager.notify(1, builder.build());
+ }
+ //传递通知
+
+}
\ No newline at end of file
diff --git a/app/src/main/java/com/example/aaa/DBOpenHelper.java b/app/src/main/java/com/example/aaa/DBOpenHelper.java
new file mode 100644
index 0000000..dd367dd
--- /dev/null
+++ b/app/src/main/java/com/example/aaa/DBOpenHelper.java
@@ -0,0 +1,32 @@
+package com.example.aaa;
+
+import android.content.Context;
+import android.database.sqlite.SQLiteDatabase;
+import android.database.sqlite.SQLiteOpenHelper;
+
+import androidx.annotation.Nullable;
+
+public class DBOpenHelper extends SQLiteOpenHelper {
+ public DBOpenHelper(@Nullable Context context) {
+ super(context, "todo.db", null, 4);
+ }
+ //创建数据库的方法,只有项目第一次运行时,会被调用
+
+ @Override
+ public void onCreate(SQLiteDatabase db) {
+ //创建USER表
+ String sql1 = "Create table user(account text primary key,password text,id text,phone text)";
+ String sql2 = "Create table todo(id integer primary key autoincrement, title text,context text,createTime text,finishTime text,statu text)";
+ db.execSQL(sql1);
+ db.execSQL(sql2);
+ }
+
+
+ // 数据库版本在更新时发生改变,会调用此方法
+ @Override
+ public void onUpgrade(SQLiteDatabase db, int oldVersion, int newVersion) {
+ db.execSQL("drop table if exists user");
+ db.execSQL("drop table if exists todo");
+ onCreate(db);
+ }
+}
diff --git a/app/src/main/java/com/example/aaa/DetailActivity.java b/app/src/main/java/com/example/aaa/DetailActivity.java
new file mode 100644
index 0000000..3248c4d
--- /dev/null
+++ b/app/src/main/java/com/example/aaa/DetailActivity.java
@@ -0,0 +1,233 @@
+package com.example.aaa;
+
+import android.app.DatePickerDialog;
+import android.app.TimePickerDialog;
+import android.content.Intent;
+import android.icu.util.Calendar;
+import android.os.Bundle;
+import android.text.TextUtils;
+import android.view.View;
+import android.widget.AdapterView;
+import android.widget.ArrayAdapter;
+import android.widget.Button;
+import android.widget.DatePicker;
+import android.widget.EditText;
+import android.widget.ImageView;
+import android.widget.Spinner;
+import android.widget.TextView;
+import android.widget.TimePicker;
+import android.widget.Toast;
+
+import androidx.appcompat.app.AppCompatActivity;
+
+public class DetailActivity extends AppCompatActivity implements View.OnClickListener {
+ private Button back;
+ private Button save;
+ private EditText title;
+ private EditText context;
+ private TextView BG_content;
+ private TextView FN_content;
+ private int note_id = 0;
+ private String get_title;//获取标题字符串
+ private String get_context;//获取内容字符串
+ private Spinner sp_dropdown;
+ private String strBGDate;
+ private String strFNDate;
+ private String strFNTime;
+ private String strBGTime;
+ private String strBG;
+ private String strFN;
+ private String statu;
+ private String[] learingSiteArrar = {"学习", "工作", "日常", "生活", "社交", "购物"};
+ private int Hour;
+ private int Minute;
+ private String get_statu;
+ private ImageView BGTime;//开始时间
+ private ImageView FNTime;//结束时间
+ private String get_BG_Time;
+ private String get_FN_Time;
+ private AdapterView.OnItemSelectedListener onItemSelectedListener = new AdapterView.OnItemSelectedListener() {
+
+ @Override
+ public void onItemSelected(AdapterView> adapterView, View view, int postion, long I) {
+ switch (adapterView.getId()) {
+ case R.id.sp_dropdown_2:
+ statu = postion + "";
+ break;
+ }
+ }
+
+ @Override
+ public void onNothingSelected(AdapterView> adapterView) {
+ }
+ };
+
+ @Override
+ protected void onCreate(Bundle savedInstanceState) {
+ super.onCreate(savedInstanceState);
+ setContentView(R.layout.activity_detail);
+
+ title = (EditText) findViewById(R.id.title_detail);
+ context = (EditText) findViewById(R.id.context_detail);
+ BG_content = (TextView) findViewById(R.id.BG_Time_content);
+ FN_content = (TextView) findViewById(R.id.FN_Time_content);
+ back = (Button) findViewById(R.id.back_detail);
+ save = (Button) findViewById(R.id.save_detail);
+ BGTime = (ImageView) findViewById(R.id.BG_Time_Right_jv);
+ FNTime = (ImageView) findViewById(R.id.FN_Time_Right_jv);
+ sp_dropdown = (Spinner) findViewById(R.id.sp_dropdown_2);
+
+ back.setOnClickListener(this);
+ save.setOnClickListener(this);
+ BGTime.setOnClickListener(this);
+ FNTime.setOnClickListener(this);
+
+ //接收listView中点击item传来的note_id,
+ Intent intent = getIntent();
+ note_id = intent.getIntExtra("note_id", 0);
+ NoteOperator noteOperator = new NoteOperator(this);
+ Note note = noteOperator.getNoteById(note_id);
+
+ title.setText(String.valueOf(note.title));
+ context.setText(String.valueOf(note.context));
+ BG_content.setText(String.valueOf(note.createTime));
+ FN_content.setText(String.valueOf(note.finishTime));
+ sp_dropdown.setSelection(Integer.parseInt(note.statu));//此处存疑
+
+
+ intiDropdownSpinner(Integer.parseInt(note.statu));
+
+ }
+
+ private void intiDropdownSpinner(int statu) {
+ Spinner sp_dropdown = (Spinner) findViewById(R.id.sp_dropdown_2);
+
+
+ ArrayAdapter learningSiteAdapter = new ArrayAdapter(this,
+ R.layout.item_select, learingSiteArrar);
+
+ sp_dropdown.setAdapter(learningSiteAdapter);
+ sp_dropdown.setSelection(statu);
+ sp_dropdown.setOnItemSelectedListener(onItemSelectedListener);
+ }
+
+ @Override
+ public void onClick(View view) {
+ switch (view.getId()) {
+ case R.id.back_detail: {
+ Intent intent = new Intent(DetailActivity.this, MainActivity.class);
+ startActivity(intent);
+ finish();
+ }
+ break;
+ case R.id.save_detail: {
+ get_title = title.getText().toString().trim();
+ get_context = context.getText().toString().trim();
+ get_statu = statu;
+ if (TextUtils.isEmpty(get_title) || TextUtils.isEmpty(get_context)) {
+ Toast.makeText(this, "修改内容不能为空", Toast.LENGTH_SHORT).show();
+ } else {
+ Note note = new Note();
+ note.note_id = note_id;
+ note.title = get_title;
+ note.context = get_context;
+ note.createTime = BG_content.toString();
+ note.finishTime = FN_content.toString();
+ note.statu = statu;
+ NoteOperator noteOperator = new NoteOperator(DetailActivity.this);
+ noteOperator.update(note);
+
+ Toast.makeText(this, "修改成功", Toast.LENGTH_SHORT).show();
+ Intent intent = new Intent();
+ intent.setClass(DetailActivity.this, MainActivity.class);
+ startActivity(intent);
+ finish();
+ }
+
+ }
+ break;
+
+ case R.id.BG_Time_Right_jv: {
+
+ strBGDate = null;
+ strBGTime = null;
+ strBG = "";
+ Calendar cal = Calendar.getInstance();
+ int hourOfDay = cal.get(Calendar.HOUR_OF_DAY); //得到小时
+ int minute = cal.get(Calendar.MINUTE); //得到分钟
+ new TimePickerDialog(DetailActivity.this, new TimePickerDialog.OnTimeSetListener() {
+ @Override
+ public void onTimeSet(TimePicker view, int hourOfDay, int minute) {
+ Hour = hourOfDay;
+ Minute = minute;
+ strBGTime = " " + hourOfDay + ":" + minute;
+ if (strBGDate != null && strBGTime != null) {
+ strBG = strBGDate + strBGTime;
+
+ } else {
+ strBG = "";
+ }
+ BG_content.setText(strBG);
+ }
+ }, hourOfDay, minute, true).show();
+
+
+ int year = cal.get(Calendar.YEAR);
+ int month = cal.get(Calendar.MONTH);
+ int day = cal.get(Calendar.DAY_OF_MONTH);
+ new DatePickerDialog(DetailActivity.this, new DatePickerDialog.OnDateSetListener() {
+ @Override
+ public void onDateSet(DatePicker datePicker, int year, int month, int day) {
+ strBGDate = year + "/" + (month + 1) + "/" + day + "";
+
+ }
+ }, year, month, day).show();
+
+
+ }
+ break;
+
+ case R.id.FN_Time_Right_jv: {
+
+ strFNDate = null;
+ strFNTime = null;
+ strFN = null;
+
+ Calendar cal = Calendar.getInstance();
+ int hourOfDay = cal.get(Calendar.HOUR_OF_DAY); //得到小时
+ int minute = cal.get(Calendar.MINUTE); //得到分钟
+ new TimePickerDialog(DetailActivity.this, new TimePickerDialog.OnTimeSetListener() {
+ @Override
+ public void onTimeSet(TimePicker view, int hourOfDay, int minute) {
+ strFNTime = " " + hourOfDay + ":" + minute;
+ if (strFNDate != null && strFNTime != null) {
+ strFN = strFNDate + strFNTime;
+
+ } else {
+ strFN = "";
+ }
+ FN_content.setText(strFN);
+ }
+ }, hourOfDay, minute, true).show();
+
+
+ int year = cal.get(Calendar.YEAR);
+ int month = cal.get(Calendar.MONTH);
+ int day = cal.get(Calendar.DAY_OF_MONTH);
+ new DatePickerDialog(DetailActivity.this, new DatePickerDialog.OnDateSetListener() {
+ @Override
+ public void onDateSet(DatePicker datePicker, int year, int month, int day) {
+ strFNDate = year + "/" + (month + 1) + "/" + day + "";
+
+ }
+ }, year, month, day).show();
+
+
+ }
+ break;
+
+
+ }
+
+ }
+}
diff --git a/app/src/main/java/com/example/aaa/LoginActivity.java b/app/src/main/java/com/example/aaa/LoginActivity.java
new file mode 100644
index 0000000..3e040f3
--- /dev/null
+++ b/app/src/main/java/com/example/aaa/LoginActivity.java
@@ -0,0 +1,122 @@
+package com.example.aaa;
+
+
+import android.annotation.SuppressLint;
+import android.content.Intent;
+import android.content.SharedPreferences;
+import android.database.Cursor;
+import android.database.sqlite.SQLiteDatabase;
+import android.os.Bundle;
+import android.view.View;
+import android.widget.Button;
+import android.widget.EditText;
+import android.widget.RadioButton;
+import android.widget.RadioGroup;
+import android.widget.Toast;
+
+import androidx.appcompat.app.AppCompatActivity;
+
+public class LoginActivity extends AppCompatActivity implements View.OnClickListener {
+ EditText ed_name;
+ EditText ed_password;
+ Button btn_login;
+ Button btn_reg;
+ String userName;
+ String IdInput;
+ String PhoneInput;
+ String Password;
+ RadioGroup radioGroup;
+ RadioButton rb_phone;
+ RadioButton rb_id;
+ SQLiteDatabase db;
+ DBOpenHelper helper;
+
+ @Override
+ protected void onCreate(Bundle savedInstanceState) {
+ super.onCreate(savedInstanceState);
+ setContentView(R.layout.activity_login);
+ helper = new DBOpenHelper(this);
+ //控件获取
+ ed_name = findViewById(R.id.ed_Name);
+ ed_password = findViewById(R.id.ed_Password);
+ btn_login = findViewById(R.id.btn_login);
+ btn_reg = findViewById(R.id.btn_reg);
+ radioGroup = findViewById(R.id.radioGroup);
+ rb_phone = findViewById(R.id.rb_phone);
+ rb_id = findViewById(R.id.rb_id);
+ btn_login.setOnClickListener(this);
+ btn_reg.setOnClickListener(this);
+ }
+
+ //记住登录信息
+ @Override
+ protected void onResume() {
+ super.onResume();
+ SharedPreferences sp = getSharedPreferences("loginInfo", MODE_PRIVATE);
+ ed_name.setText(sp.getString("account", ""));
+ ed_password.setText(sp.getString("password", ""));
+ }
+
+ @SuppressLint("Range")
+ @Override
+ public void onClick(View view) {
+ switch (view.getId()) {
+ case R.id.btn_login:
+ String name = ed_name.getText().toString();
+ String password = ed_password.getText().toString();
+ if (name.isEmpty()) {
+ Toast.makeText(LoginActivity.this, "请输入用户名", Toast.LENGTH_SHORT).show();
+ return;
+ }
+ if (password.isEmpty()) {
+ Toast.makeText(LoginActivity.this, "请输入密码", Toast.LENGTH_SHORT).show();
+ return;
+ }
+ //从数据库中获取信息
+ db = helper.getReadableDatabase();
+ //通过判断是学号登陆还是手机号登录来获取不同的信息比对
+ if (rb_phone.isChecked()) {
+ Cursor cursor = db.query("user", null, "phone=?", new String[]{name}, null, null, null);
+ if (cursor.getCount() > 0) {
+ cursor.moveToNext();//结果集中的指针指向下一个位置
+ PhoneInput = cursor.getString(cursor.getColumnIndex("phone"));
+ Password = cursor.getString(cursor.getColumnIndex("password"));
+ }
+ userName = PhoneInput;
+ }
+ if (rb_id.isChecked()) {
+ Cursor cursor = db.query("user", null, "id=?", new String[]{name}, null, null, null);
+ if (cursor.getCount() > 0) {
+ cursor.moveToNext();//结果集中的指针指向下一个位置
+ IdInput = cursor.getString(cursor.getColumnIndex("id"));
+ Password = cursor.getString(cursor.getColumnIndex("password"));
+ }
+ userName = IdInput;
+ }
+ db.close();
+ //如果密码和账号都正确的话可以登录,并且记住密码
+ if (name.equals(userName) && password.equals(Password)) {
+ Toast.makeText(LoginActivity.this, "登陆成功", Toast.LENGTH_SHORT).show();
+ Intent intent = new Intent(LoginActivity.this, MainActivity.class);
+ startActivity(intent);
+ SharedPreferences sp = getSharedPreferences("loginInfo", MODE_PRIVATE);
+ SharedPreferences.Editor editor = sp.edit();
+ editor.putString("account", name);
+ editor.putString("password", password);
+ editor.commit();
+ finish();
+
+ } else {
+ Toast.makeText(LoginActivity.this, "账号或密码错误", Toast.LENGTH_SHORT).show();
+ }
+ break;
+ //跳转到注册界面
+ case R.id.btn_reg:
+ Intent intent = new Intent(LoginActivity.this, RegistActivity.class);
+ startActivity(intent);
+ finish();
+ break;
+ }
+ }
+
+}
\ No newline at end of file
diff --git a/app/src/main/java/com/example/aaa/MainActivity.java b/app/src/main/java/com/example/aaa/MainActivity.java
new file mode 100644
index 0000000..1b220f0
--- /dev/null
+++ b/app/src/main/java/com/example/aaa/MainActivity.java
@@ -0,0 +1,166 @@
+package com.example.aaa;
+
+import android.app.AlarmManager;
+import android.app.AlertDialog;
+import android.app.PendingIntent;
+import android.content.Context;
+import android.content.DialogInterface;
+import android.content.Intent;
+import android.icu.util.Calendar;
+import android.icu.util.TimeZone;
+import android.os.Build;
+import android.os.Bundle;
+import android.view.View;
+import android.widget.AdapterView;
+import android.widget.Button;
+import android.widget.ListAdapter;
+import android.widget.ListView;
+import android.widget.SimpleAdapter;
+import android.widget.Toast;
+
+import androidx.annotation.RequiresApi;
+import androidx.appcompat.app.AppCompatActivity;
+
+import java.util.ArrayList;
+import java.util.HashMap;
+import java.util.List;
+
+public class MainActivity extends AppCompatActivity implements View.OnClickListener {
+ ListView listView;
+ Button add;//添加按钮
+ Button btnok;//完成按钮
+ ArrayList> list;
+ private List data;
+
+ @Override
+ protected void onCreate(Bundle savedInstanceState) {
+ super.onCreate(savedInstanceState);
+ setContentView(R.layout.activity_main);
+
+ listView = (ListView) findViewById(R.id.listView);
+ add = (Button) findViewById(R.id.add);
+ btnok = (Button) findViewById(R.id.btnok);
+
+ add.setOnClickListener(this);
+
+
+
+
+
+ //通过list获取数据库表中的所有id和title,通过ListAdapter给listView赋值
+ final NoteOperator noteOperator = new NoteOperator(MainActivity.this);
+
+
+
+
+
+ list = noteOperator.getNoteList();
+ final ListAdapter listAdapter = new SimpleAdapter(MainActivity.this, list, R.layout.item,
+ new String[]{"id", "title"}, new int[]{R.id.note_id, R.id.note_title});
+ listView.setAdapter(listAdapter);
+
+
+ data = new ArrayList<>();
+ data=noteOperator.getTitleList();
+ MyAdapter myAdapter=new MyAdapter(data);
+ listView.setAdapter(myAdapter);
+
+
+
+
+ //通过添加界面传来的值判断是否要刷新listView
+ Intent intent = getIntent();
+ int flag = intent.getIntExtra("Insert", 0);
+ if (flag == 1) {
+ list = noteOperator.getNoteList();
+ listView.setAdapter(listAdapter);
+ }
+
+ if (list.size() != 0) {
+ //点击listView的任何一项跳到详情页面
+ listView.setOnItemClickListener(new AdapterView.OnItemClickListener() {
+ @Override
+ public void onItemClick(AdapterView> adapterView, View view, int position, long i) {
+
+ String id = list.get(position).get("id");
+ Intent intent = new Intent();
+ intent.setClass(MainActivity.this, DetailActivity.class);
+ intent.putExtra("note_id", Integer.parseInt(id));
+ startActivity(intent);
+ finish();
+ }
+ });
+
+ //长按实现对列表的删除
+ listView.setOnItemLongClickListener(new AdapterView.OnItemLongClickListener() {
+ @Override
+ public boolean onItemLongClick(final AdapterView> adapterView, View view, final int position, long l) {
+ AlertDialog.Builder builder = new AlertDialog.Builder(MainActivity.this);
+ builder.setMessage("确定删除?");
+ builder.setTitle("提示");
+
+ //添加AlterDialog.Builder对象的setPositiveButton()方法
+ builder.setPositiveButton("确定", new DialogInterface.OnClickListener() {
+ @Override
+ public void onClick(DialogInterface dialogInterface, int which) {
+ String id = list.get(position).get("id");
+ noteOperator.delete(Integer.parseInt(id));
+ list.remove(position);
+ //listAdapter.notify();
+ listView.setAdapter(listAdapter);
+ Toast.makeText(MainActivity.this, "已删除待办", Toast.LENGTH_SHORT).show();
+ }
+ });
+
+ //添加AlterDialog.Builder对象的setNegativeButton()方法
+ builder.setNegativeButton("取消", new DialogInterface.OnClickListener() {
+ @Override
+ public void onClick(DialogInterface dialogInterface, int i) {
+
+ }
+ });
+ builder.create().show();
+ return true;
+ }
+ });
+
+ }
+
+
+ }
+
+ @RequiresApi(api = Build.VERSION_CODES.O)
+ @Override
+ public void onClick(View view) {
+ switch (view.getId()) {
+
+ case R.id.add: {
+ //添加待办按钮事件,跳转到添加页面
+ Intent intent = new Intent();
+ intent.setClass(MainActivity.this, AddActivity.class);
+ startActivity(intent);
+ finish();
+ break;
+ }
+
+
+ }
+
+
+ }
+
+ //
+ public void refresh() {
+ //通过list获取数据库表中的所有id和title,通过ListAdapter给listView赋值
+ final NoteOperator noteOperator = new NoteOperator(MainActivity.this);
+ list = noteOperator.getNoteList();
+ final ListAdapter listAdapter = new SimpleAdapter(MainActivity.this, list, R.layout.item,
+ new String[]{"id", "title"}, new int[]{R.id.note_id, R.id.note_title});
+ listView.setAdapter(listAdapter);
+
+ }
+
+}
+
+
+
diff --git a/app/src/main/java/com/example/aaa/MyAdapter.java b/app/src/main/java/com/example/aaa/MyAdapter.java
new file mode 100644
index 0000000..194718c
--- /dev/null
+++ b/app/src/main/java/com/example/aaa/MyAdapter.java
@@ -0,0 +1,110 @@
+package com.example.aaa;
+
+import android.app.AlertDialog;
+import android.content.Context;
+import android.content.DialogInterface;
+import android.content.Intent;
+import android.database.sqlite.SQLiteDatabase;
+import android.view.LayoutInflater;
+import android.view.View;
+import android.view.ViewGroup;
+import android.widget.BaseAdapter;
+import android.widget.Button;
+import android.widget.TextView;
+import android.widget.Toast;
+
+import java.util.List;
+
+public class MyAdapter extends BaseAdapter implements View.OnClickListener {
+ private Context context;
+ private List data;
+ private int position;
+ final NoteOperator noteOperator = new NoteOperator(context);
+ private DBOpenHelper DBOpenHelper=new DBOpenHelper(context);
+
+ public void NoteOperator(Context context) {
+ DBOpenHelper = new DBOpenHelper(context);
+ }
+
+
+ public MyAdapter(List data){
+ this.data = data;
+ }
+ @Override
+ public int getCount() {
+ return data == null ? 0 : data.size();
+ }
+ @Override
+ public Object getItem(int i) {
+ return data.get(i);
+ }
+
+ @Override
+ public long getItemId(int i) {
+ return i;
+ }
+
+ @Override
+ public View getView(int i, View view, ViewGroup viewGroup) {
+ ViewHolder viewHolder = null;
+ if(context == null)
+ context = viewGroup.getContext();
+ if(view == null){
+ view = LayoutInflater.from(viewGroup.getContext()).inflate(R.layout.item,null);
+ viewHolder = new ViewHolder();
+ viewHolder.mTv = (TextView)view.findViewById(R.id.note_title);
+ viewHolder.mBtn = (Button)view.findViewById(R.id.btnok);
+ view.setTag(viewHolder);
+ }
+ viewHolder = (ViewHolder)view.getTag();
+ //设置tag标记
+ viewHolder.mBtn.setTag(R.id.btnok,i);//添加此代码
+// viewHolder.mBtn.setText("点我点我"+ i);
+ viewHolder.mBtn.setOnClickListener(this);
+ viewHolder.mTv.setText(data.get(i));
+ //设置tag标记
+ viewHolder.mTv.setTag(R.id.note_title,i);//添加此代码
+
+ return view;
+ }
+ @Override
+ public void onClick(View view) {
+ switch (view.getId()){
+ case R.id.btnok:
+ ViewHolder viewHolder = null;
+ int b = (int) view.getTag(R.id.btnok);
+// Toast.makeText(context,"我是按钮 " + b,Toast.LENGTH_SHORT).show();
+
+ AlertDialog.Builder builder = new AlertDialog.Builder(context);
+ builder.setMessage("确定完成并删除该待办吗?");
+ builder.setTitle("提示");
+
+ //添加AlterDialog.Builder对象的setPositiveButton()方法
+ builder.setPositiveButton("确定", new DialogInterface.OnClickListener() {
+ @Override
+ public void onClick(DialogInterface dialogInterface, int which) {
+ NoteOperator noteOperator = new NoteOperator(context);
+ noteOperator.btn_delete(data.get(b));
+
+ Intent intent = new Intent(context, MainActivity.class);
+ context.startActivity(intent);
+
+ }
+ });
+
+ //添加AlterDialog.Builder对象的setNegativeButton()方法
+ builder.setNegativeButton("取消", new DialogInterface.OnClickListener() {
+ @Override
+ public void onClick(DialogInterface dialogInterface, int i) {
+
+ }
+ });
+ builder.create().show();
+ break;
+ }
+ }
+ static class ViewHolder{
+ TextView mTv;
+ Button mBtn;
+ }
+}
\ No newline at end of file
diff --git a/app/src/main/java/com/example/aaa/Note.java b/app/src/main/java/com/example/aaa/Note.java
new file mode 100644
index 0000000..9379b3b
--- /dev/null
+++ b/app/src/main/java/com/example/aaa/Note.java
@@ -0,0 +1,22 @@
+package com.example.aaa;
+
+public class Note {
+ //表名
+ public static final String TABLE = "todo";
+ //列名
+ public static final String KEY_id = "id";
+ public static final String KEY_title = "title";
+ public static final String KEY_context = "context";
+ public static final String KEY_createTime = "createTime";
+ public static final String KEY_finishTime = "finishTime";
+ public static final String KEY_statu = "statu";
+
+ public int note_id;
+ public String title;
+ public String context;
+ public String createTime;
+ public String finishTime;
+ public String statu;
+
+
+}
\ No newline at end of file
diff --git a/app/src/main/java/com/example/aaa/NoteOperator.java b/app/src/main/java/com/example/aaa/NoteOperator.java
new file mode 100644
index 0000000..a6f20c0
--- /dev/null
+++ b/app/src/main/java/com/example/aaa/NoteOperator.java
@@ -0,0 +1,143 @@
+package com.example.aaa;
+
+
+import android.content.ContentValues;
+import android.content.Context;
+import android.database.Cursor;
+import android.database.sqlite.SQLiteDatabase;
+
+import java.util.ArrayList;
+import java.util.HashMap;
+
+
+public class NoteOperator {
+
+ private DBOpenHelper DBOpenHelper;
+
+ public NoteOperator(Context context) {
+ DBOpenHelper = new DBOpenHelper(context);
+ }
+
+ public boolean insert(Note note) {
+
+ //与数据库建立连接
+ SQLiteDatabase db = DBOpenHelper.getWritableDatabase();
+ ContentValues contentValues = new ContentValues();
+ contentValues.put(Note.KEY_title, note.title);
+ contentValues.put(Note.KEY_context, note.context);
+ contentValues.put(Note.KEY_createTime, note.createTime);
+ contentValues.put(Note.KEY_finishTime, note.finishTime);
+ contentValues.put(Note.KEY_statu, note.statu);
+ //插入每一行数据
+ long note_id = db.insert(Note.TABLE, null, contentValues);
+ db.close();
+ if (note_id != -1)
+ return true;
+ else
+ return false;
+ }
+
+ /**
+ * 删除数据
+ *
+ * @param note_id
+ */
+ public void delete(int note_id) {
+ //与数据库建立连接
+ SQLiteDatabase db = DBOpenHelper.getWritableDatabase();
+ db.delete(Note.TABLE, Note.KEY_id + "=?", new String[]{String.valueOf(note_id)});
+ db.close();
+ }
+ public void btn_delete(String title) {
+ //与数据库建立连接
+ SQLiteDatabase db = DBOpenHelper.getWritableDatabase();
+ db.delete(Note.TABLE, Note.KEY_title + "=?", new String[]{String.valueOf(title)});
+ db.close();
+ }
+
+ /**
+ * 从数据库中查找 id,title,context,createTime,finishTime,status
+ *
+ * @return ArrayList
+ */
+ public ArrayList> getNoteList() {
+ //与数据库建立连接
+ SQLiteDatabase db = DBOpenHelper.getReadableDatabase();
+ String sql = "select " + Note.KEY_id + "," + Note.KEY_title + "," + Note.KEY_context + ","
+ + Note.KEY_createTime + "," + Note.KEY_finishTime + "," + Note.KEY_statu + " from " + Note.TABLE;
+ //通过游标将每一条数据放进ArrayList中
+ ArrayList> noteList = new ArrayList>();
+ Cursor cursor = db.rawQuery(sql, null);
+ while (cursor.moveToNext()) {
+ HashMap note = new HashMap();
+ note.put("id", cursor.getString(cursor.getColumnIndex(Note.KEY_id)));
+ note.put("title", cursor.getString(cursor.getColumnIndex(Note.KEY_title)));
+
+
+ noteList.add(note);
+ }
+ cursor.close();
+ db.close();
+ return noteList;
+ }
+
+ /**
+ * 从数据库中查找 id,title,context,createTime,finishTime,status
+ *
+ * @return ArrayList
+ */
+ public ArrayList getTitleList() {
+ //与数据库建立连接
+ SQLiteDatabase db = DBOpenHelper.getReadableDatabase();
+ String sql = "select " + Note.KEY_id + "," + Note.KEY_title + "," + Note.KEY_context + ","
+ + Note.KEY_createTime + "," + Note.KEY_finishTime + "," + Note.KEY_statu + " from " + Note.TABLE;
+ //通过游标将每一条数据放进ArrayList中
+ ArrayList noteList = new ArrayList();
+ Cursor cursor = db.rawQuery(sql, null);
+ while (cursor.moveToNext()) {
+ noteList.add(cursor.getString(cursor.getColumnIndex(Note.KEY_title)));
+ }
+ cursor.close();
+ db.close();
+ return noteList;
+ }
+
+ /**
+ * 通过id查找,返回一个Note对象
+ *
+ * @param id
+ * @return note对象
+ */
+ public Note getNoteById(int id) {
+ //与数据库建立连接
+ SQLiteDatabase db = DBOpenHelper.getReadableDatabase();
+ String sql = "select " + Note.KEY_title + "," + Note.KEY_context +
+ "," + Note.KEY_createTime + "," + Note.KEY_finishTime + "," + Note.KEY_statu + " from " + Note.TABLE + " where " + Note.KEY_id + "=?";
+ Note note = new Note();
+ Cursor cursor = db.rawQuery(sql, new String[]{String.valueOf(id)});
+ while (cursor.moveToNext()) {
+ note.title = cursor.getString(cursor.getColumnIndex(Note.KEY_title));
+ note.context = cursor.getString(cursor.getColumnIndex(Note.KEY_context));
+ note.createTime = cursor.getString(cursor.getColumnIndex(Note.KEY_createTime));
+ note.finishTime = cursor.getString(cursor.getColumnIndex(Note.KEY_finishTime));
+ note.statu = cursor.getString(cursor.getColumnIndex(Note.KEY_statu));
+ }
+ cursor.close();
+ db.close();
+ return note;
+ }
+
+ /**
+ * 更新数据
+ *
+ * @param note
+ */
+ public void update(Note note) {
+ SQLiteDatabase db = DBOpenHelper.getWritableDatabase();
+ ContentValues contentValues = new ContentValues();
+ contentValues.put(Note.KEY_title, note.title);
+ contentValues.put(Note.KEY_context, note.context);
+ db.update(Note.TABLE, contentValues, Note.KEY_id + "=?", new String[]{String.valueOf(note.note_id)});
+ db.close();
+ }
+}
diff --git a/app/src/main/java/com/example/aaa/RegistActivity.java b/app/src/main/java/com/example/aaa/RegistActivity.java
new file mode 100644
index 0000000..0d18541
--- /dev/null
+++ b/app/src/main/java/com/example/aaa/RegistActivity.java
@@ -0,0 +1,113 @@
+package com.example.aaa;
+
+import android.content.ContentValues;
+import android.content.Intent;
+import android.content.SharedPreferences;
+import android.database.sqlite.SQLiteDatabase;
+import android.os.Bundle;
+import android.util.Log;
+import android.view.View;
+import android.widget.Button;
+import android.widget.EditText;
+import android.widget.Toast;
+
+import androidx.appcompat.app.AppCompatActivity;
+
+public class RegistActivity extends AppCompatActivity implements View.OnClickListener {
+ EditText ed_username, ed_userpwd, ed_userpwdr, ed_id, ed_phone;
+ Button btn_submit, btn_back;
+ SQLiteDatabase db;
+ DBOpenHelper helper;
+
+ @Override
+ protected void onCreate(Bundle savedInstanceState) {
+ super.onCreate(savedInstanceState);
+ setContentView(R.layout.activity_regist);
+ initView();
+ helper = new DBOpenHelper(this);
+ }
+
+ private void initView() {
+ ed_username = findViewById(R.id.UserNameEdit);
+ ed_userpwd = findViewById(R.id.PassWordEdit);
+ ed_userpwdr = findViewById(R.id.PassWordAgainEdit);
+ ed_id = findViewById(R.id.IdEdit);
+ ed_phone = findViewById(R.id.PhoneEdit);
+ btn_submit = findViewById(R.id.SignUpButton);
+ btn_back = findViewById(R.id.BackLoginButton);
+ btn_back.setOnClickListener(this);
+ btn_submit.setOnClickListener(this);
+ }
+
+ @Override
+ public void onClick(View view) {
+ String userName = ed_username.getText().toString();
+ String userPsd = ed_userpwd.getText().toString();
+ String confirPsd = ed_userpwdr.getText().toString();
+ String userId = ed_id.getText().toString();
+ String userPhone = ed_phone.getText().toString();
+
+ switch (view.getId()) {
+ //通过判断哪一项为空来提示输入
+ case R.id.SignUpButton:
+ String name = ed_username.getText().toString();
+ String pwd = ed_userpwd.getText().toString();
+ String id = ed_id.getText().toString();
+ String phone = ed_phone.getText().toString();
+ if (name.isEmpty()) {
+ Toast.makeText(RegistActivity.this, "请输入用户名", Toast.LENGTH_SHORT).show();
+ return;
+ }
+ if (pwd.isEmpty()) {
+ Toast.makeText(RegistActivity.this, "请输入密码", Toast.LENGTH_SHORT).show();
+ return;
+ }
+ if (id.isEmpty()) {
+ Toast.makeText(RegistActivity.this, "请输入学号", Toast.LENGTH_SHORT).show();
+ return;
+ }
+ if (phone.isEmpty()) {
+ Toast.makeText(RegistActivity.this, "请输入手机号", Toast.LENGTH_SHORT).show();
+ return;
+ }
+ //判断两次密码是否一致
+ if (!userPsd.equals(confirPsd)) {
+ Toast.makeText(RegistActivity.this, "两次输入的密码不一致,注册失败", Toast.LENGTH_SHORT).show();
+ } else {
+ //密码一致注册成功并且存入数据库
+ SharedPreferences sp = getSharedPreferences("regInfo", MODE_PRIVATE);
+ SharedPreferences.Editor editor = sp.edit();
+ editor.putString("account", userName);
+ editor.putString("password", userPsd);
+ editor.putString("id", userId);
+ editor.putString("phone", userPhone);
+ editor.commit();
+ //获取创建的数据库对象
+ db = helper.getWritableDatabase();
+ ContentValues values = new ContentValues();
+ values.put("account", userName);
+ values.put("password", userPsd);
+ values.put("id", userId);
+ values.put("phone", userPhone);
+ db.insert("user", null, values);
+ db.close();
+
+ //获取创建的数据库对象
+ Toast.makeText(RegistActivity.this, "注册成功", Toast.LENGTH_SHORT).show();
+ //注册成功后跳转到登陆界面
+ Intent intent = new Intent(RegistActivity.this, LoginActivity.class);
+ startActivity(intent);
+ finish();
+
+ }
+
+ break;
+ case R.id.BackLoginButton:
+ //返回到登陆界面
+ Intent intent = new Intent(RegistActivity.this, LoginActivity.class);
+ startActivity(intent);
+ finish();
+ break;
+ }
+ }
+}
\ No newline at end of file
diff --git a/app/src/main/res/drawable-v24/ic_launcher_foreground.xml b/app/src/main/res/drawable-v24/ic_launcher_foreground.xml
new file mode 100644
index 0000000..2b068d1
--- /dev/null
+++ b/app/src/main/res/drawable-v24/ic_launcher_foreground.xml
@@ -0,0 +1,30 @@
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/app/src/main/res/drawable-v24/ic_launcher_icon.png b/app/src/main/res/drawable-v24/ic_launcher_icon.png
new file mode 100644
index 0000000..d4975e6
Binary files /dev/null and b/app/src/main/res/drawable-v24/ic_launcher_icon.png differ
diff --git a/app/src/main/res/drawable-v24/rightiv.png b/app/src/main/res/drawable-v24/rightiv.png
new file mode 100644
index 0000000..e3340d0
Binary files /dev/null and b/app/src/main/res/drawable-v24/rightiv.png differ
diff --git a/app/src/main/res/drawable/btn_circle.xml b/app/src/main/res/drawable/btn_circle.xml
new file mode 100644
index 0000000..655b829
--- /dev/null
+++ b/app/src/main/res/drawable/btn_circle.xml
@@ -0,0 +1,15 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/app/src/main/res/drawable/edit_background.xml b/app/src/main/res/drawable/edit_background.xml
new file mode 100644
index 0000000..cacb4f9
--- /dev/null
+++ b/app/src/main/res/drawable/edit_background.xml
@@ -0,0 +1,14 @@
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/app/src/main/res/drawable/ic_launcher_background.xml b/app/src/main/res/drawable/ic_launcher_background.xml
new file mode 100644
index 0000000..07d5da9
--- /dev/null
+++ b/app/src/main/res/drawable/ic_launcher_background.xml
@@ -0,0 +1,170 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/app/src/main/res/drawable/ic_launcher_icon.png b/app/src/main/res/drawable/ic_launcher_icon.png
new file mode 100644
index 0000000..b0054a8
Binary files /dev/null and b/app/src/main/res/drawable/ic_launcher_icon.png differ
diff --git a/app/src/main/res/drawable/logo.jpg b/app/src/main/res/drawable/logo.jpg
new file mode 100644
index 0000000..b0054a8
Binary files /dev/null and b/app/src/main/res/drawable/logo.jpg differ
diff --git a/app/src/main/res/drawable/notif.jpg b/app/src/main/res/drawable/notif.jpg
new file mode 100644
index 0000000..511ee34
Binary files /dev/null and b/app/src/main/res/drawable/notif.jpg differ
diff --git a/app/src/main/res/layout/activity_add.xml b/app/src/main/res/layout/activity_add.xml
new file mode 100644
index 0000000..02dc410
--- /dev/null
+++ b/app/src/main/res/layout/activity_add.xml
@@ -0,0 +1,175 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/app/src/main/res/layout/activity_detail.xml b/app/src/main/res/layout/activity_detail.xml
new file mode 100644
index 0000000..e8252fc
--- /dev/null
+++ b/app/src/main/res/layout/activity_detail.xml
@@ -0,0 +1,165 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/app/src/main/res/layout/activity_login.xml b/app/src/main/res/layout/activity_login.xml
new file mode 100644
index 0000000..7203d98
--- /dev/null
+++ b/app/src/main/res/layout/activity_login.xml
@@ -0,0 +1,169 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/app/src/main/res/layout/activity_main.xml b/app/src/main/res/layout/activity_main.xml
new file mode 100644
index 0000000..d3d9134
--- /dev/null
+++ b/app/src/main/res/layout/activity_main.xml
@@ -0,0 +1,43 @@
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/app/src/main/res/layout/activity_regist.xml b/app/src/main/res/layout/activity_regist.xml
new file mode 100644
index 0000000..7ba58c5
--- /dev/null
+++ b/app/src/main/res/layout/activity_regist.xml
@@ -0,0 +1,210 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/app/src/main/res/layout/dialog_date.xml b/app/src/main/res/layout/dialog_date.xml
new file mode 100644
index 0000000..95ec58b
--- /dev/null
+++ b/app/src/main/res/layout/dialog_date.xml
@@ -0,0 +1,15 @@
+
+
+
+
+
diff --git a/app/src/main/res/layout/item.xml b/app/src/main/res/layout/item.xml
new file mode 100644
index 0000000..01a192d
--- /dev/null
+++ b/app/src/main/res/layout/item.xml
@@ -0,0 +1,43 @@
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/app/src/main/res/layout/item_select.xml b/app/src/main/res/layout/item_select.xml
new file mode 100644
index 0000000..84e95c5
--- /dev/null
+++ b/app/src/main/res/layout/item_select.xml
@@ -0,0 +1,8 @@
+
\ No newline at end of file
diff --git a/app/src/main/res/mipmap-anydpi-v26/ic_launcher.xml b/app/src/main/res/mipmap-anydpi-v26/ic_launcher.xml
new file mode 100644
index 0000000..eca70cf
--- /dev/null
+++ b/app/src/main/res/mipmap-anydpi-v26/ic_launcher.xml
@@ -0,0 +1,5 @@
+
+
+
+
+
\ No newline at end of file
diff --git a/app/src/main/res/mipmap-anydpi-v26/ic_launcher_round.xml b/app/src/main/res/mipmap-anydpi-v26/ic_launcher_round.xml
new file mode 100644
index 0000000..eca70cf
--- /dev/null
+++ b/app/src/main/res/mipmap-anydpi-v26/ic_launcher_round.xml
@@ -0,0 +1,5 @@
+
+
+
+
+
\ No newline at end of file
diff --git a/app/src/main/res/mipmap-hdpi/ic_launcher.webp b/app/src/main/res/mipmap-hdpi/ic_launcher.webp
new file mode 100644
index 0000000..c209e78
Binary files /dev/null and b/app/src/main/res/mipmap-hdpi/ic_launcher.webp differ
diff --git a/app/src/main/res/mipmap-hdpi/ic_launcher_round.webp b/app/src/main/res/mipmap-hdpi/ic_launcher_round.webp
new file mode 100644
index 0000000..b2dfe3d
Binary files /dev/null and b/app/src/main/res/mipmap-hdpi/ic_launcher_round.webp differ
diff --git a/app/src/main/res/mipmap-mdpi/ic_launcher.webp b/app/src/main/res/mipmap-mdpi/ic_launcher.webp
new file mode 100644
index 0000000..4f0f1d6
Binary files /dev/null and b/app/src/main/res/mipmap-mdpi/ic_launcher.webp differ
diff --git a/app/src/main/res/mipmap-mdpi/ic_launcher_round.webp b/app/src/main/res/mipmap-mdpi/ic_launcher_round.webp
new file mode 100644
index 0000000..62b611d
Binary files /dev/null and b/app/src/main/res/mipmap-mdpi/ic_launcher_round.webp differ
diff --git a/app/src/main/res/mipmap-xhdpi/ic_launcher.webp b/app/src/main/res/mipmap-xhdpi/ic_launcher.webp
new file mode 100644
index 0000000..948a307
Binary files /dev/null and b/app/src/main/res/mipmap-xhdpi/ic_launcher.webp differ
diff --git a/app/src/main/res/mipmap-xhdpi/ic_launcher_round.webp b/app/src/main/res/mipmap-xhdpi/ic_launcher_round.webp
new file mode 100644
index 0000000..1b9a695
Binary files /dev/null and b/app/src/main/res/mipmap-xhdpi/ic_launcher_round.webp differ
diff --git a/app/src/main/res/mipmap-xxhdpi/ic_launcher.webp b/app/src/main/res/mipmap-xxhdpi/ic_launcher.webp
new file mode 100644
index 0000000..28d4b77
Binary files /dev/null and b/app/src/main/res/mipmap-xxhdpi/ic_launcher.webp differ
diff --git a/app/src/main/res/mipmap-xxhdpi/ic_launcher_round.webp b/app/src/main/res/mipmap-xxhdpi/ic_launcher_round.webp
new file mode 100644
index 0000000..9287f50
Binary files /dev/null and b/app/src/main/res/mipmap-xxhdpi/ic_launcher_round.webp differ
diff --git a/app/src/main/res/mipmap-xxxhdpi/ic_launcher.webp b/app/src/main/res/mipmap-xxxhdpi/ic_launcher.webp
new file mode 100644
index 0000000..aa7d642
Binary files /dev/null and b/app/src/main/res/mipmap-xxxhdpi/ic_launcher.webp differ
diff --git a/app/src/main/res/mipmap-xxxhdpi/ic_launcher_round.webp b/app/src/main/res/mipmap-xxxhdpi/ic_launcher_round.webp
new file mode 100644
index 0000000..9126ae3
Binary files /dev/null and b/app/src/main/res/mipmap-xxxhdpi/ic_launcher_round.webp differ
diff --git a/app/src/main/res/values-night/themes.xml b/app/src/main/res/values-night/themes.xml
new file mode 100644
index 0000000..2df99cc
--- /dev/null
+++ b/app/src/main/res/values-night/themes.xml
@@ -0,0 +1,16 @@
+
+
+
+
\ No newline at end of file
diff --git a/app/src/main/res/values/colors.xml b/app/src/main/res/values/colors.xml
new file mode 100644
index 0000000..2a879de
--- /dev/null
+++ b/app/src/main/res/values/colors.xml
@@ -0,0 +1,16 @@
+
+
+ #FFBB86FC
+ #FF6200EE
+ #FF3700B3
+ #FF03DAC5
+ #FF018786
+ #FF000000
+ #FFFFFFFF
+ #DDDDDD
+ #808080
+
+ #30CCF3
+ #72F877
+
+
\ No newline at end of file
diff --git a/app/src/main/res/values/strings.xml b/app/src/main/res/values/strings.xml
new file mode 100644
index 0000000..76e5295
--- /dev/null
+++ b/app/src/main/res/values/strings.xml
@@ -0,0 +1,33 @@
+
+ ToDo
+ 返回
+ 添加事项
+ 完成
+ 请输入标题
+ 请输入详细内容
+ 开始时间:
+ 结束时间:
+ 请选择
+ 详细内容
+ 保存
+ ToDO·登录
+ 请输入手机号或学号
+ 输入用户密码
+ 记住登录信息
+ 手机号登录
+ 学号登录
+ 登 录
+ 注 册
+ 代办清单
+ ToDo·注册
+ 输入用户名
+ 输入密码
+ 再次输入密码
+ 输入学号
+ 输入电话号码
+ 返回登录
+ 立即注册
+ 请选择待办类型
+ 是否启用定时通知
+
+
\ No newline at end of file
diff --git a/app/src/main/res/values/themes.xml b/app/src/main/res/values/themes.xml
new file mode 100644
index 0000000..21f51de
--- /dev/null
+++ b/app/src/main/res/values/themes.xml
@@ -0,0 +1,17 @@
+
+
+
+
\ No newline at end of file
diff --git a/app/src/test/java/com/example/aaa/ExampleUnitTest.java b/app/src/test/java/com/example/aaa/ExampleUnitTest.java
new file mode 100644
index 0000000..75dc472
--- /dev/null
+++ b/app/src/test/java/com/example/aaa/ExampleUnitTest.java
@@ -0,0 +1,17 @@
+package com.example.aaa;
+
+import org.junit.Test;
+
+import static org.junit.Assert.*;
+
+/**
+ * Example local unit test, which will execute on the development machine (host).
+ *
+ * @see Testing documentation
+ */
+public class ExampleUnitTest {
+ @Test
+ public void addition_isCorrect() {
+ assertEquals(4, 2 + 2);
+ }
+}
\ No newline at end of file
diff --git a/build.gradle b/build.gradle
new file mode 100644
index 0000000..2fcc7ef
--- /dev/null
+++ b/build.gradle
@@ -0,0 +1,9 @@
+// Top-level build file where you can add configuration options common to all sub-projects/modules.
+plugins {
+ id 'com.android.application' version '7.1.2' apply false
+ id 'com.android.library' version '7.1.2' apply false
+}
+
+task clean(type: Delete) {
+ delete rootProject.buildDir
+}
\ No newline at end of file
diff --git a/gradle.properties b/gradle.properties
new file mode 100644
index 0000000..dab7c28
--- /dev/null
+++ b/gradle.properties
@@ -0,0 +1,21 @@
+# Project-wide Gradle settings.
+# IDE (e.g. Android Studio) users:
+# Gradle settings configured through the IDE *will override*
+# any settings specified in this file.
+# For more details on how to configure your build environment visit
+# http://www.gradle.org/docs/current/userguide/build_environment.html
+# Specifies the JVM arguments used for the daemon process.
+# The setting is particularly useful for tweaking memory settings.
+org.gradle.jvmargs=-Xmx2048m -Dfile.encoding=UTF-8
+# When configured, Gradle will run in incubating parallel mode.
+# This option should only be used with decoupled projects. More details, visit
+# http://www.gradle.org/docs/current/userguide/multi_project_builds.html#sec:decoupled_projects
+# org.gradle.parallel=true
+# AndroidX package structure to make it clearer which packages are bundled with the
+# Android operating system, and which are packaged with your app"s APK
+# https://developer.android.com/topic/libraries/support-library/androidx-rn
+android.useAndroidX=true
+# Enables namespacing of each library's R class so that its R class includes only the
+# resources declared in the library itself and none from the library's dependencies,
+# thereby reducing the size of the R class for that library
+android.nonTransitiveRClass=true
\ No newline at end of file
diff --git a/gradle/wrapper/gradle-wrapper.jar b/gradle/wrapper/gradle-wrapper.jar
new file mode 100644
index 0000000..e708b1c
Binary files /dev/null and b/gradle/wrapper/gradle-wrapper.jar differ
diff --git a/gradle/wrapper/gradle-wrapper.properties b/gradle/wrapper/gradle-wrapper.properties
new file mode 100644
index 0000000..0d13669
--- /dev/null
+++ b/gradle/wrapper/gradle-wrapper.properties
@@ -0,0 +1,6 @@
+#Wed Jun 08 16:37:53 CST 2022
+distributionBase=GRADLE_USER_HOME
+distributionUrl=https\://mirrors.cloud.tencent.com/gradle/gradle-7.2-bin.zip
+distributionPath=wrapper/dists
+zipStorePath=wrapper/dists
+zipStoreBase=GRADLE_USER_HOME
diff --git a/gradlew b/gradlew
new file mode 100644
index 0000000..4f906e0
--- /dev/null
+++ b/gradlew
@@ -0,0 +1,185 @@
+#!/usr/bin/env sh
+
+#
+# Copyright 2015 the original author or authors.
+#
+# 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
+#
+# https://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.
+#
+
+##############################################################################
+##
+## Gradle start up script for UN*X
+##
+##############################################################################
+
+# Attempt to set APP_HOME
+# Resolve links: $0 may be a link
+PRG="$0"
+# Need this for relative symlinks.
+while [ -h "$PRG" ] ; do
+ ls=`ls -ld "$PRG"`
+ link=`expr "$ls" : '.*-> \(.*\)$'`
+ if expr "$link" : '/.*' > /dev/null; then
+ PRG="$link"
+ else
+ PRG=`dirname "$PRG"`"/$link"
+ fi
+done
+SAVED="`pwd`"
+cd "`dirname \"$PRG\"`/" >/dev/null
+APP_HOME="`pwd -P`"
+cd "$SAVED" >/dev/null
+
+APP_NAME="Gradle"
+APP_BASE_NAME=`basename "$0"`
+
+# Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
+DEFAULT_JVM_OPTS='"-Xmx64m" "-Xms64m"'
+
+# Use the maximum available, or set MAX_FD != -1 to use that value.
+MAX_FD="maximum"
+
+warn () {
+ echo "$*"
+}
+
+die () {
+ echo
+ echo "$*"
+ echo
+ exit 1
+}
+
+# OS specific support (must be 'true' or 'false').
+cygwin=false
+msys=false
+darwin=false
+nonstop=false
+case "`uname`" in
+ CYGWIN* )
+ cygwin=true
+ ;;
+ Darwin* )
+ darwin=true
+ ;;
+ MINGW* )
+ msys=true
+ ;;
+ NONSTOP* )
+ nonstop=true
+ ;;
+esac
+
+CLASSPATH=$APP_HOME/gradle/wrapper/gradle-wrapper.jar
+
+
+# Determine the Java command to use to start the JVM.
+if [ -n "$JAVA_HOME" ] ; then
+ if [ -x "$JAVA_HOME/jre/sh/java" ] ; then
+ # IBM's JDK on AIX uses strange locations for the executables
+ JAVACMD="$JAVA_HOME/jre/sh/java"
+ else
+ JAVACMD="$JAVA_HOME/bin/java"
+ fi
+ if [ ! -x "$JAVACMD" ] ; then
+ die "ERROR: JAVA_HOME is set to an invalid directory: $JAVA_HOME
+
+Please set the JAVA_HOME variable in your environment to match the
+location of your Java installation."
+ fi
+else
+ JAVACMD="java"
+ which java >/dev/null 2>&1 || die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.
+
+Please set the JAVA_HOME variable in your environment to match the
+location of your Java installation."
+fi
+
+# Increase the maximum file descriptors if we can.
+if [ "$cygwin" = "false" -a "$darwin" = "false" -a "$nonstop" = "false" ] ; then
+ MAX_FD_LIMIT=`ulimit -H -n`
+ if [ $? -eq 0 ] ; then
+ if [ "$MAX_FD" = "maximum" -o "$MAX_FD" = "max" ] ; then
+ MAX_FD="$MAX_FD_LIMIT"
+ fi
+ ulimit -n $MAX_FD
+ if [ $? -ne 0 ] ; then
+ warn "Could not set maximum file descriptor limit: $MAX_FD"
+ fi
+ else
+ warn "Could not query maximum file descriptor limit: $MAX_FD_LIMIT"
+ fi
+fi
+
+# For Darwin, add options to specify how the application appears in the dock
+if $darwin; then
+ GRADLE_OPTS="$GRADLE_OPTS \"-Xdock:name=$APP_NAME\" \"-Xdock:icon=$APP_HOME/media/gradle.icns\""
+fi
+
+# For Cygwin or MSYS, switch paths to Windows format before running java
+if [ "$cygwin" = "true" -o "$msys" = "true" ] ; then
+ APP_HOME=`cygpath --path --mixed "$APP_HOME"`
+ CLASSPATH=`cygpath --path --mixed "$CLASSPATH"`
+
+ JAVACMD=`cygpath --unix "$JAVACMD"`
+
+ # We build the pattern for arguments to be converted via cygpath
+ ROOTDIRSRAW=`find -L / -maxdepth 1 -mindepth 1 -type d 2>/dev/null`
+ SEP=""
+ for dir in $ROOTDIRSRAW ; do
+ ROOTDIRS="$ROOTDIRS$SEP$dir"
+ SEP="|"
+ done
+ OURCYGPATTERN="(^($ROOTDIRS))"
+ # Add a user-defined pattern to the cygpath arguments
+ if [ "$GRADLE_CYGPATTERN" != "" ] ; then
+ OURCYGPATTERN="$OURCYGPATTERN|($GRADLE_CYGPATTERN)"
+ fi
+ # Now convert the arguments - kludge to limit ourselves to /bin/sh
+ i=0
+ for arg in "$@" ; do
+ CHECK=`echo "$arg"|egrep -c "$OURCYGPATTERN" -`
+ CHECK2=`echo "$arg"|egrep -c "^-"` ### Determine if an option
+
+ if [ $CHECK -ne 0 ] && [ $CHECK2 -eq 0 ] ; then ### Added a condition
+ eval `echo args$i`=`cygpath --path --ignore --mixed "$arg"`
+ else
+ eval `echo args$i`="\"$arg\""
+ fi
+ i=`expr $i + 1`
+ done
+ case $i in
+ 0) set -- ;;
+ 1) set -- "$args0" ;;
+ 2) set -- "$args0" "$args1" ;;
+ 3) set -- "$args0" "$args1" "$args2" ;;
+ 4) set -- "$args0" "$args1" "$args2" "$args3" ;;
+ 5) set -- "$args0" "$args1" "$args2" "$args3" "$args4" ;;
+ 6) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" ;;
+ 7) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" ;;
+ 8) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" ;;
+ 9) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" "$args8" ;;
+ esac
+fi
+
+# Escape application args
+save () {
+ for i do printf %s\\n "$i" | sed "s/'/'\\\\''/g;1s/^/'/;\$s/\$/' \\\\/" ; done
+ echo " "
+}
+APP_ARGS=`save "$@"`
+
+# Collect all arguments for the java command, following the shell quoting and substitution rules
+eval set -- $DEFAULT_JVM_OPTS $JAVA_OPTS $GRADLE_OPTS "\"-Dorg.gradle.appname=$APP_BASE_NAME\"" -classpath "\"$CLASSPATH\"" org.gradle.wrapper.GradleWrapperMain "$APP_ARGS"
+
+exec "$JAVACMD" "$@"
diff --git a/gradlew.bat b/gradlew.bat
new file mode 100644
index 0000000..107acd3
--- /dev/null
+++ b/gradlew.bat
@@ -0,0 +1,89 @@
+@rem
+@rem Copyright 2015 the original author or authors.
+@rem
+@rem Licensed under the Apache License, Version 2.0 (the "License");
+@rem you may not use this file except in compliance with the License.
+@rem You may obtain a copy of the License at
+@rem
+@rem https://www.apache.org/licenses/LICENSE-2.0
+@rem
+@rem Unless required by applicable law or agreed to in writing, software
+@rem distributed under the License is distributed on an "AS IS" BASIS,
+@rem WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+@rem See the License for the specific language governing permissions and
+@rem limitations under the License.
+@rem
+
+@if "%DEBUG%" == "" @echo off
+@rem ##########################################################################
+@rem
+@rem Gradle startup script for Windows
+@rem
+@rem ##########################################################################
+
+@rem Set local scope for the variables with windows NT shell
+if "%OS%"=="Windows_NT" setlocal
+
+set DIRNAME=%~dp0
+if "%DIRNAME%" == "" set DIRNAME=.
+set APP_BASE_NAME=%~n0
+set APP_HOME=%DIRNAME%
+
+@rem Resolve any "." and ".." in APP_HOME to make it shorter.
+for %%i in ("%APP_HOME%") do set APP_HOME=%%~fi
+
+@rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
+set DEFAULT_JVM_OPTS="-Xmx64m" "-Xms64m"
+
+@rem Find java.exe
+if defined JAVA_HOME goto findJavaFromJavaHome
+
+set JAVA_EXE=java.exe
+%JAVA_EXE% -version >NUL 2>&1
+if "%ERRORLEVEL%" == "0" goto execute
+
+echo.
+echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.
+echo.
+echo Please set the JAVA_HOME variable in your environment to match the
+echo location of your Java installation.
+
+goto fail
+
+:findJavaFromJavaHome
+set JAVA_HOME=%JAVA_HOME:"=%
+set JAVA_EXE=%JAVA_HOME%/bin/java.exe
+
+if exist "%JAVA_EXE%" goto execute
+
+echo.
+echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME%
+echo.
+echo Please set the JAVA_HOME variable in your environment to match the
+echo location of your Java installation.
+
+goto fail
+
+:execute
+@rem Setup the command line
+
+set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar
+
+
+@rem Execute Gradle
+"%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" org.gradle.wrapper.GradleWrapperMain %*
+
+:end
+@rem End local scope for the variables with windows NT shell
+if "%ERRORLEVEL%"=="0" goto mainEnd
+
+:fail
+rem Set variable GRADLE_EXIT_CONSOLE if you need the _script_ return code instead of
+rem the _cmd.exe /c_ return code!
+if not "" == "%GRADLE_EXIT_CONSOLE%" exit 1
+exit /b 1
+
+:mainEnd
+if "%OS%"=="Windows_NT" endlocal
+
+:omega
diff --git a/settings.gradle b/settings.gradle
new file mode 100644
index 0000000..d443c47
--- /dev/null
+++ b/settings.gradle
@@ -0,0 +1,16 @@
+pluginManagement {
+ repositories {
+ gradlePluginPortal()
+ google()
+ mavenCentral()
+ }
+}
+dependencyResolutionManagement {
+ repositoriesMode.set(RepositoriesMode.FAIL_ON_PROJECT_REPOS)
+ repositories {
+ google()
+ mavenCentral()
+ }
+}
+rootProject.name = "AAA"
+include ':app'