() {
851 | @Override
852 | public int compare(Plan o1, Plan o2) {
853 | try {
854 | if (mode == 1)
855 | return ChangeLong(calStrToSec(o1.getTime()) - calStrToSec(o2.getTime()));
856 | else if (mode == 2) //reverseSort
857 | return ChangeLong(calStrToSec(o2.getTime()) - calStrToSec(o1.getTime()));
858 | } catch (java.text.ParseException e) {
859 | e.printStackTrace();
860 | }
861 | return 1;
862 | }
863 | });
864 | }
865 | public long calStrToSec(String date) throws java.text.ParseException {
866 | java.text.SimpleDateFormat format = new java.text.SimpleDateFormat("yyyy-MM-dd HH:mm");
867 | long secTime = Objects.requireNonNull(format.parse(date)).getTime();
868 | return secTime;
869 | }
870 | }
--------------------------------------------------------------------------------
/app/src/main/java/com/example/notebook/MyIntentService.java:
--------------------------------------------------------------------------------
1 | package com.example.notebook;
2 |
3 | import android.app.IntentService;
4 | import android.content.Intent;
5 | import android.media.MediaPlayer;
6 |
7 |
8 | /**
9 | * An {@link IntentService} subclass for handling asynchronous task requests in
10 | * a service on a separate handler thread.
11 | *
12 | * TODO: Customize class - update intent actions and extra parameters.
13 | */
14 | public class MyIntentService extends IntentService {
15 | // TODO: Rename actions, choose action names that describe tasks that this
16 | // IntentService can perform, e.g. ACTION_FETCH_NEW_ITEMS
17 | public static final String ACTION_FOO = "com.example.notebook.action.FOO";
18 | public static final String ACTION_BAZ = "com.example.notebook.action.BAZ";
19 |
20 | // action声明 这里有五个背景音乐
21 | public static final String ACTION_MUSIC_1 = "com.example.notebook.action.music1";
22 | public static final String ACTION_MUSIC_2 = "com.example.notebook.action.music2";
23 | public static final String ACTION_MUSIC_3 = "com.example.notebook.action.music3";
24 | public static final String ACTION_MUSIC_4 = "com.example.notebook.action.music4";
25 | public static final String ACTION_MUSIC_5 = "com.example.notebook.action.music5";
26 | public static final String ACTION_MUSIC_6 = "com.example.notebook.action.music6";
27 |
28 | // TODO: Rename parameters
29 | public static final String EXTRA_PARAM1 = "com.example.notebook.extra.PARAM1";
30 | public static final String EXTRA_PARAM2 = "com.example.notebook.extra.PARAM2";
31 |
32 | // 声明MediaPlayer对象
33 | private static MediaPlayer mediaPlayer;
34 |
35 | public MyIntentService() {
36 | super("MyIntentService");
37 | }
38 |
39 | @Override
40 | protected void onHandleIntent(Intent intent) {
41 | final String action = intent.getAction();
42 | if (intent != null) {
43 | if (ACTION_FOO.equals(action)) {
44 | final String param1 = intent.getStringExtra(EXTRA_PARAM1);
45 | final String param2 = intent.getStringExtra(EXTRA_PARAM2);
46 | handleActionFoo(param1, param2);
47 | } else if (ACTION_BAZ.equals(action)) {
48 | final String param1 = intent.getStringExtra(EXTRA_PARAM1);
49 | final String param2 = intent.getStringExtra(EXTRA_PARAM2);
50 | handleActionBaz(param1, param2);
51 | }
52 |
53 | // 根据intent设置的action来执行对应服务的操作
54 | if (ACTION_MUSIC_1.equals(action)){
55 | handleActionMusic1();
56 | }else if (ACTION_MUSIC_2.equals(action)){
57 | handleActionMusic2();
58 | }else if (ACTION_MUSIC_3.equals(action)){
59 | handleActionMusic3();
60 | }else if (ACTION_MUSIC_4.equals(action)){
61 | handleActionMusic4();
62 | }else if (ACTION_MUSIC_5.equals(action)){
63 | handleActionMusic5();
64 | }else if (ACTION_MUSIC_6.equals(action)){
65 | handleActionMusic6();
66 | }
67 | }
68 | }
69 |
70 | /**
71 | * 该服务执行的操作用来播放背景音乐
72 | */
73 | private void handleActionMusic1() {
74 | if(mediaPlayer != null) mediaPlayer.stop();
75 | // 根据音乐资源文件创建MediaPlayer对象 设置循环播放属性 开始播放
76 | mediaPlayer = MediaPlayer.create(this, R.raw.run);
77 | mediaPlayer.setLooping(true);
78 | mediaPlayer.start();
79 | }
80 | private void handleActionMusic2() {
81 | if(mediaPlayer != null) mediaPlayer.stop();
82 | // 根据音乐资源文件创建MediaPlayer对象 设置循环播放属性 开始播放
83 | mediaPlayer = MediaPlayer.create(this, R.raw.dream_wedding);
84 | mediaPlayer.setLooping(true);
85 | mediaPlayer.start();
86 | }
87 | private void handleActionMusic3() {
88 | if(mediaPlayer != null) mediaPlayer.stop();
89 | // 根据音乐资源文件创建MediaPlayer对象 设置循环播放属性 开始播放
90 | mediaPlayer = MediaPlayer.create(this, R.raw.be_quiet);
91 | mediaPlayer.setLooping(true);
92 | mediaPlayer.start();
93 | }
94 | private void handleActionMusic4() {
95 | if(mediaPlayer != null) mediaPlayer.stop();
96 | // 根据音乐资源文件创建MediaPlayer对象 设置循环播放属性 开始播放
97 | mediaPlayer = MediaPlayer.create(this, R.raw.girly_heart);
98 | mediaPlayer.setLooping(true);
99 | mediaPlayer.start();
100 | }
101 | private void handleActionMusic5() {
102 | if(mediaPlayer != null) mediaPlayer.stop();
103 | // 根据音乐资源文件创建MediaPlayer对象 设置循环播放属性 开始播放
104 | mediaPlayer = MediaPlayer.create(this, R.raw.sword_fairy);
105 | mediaPlayer.setLooping(true);
106 | mediaPlayer.start();
107 | }
108 | private void handleActionMusic6() {
109 | if(mediaPlayer != null) mediaPlayer.stop();
110 | // 根据音乐资源文件创建MediaPlayer对象 设置循环播放属性 开始播放
111 | mediaPlayer = MediaPlayer.create(this, R.raw.perfect_encounter);
112 | mediaPlayer.setLooping(true);
113 | mediaPlayer.start();
114 | }
115 |
116 |
117 | /**
118 | * Handle action Foo in the provided background thread with the provided
119 | * parameters.
120 | */
121 | private void handleActionFoo(String param1, String param2) {
122 | // TODO: Handle action Foo
123 | throw new UnsupportedOperationException("Not yet implemented");
124 | }
125 |
126 | /**
127 | * Handle action Baz in the provided background thread with the provided
128 | * parameters.
129 | */
130 | private void handleActionBaz(String param1, String param2) {
131 | // TODO: Handle action Baz
132 | throw new UnsupportedOperationException("Not yet implemented");
133 | }
134 | }
135 |
136 |
--------------------------------------------------------------------------------
/app/src/main/java/com/example/notebook/Note.java:
--------------------------------------------------------------------------------
1 | package com.example.notebook;
2 |
3 | public class Note {
4 | private long id;
5 | private String content;
6 | private String time;
7 | private int tag;
8 |
9 | public Note() {
10 | }
11 |
12 | public Note(String content, String time, int tag) {
13 | this.content = content;
14 | this.time = time;
15 | this.tag = tag;
16 | }
17 | public long getId() {
18 | return id;
19 | }
20 |
21 | //返回笔记的内容
22 | public String getContent() {
23 | return content;
24 | }
25 |
26 | public String getTime() {
27 | return time;
28 | }
29 |
30 | public void setId(long id) {
31 | this.id = id;
32 | }
33 |
34 | public void setContent(String content) {
35 | this.content = content;
36 | }
37 |
38 | public void setTime(String time) {
39 | this.time = time;
40 | }
41 |
42 |
43 | public int getTag() {
44 | return tag;
45 | }
46 |
47 | public void setTag(int tag) {
48 | this.tag = tag;
49 | }
50 |
51 | @Override
52 | public String toString() {
53 | return content + "\n" + time.substring(5,16) + " "+ id;
54 | }
55 | }
56 |
--------------------------------------------------------------------------------
/app/src/main/java/com/example/notebook/NoteAdapter.java:
--------------------------------------------------------------------------------
1 | package com.example.notebook;
2 |
3 | import android.content.Context;
4 | import android.text.TextUtils;
5 | import android.view.View;
6 | import android.view.ViewGroup;
7 | import android.widget.BaseAdapter;
8 | import android.widget.Filter;
9 | import android.widget.Filterable;
10 | import android.widget.TextView;
11 |
12 | import java.util.ArrayList;
13 | import java.util.List;
14 |
15 | public class NoteAdapter extends BaseAdapter implements Filterable {
16 | private Context mContext;
17 |
18 | private List backList;//用来备份原始数据
19 | private List noteList;//这个数据是会改变的,所以要有个变量来备份一下原始数据
20 | private MyFilter mFilter;
21 |
22 | public NoteAdapter(Context mContext, List noteList) {
23 | this.mContext = mContext;
24 | this.noteList = noteList;
25 | backList = noteList;
26 | }
27 |
28 | @Override
29 | public int getCount() {
30 | return noteList.size();
31 | }
32 |
33 | @Override
34 | public Object getItem(int position) {
35 | return noteList.get(position);
36 | }
37 |
38 | @Override
39 | public long getItemId(int position) {
40 | return position;
41 | }
42 |
43 | @Override
44 | public View getView(int position, View convertView, ViewGroup parent) {
45 | mContext.setTheme(R.style.AppTheme);
46 | View v = View.inflate(mContext, R.layout.note_layout, null);
47 | TextView tv_content = v.findViewById(R.id.tv_content);
48 | TextView tv_time = v.findViewById(R.id.tv_time);
49 |
50 | //设置文本到TextView
51 | String allText = noteList.get(position).getContent();
52 | tv_content.setText(allText);
53 | tv_time.setText(noteList.get(position).getTime());
54 |
55 | //存储笔记到tag
56 | v.setTag(noteList.get(position).getId());
57 |
58 | return v;
59 | }
60 |
61 | @Override
62 | public Filter getFilter() {
63 | if (mFilter ==null){
64 | mFilter = new MyFilter();
65 | }
66 | return mFilter;
67 | }
68 |
69 |
70 | class MyFilter extends Filter {
71 | //在performFiltering这个方法中定义过滤规则
72 | @Override
73 | protected FilterResults performFiltering(CharSequence charSequence) {
74 | FilterResults result = new FilterResults();
75 | List list;
76 | if (TextUtils.isEmpty(charSequence)) { //当过滤的关键字为空的时候,则显示所有的数据
77 | list = backList;
78 | } else { //否则把符合条件的数据对象添加到集合中
79 | list = new ArrayList<>();
80 | for (Note note : backList) {
81 | if (note.getContent().contains(charSequence)) {
82 | list.add(note);
83 | }
84 |
85 | }
86 | }
87 | result.values = list; //将得到的集合保存到FilterResults的value变量中
88 | result.count = list.size();//将集合的大小保存到FilterResults的count变量中
89 |
90 | return result;
91 | }
92 | //在publishResults方法中告诉适配器更新界面
93 | @Override
94 | protected void publishResults(CharSequence charSequence, FilterResults filterResults) {
95 | noteList = (List)filterResults.values;
96 | if (filterResults.count>0){
97 | notifyDataSetChanged();//通知数据发生了改变
98 | }else {
99 | notifyDataSetInvalidated();//通知数据失效
100 | }
101 | }
102 | }
103 | }
104 |
--------------------------------------------------------------------------------
/app/src/main/java/com/example/notebook/NoteDatabase.java:
--------------------------------------------------------------------------------
1 | package com.example.notebook;
2 |
3 | import android.content.Context;
4 | import android.database.sqlite.SQLiteDatabase;
5 | import android.database.sqlite.SQLiteOpenHelper;
6 |
7 |
8 | public class NoteDatabase extends SQLiteOpenHelper {
9 |
10 | public static final String TABLE_NAME = "notes";
11 | public static final String CONTENT = "content";
12 | public static final String ID = "_id";
13 | public static final String TIME = "time";
14 | public static final String MODE = "mode";
15 |
16 | public NoteDatabase(Context context){
17 | super(context, "notes", null, 1);
18 | }
19 |
20 | @Override
21 | public void onCreate(SQLiteDatabase db) {
22 | db.execSQL("CREATE TABLE "+ TABLE_NAME
23 | + "("
24 | + ID + " INTEGER PRIMARY KEY AUTOINCREMENT,"
25 | + CONTENT + " TEXT NOT NULL,"
26 | + TIME + " TEXT NOT NULL,"
27 | + MODE + " INTEGER DEFAULT 1)"
28 | );
29 | }
30 |
31 | @Override
32 | public void onUpgrade(SQLiteDatabase db, int oldVersion, int newVersion) {
33 |
34 | }
35 | }
36 |
--------------------------------------------------------------------------------
/app/src/main/res/anim/in_lefttoright.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
8 |
--------------------------------------------------------------------------------
/app/src/main/res/anim/in_righttoleft.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
7 |
--------------------------------------------------------------------------------
/app/src/main/res/anim/in_slow.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
8 |
--------------------------------------------------------------------------------
/app/src/main/res/anim/night_switch.xml:
--------------------------------------------------------------------------------
1 |
2 |
7 |
8 |
--------------------------------------------------------------------------------
/app/src/main/res/anim/night_switch_over.xml:
--------------------------------------------------------------------------------
1 |
2 |
7 |
8 |
--------------------------------------------------------------------------------
/app/src/main/res/anim/no.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
--------------------------------------------------------------------------------
/app/src/main/res/anim/out_lefttoright.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
7 |
--------------------------------------------------------------------------------
/app/src/main/res/anim/out_righttoleft.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
8 |
--------------------------------------------------------------------------------
/app/src/main/res/anim/out_slow.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
8 |
--------------------------------------------------------------------------------
/app/src/main/res/drawable-v24/alarm_24.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Southpost/NoteBook/2182961b3922e4b0b65cee30e4d25fad3ce9abee/app/src/main/res/drawable-v24/alarm_24.png
--------------------------------------------------------------------------------
/app/src/main/res/drawable-v24/bgd.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Southpost/NoteBook/2182961b3922e4b0b65cee30e4d25fad3ce9abee/app/src/main/res/drawable-v24/bgd.jpg
--------------------------------------------------------------------------------
/app/src/main/res/drawable-v24/ic_launcher_foreground.xml:
--------------------------------------------------------------------------------
1 |
7 |
8 |
9 |
15 |
18 |
21 |
22 |
23 |
24 |
30 |
--------------------------------------------------------------------------------
/app/src/main/res/drawable-v24/music_collection.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Southpost/NoteBook/2182961b3922e4b0b65cee30e4d25fad3ce9abee/app/src/main/res/drawable-v24/music_collection.png
--------------------------------------------------------------------------------
/app/src/main/res/drawable-v24/note_shape.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | -
6 |
7 |
8 |
9 |
10 |
11 | -
12 |
13 |
14 |
15 |
16 |
17 |
18 |
--------------------------------------------------------------------------------
/app/src/main/res/drawable-v24/skin.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Southpost/NoteBook/2182961b3922e4b0b65cee30e4d25fad3ce9abee/app/src/main/res/drawable-v24/skin.png
--------------------------------------------------------------------------------
/app/src/main/res/drawable-v24/tomato.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Southpost/NoteBook/2182961b3922e4b0b65cee30e4d25fad3ce9abee/app/src/main/res/drawable-v24/tomato.png
--------------------------------------------------------------------------------
/app/src/main/res/drawable/ic_baseline_add_24.xml:
--------------------------------------------------------------------------------
1 |
4 |
5 |
6 |
--------------------------------------------------------------------------------
/app/src/main/res/drawable/ic_baseline_add_circle_outline_24.xml:
--------------------------------------------------------------------------------
1 |
7 |
10 |
11 |
--------------------------------------------------------------------------------
/app/src/main/res/drawable/ic_baseline_create_24.xml:
--------------------------------------------------------------------------------
1 |
4 |
5 |
6 |
--------------------------------------------------------------------------------
/app/src/main/res/drawable/ic_baseline_delete_24.xml:
--------------------------------------------------------------------------------
1 |
7 |
10 |
11 |
--------------------------------------------------------------------------------
/app/src/main/res/drawable/ic_baseline_keyboard_voice_24.xml:
--------------------------------------------------------------------------------
1 |
4 |
5 |
6 |
--------------------------------------------------------------------------------
/app/src/main/res/drawable/ic_baseline_library_music_24.xml:
--------------------------------------------------------------------------------
1 |
4 |
5 |
6 |
--------------------------------------------------------------------------------
/app/src/main/res/drawable/ic_baseline_list_24.xml:
--------------------------------------------------------------------------------
1 |
7 |
10 |
11 |
--------------------------------------------------------------------------------
/app/src/main/res/drawable/ic_baseline_menu_book_24.xml:
--------------------------------------------------------------------------------
1 |
4 |
5 |
6 |
7 |
8 |
9 |
--------------------------------------------------------------------------------
/app/src/main/res/drawable/ic_baseline_search_24.xml:
--------------------------------------------------------------------------------
1 |
7 |
10 |
11 |
--------------------------------------------------------------------------------
/app/src/main/res/drawable/ic_baseline_settings_24.xml:
--------------------------------------------------------------------------------
1 |
7 |
10 |
11 |
--------------------------------------------------------------------------------
/app/src/main/res/drawable/ic_create_24.xml:
--------------------------------------------------------------------------------
1 |
6 |
9 |
10 |
--------------------------------------------------------------------------------
/app/src/main/res/drawable/ic_delete_all_24.xml:
--------------------------------------------------------------------------------
1 |
7 |
10 |
11 |
--------------------------------------------------------------------------------
/app/src/main/res/drawable/ic_error_outline_black_24dp.xml:
--------------------------------------------------------------------------------
1 |
4 |
5 |
6 |
--------------------------------------------------------------------------------
/app/src/main/res/drawable/ic_keyboard_arrow_left_black_24dp.xml:
--------------------------------------------------------------------------------
1 |
6 |
9 |
10 |
--------------------------------------------------------------------------------
/app/src/main/res/drawable/ic_launcher_background.xml:
--------------------------------------------------------------------------------
1 |
2 |
7 |
10 |
15 |
20 |
25 |
30 |
35 |
40 |
45 |
50 |
55 |
60 |
65 |
70 |
75 |
80 |
85 |
90 |
95 |
100 |
105 |
110 |
115 |
120 |
125 |
130 |
135 |
140 |
145 |
150 |
155 |
160 |
165 |
170 |
171 |
--------------------------------------------------------------------------------
/app/src/main/res/drawable/ic_menu_24.xml:
--------------------------------------------------------------------------------
1 |
4 |
5 |
6 |
--------------------------------------------------------------------------------
/app/src/main/res/drawable/ic_menu_black_24dp.xml:
--------------------------------------------------------------------------------
1 |
6 |
9 |
10 |
--------------------------------------------------------------------------------
/app/src/main/res/drawable/ic_notifications_black_24dp.xml:
--------------------------------------------------------------------------------
1 |
6 |
9 |
10 |
--------------------------------------------------------------------------------
/app/src/main/res/drawable/red_alarm_24dp.xml:
--------------------------------------------------------------------------------
1 |
4 |
5 |
6 |
7 |
--------------------------------------------------------------------------------
/app/src/main/res/drawable/top_button_shap.xml:
--------------------------------------------------------------------------------
1 |
2 |
4 |
5 |
6 |
--------------------------------------------------------------------------------
/app/src/main/res/layout/activity_edit.xml:
--------------------------------------------------------------------------------
1 |
2 |
12 |
13 |
22 |
23 |
30 |
31 |
35 |
42 |
49 |
50 |
51 |
--------------------------------------------------------------------------------
/app/src/main/res/layout/activity_handwriting.xml:
--------------------------------------------------------------------------------
1 |
2 |
8 |
9 |
10 |
17 |
18 |
25 |
26 |
27 |
28 |
36 |
37 |
45 |
46 |
47 |
--------------------------------------------------------------------------------
/app/src/main/res/layout/activity_main.xml:
--------------------------------------------------------------------------------
1 |
2 |
12 |
13 |
14 |
29 |
30 |
43 |
56 |
57 |
71 |
84 |
85 |
89 |
90 |
99 |
103 |
118 |
119 |
120 |
121 |
126 |
127 |
138 |
139 |
140 |
145 |
155 |
156 |
157 |
158 |
--------------------------------------------------------------------------------
/app/src/main/res/layout/edit_alarm_layout.xml:
--------------------------------------------------------------------------------
1 |
2 |
10 |
11 |
21 |
22 |
28 |
39 |
43 |
48 |
56 |
63 |
64 |
69 |
77 |
84 |
85 |
86 |
96 |
97 |
98 |
--------------------------------------------------------------------------------
/app/src/main/res/layout/note_layout.xml:
--------------------------------------------------------------------------------
1 |
2 |
12 |
13 |
21 |
22 |
29 |
30 |
--------------------------------------------------------------------------------
/app/src/main/res/layout/plan_layout.xml:
--------------------------------------------------------------------------------
1 |
2 |
12 |
13 |
17 |
26 |
34 |
35 |
36 |
44 |
--------------------------------------------------------------------------------
/app/src/main/res/layout/setting_cover.xml:
--------------------------------------------------------------------------------
1 |
2 |
5 |
9 |
10 |
11 |
--------------------------------------------------------------------------------
/app/src/main/res/layout/setting_layout.xml:
--------------------------------------------------------------------------------
1 |
2 |
7 |
16 |
23 |
28 |
35 |
45 |
46 |
51 |
55 |
56 |
57 |
58 |
--------------------------------------------------------------------------------
/app/src/main/res/layout/usersetting_layout.xml:
--------------------------------------------------------------------------------
1 |
2 |
8 |
9 |
19 |
24 |
29 |
35 |
41 |
42 |
43 |
53 |
54 |
55 |
--------------------------------------------------------------------------------
/app/src/main/res/menu/edit_menu.xml:
--------------------------------------------------------------------------------
1 |
2 |
--------------------------------------------------------------------------------
/app/src/main/res/menu/main_menu.xml:
--------------------------------------------------------------------------------
1 |
2 |
--------------------------------------------------------------------------------
/app/src/main/res/menu/memo_menu.xml:
--------------------------------------------------------------------------------
1 |
2 |
--------------------------------------------------------------------------------
/app/src/main/res/mipmap-anydpi-v26/ic_launcher.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
--------------------------------------------------------------------------------
/app/src/main/res/mipmap-anydpi-v26/ic_launcher_round.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
--------------------------------------------------------------------------------
/app/src/main/res/mipmap-hdpi/ic_launcher.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Southpost/NoteBook/2182961b3922e4b0b65cee30e4d25fad3ce9abee/app/src/main/res/mipmap-hdpi/ic_launcher.png
--------------------------------------------------------------------------------
/app/src/main/res/mipmap-hdpi/ic_launcher_round.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Southpost/NoteBook/2182961b3922e4b0b65cee30e4d25fad3ce9abee/app/src/main/res/mipmap-hdpi/ic_launcher_round.png
--------------------------------------------------------------------------------
/app/src/main/res/mipmap-mdpi/ic_launcher.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Southpost/NoteBook/2182961b3922e4b0b65cee30e4d25fad3ce9abee/app/src/main/res/mipmap-mdpi/ic_launcher.png
--------------------------------------------------------------------------------
/app/src/main/res/mipmap-mdpi/ic_launcher_round.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Southpost/NoteBook/2182961b3922e4b0b65cee30e4d25fad3ce9abee/app/src/main/res/mipmap-mdpi/ic_launcher_round.png
--------------------------------------------------------------------------------
/app/src/main/res/mipmap-mdpi/main1.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Southpost/NoteBook/2182961b3922e4b0b65cee30e4d25fad3ce9abee/app/src/main/res/mipmap-mdpi/main1.png
--------------------------------------------------------------------------------
/app/src/main/res/mipmap-xhdpi/ic_launcher.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Southpost/NoteBook/2182961b3922e4b0b65cee30e4d25fad3ce9abee/app/src/main/res/mipmap-xhdpi/ic_launcher.png
--------------------------------------------------------------------------------
/app/src/main/res/mipmap-xhdpi/ic_launcher_round.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Southpost/NoteBook/2182961b3922e4b0b65cee30e4d25fad3ce9abee/app/src/main/res/mipmap-xhdpi/ic_launcher_round.png
--------------------------------------------------------------------------------
/app/src/main/res/mipmap-xxhdpi/ic_launcher.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Southpost/NoteBook/2182961b3922e4b0b65cee30e4d25fad3ce9abee/app/src/main/res/mipmap-xxhdpi/ic_launcher.png
--------------------------------------------------------------------------------
/app/src/main/res/mipmap-xxhdpi/ic_launcher_round.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Southpost/NoteBook/2182961b3922e4b0b65cee30e4d25fad3ce9abee/app/src/main/res/mipmap-xxhdpi/ic_launcher_round.png
--------------------------------------------------------------------------------
/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Southpost/NoteBook/2182961b3922e4b0b65cee30e4d25fad3ce9abee/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png
--------------------------------------------------------------------------------
/app/src/main/res/mipmap-xxxhdpi/ic_launcher_round.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Southpost/NoteBook/2182961b3922e4b0b65cee30e4d25fad3ce9abee/app/src/main/res/mipmap-xxxhdpi/ic_launcher_round.png
--------------------------------------------------------------------------------
/app/src/main/res/raw/be_quiet.mp3:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Southpost/NoteBook/2182961b3922e4b0b65cee30e4d25fad3ce9abee/app/src/main/res/raw/be_quiet.mp3
--------------------------------------------------------------------------------
/app/src/main/res/raw/dream_wedding.mp3:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Southpost/NoteBook/2182961b3922e4b0b65cee30e4d25fad3ce9abee/app/src/main/res/raw/dream_wedding.mp3
--------------------------------------------------------------------------------
/app/src/main/res/raw/girly_heart.mp3:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Southpost/NoteBook/2182961b3922e4b0b65cee30e4d25fad3ce9abee/app/src/main/res/raw/girly_heart.mp3
--------------------------------------------------------------------------------
/app/src/main/res/raw/perfect_encounter.mp3:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Southpost/NoteBook/2182961b3922e4b0b65cee30e4d25fad3ce9abee/app/src/main/res/raw/perfect_encounter.mp3
--------------------------------------------------------------------------------
/app/src/main/res/raw/run.mp3:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Southpost/NoteBook/2182961b3922e4b0b65cee30e4d25fad3ce9abee/app/src/main/res/raw/run.mp3
--------------------------------------------------------------------------------
/app/src/main/res/raw/sword_fairy.mp3:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Southpost/NoteBook/2182961b3922e4b0b65cee30e4d25fad3ce9abee/app/src/main/res/raw/sword_fairy.mp3
--------------------------------------------------------------------------------
/app/src/main/res/values-v23/styles.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
29 |
--------------------------------------------------------------------------------
/app/src/main/res/values/attr.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
--------------------------------------------------------------------------------
/app/src/main/res/values/colors.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 | #ffffff
4 | #00574B
5 | #D81B60
6 |
7 | #ffbbbb
8 | #000000
9 | #3b3b3b
10 | #cccccc
11 | #999999
12 | #FAFAFA
13 | #ffffff
14 | #f3f3f3
15 | #00000000
16 | #d0000000
17 | #66000000
18 | #ffc129
19 | #19CAAD
20 | #8CC7B5
21 | #A0EEE1
22 | #BEE7E9
23 | #BEEDC7
24 | #D6D5B7
25 | #D1BA74
26 | #E6CEAC
27 | #ECAD9E
28 | #F4606C
29 | #C7EDCC
30 | #EE82EE
31 | #1E90FF
32 | #7FFFAA
33 | #FF69B4
34 | #B2000000
35 | #e5e5e5
36 | #808080
37 | #f1f1f1
38 | #e91e63
39 | #ec407a
40 | #805677fc
41 | #80738ffe
42 | #000000
43 |
44 |
--------------------------------------------------------------------------------
/app/src/main/res/values/strings.xml:
--------------------------------------------------------------------------------
1 |
2 | NoteBook
3 | 请输入日记内容
4 | 磊哥好丑
5 | 日记将自动保存
6 | MainActivity
7 | Home
8 | Memo
9 | Notifications
10 |
--------------------------------------------------------------------------------
/app/src/main/res/values/styles.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
29 |
33 |
44 |
45 |
56 |
--------------------------------------------------------------------------------
/app/src/test/java/com/example/notebook/ExampleUnitTest.java:
--------------------------------------------------------------------------------
1 | package com.example.notebook;
2 |
3 | import org.junit.Test;
4 |
5 | import static org.junit.Assert.*;
6 |
7 | /**
8 | * Example local unit run, which will execute on the development machine (host).
9 | *
10 | * @see Testing documentation
11 | */
12 | public class ExampleUnitTest {
13 | @Test
14 | public void addition_isCorrect() {
15 | assertEquals(4, 2 + 2);
16 | }
17 | }
--------------------------------------------------------------------------------
/build.gradle:
--------------------------------------------------------------------------------
1 | // Top-level build file where you can add configuration options common to all sub-projects/modules.
2 | buildscript {
3 | repositories {
4 | google()
5 | jcenter()
6 | }
7 | dependencies {
8 | classpath 'com.android.tools.build:gradle:4.1.2'
9 |
10 | // NOTE: Do not place your application dependencies here; they belong
11 | // in the individual module build.gradle files
12 | }
13 | }
14 |
15 | allprojects {
16 | repositories {
17 | google()
18 | jcenter()
19 | }
20 | }
21 |
22 | task clean(type: Delete) {
23 | delete rootProject.buildDir
24 | }
--------------------------------------------------------------------------------
/git:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Southpost/NoteBook/2182961b3922e4b0b65cee30e4d25fad3ce9abee/git
--------------------------------------------------------------------------------
/gradle.properties:
--------------------------------------------------------------------------------
1 | # Project-wide Gradle settings.
2 | # IDE (e.g. Android Studio) users:
3 | # Gradle settings configured through the IDE *will override*
4 | # any settings specified in this file.
5 | # For more details on how to configure your build environment visit
6 | # http://www.gradle.org/docs/current/userguide/build_environment.html
7 | # Specifies the JVM arguments used for the daemon process.
8 | # The setting is particularly useful for tweaking memory settings.
9 | org.gradle.jvmargs=-Xmx2048m
10 | # When configured, Gradle will run in incubating parallel mode.
11 | # This option should only be used with decoupled projects. More details, visit
12 | # http://www.gradle.org/docs/current/userguide/multi_project_builds.html#sec:decoupled_projects
13 | # org.gradle.parallel=true
14 | # AndroidX package structure to make it clearer which packages are bundled with the
15 | # Android operating system, and which are packaged with your app"s APK
16 | # https://developer.android.com/topic/libraries/support-library/androidx-rn
17 | android.useAndroidX=true
18 | # Automatically convert third-party libraries to use AndroidX
19 | android.enableJetifier=true
--------------------------------------------------------------------------------
/gradle/wrapper/gradle-wrapper.jar:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Southpost/NoteBook/2182961b3922e4b0b65cee30e4d25fad3ce9abee/gradle/wrapper/gradle-wrapper.jar
--------------------------------------------------------------------------------
/gradle/wrapper/gradle-wrapper.properties:
--------------------------------------------------------------------------------
1 | #Tue Apr 27 22:49:28 CST 2021
2 | distributionBase=GRADLE_USER_HOME
3 | distributionPath=wrapper/dists
4 | zipStoreBase=GRADLE_USER_HOME
5 | zipStorePath=wrapper/dists
6 | distributionUrl=https\://services.gradle.org/distributions/gradle-6.5-bin.zip
7 |
--------------------------------------------------------------------------------
/gradlew:
--------------------------------------------------------------------------------
1 | #!/usr/bin/env sh
2 |
3 | ##############################################################################
4 | ##
5 | ## Gradle start up script for UN*X
6 | ##
7 | ##############################################################################
8 |
9 | # Attempt to set APP_HOME
10 | # Resolve links: $0 may be a link
11 | PRG="$0"
12 | # Need this for relative symlinks.
13 | while [ -h "$PRG" ] ; do
14 | ls=`ls -ld "$PRG"`
15 | link=`expr "$ls" : '.*-> \(.*\)$'`
16 | if expr "$link" : '/.*' > /dev/null; then
17 | PRG="$link"
18 | else
19 | PRG=`dirname "$PRG"`"/$link"
20 | fi
21 | done
22 | SAVED="`pwd`"
23 | cd "`dirname \"$PRG\"`/" >/dev/null
24 | APP_HOME="`pwd -P`"
25 | cd "$SAVED" >/dev/null
26 |
27 | APP_NAME="Gradle"
28 | APP_BASE_NAME=`basename "$0"`
29 |
30 | # Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
31 | DEFAULT_JVM_OPTS=""
32 |
33 | # Use the maximum available, or set MAX_FD != -1 to use that value.
34 | MAX_FD="maximum"
35 |
36 | warn () {
37 | echo "$*"
38 | }
39 |
40 | die () {
41 | echo
42 | echo "$*"
43 | echo
44 | exit 1
45 | }
46 |
47 | # OS specific support (must be 'true' or 'false').
48 | cygwin=false
49 | msys=false
50 | darwin=false
51 | nonstop=false
52 | case "`uname`" in
53 | CYGWIN* )
54 | cygwin=true
55 | ;;
56 | Darwin* )
57 | darwin=true
58 | ;;
59 | MINGW* )
60 | msys=true
61 | ;;
62 | NONSTOP* )
63 | nonstop=true
64 | ;;
65 | esac
66 |
67 | CLASSPATH=$APP_HOME/gradle/wrapper/gradle-wrapper.jar
68 |
69 | # Determine the Java command to use to start the JVM.
70 | if [ -n "$JAVA_HOME" ] ; then
71 | if [ -x "$JAVA_HOME/jre/sh/java" ] ; then
72 | # IBM's JDK on AIX uses strange locations for the executables
73 | JAVACMD="$JAVA_HOME/jre/sh/java"
74 | else
75 | JAVACMD="$JAVA_HOME/bin/java"
76 | fi
77 | if [ ! -x "$JAVACMD" ] ; then
78 | die "ERROR: JAVA_HOME is set to an invalid directory: $JAVA_HOME
79 |
80 | Please set the JAVA_HOME variable in your environment to match the
81 | location of your Java installation."
82 | fi
83 | else
84 | JAVACMD="java"
85 | which java >/dev/null 2>&1 || die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.
86 |
87 | Please set the JAVA_HOME variable in your environment to match the
88 | location of your Java installation."
89 | fi
90 |
91 | # Increase the maximum file descriptors if we can.
92 | if [ "$cygwin" = "false" -a "$darwin" = "false" -a "$nonstop" = "false" ] ; then
93 | MAX_FD_LIMIT=`ulimit -H -n`
94 | if [ $? -eq 0 ] ; then
95 | if [ "$MAX_FD" = "maximum" -o "$MAX_FD" = "max" ] ; then
96 | MAX_FD="$MAX_FD_LIMIT"
97 | fi
98 | ulimit -n $MAX_FD
99 | if [ $? -ne 0 ] ; then
100 | warn "Could not set maximum file descriptor limit: $MAX_FD"
101 | fi
102 | else
103 | warn "Could not query maximum file descriptor limit: $MAX_FD_LIMIT"
104 | fi
105 | fi
106 |
107 | # For Darwin, add options to specify how the application appears in the dock
108 | if $darwin; then
109 | GRADLE_OPTS="$GRADLE_OPTS \"-Xdock:name=$APP_NAME\" \"-Xdock:icon=$APP_HOME/media/gradle.icns\""
110 | fi
111 |
112 | # For Cygwin, switch paths to Windows format before running java
113 | if $cygwin ; then
114 | APP_HOME=`cygpath --path --mixed "$APP_HOME"`
115 | CLASSPATH=`cygpath --path --mixed "$CLASSPATH"`
116 | JAVACMD=`cygpath --unix "$JAVACMD"`
117 |
118 | # We build the pattern for arguments to be converted via cygpath
119 | ROOTDIRSRAW=`find -L / -maxdepth 1 -mindepth 1 -type d 2>/dev/null`
120 | SEP=""
121 | for dir in $ROOTDIRSRAW ; do
122 | ROOTDIRS="$ROOTDIRS$SEP$dir"
123 | SEP="|"
124 | done
125 | OURCYGPATTERN="(^($ROOTDIRS))"
126 | # Add a user-defined pattern to the cygpath arguments
127 | if [ "$GRADLE_CYGPATTERN" != "" ] ; then
128 | OURCYGPATTERN="$OURCYGPATTERN|($GRADLE_CYGPATTERN)"
129 | fi
130 | # Now convert the arguments - kludge to limit ourselves to /bin/sh
131 | i=0
132 | for arg in "$@" ; do
133 | CHECK=`echo "$arg"|egrep -c "$OURCYGPATTERN" -`
134 | CHECK2=`echo "$arg"|egrep -c "^-"` ### Determine if an option
135 |
136 | if [ $CHECK -ne 0 ] && [ $CHECK2 -eq 0 ] ; then ### Added a condition
137 | eval `echo args$i`=`cygpath --path --ignore --mixed "$arg"`
138 | else
139 | eval `echo args$i`="\"$arg\""
140 | fi
141 | i=$((i+1))
142 | done
143 | case $i in
144 | (0) set -- ;;
145 | (1) set -- "$args0" ;;
146 | (2) set -- "$args0" "$args1" ;;
147 | (3) set -- "$args0" "$args1" "$args2" ;;
148 | (4) set -- "$args0" "$args1" "$args2" "$args3" ;;
149 | (5) set -- "$args0" "$args1" "$args2" "$args3" "$args4" ;;
150 | (6) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" ;;
151 | (7) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" ;;
152 | (8) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" ;;
153 | (9) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" "$args8" ;;
154 | esac
155 | fi
156 |
157 | # Escape application args
158 | save () {
159 | for i do printf %s\\n "$i" | sed "s/'/'\\\\''/g;1s/^/'/;\$s/\$/' \\\\/" ; done
160 | echo " "
161 | }
162 | APP_ARGS=$(save "$@")
163 |
164 | # Collect all arguments for the java command, following the shell quoting and substitution rules
165 | eval set -- $DEFAULT_JVM_OPTS $JAVA_OPTS $GRADLE_OPTS "\"-Dorg.gradle.appname=$APP_BASE_NAME\"" -classpath "\"$CLASSPATH\"" org.gradle.wrapper.GradleWrapperMain "$APP_ARGS"
166 |
167 | # by default we should be in the correct project dir, but when run from Finder on Mac, the cwd is wrong
168 | if [ "$(uname)" = "Darwin" ] && [ "$HOME" = "$PWD" ]; then
169 | cd "$(dirname "$0")"
170 | fi
171 |
172 | exec "$JAVACMD" "$@"
173 |
--------------------------------------------------------------------------------
/gradlew.bat:
--------------------------------------------------------------------------------
1 | @if "%DEBUG%" == "" @echo off
2 | @rem ##########################################################################
3 | @rem
4 | @rem Gradle startup script for Windows
5 | @rem
6 | @rem ##########################################################################
7 |
8 | @rem Set local scope for the variables with windows NT shell
9 | if "%OS%"=="Windows_NT" setlocal
10 |
11 | set DIRNAME=%~dp0
12 | if "%DIRNAME%" == "" set DIRNAME=.
13 | set APP_BASE_NAME=%~n0
14 | set APP_HOME=%DIRNAME%
15 |
16 | @rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
17 | set DEFAULT_JVM_OPTS=
18 |
19 | @rem Find java.exe
20 | if defined JAVA_HOME goto findJavaFromJavaHome
21 |
22 | set JAVA_EXE=java.exe
23 | %JAVA_EXE% -version >NUL 2>&1
24 | if "%ERRORLEVEL%" == "0" goto init
25 |
26 | echo.
27 | echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.
28 | echo.
29 | echo Please set the JAVA_HOME variable in your environment to match the
30 | echo location of your Java installation.
31 |
32 | goto fail
33 |
34 | :findJavaFromJavaHome
35 | set JAVA_HOME=%JAVA_HOME:"=%
36 | set JAVA_EXE=%JAVA_HOME%/bin/java.exe
37 |
38 | if exist "%JAVA_EXE%" goto init
39 |
40 | echo.
41 | echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME%
42 | echo.
43 | echo Please set the JAVA_HOME variable in your environment to match the
44 | echo location of your Java installation.
45 |
46 | goto fail
47 |
48 | :init
49 | @rem Get command-line arguments, handling Windows variants
50 |
51 | if not "%OS%" == "Windows_NT" goto win9xME_args
52 |
53 | :win9xME_args
54 | @rem Slurp the command line arguments.
55 | set CMD_LINE_ARGS=
56 | set _SKIP=2
57 |
58 | :win9xME_args_slurp
59 | if "x%~1" == "x" goto execute
60 |
61 | set CMD_LINE_ARGS=%*
62 |
63 | :execute
64 | @rem Setup the command line
65 |
66 | set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar
67 |
68 | @rem Execute Gradle
69 | "%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" org.gradle.wrapper.GradleWrapperMain %CMD_LINE_ARGS%
70 |
71 | :end
72 | @rem End local scope for the variables with windows NT shell
73 | if "%ERRORLEVEL%"=="0" goto mainEnd
74 |
75 | :fail
76 | rem Set variable GRADLE_EXIT_CONSOLE if you need the _script_ return code instead of
77 | rem the _cmd.exe /c_ return code!
78 | if not "" == "%GRADLE_EXIT_CONSOLE%" exit 1
79 | exit /b 1
80 |
81 | :mainEnd
82 | if "%OS%"=="Windows_NT" endlocal
83 |
84 | :omega
85 |
--------------------------------------------------------------------------------
/settings.gradle:
--------------------------------------------------------------------------------
1 | include ':app'
2 | rootProject.name = "NoteBook"
--------------------------------------------------------------------------------
/test.txt:
--------------------------------------------------------------------------------
1 | duserqq
--------------------------------------------------------------------------------