diff --git a/doc/~$模板-开源软件泛读、标注和维护报告文档 .docx b/doc/~$模板-开源软件泛读、标注和维护报告文档 .docx new file mode 100644 index 0000000..5be0a1c Binary files /dev/null and b/doc/~$模板-开源软件泛读、标注和维护报告文档 .docx differ diff --git a/doc/实践模板-开源软件泛读、标注和维护报告文档 .docx b/doc/实践模板-开源软件泛读、标注和维护报告文档 .docx new file mode 100644 index 0000000..e0ac5df Binary files /dev/null and b/doc/实践模板-开源软件泛读、标注和维护报告文档 .docx differ diff --git a/doc/实践模板-开源软件泛读、标注和维护报告文档 .docx b/doc/实践模板-开源软件泛读、标注和维护报告文档 .docx deleted file mode 100644 index 710849a..0000000 Binary files a/doc/实践模板-开源软件泛读、标注和维护报告文档 .docx and /dev/null differ diff --git a/doc/小米便签开源代码的泛读报告 .docx b/doc/小米便签开源代码的泛读报告 .docx deleted file mode 100644 index 16c4623..0000000 Binary files a/doc/小米便签开源代码的泛读报告 .docx and /dev/null differ diff --git a/src/Notes-master1/app/src/main/AndroidManifest.xml b/src/Notes-master1/app/src/main/AndroidManifest.xml index d696e61..f96035c 100644 --- a/src/Notes-master1/app/src/main/AndroidManifest.xml +++ b/src/Notes-master1/app/src/main/AndroidManifest.xml @@ -41,7 +41,6 @@ android:configChanges="keyboardHidden|orientation|screenSize" android:launchMode="singleTop" android:theme="@style/NoteTheme" - android:uiOptions="splitActionBarWhenNarrow" android:windowSoftInputMode="adjustPan" android:exported="true"> diff --git a/src/Notes-master1/app/src/main/java/net/micode/notes/model/Note.java b/src/Notes-master1/app/src/main/java/net/micode/notes/model/Note.java index 1e4e35c..02d889f 100644 --- a/src/Notes-master1/app/src/main/java/net/micode/notes/model/Note.java +++ b/src/Notes-master1/app/src/main/java/net/micode/notes/model/Note.java @@ -67,12 +67,12 @@ public class Note { return noteId; } - public Note() { //定义两个变量用来存储便签的数据,一个是存储便签属性、一个是存储便签内容 + //定义两个变量用来存储便签的数据,一个是存储便签属性、一个是存储便签内容 + public Note() { mNoteDiffValues = new ContentValues(); mNoteData = new NoteData(); } - public void setNoteValue(String key, String value) { /*设置数据库表格的标签属性数据,设置便签属性*/ mNoteDiffValues.put(key, value); @@ -111,6 +111,7 @@ public class Note { return mNoteDiffValues.size() > 0 || mNoteData.isLocalModified(); } + //同步便签,在WorkingNote中用到 public boolean syncNote(Context context, long noteId) { if (noteId <= 0) { throw new IllegalArgumentException("Wrong note id:" + noteId); diff --git a/src/Notes-master1/app/src/main/java/net/micode/notes/model/WorkingNote.java b/src/Notes-master1/app/src/main/java/net/micode/notes/model/WorkingNote.java index be081e4..acced2e 100644 --- a/src/Notes-master1/app/src/main/java/net/micode/notes/model/WorkingNote.java +++ b/src/Notes-master1/app/src/main/java/net/micode/notes/model/WorkingNote.java @@ -62,7 +62,9 @@ public class WorkingNote { private NoteSettingChangedListener mNoteSettingStatusListener; - public static final String[] DATA_PROJECTION = new String[] { + // 声明 DATA_PROJECTION字符串数组 + public static final String[] DATA_PROJECTION = new String[] {//与便签数组对应 + //每个便签的数据 DataColumns.ID, DataColumns.CONTENT, DataColumns.MIME_TYPE, @@ -72,7 +74,9 @@ public class WorkingNote { DataColumns.DATA4, }; - public static final String[] NOTE_PROJECTION = new String[] { + // 声明 NOTE_PROJECTION字符串数组 + public static final String[] NOTE_PROJECTION = new String[] {//便签数组 + //每个便签的成员 NoteColumns.PARENT_ID, NoteColumns.ALERTED_DATE, NoteColumns.BG_COLOR_ID, @@ -101,7 +105,7 @@ public class WorkingNote { private static final int NOTE_MODIFIED_DATE_COLUMN = 5; - // New note construct + // New note construct 构造函数? private WorkingNote(Context context, long folderId) { mContext = context; mAlertDate = 0; @@ -114,7 +118,7 @@ public class WorkingNote { mWidgetType = Notes.TYPE_WIDGET_INVALIDE; } - // Existing note construct + // Existing note construct 构造函数? private WorkingNote(Context context, long noteId, long folderId) { mContext = context; mNoteId = noteId; @@ -124,6 +128,7 @@ public class WorkingNote { loadNote(); } + // 加载NoteData private void loadNote() { Cursor cursor = mContext.getContentResolver().query( ContentUris.withAppendedId(Notes.CONTENT_NOTE_URI, mNoteId), NOTE_PROJECTION, null, @@ -174,6 +179,8 @@ public class WorkingNote { } } + // 创建空的Note + // 传参:context,文件夹id,widget,背景颜色 public static WorkingNote createEmptyNote(Context context, long folderId, int widgetId, int widgetType, int defaultBgColorId) { WorkingNote note = new WorkingNote(context, folderId); @@ -187,6 +194,7 @@ public class WorkingNote { return new WorkingNote(context, id, 0); } + // 保存Note public synchronized boolean saveNote() { if (isWorthSaving()) { if (!existInDatabase()) { @@ -247,6 +255,7 @@ public class WorkingNote { } } + // 设定背景颜色 public void setBgColorId(int id) { if (id != mBgColorId) { mBgColorId = id; @@ -342,6 +351,8 @@ public class WorkingNote { return mWidgetType; } + // 创建接口 NoteSettingChangedListener,便签更新监视 + // 为NoteEditActivity提供接口 public interface NoteSettingChangedListener { /** * Called when the background color of current note has just changed diff --git a/src/Notes-master1/app/src/main/java/net/micode/notes/tool/DataUtils.java b/src/Notes-master1/app/src/main/java/net/micode/notes/tool/DataUtils.java index 2a14982..ae3066e 100644 --- a/src/Notes-master1/app/src/main/java/net/micode/notes/tool/DataUtils.java +++ b/src/Notes-master1/app/src/main/java/net/micode/notes/tool/DataUtils.java @@ -80,8 +80,7 @@ public class DataUtils { resolver.update(ContentUris.withAppendedId(Notes.CONTENT_NOTE_URI, id), values, null, null); } - public static boolean batchMoveToFolder(ContentResolver resolver, HashSet ids, - long folderId) { + public static boolean batchMoveToFolder(ContentResolver resolver, HashSet ids, long folderId) { if (ids == null) { Log.d(TAG, "the ids is null"); return true; diff --git a/src/Notes-master1/app/src/main/java/net/micode/notes/ui/NotesListActivity.java b/src/Notes-master1/app/src/main/java/net/micode/notes/ui/NotesListActivity.java index 83d6548..2c99d72 100644 --- a/src/Notes-master1/app/src/main/java/net/micode/notes/ui/NotesListActivity.java +++ b/src/Notes-master1/app/src/main/java/net/micode/notes/ui/NotesListActivity.java @@ -1,5 +1,6 @@ package net.micode.notes.ui; +import android.annotation.SuppressLint; import android.app.Activity; import android.app.AlertDialog; import android.app.Dialog; @@ -473,6 +474,7 @@ public class NotesListActivity extends Activity implements OnClickListener, OnIt this.startActivityForResult(intent, REQUEST_CODE_NEW_NODE); } + @SuppressLint("StaticFieldLeak") private void batchDelete() { new AsyncTask>() { protected HashSet doInBackground(Void... unused) { diff --git a/src/Notes-master1/app/src/main/res/values/styles.xml b/src/Notes-master1/app/src/main/res/values/styles.xml index d750e65..ad0d90d 100644 --- a/src/Notes-master1/app/src/main/res/values/styles.xml +++ b/src/Notes-master1/app/src/main/res/values/styles.xml @@ -64,6 +64,6 @@ \ No newline at end of file