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..922c017 100644 --- a/app/src/main/java/net/micode/notes/data/Notes.java +++ b/app/src/main/java/net/micode/notes/data/Notes.java @@ -17,9 +17,9 @@ package net.micode.notes.data; import android.net.Uri; -public class Notes { - public static final String AUTHORITY = "micode_notes"; - public static final String TAG = "Notes"; +public class Notes { //定义类,为模块的其他类提供变量定义 + public static final String AUTHORITY = "micode_notes"; //设置AUTHORITY + public static final String TAG = "Notes"; //设置TAG public static final int TYPE_NOTE = 0; public static final int TYPE_FOLDER = 1; public static final int TYPE_SYSTEM = 2; @@ -46,7 +46,7 @@ public class Notes { public static final int TYPE_WIDGET_2X = 0; public static final int TYPE_WIDGET_4X = 1; - public static class DataConstants { + public static class DataConstants { //获取记录 public static final String NOTE = TextNote.CONTENT_ITEM_TYPE; public static final String CALL_NOTE = CallNote.CONTENT_ITEM_TYPE; } @@ -54,14 +54,14 @@ public class Notes { /** * Uri to query all notes and folders */ - public static final Uri CONTENT_NOTE_URI = Uri.parse("content://" + AUTHORITY + "/note"); + public static final Uri CONTENT_NOTE_URI = Uri.parse("content://" + AUTHORITY + "/note");//查询所有笔记与文件的uri /** * Uri to query data */ - public static final Uri CONTENT_DATA_URI = Uri.parse("content://" + AUTHORITY + "/data"); + public static final Uri CONTENT_DATA_URI = Uri.parse("content://" + AUTHORITY + "/data");//查询数据的uri - public interface NoteColumns { + public interface NoteColumns { //定义便签变量接口 /** * The unique ID for a row *

Type: INTEGER (long)

@@ -72,50 +72,50 @@ public class Notes { * The parent's id for note or folder *

Type: INTEGER (long)

*/ - public static final String PARENT_ID = "parent_id"; + public static final String PARENT_ID = "parent_id"; //父文件夹的id /** * Created data for note or folder *

Type: INTEGER (long)

*/ - public static final String CREATED_DATE = "created_date"; + public static final String CREATED_DATE = "created_date"; //表示文件夹或便签创建日期 /** * Latest modified date *

Type: INTEGER (long)

*/ - public static final String MODIFIED_DATE = "modified_date"; + public static final String MODIFIED_DATE = "modified_date"; //便签的最新的修改日期 /** * Alert date *

Type: INTEGER (long)

*/ - public static final String ALERTED_DATE = "alert_date"; + public static final String ALERTED_DATE = "alert_date"; //提醒日期 /** * Folder's name or text content of note *

Type: TEXT

*/ - public static final String SNIPPET = "snippet"; + public static final String SNIPPET = "snippet"; //文件夹名称或便签内容 /** * Note's widget id *

Type: INTEGER (long)

*/ - public static final String WIDGET_ID = "widget_id"; + public static final String WIDGET_ID = "widget_id"; //便签的widget的id /** * Note's widget type *

Type: INTEGER (long)

*/ - public static final String WIDGET_TYPE = "widget_type"; + public static final String WIDGET_TYPE = "widget_type"; //便签widget的类型 /** * Note's background color's id *

Type: INTEGER (long)

*/ - public static final String BG_COLOR_ID = "bg_color_id"; + public static final String BG_COLOR_ID = "bg_color_id"; //背景颜色代号 /** * For text note, it doesn't has attachment, for multi-media @@ -128,31 +128,31 @@ public class Notes { * Folder's count of notes *

Type: INTEGER (long)

*/ - public static final String NOTES_COUNT = "notes_count"; + public static final String NOTES_COUNT = "notes_count"; //文件夹内的便签数 /** * The file type: folder or note *

Type: INTEGER

*/ - public static final String TYPE = "type"; + public static final String TYPE = "type"; //文件类型,是文件夹或便签 /** * The last sync id *

Type: INTEGER (long)

*/ - public static final String SYNC_ID = "sync_id"; + public static final String SYNC_ID = "sync_id"; //最后一次同步id /** * Sign to indicate local modified or not *

Type: INTEGER

*/ - public static final String LOCAL_MODIFIED = "local_modified"; + public static final String LOCAL_MODIFIED = "local_modified"; //本地修改名称标识 /** * Original parent id before moving into temporary folder *

Type : INTEGER

*/ - public static final String ORIGIN_PARENT_ID = "origin_parent_id"; + public static final String ORIGIN_PARENT_ID = "origin_parent_id"; //移动文件时文件的前父类文件夹 /** * The gtask id @@ -164,10 +164,10 @@ public class Notes { * The version code *

Type : INTEGER (long)

*/ - public static final String VERSION = "version"; + public static final String VERSION = "version"; //版本名称 } - public interface DataColumns { + public interface DataColumns { //定义数据变量接口 /** * The unique ID for a row *

Type: INTEGER (long)

@@ -184,25 +184,25 @@ public class Notes { * The reference id to note that this data belongs to *

Type: INTEGER (long)

*/ - public static final String NOTE_ID = "note_id"; + public static final String NOTE_ID = "note_id"; //便签名称 /** * Created data for note or folder *

Type: INTEGER (long)

*/ - public static final String CREATED_DATE = "created_date"; + public static final String CREATED_DATE = "created_date"; //创建文件夹或者便签的名称 /** * Latest modified date *

Type: INTEGER (long)

*/ - public static final String MODIFIED_DATE = "modified_date"; + public static final String MODIFIED_DATE = "modified_date"; //最后修改日期 /** * Data's content *

Type: TEXT

*/ - public static final String CONTENT = "content"; + public static final String CONTENT = "content"; //便签内容数据 /** @@ -210,7 +210,7 @@ public class Notes { * integer data type *

Type: INTEGER

*/ - public static final String DATA1 = "data1"; + public static final String DATA1 = "data1"; //不同类型的通用数据列,用于可能的存储与查找 /** * Generic data column, the meaning is {@link #MIMETYPE} specific, used for @@ -244,17 +244,17 @@ public class Notes { public static final class TextNote implements DataColumns { /** * Mode to indicate the text in check list mode or not - *

Type: Integer 1:check list mode 0: normal mode

+ *

Type: Integer 1:check list mode 0: normal mode

//1为列表检查模式,0为普通模式 */ - public static final String MODE = DATA1; + public static final String MODE = DATA1; //模式 - public static final int MODE_CHECK_LIST = 1; + public static final int MODE_CHECK_LIST = 1; //列表检查模式 public static final String CONTENT_TYPE = "vnd.android.cursor.dir/text_note"; 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 Uri CONTENT_URI = Uri.parse("content://" + AUTHORITY + "/text_note");//访问数据表uri } public static final class CallNote implements DataColumns { @@ -262,18 +262,18 @@ public class Notes { * Call date for this record *

Type: INTEGER (long)

*/ - public static final String CALL_DATE = DATA1; + public static final String CALL_DATE = DATA1; //呼叫数据 /** * Phone number for this record *

Type: TEXT

*/ - public static final String PHONE_NUMBER = DATA3; + public static final String PHONE_NUMBER = DATA3; //呼叫号码 public static final String CONTENT_TYPE = "vnd.android.cursor.dir/call_note"; 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"); + public static final Uri CONTENT_URI = Uri.parse("content://" + AUTHORITY + "/call_note");//访问电话记录uri } }