From 19df83660d90de2a2b6ddae4fea3ba44755bfa28 Mon Sep 17 00:00:00 2001 From: 2290867136 <2290867136@qq.com> Date: Thu, 11 May 2023 22:11:39 +0800 Subject: [PATCH] new annotation --- .../java/net/micode/notes/data/Notes.java | 60 ++++++++++--------- 1 file changed, 31 insertions(+), 29 deletions(-) diff --git a/app/src/main/java/net/micode/notes/data/Notes.java b/app/src/main/java/net/micode/notes/data/Notes.java index f240604..3da9de3 100644 --- a/app/src/main/java/net/micode/notes/data/Notes.java +++ b/app/src/main/java/net/micode/notes/data/Notes.java @@ -22,18 +22,18 @@ public class Notes { public static final String TAG = "Notes"; public static final int TYPE_NOTE = 0; public static final int TYPE_FOLDER = 1; - public static final int TYPE_SYSTEM = 2; + public static final int TYPE_SYSTEM = 2;//定义了常量,其中TYPE用于设置条件 /** - * Following IDs are system folders' identifiers - * {@link Notes#ID_ROOT_FOLDER } is default folder - * {@link Notes#ID_TEMPARAY_FOLDER } is for notes belonging no folder - * {@link Notes#ID_CALL_RECORD_FOLDER} is to store call records + * Following IDs are system folders' identifiers 以下是系统文件的标识符 + * {@link Notes#ID_ROOT_FOLDER } is default folder 是默认文件夹 + * {@link Notes#ID_TEMPARAY_FOLDER } is for notes belonging no folder 不属于文件夹的记录 + * {@link Notes#ID_CALL_RECORD_FOLDER} is to store call records 存储通话记录 */ public static final int ID_ROOT_FOLDER = 0; public static final int ID_TEMPARAY_FOLDER = -1; public static final int ID_CALL_RECORD_FOLDER = -2; - public static final int ID_TRASH_FOLER = -3; + public static final int ID_TRASH_FOLER = -3;//定义了常量用于设置条件 public static final String INTENT_EXTRA_ALERT_DATE = "net.micode.notes.alert_date"; public static final String INTENT_EXTRA_BACKGROUND_ID = "net.micode.notes.background_color_id"; @@ -44,7 +44,7 @@ public class Notes { public static final int TYPE_WIDGET_INVALIDE = -1; public static final int TYPE_WIDGET_2X = 0; - public static final int TYPE_WIDGET_4X = 1; + public static final int TYPE_WIDGET_4X = 1;//定义了常量用于设置条件 public static class DataConstants { public static final String NOTE = TextNote.CONTENT_ITEM_TYPE; @@ -52,67 +52,69 @@ public class Notes { } /** - * Uri to query all notes and folders + * Uri to query all notes and folders 查询所有便签和文件 */ public static final Uri CONTENT_NOTE_URI = Uri.parse("content://" + AUTHORITY + "/note"); + //定义Uri查询的指针指向note /** - * Uri to query data + * Uri to query data 查询数据 */ public static final Uri CONTENT_DATA_URI = Uri.parse("content://" + AUTHORITY + "/data"); + //定义Uri查询的指针指向data public interface NoteColumns { /** - * The unique ID for a row + * The unique ID for a row 行唯一的ID *
Type: INTEGER (long)
*/ public static final String ID = "_id"; /** - * The parent's id for note or folder + * The parent's id for note or folder 对于便签或文件夹的父类ID *Type: INTEGER (long)
*/ public static final String PARENT_ID = "parent_id"; /** - * Created data for note or folder + * Created data for note or folder 创建数据给便签或文件夹 *Type: INTEGER (long)
*/ public static final String CREATED_DATE = "created_date"; /** - * Latest modified date + * Latest modified date 最近修改日期 *Type: INTEGER (long)
*/ public static final String MODIFIED_DATE = "modified_date"; /** - * Alert date + * Alert date 提醒的日期 *Type: INTEGER (long)
*/ public static final String ALERTED_DATE = "alert_date"; /** - * Folder's name or text content of note + * Folder's name or text content of note 文件夹的名称或备注的便签内容 *Type: TEXT
*/ public static final String SNIPPET = "snippet"; /** - * Note's widget id + * Note's widget id 便签的窗口ID *Type: INTEGER (long)
*/ public static final String WIDGET_ID = "widget_id"; /** - * Note's widget type + * Note's widget type 便签的窗口类型 *Type: INTEGER (long)
*/ public static final String WIDGET_TYPE = "widget_type"; /** - * Note's background color's id + * Note's background color's id 便签的背景颜色 *Type: INTEGER (long)
*/ public static final String BG_COLOR_ID = "bg_color_id"; @@ -125,47 +127,47 @@ public class Notes { public static final String HAS_ATTACHMENT = "has_attachment"; /** - * Folder's count of notes + * Folder's count of notes 便签的文件计数 *Type: INTEGER (long)
*/ public static final String NOTES_COUNT = "notes_count"; /** - * The file type: folder or note + * The file type: folder or note 文件类型,文件或便签 *Type: INTEGER
*/ public static final String TYPE = "type"; /** - * The last sync id + * The last sync id 最后一个同步ID *Type: INTEGER (long)
*/ public static final String SYNC_ID = "sync_id"; /** - * Sign to indicate local modified or not + * Sign to indicate local modified or not 标记是否进行了本地修改 *Type: INTEGER
*/ public static final String LOCAL_MODIFIED = "local_modified"; /** - * Original parent id before moving into temporary folder + * Original parent id before moving into temporary folder 移动到临时文件夹之前的原始父id *Type : INTEGER
*/ public static final String ORIGIN_PARENT_ID = "origin_parent_id"; /** - * The gtask id + * The gtask id *Type : TEXT
*/ public static final String GTASK_ID = "gtask_id"; /** - * The version code + * The version code 版本号 *Type : INTEGER (long)
*/ public static final String VERSION = "version"; - } + }//定义一个存放便签各种属性的接口 public interface DataColumns { /** @@ -239,7 +241,7 @@ public class Notes { *Type: TEXT
*/ public static final String DATA5 = "data5"; - } + }//定义便签的内容Data public static final class TextNote implements DataColumns { /** @@ -255,7 +257,7 @@ public class Notes { public static final String CONTENT_ITEM_TYPE = "vnd.android.cursor.item/text_note"; public static final Uri CONTENT_URI = Uri.parse("content://" + AUTHORITY + "/text_note"); - } + }//文本记录 public static final class CallNote implements DataColumns { /** @@ -275,5 +277,5 @@ public class Notes { public static final String CONTENT_ITEM_TYPE = "vnd.android.cursor.item/call_note"; public static final Uri CONTENT_URI = Uri.parse("content://" + AUTHORITY + "/call_note"); - } + }//电话记录 }