parent
1c11f5ead3
commit
007867c809
Binary file not shown.
Binary file not shown.
@ -0,0 +1,268 @@
|
||||
// 对便签本身进行操作
|
||||
|
||||
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 static final int TYPE_NOTE = 0;
|
||||
public static final int TYPE_FOLDER = 1;
|
||||
public static final int TYPE_SYSTEM = 2;
|
||||
|
||||
/**
|
||||
* 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 String INTENT_EXTRA_ALERT_DATE = "net.micode.notes.alert_date";
|
||||
public static final String INTENT_EXTRA_BACKGROUND_ID = "net.micode.notes.background_color_id";
|
||||
public static final String INTENT_EXTRA_WIDGET_ID = "net.micode.notes.widget_id";
|
||||
public static final String INTENT_EXTRA_WIDGET_TYPE = "net.micode.notes.widget_type";
|
||||
public static final String INTENT_EXTRA_FOLDER_ID = "net.micode.notes.folder_id";
|
||||
public static final String INTENT_EXTRA_CALL_DATE = "net.micode.notes.call_date";
|
||||
|
||||
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 class DataConstants {
|
||||
public static final String NOTE = TextNote.CONTENT_ITEM_TYPE;
|
||||
public static final String CALL_NOTE = CallNote.CONTENT_ITEM_TYPE;
|
||||
}
|
||||
|
||||
/**
|
||||
* Uri to query all notes and folders
|
||||
*/
|
||||
public static final Uri CONTENT_NOTE_URI = Uri.parse("content://" + AUTHORITY + "/note");
|
||||
|
||||
/**
|
||||
* Uri to query data
|
||||
*/
|
||||
public static final Uri CONTENT_DATA_URI = Uri.parse("content://" + AUTHORITY + "/data");
|
||||
|
||||
public interface NoteColumns {
|
||||
// 建立便签独有id
|
||||
/**
|
||||
* The unique ID for a row
|
||||
* <P> Type: INTEGER (long) </P>
|
||||
*/
|
||||
public static final String ID = "_id";
|
||||
|
||||
// 确立母文件夹位置
|
||||
/**
|
||||
* The parent's id for note or folder
|
||||
* <P> Type: INTEGER (long) </P>
|
||||
*/
|
||||
public static final String PARENT_ID = "parent_id";
|
||||
|
||||
// 写入便签数据
|
||||
/**
|
||||
* Created data for note or folder
|
||||
* <P> Type: INTEGER (long) </P>
|
||||
*/
|
||||
public static final String CREATED_DATE = "created_date";
|
||||
|
||||
/**
|
||||
* Latest modified date
|
||||
* <P> Type: INTEGER (long) </P>
|
||||
*/
|
||||
public static final String MODIFIED_DATE = "modified_date";
|
||||
|
||||
|
||||
/**
|
||||
* Alert date
|
||||
* <P> Type: INTEGER (long) </P>
|
||||
*/
|
||||
public static final String ALERTED_DATE = "alert_date";
|
||||
|
||||
/**
|
||||
* Folder's name or text content of note
|
||||
* <P> Type: TEXT </P>
|
||||
*/
|
||||
public static final String SNIPPET = "snippet";
|
||||
|
||||
/**
|
||||
* Note's widget id
|
||||
* <P> Type: INTEGER (long) </P>
|
||||
*/
|
||||
public static final String WIDGET_ID = "widget_id";
|
||||
|
||||
/**
|
||||
* Note's widget type
|
||||
* <P> Type: INTEGER (long) </P>
|
||||
*/
|
||||
public static final String WIDGET_TYPE = "widget_type";
|
||||
|
||||
/**
|
||||
* Note's background color's id
|
||||
* <P> Type: INTEGER (long) </P>
|
||||
*/
|
||||
public static final String BG_COLOR_ID = "bg_color_id";
|
||||
|
||||
/**
|
||||
* For text note, it doesn't has attachment, for multi-media
|
||||
* note, it has at least one attachment
|
||||
* <P> Type: INTEGER </P>
|
||||
*/
|
||||
public static final String HAS_ATTACHMENT = "has_attachment";
|
||||
|
||||
/**
|
||||
* Folder's count of notes
|
||||
* <P> Type: INTEGER (long) </P>
|
||||
*/
|
||||
public static final String NOTES_COUNT = "notes_count";
|
||||
|
||||
/**
|
||||
* The file type: folder or note
|
||||
* <P> Type: INTEGER </P>
|
||||
*/
|
||||
public static final String TYPE = "type";
|
||||
|
||||
/**
|
||||
* The last sync id
|
||||
* <P> Type: INTEGER (long) </P>
|
||||
*/
|
||||
public static final String SYNC_ID = "sync_id";
|
||||
|
||||
/**
|
||||
* Sign to indicate local modified or not
|
||||
* <P> Type: INTEGER </P>
|
||||
*/
|
||||
public static final String LOCAL_MODIFIED = "local_modified";
|
||||
|
||||
/**
|
||||
* Original parent id before moving into temporary folder
|
||||
* <P> Type : INTEGER </P>
|
||||
*/
|
||||
public static final String ORIGIN_PARENT_ID = "origin_parent_id";
|
||||
|
||||
/**
|
||||
* The gtask id
|
||||
* <P> Type : TEXT </P>
|
||||
*/
|
||||
public static final String GTASK_ID = "gtask_id";
|
||||
|
||||
/**
|
||||
* The version code
|
||||
* <P> Type : INTEGER (long) </P>
|
||||
*/
|
||||
public static final String VERSION = "version";
|
||||
}
|
||||
|
||||
public interface DataColumns {
|
||||
/**
|
||||
* The unique ID for a row
|
||||
* <P> Type: INTEGER (long) </P>
|
||||
*/
|
||||
public static final String ID = "_id";
|
||||
|
||||
/**
|
||||
* The MIME type of the item represented by this row.
|
||||
* <P> Type: Text </P>
|
||||
*/
|
||||
public static final String MIME_TYPE = "mime_type";
|
||||
|
||||
/**
|
||||
* The reference id to note that this data belongs to
|
||||
* <P> Type: INTEGER (long) </P>
|
||||
*/
|
||||
public static final String NOTE_ID = "note_id";
|
||||
|
||||
/**
|
||||
* Created data for note or folder
|
||||
* <P> Type: INTEGER (long) </P>
|
||||
*/
|
||||
public static final String CREATED_DATE = "created_date";
|
||||
|
||||
/**
|
||||
* Latest modified date
|
||||
* <P> Type: INTEGER (long) </P>
|
||||
*/
|
||||
public static final String MODIFIED_DATE = "modified_date";
|
||||
|
||||
/**
|
||||
* Data's content
|
||||
* <P> Type: TEXT </P>
|
||||
*/
|
||||
public static final String CONTENT = "content";
|
||||
|
||||
|
||||
/**
|
||||
* Generic data column, the meaning is {@link #MIMETYPE} specific, used for
|
||||
* integer data type
|
||||
* <P> Type: INTEGER </P>
|
||||
*/
|
||||
public static final String DATA1 = "data1";
|
||||
|
||||
/**
|
||||
* Generic data column, the meaning is {@link #MIMETYPE} specific, used for
|
||||
* integer data type
|
||||
* <P> Type: INTEGER </P>
|
||||
*/
|
||||
public static final String DATA2 = "data2";
|
||||
|
||||
/**
|
||||
* Generic data column, the meaning is {@link #MIMETYPE} specific, used for
|
||||
* TEXT data type
|
||||
* <P> Type: TEXT </P>
|
||||
*/
|
||||
public static final String DATA3 = "data3";
|
||||
|
||||
/**
|
||||
* Generic data column, the meaning is {@link #MIMETYPE} specific, used for
|
||||
* TEXT data type
|
||||
* <P> Type: TEXT </P>
|
||||
*/
|
||||
public static final String DATA4 = "data4";
|
||||
|
||||
/**
|
||||
* Generic data column, the meaning is {@link #MIMETYPE} specific, used for
|
||||
* TEXT data type
|
||||
* <P> Type: TEXT </P>
|
||||
*/
|
||||
public static final String DATA5 = "data5";
|
||||
}
|
||||
|
||||
public static final class TextNote implements DataColumns {
|
||||
/**
|
||||
* Mode to indicate the text in check list mode or not
|
||||
* <P> Type: Integer 1:check list mode 0: normal mode </P>
|
||||
*/
|
||||
public static final String MODE = DATA1;
|
||||
|
||||
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 class CallNote implements DataColumns {
|
||||
/**
|
||||
* Call date for this record
|
||||
* <P> Type: INTEGER (long) </P>
|
||||
*/
|
||||
public static final String CALL_DATE = DATA1;
|
||||
|
||||
/**
|
||||
* Phone number for this record
|
||||
* <P> Type: TEXT </P>
|
||||
*/
|
||||
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");
|
||||
}
|
||||
}
|
@ -0,0 +1,289 @@
|
||||
package net.micode.notes.data;
|
||||
|
||||
|
||||
import android.app.SearchManager;
|
||||
import android.content.ContentProvider;
|
||||
import android.content.ContentUris;
|
||||
import android.content.ContentValues;
|
||||
import android.content.Intent;
|
||||
import android.content.UriMatcher;
|
||||
import android.database.Cursor;
|
||||
import android.database.sqlite.SQLiteDatabase;
|
||||
import android.net.Uri;
|
||||
import android.text.TextUtils;
|
||||
import android.util.Log;
|
||||
|
||||
import net.micode.notes.R;
|
||||
import net.micode.notes.data.Notes.DataColumns;
|
||||
import net.micode.notes.data.Notes.NoteColumns;
|
||||
import net.micode.notes.data.NotesDatabaseHelper.TABLE;
|
||||
|
||||
|
||||
public class NotesProvider extends ContentProvider {
|
||||
private static final UriMatcher mMatcher;
|
||||
|
||||
private NotesDatabaseHelper mHelper;
|
||||
|
||||
private static final String TAG = "NotesProvider";
|
||||
|
||||
private static final int URI_NOTE = 1;
|
||||
private static final int URI_NOTE_ITEM = 2;
|
||||
private static final int URI_DATA = 3;
|
||||
private static final int URI_DATA_ITEM = 4;
|
||||
|
||||
private static final int URI_SEARCH = 5;
|
||||
private static final int URI_SEARCH_SUGGEST = 6;
|
||||
|
||||
static {
|
||||
mMatcher = new UriMatcher(UriMatcher.NO_MATCH);
|
||||
mMatcher.addURI(Notes.AUTHORITY, "note", URI_NOTE);
|
||||
mMatcher.addURI(Notes.AUTHORITY, "note/#", URI_NOTE_ITEM);
|
||||
mMatcher.addURI(Notes.AUTHORITY, "data", URI_DATA);
|
||||
mMatcher.addURI(Notes.AUTHORITY, "data/#", URI_DATA_ITEM);
|
||||
mMatcher.addURI(Notes.AUTHORITY, "search", URI_SEARCH);
|
||||
mMatcher.addURI(Notes.AUTHORITY, SearchManager.SUGGEST_URI_PATH_QUERY, URI_SEARCH_SUGGEST);
|
||||
mMatcher.addURI(Notes.AUTHORITY, SearchManager.SUGGEST_URI_PATH_QUERY + "/*", URI_SEARCH_SUGGEST);
|
||||
}
|
||||
|
||||
/**
|
||||
* x'0A' represents the '\n' character in sqlite. For title and content in the search result,
|
||||
* we will trim '\n' and white space in order to show more information.
|
||||
*/
|
||||
private static final String NOTES_SEARCH_PROJECTION = NoteColumns.ID + ","
|
||||
+ NoteColumns.ID + " AS " + SearchManager.SUGGEST_COLUMN_INTENT_EXTRA_DATA + ","
|
||||
+ "TRIM(REPLACE(" + NoteColumns.SNIPPET + ", x'0A','')) AS " + SearchManager.SUGGEST_COLUMN_TEXT_1 + ","
|
||||
+ "TRIM(REPLACE(" + NoteColumns.SNIPPET + ", x'0A','')) AS " + SearchManager.SUGGEST_COLUMN_TEXT_2 + ","
|
||||
+ R.drawable.search_result + " AS " + SearchManager.SUGGEST_COLUMN_ICON_1 + ","
|
||||
+ "'" + Intent.ACTION_VIEW + "' AS " + SearchManager.SUGGEST_COLUMN_INTENT_ACTION + ","
|
||||
+ "'" + Notes.TextNote.CONTENT_TYPE + "' AS " + SearchManager.SUGGEST_COLUMN_INTENT_DATA;
|
||||
|
||||
private static String NOTES_SNIPPET_SEARCH_QUERY = "SELECT " + NOTES_SEARCH_PROJECTION
|
||||
+ " FROM " + TABLE.NOTE
|
||||
+ " WHERE " + NoteColumns.SNIPPET + " LIKE ?"
|
||||
+ " AND " + NoteColumns.PARENT_ID + "<>" + Notes.ID_TRASH_FOLER
|
||||
+ " AND " + NoteColumns.TYPE + "=" + Notes.TYPE_NOTE;
|
||||
|
||||
@Override
|
||||
public boolean onCreate() {
|
||||
mHelper = NotesDatabaseHelper.getInstance(getContext());
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Cursor query(Uri uri, String[] projection, String selection, String[] selectionArgs,
|
||||
String sortOrder) {
|
||||
Cursor c = null;
|
||||
SQLiteDatabase db = mHelper.getReadableDatabase();
|
||||
String id = null;
|
||||
switch (mMatcher.match(uri)) {
|
||||
case URI_NOTE:
|
||||
c = db.query(TABLE.NOTE, projection, selection, selectionArgs, null, null,
|
||||
sortOrder);
|
||||
break;
|
||||
case URI_NOTE_ITEM:
|
||||
id = uri.getPathSegments().get(1);
|
||||
c = db.query(TABLE.NOTE, projection, NoteColumns.ID + "=" + id
|
||||
+ parseSelection(selection), selectionArgs, null, null, sortOrder);
|
||||
break;
|
||||
case URI_DATA:
|
||||
c = db.query(TABLE.DATA, projection, selection, selectionArgs, null, null,
|
||||
sortOrder);
|
||||
break;
|
||||
case URI_DATA_ITEM:
|
||||
id = uri.getPathSegments().get(1);
|
||||
c = db.query(TABLE.DATA, projection, DataColumns.ID + "=" + id
|
||||
+ parseSelection(selection), selectionArgs, null, null, sortOrder);
|
||||
break;
|
||||
case URI_SEARCH:
|
||||
case URI_SEARCH_SUGGEST:
|
||||
if (sortOrder != null || projection != null) {
|
||||
throw new IllegalArgumentException(
|
||||
"do not specify sortOrder, selection, selectionArgs, or projection" + "with this query");
|
||||
}
|
||||
|
||||
String searchString = null;
|
||||
if (mMatcher.match(uri) == URI_SEARCH_SUGGEST) {
|
||||
if (uri.getPathSegments().size() > 1) {
|
||||
searchString = uri.getPathSegments().get(1);
|
||||
}
|
||||
} else {
|
||||
searchString = uri.getQueryParameter("pattern");
|
||||
}
|
||||
|
||||
if (TextUtils.isEmpty(searchString)) {
|
||||
return null;
|
||||
}
|
||||
|
||||
try {
|
||||
searchString = String.format("%%%s%%", searchString);
|
||||
c = db.rawQuery(NOTES_SNIPPET_SEARCH_QUERY,
|
||||
new String[] { searchString });
|
||||
} catch (IllegalStateException ex) {
|
||||
Log.e(TAG, "got exception: " + ex.toString());
|
||||
}
|
||||
break;
|
||||
default:
|
||||
throw new IllegalArgumentException("Unknown URI " + uri);
|
||||
}
|
||||
if (c != null) {
|
||||
c.setNotificationUri(getContext().getContentResolver(), uri);
|
||||
}
|
||||
return c;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Uri insert(Uri uri, ContentValues values) {
|
||||
SQLiteDatabase db = mHelper.getWritableDatabase();
|
||||
long dataId = 0, noteId = 0, insertedId = 0;
|
||||
switch (mMatcher.match(uri)) {
|
||||
case URI_NOTE:
|
||||
insertedId = noteId = db.insert(TABLE.NOTE, null, values);
|
||||
break;
|
||||
case URI_DATA:
|
||||
if (values.containsKey(DataColumns.NOTE_ID)) {
|
||||
noteId = values.getAsLong(DataColumns.NOTE_ID);
|
||||
} else {
|
||||
Log.d(TAG, "Wrong data format without note id:" + values.toString());
|
||||
}
|
||||
insertedId = dataId = db.insert(TABLE.DATA, null, values);
|
||||
break;
|
||||
default:
|
||||
throw new IllegalArgumentException("Unknown URI " + uri);
|
||||
}
|
||||
// Notify the note uri
|
||||
if (noteId > 0) {
|
||||
getContext().getContentResolver().notifyChange(
|
||||
ContentUris.withAppendedId(Notes.CONTENT_NOTE_URI, noteId), null);
|
||||
}
|
||||
|
||||
// Notify the data uri
|
||||
if (dataId > 0) {
|
||||
getContext().getContentResolver().notifyChange(
|
||||
ContentUris.withAppendedId(Notes.CONTENT_DATA_URI, dataId), null);
|
||||
}
|
||||
|
||||
return ContentUris.withAppendedId(uri, insertedId);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int delete(Uri uri, String selection, String[] selectionArgs) {
|
||||
int count = 0;
|
||||
String id = null;
|
||||
SQLiteDatabase db = mHelper.getWritableDatabase();
|
||||
boolean deleteData = false;
|
||||
switch (mMatcher.match(uri)) {
|
||||
case URI_NOTE:
|
||||
selection = "(" + selection + ") AND " + NoteColumns.ID + ">0 ";
|
||||
count = db.delete(TABLE.NOTE, selection, selectionArgs);
|
||||
break;
|
||||
case URI_NOTE_ITEM:
|
||||
id = uri.getPathSegments().get(1);
|
||||
/**
|
||||
* ID that smaller than 0 is system folder which is not allowed to
|
||||
* trash
|
||||
*/
|
||||
long noteId = Long.valueOf(id);
|
||||
if (noteId <= 0) {
|
||||
break;
|
||||
}
|
||||
count = db.delete(TABLE.NOTE,
|
||||
NoteColumns.ID + "=" + id + parseSelection(selection), selectionArgs);
|
||||
break;
|
||||
case URI_DATA:
|
||||
count = db.delete(TABLE.DATA, selection, selectionArgs);
|
||||
deleteData = true;
|
||||
break;
|
||||
case URI_DATA_ITEM:
|
||||
id = uri.getPathSegments().get(1);
|
||||
count = db.delete(TABLE.DATA,
|
||||
DataColumns.ID + "=" + id + parseSelection(selection), selectionArgs);
|
||||
deleteData = true;
|
||||
break;
|
||||
default:
|
||||
throw new IllegalArgumentException("Unknown URI " + uri);
|
||||
}
|
||||
if (count > 0) {
|
||||
if (deleteData) {
|
||||
getContext().getContentResolver().notifyChange(Notes.CONTENT_NOTE_URI, null);
|
||||
}
|
||||
getContext().getContentResolver().notifyChange(uri, null);
|
||||
}
|
||||
return count;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int update(Uri uri, ContentValues values, String selection, String[] selectionArgs) {
|
||||
int count = 0;
|
||||
String id = null;
|
||||
SQLiteDatabase db = mHelper.getWritableDatabase();
|
||||
boolean updateData = false;
|
||||
switch (mMatcher.match(uri)) {
|
||||
case URI_NOTE:
|
||||
increaseNoteVersion(-1, selection, selectionArgs);
|
||||
count = db.update(TABLE.NOTE, values, selection, selectionArgs);
|
||||
break;
|
||||
case URI_NOTE_ITEM:
|
||||
id = uri.getPathSegments().get(1);
|
||||
increaseNoteVersion(Long.valueOf(id), selection, selectionArgs);
|
||||
count = db.update(TABLE.NOTE, values, NoteColumns.ID + "=" + id
|
||||
+ parseSelection(selection), selectionArgs);
|
||||
break;
|
||||
case URI_DATA:
|
||||
count = db.update(TABLE.DATA, values, selection, selectionArgs);
|
||||
updateData = true;
|
||||
break;
|
||||
case URI_DATA_ITEM:
|
||||
id = uri.getPathSegments().get(1);
|
||||
count = db.update(TABLE.DATA, values, DataColumns.ID + "=" + id
|
||||
+ parseSelection(selection), selectionArgs);
|
||||
updateData = true;
|
||||
break;
|
||||
default:
|
||||
throw new IllegalArgumentException("Unknown URI " + uri);
|
||||
}
|
||||
|
||||
if (count > 0) {
|
||||
if (updateData) {
|
||||
getContext().getContentResolver().notifyChange(Notes.CONTENT_NOTE_URI, null);
|
||||
}
|
||||
getContext().getContentResolver().notifyChange(uri, null);
|
||||
}
|
||||
return count;
|
||||
}
|
||||
|
||||
private String parseSelection(String selection) {
|
||||
return (!TextUtils.isEmpty(selection) ? " AND (" + selection + ')' : "");
|
||||
}
|
||||
|
||||
private void increaseNoteVersion(long id, String selection, String[] selectionArgs) {
|
||||
StringBuilder sql = new StringBuilder(120);
|
||||
sql.append("UPDATE ");
|
||||
sql.append(TABLE.NOTE);
|
||||
sql.append(" SET ");
|
||||
sql.append(NoteColumns.VERSION);
|
||||
sql.append("=" + NoteColumns.VERSION + "+1 ");
|
||||
|
||||
if (id > 0 || !TextUtils.isEmpty(selection)) {
|
||||
sql.append(" WHERE ");
|
||||
}
|
||||
if (id > 0) {
|
||||
sql.append(NoteColumns.ID + "=" + String.valueOf(id));
|
||||
}
|
||||
if (!TextUtils.isEmpty(selection)) {
|
||||
String selectString = id > 0 ? parseSelection(selection) : selection;
|
||||
for (String args : selectionArgs) {
|
||||
selectString = selectString.replaceFirst("\\?", args);
|
||||
}
|
||||
sql.append(selectString);
|
||||
}
|
||||
|
||||
mHelper.getWritableDatabase().execSQL(sql.toString());
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getType(Uri uri) {
|
||||
// TODO Auto-generated method stub
|
||||
return null;
|
||||
}
|
||||
|
||||
}
|
Binary file not shown.
@ -0,0 +1,8 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<!-- 这是一个字符串数组资源,用于定义一个分享的方式菜单 -->
|
||||
<resources>
|
||||
<string-array name="menu_share_ways">
|
||||
<item>短信</item>
|
||||
<item>邮件</item>
|
||||
</string-array>
|
||||
</resources>
|
@ -0,0 +1,8 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<!-- 这是一个字符串数组资源,用于定义一个分享的方式菜单 -->
|
||||
<resources>
|
||||
<string-array name="menu_share_ways">
|
||||
<item>短信</item>
|
||||
<item>邮件</item>
|
||||
</string-array>
|
||||
</resources>
|
@ -0,0 +1,16 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<resources>
|
||||
<!-- 定义备份格式 -->
|
||||
<string-array name="format_for_exported_note">
|
||||
<item>-%s</item> <!-- 文件夹名称格式 -->
|
||||
<item>--%s</item> <!-- 文件夹中笔记的日期格式 -->
|
||||
<item>--%s</item> <!-- 笔记日期格式 -->
|
||||
<item>--%s</item> <!-- 笔记内容格式 -->
|
||||
</string-array>
|
||||
|
||||
<!-- 定义分享方式 -->
|
||||
<string-array name="menu_share_ways">
|
||||
<item>Messaging</item>
|
||||
<item>Email</item>
|
||||
</string-array>
|
||||
</resources>
|
@ -0,0 +1,5 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<!-- 定义了一个名为 "user_query_highlight",值为 #335b5b5b 的颜色资源。-->
|
||||
<resources>
|
||||
<color name="user_query_highlight">#335b5b5b</color>
|
||||
</resources>
|
@ -0,0 +1,9 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<resources>
|
||||
<!-- 定义字体大小 -->
|
||||
<dimen name="text_font_size_super">33sp</dimen>
|
||||
<dimen name="text_font_size_large">26sp</dimen>
|
||||
<dimen name="text_font_size_medium">20sp</dimen>
|
||||
<dimen name="text_font_size_normal">17sp</dimen>
|
||||
<dimen name="text_font_size_small">14sp</dimen>
|
||||
</resources>
|
@ -0,0 +1,65 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
|
||||
<!-- 定义了一些文字样式 -->
|
||||
<resources>
|
||||
<!-- 超大号字体样式 -->
|
||||
<style name="TextAppearanceSuper">
|
||||
<item name="android:textSize">@dimen/text_font_size_super</item>
|
||||
<item name="android:textColorLink">#0000ff</item>
|
||||
</style>
|
||||
|
||||
<!-- 大号字体样式 -->
|
||||
<style name="TextAppearanceLarge">
|
||||
<item name="android:textSize">@dimen/text_font_size_large</item>
|
||||
<item name="android:textColorLink">#0000ff</item>
|
||||
</style>
|
||||
|
||||
<!-- 中号字体样式 -->
|
||||
<style name="TextAppearanceMedium">
|
||||
<item name="android:textSize">@dimen/text_font_size_medium</item>
|
||||
<item name="android:textColorLink">#0000ff</item>
|
||||
</style>
|
||||
|
||||
<!-- 正常大小字体样式 -->
|
||||
<style name="TextAppearanceNormal">
|
||||
<item name="android:textSize">@dimen/text_font_size_normal</item>
|
||||
<item name="android:textColorLink">#0000ff</item>
|
||||
</style>
|
||||
|
||||
<!-- 字体主要样式 -->
|
||||
<style name="TextAppearancePrimaryItem">
|
||||
<item name="android:textSize">@dimen/text_font_size_normal</item>
|
||||
<item name="android:textColor">@color/primary_text_dark</item>
|
||||
</style>
|
||||
|
||||
<!-- 字体附属样式 -->
|
||||
<style name="TextAppearanceSecondaryItem">
|
||||
<item name="android:textSize">@dimen/text_font_size_small</item>
|
||||
<item name="android:textColor">@color/secondary_text_dark</item>
|
||||
</style>
|
||||
|
||||
<style name="TextAppearanceUnderMenuIcon">
|
||||
<item name="android:textSize">@dimen/text_font_size_normal</item>
|
||||
<item name="android:textColor">@android:color/black</item>
|
||||
</style>
|
||||
|
||||
<style name="HighlightTextAppearancePrimary">
|
||||
<item name="android:textSize">@dimen/text_font_size_normal</item>
|
||||
<item name="android:textColor">@color/primary_text_dark</item>
|
||||
</style>
|
||||
|
||||
<style name="HighlightTextAppearanceSecondary">
|
||||
<item name="android:textSize">@dimen/text_font_size_small</item>
|
||||
<item name="android:textColor">@color/secondary_text_dark</item>
|
||||
</style>
|
||||
|
||||
<!-- 主题字体样式 -->
|
||||
<style name="NoteTheme" parent="@android:style/Theme.Holo.Light">
|
||||
<item name="android:actionBarStyle">@style/NoteActionBarStyle</item>
|
||||
</style>
|
||||
|
||||
<style name="NoteActionBarStyle" parent="@android:style/Widget.Holo.Light.ActionBar.Solid">
|
||||
<item name="android:displayOptions" />
|
||||
<item name="android:visibility">gone</item>
|
||||
</style>
|
||||
</resources>
|
@ -0,0 +1,17 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<!-- 定义一个首选项屏幕 -->
|
||||
<PreferenceScreen xmlns:android="http://schemas.android.com/apk/res/android">
|
||||
<!-- 定义一个首选项类别,用于放置其他首选项 -->
|
||||
<PreferenceCategory android:key="pref_sync_account_key">
|
||||
<!-- 这里可以添加其他首选项 -->
|
||||
</PreferenceCategory>
|
||||
|
||||
<!-- 定义一个首选项类别 -->
|
||||
<PreferenceCategory>
|
||||
<!-- 定义一个复选框首选项 -->
|
||||
<CheckBoxPreference
|
||||
android:key="pref_key_bg_random_appear"
|
||||
android:title="@string/preferences_bg_random_appear_title"
|
||||
android:defaultValue="false" />
|
||||
</PreferenceCategory>
|
||||
</PreferenceScreen>
|
@ -0,0 +1,12 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<!--定义一个可搜索的配置文件-->
|
||||
<searchable
|
||||
xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:label="@string/search_label" <!--搜索栏的标签-->
|
||||
android:hint="@string/search_hint" <!--搜索栏的提示信息-->
|
||||
android:searchMode="queryRewriteFromText" <!--搜索模式-->
|
||||
|
||||
android:searchSuggestAuthority="notes" <!--提供搜索建议的内容提供者的Authority-->
|
||||
android:searchSuggestIntentAction="android.intent.action.VIEW" <!--点击搜索建议时所执行的操作-->
|
||||
android:searchSettingsDescription="@string/search_setting_description" <!--在系统设置中显示的搜索描述-->
|
||||
android:includeInGlobalSearch="true" /> <!--是否包含在全局搜索中-->
|
@ -0,0 +1,11 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<!-- appwidget-provider 是一个 XML 标签,用于声明应用程序小部件提供程序。
|
||||
xmlns:android 属性指定了 Android 的 XML 命名空间。
|
||||
initialLayout 属性指定了小部件的初始化布局文件,即 widget_2x.xml。
|
||||
minWidth 和 minHeight 属性分别指定了小部件的最小宽度和高度。 -->
|
||||
<appwidget-provider
|
||||
xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:initialLayout="@layout/widget_2x"
|
||||
android:minWidth="146dip"
|
||||
android:minHeight="146dip">
|
||||
</appwidget-provider>
|
@ -0,0 +1,13 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
|
||||
<!-- appwidget-provider 是一个 XML 标签,用于声明应用程序小部件提供程序。
|
||||
xmlns:android 属性指定了 Android 的 XML 命名空间。
|
||||
initialLayout 属性指定了小部件的初始化布局文件,即 widget_2x.xml。
|
||||
minWidth 和 minHeight 属性分别指定了小部件的最小宽度和高度。 -->
|
||||
|
||||
<appwidget-provider
|
||||
xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:initialLayout="@layout/widget_4x"
|
||||
android:minWidth="294dip"
|
||||
android:minHeight="294dip">
|
||||
</appwidget-provider>
|
@ -0,0 +1,113 @@
|
||||
/*
|
||||
* Copyright (c) 2010-2011, The MiCode Open Source Community (www.micode.net)
|
||||
*
|
||||
* 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
|
||||
*
|
||||
* http://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.
|
||||
*/
|
||||
|
||||
package net.micode.notes.tool;
|
||||
|
||||
public class GTaskStringUtils {
|
||||
|
||||
public final static String GTASK_JSON_ACTION_ID = "action_id";
|
||||
|
||||
public final static String GTASK_JSON_ACTION_LIST = "action_list";
|
||||
|
||||
public final static String GTASK_JSON_ACTION_TYPE = "action_type";
|
||||
|
||||
public final static String GTASK_JSON_ACTION_TYPE_CREATE = "create";
|
||||
|
||||
public final static String GTASK_JSON_ACTION_TYPE_GETALL = "get_all";
|
||||
|
||||
public final static String GTASK_JSON_ACTION_TYPE_MOVE = "move";
|
||||
|
||||
public final static String GTASK_JSON_ACTION_TYPE_UPDATE = "update";
|
||||
|
||||
public final static String GTASK_JSON_CREATOR_ID = "creator_id";
|
||||
|
||||
public final static String GTASK_JSON_CHILD_ENTITY = "child_entity";
|
||||
|
||||
public final static String GTASK_JSON_CLIENT_VERSION = "client_version";
|
||||
|
||||
public final static String GTASK_JSON_COMPLETED = "completed";
|
||||
|
||||
public final static String GTASK_JSON_CURRENT_LIST_ID = "current_list_id";
|
||||
|
||||
public final static String GTASK_JSON_DEFAULT_LIST_ID = "default_list_id";
|
||||
|
||||
public final static String GTASK_JSON_DELETED = "deleted";
|
||||
|
||||
public final static String GTASK_JSON_DEST_LIST = "dest_list";
|
||||
|
||||
public final static String GTASK_JSON_DEST_PARENT = "dest_parent";
|
||||
|
||||
public final static String GTASK_JSON_DEST_PARENT_TYPE = "dest_parent_type";
|
||||
|
||||
public final static String GTASK_JSON_ENTITY_DELTA = "entity_delta";
|
||||
|
||||
public final static String GTASK_JSON_ENTITY_TYPE = "entity_type";
|
||||
|
||||
public final static String GTASK_JSON_GET_DELETED = "get_deleted";
|
||||
|
||||
public final static String GTASK_JSON_ID = "id";
|
||||
|
||||
public final static String GTASK_JSON_INDEX = "index";
|
||||
|
||||
public final static String GTASK_JSON_LAST_MODIFIED = "last_modified";
|
||||
|
||||
public final static String GTASK_JSON_LATEST_SYNC_POINT = "latest_sync_point";
|
||||
|
||||
public final static String GTASK_JSON_LIST_ID = "list_id";
|
||||
|
||||
public final static String GTASK_JSON_LISTS = "lists";
|
||||
|
||||
public final static String GTASK_JSON_NAME = "name";
|
||||
|
||||
public final static String GTASK_JSON_NEW_ID = "new_id";
|
||||
|
||||
public final static String GTASK_JSON_NOTES = "notes";
|
||||
|
||||
public final static String GTASK_JSON_PARENT_ID = "parent_id";
|
||||
|
||||
public final static String GTASK_JSON_PRIOR_SIBLING_ID = "prior_sibling_id";
|
||||
|
||||
public final static String GTASK_JSON_RESULTS = "results";
|
||||
|
||||
public final static String GTASK_JSON_SOURCE_LIST = "source_list";
|
||||
|
||||
public final static String GTASK_JSON_TASKS = "tasks";
|
||||
|
||||
public final static String GTASK_JSON_TYPE = "type";
|
||||
|
||||
public final static String GTASK_JSON_TYPE_GROUP = "GROUP";
|
||||
|
||||
public final static String GTASK_JSON_TYPE_TASK = "TASK";
|
||||
|
||||
public final static String GTASK_JSON_USER = "user";
|
||||
|
||||
public final static String MIUI_FOLDER_PREFFIX = "[MIUI_Notes]";
|
||||
|
||||
public final static String FOLDER_DEFAULT = "Default";
|
||||
|
||||
public final static String FOLDER_CALL_NOTE = "Call_Note";
|
||||
|
||||
public final static String FOLDER_META = "METADATA";
|
||||
|
||||
public final static String META_HEAD_GTASK_ID = "meta_gid";
|
||||
|
||||
public final static String META_HEAD_NOTE = "meta_note";
|
||||
|
||||
public final static String META_HEAD_DATA = "meta_data";
|
||||
|
||||
public final static String META_NOTE_NAME = "[META INFO] DON'T UPDATE AND DELETE";
|
||||
|
||||
}
|
@ -0,0 +1,181 @@
|
||||
/*
|
||||
* Copyright (c) 2010-2011, The MiCode Open Source Community (www.micode.net)
|
||||
*
|
||||
* 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
|
||||
*
|
||||
* http://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.
|
||||
*/
|
||||
|
||||
package net.micode.notes.tool;
|
||||
|
||||
import android.content.Context;
|
||||
import android.preference.PreferenceManager;
|
||||
|
||||
import net.micode.notes.R;
|
||||
import net.micode.notes.ui.NotesPreferenceActivity;
|
||||
|
||||
public class ResourceParser {
|
||||
|
||||
public static final int YELLOW = 0;
|
||||
public static final int BLUE = 1;
|
||||
public static final int WHITE = 2;
|
||||
public static final int GREEN = 3;
|
||||
public static final int RED = 4;
|
||||
|
||||
public static final int BG_DEFAULT_COLOR = YELLOW;
|
||||
|
||||
public static final int TEXT_SMALL = 0;
|
||||
public static final int TEXT_MEDIUM = 1;
|
||||
public static final int TEXT_LARGE = 2;
|
||||
public static final int TEXT_SUPER = 3;
|
||||
|
||||
public static final int BG_DEFAULT_FONT_SIZE = TEXT_MEDIUM;
|
||||
|
||||
public static class NoteBgResources {
|
||||
private final static int [] BG_EDIT_RESOURCES = new int [] {
|
||||
R.drawable.edit_yellow,
|
||||
R.drawable.edit_blue,
|
||||
R.drawable.edit_white,
|
||||
R.drawable.edit_green,
|
||||
R.drawable.edit_red
|
||||
};
|
||||
|
||||
private final static int [] BG_EDIT_TITLE_RESOURCES = new int [] {
|
||||
R.drawable.edit_title_yellow,
|
||||
R.drawable.edit_title_blue,
|
||||
R.drawable.edit_title_white,
|
||||
R.drawable.edit_title_green,
|
||||
R.drawable.edit_title_red
|
||||
};
|
||||
|
||||
public static int getNoteBgResource(int id) {
|
||||
return BG_EDIT_RESOURCES[id];
|
||||
}
|
||||
|
||||
public static int getNoteTitleBgResource(int id) {
|
||||
return BG_EDIT_TITLE_RESOURCES[id];
|
||||
}
|
||||
}
|
||||
|
||||
public static int getDefaultBgId(Context context) {
|
||||
if (PreferenceManager.getDefaultSharedPreferences(context).getBoolean(
|
||||
NotesPreferenceActivity.PREFERENCE_SET_BG_COLOR_KEY, false)) {
|
||||
return (int) (Math.random() * NoteBgResources.BG_EDIT_RESOURCES.length);
|
||||
} else {
|
||||
return BG_DEFAULT_COLOR;
|
||||
}
|
||||
}
|
||||
|
||||
public static class NoteItemBgResources {
|
||||
private final static int [] BG_FIRST_RESOURCES = new int [] {
|
||||
R.drawable.list_yellow_up,
|
||||
R.drawable.list_blue_up,
|
||||
R.drawable.list_white_up,
|
||||
R.drawable.list_green_up,
|
||||
R.drawable.list_red_up
|
||||
};
|
||||
|
||||
private final static int [] BG_NORMAL_RESOURCES = new int [] {
|
||||
R.drawable.list_yellow_middle,
|
||||
R.drawable.list_blue_middle,
|
||||
R.drawable.list_white_middle,
|
||||
R.drawable.list_green_middle,
|
||||
R.drawable.list_red_middle
|
||||
};
|
||||
|
||||
private final static int [] BG_LAST_RESOURCES = new int [] {
|
||||
R.drawable.list_yellow_down,
|
||||
R.drawable.list_blue_down,
|
||||
R.drawable.list_white_down,
|
||||
R.drawable.list_green_down,
|
||||
R.drawable.list_red_down,
|
||||
};
|
||||
|
||||
private final static int [] BG_SINGLE_RESOURCES = new int [] {
|
||||
R.drawable.list_yellow_single,
|
||||
R.drawable.list_blue_single,
|
||||
R.drawable.list_white_single,
|
||||
R.drawable.list_green_single,
|
||||
R.drawable.list_red_single
|
||||
};
|
||||
|
||||
public static int getNoteBgFirstRes(int id) {
|
||||
return BG_FIRST_RESOURCES[id];
|
||||
}
|
||||
|
||||
public static int getNoteBgLastRes(int id) {
|
||||
return BG_LAST_RESOURCES[id];
|
||||
}
|
||||
|
||||
public static int getNoteBgSingleRes(int id) {
|
||||
return BG_SINGLE_RESOURCES[id];
|
||||
}
|
||||
|
||||
public static int getNoteBgNormalRes(int id) {
|
||||
return BG_NORMAL_RESOURCES[id];
|
||||
}
|
||||
|
||||
public static int getFolderBgRes() {
|
||||
return R.drawable.list_folder;
|
||||
}
|
||||
}
|
||||
|
||||
public static class WidgetBgResources {
|
||||
private final static int [] BG_2X_RESOURCES = new int [] {
|
||||
R.drawable.widget_2x_yellow,
|
||||
R.drawable.widget_2x_blue,
|
||||
R.drawable.widget_2x_white,
|
||||
R.drawable.widget_2x_green,
|
||||
R.drawable.widget_2x_red,
|
||||
};
|
||||
|
||||
public static int getWidget2xBgResource(int id) {
|
||||
return BG_2X_RESOURCES[id];
|
||||
}
|
||||
|
||||
private final static int [] BG_4X_RESOURCES = new int [] {
|
||||
R.drawable.widget_4x_yellow,
|
||||
R.drawable.widget_4x_blue,
|
||||
R.drawable.widget_4x_white,
|
||||
R.drawable.widget_4x_green,
|
||||
R.drawable.widget_4x_red
|
||||
};
|
||||
|
||||
public static int getWidget4xBgResource(int id) {
|
||||
return BG_4X_RESOURCES[id];
|
||||
}
|
||||
}
|
||||
|
||||
public static class TextAppearanceResources {
|
||||
private final static int [] TEXTAPPEARANCE_RESOURCES = new int [] {
|
||||
R.style.TextAppearanceNormal,
|
||||
R.style.TextAppearanceMedium,
|
||||
R.style.TextAppearanceLarge,
|
||||
R.style.TextAppearanceSuper
|
||||
};
|
||||
|
||||
public static int getTexAppearanceResource(int id) {
|
||||
/**
|
||||
* HACKME: Fix bug of store the resource id in shared preference.
|
||||
* The id may larger than the length of resources, in this case,
|
||||
* return the {@link ResourceParser#BG_DEFAULT_FONT_SIZE}
|
||||
*/
|
||||
if (id >= TEXTAPPEARANCE_RESOURCES.length) {
|
||||
return BG_DEFAULT_FONT_SIZE;
|
||||
}
|
||||
return TEXTAPPEARANCE_RESOURCES[id];
|
||||
}
|
||||
|
||||
public static int getResourcesSize() {
|
||||
return TEXTAPPEARANCE_RESOURCES.length;
|
||||
}
|
||||
}
|
||||
}
|
Binary file not shown.
After Width: | Height: | Size: 58 KiB |
@ -0,0 +1,59 @@
|
||||
@startuml
|
||||
|
||||
class 小米便签控制 {
|
||||
-便签列表: 列表<便签>
|
||||
-待做事项: 列表<待做事项>
|
||||
+创建便签(): void
|
||||
+添加图片到便签(): void
|
||||
+保存便签(): void
|
||||
+呈现便签(): void
|
||||
+呈现待做事项(): void
|
||||
+阅读待做事项(): void
|
||||
+标记完成(): void
|
||||
}
|
||||
|
||||
class 小米便签边界 {
|
||||
+展示(): void
|
||||
+创建便签(): void
|
||||
+添加图片到便签(): void
|
||||
+保存便签(): void
|
||||
+呈现便签(): void
|
||||
+呈现待做事项(): void
|
||||
+阅读待做事项(): void
|
||||
+标记完成(): void
|
||||
}
|
||||
|
||||
class 便签 {
|
||||
-标题: 字符串
|
||||
-内容: 字符串
|
||||
-图片列表: 列表<图片>
|
||||
+设置标题(标题: 字符串): void
|
||||
+设置内容(内容: 字符串): void
|
||||
+add图片(图片: 图片): void
|
||||
+获取标题(): 字符串
|
||||
+获取内容(): 字符串
|
||||
+获取图片列表(): 列表<图片>
|
||||
}
|
||||
|
||||
class 图片 {
|
||||
-路径: 字符串
|
||||
+获取路径(): 字符串
|
||||
}
|
||||
|
||||
class 待做事项 {
|
||||
-标题: 字符串
|
||||
-描述: 字符串
|
||||
-状态: 字符串
|
||||
+设置标题(标题: 字符串): void
|
||||
+设置描述(描述: 字符串): void
|
||||
+获取状态(): 字符串
|
||||
+设置状态(状态: 字符串): void
|
||||
}
|
||||
|
||||
小米便签控制 --> 便签
|
||||
便签 --> 图片
|
||||
小米便签控制 --> 待做事项
|
||||
|
||||
小米便签边界 --> 小米便签控制
|
||||
|
||||
@enduml
|
@ -0,0 +1,22 @@
|
||||
@startuml
|
||||
left to right direction
|
||||
|
||||
actor User
|
||||
|
||||
rectangle "便签功能" {
|
||||
User -> (创建新便签)
|
||||
User -> (删除便签)
|
||||
User -> (移动便签)
|
||||
User -> (修改保存便签内容)
|
||||
User -> (获取便签ID)
|
||||
User -> (标记便签颜色)
|
||||
User ---> (设置便签的提醒时间和日期)
|
||||
User -> (监听笔记设置的更改)
|
||||
User -> (新建文件夹)
|
||||
User -> (导出便签内容)
|
||||
User -> (同步便签信息)
|
||||
User ---> (检索便签内容)
|
||||
User --> (设置提醒时间)
|
||||
}
|
||||
|
||||
@enduml
|
After Width: | Height: | Size: 44 KiB |
@ -0,0 +1,33 @@
|
||||
@startuml
|
||||
|
||||
left to right direction
|
||||
|
||||
actor User
|
||||
|
||||
rectangle 小米便签 {
|
||||
usecase CreateNote as "创建便签"
|
||||
usecase AddImageToNote as "添加图片"
|
||||
usecase SaveNote as "保存便签"
|
||||
usecase DisplayNote as "显示便签"
|
||||
usecase DisplayToDoList as "显示待处理事件列表"
|
||||
usecase ReadToDoItem as "朗读待处理事件"
|
||||
usecase MarkToDoItemAsDone as "标记待处理事件为已完成"
|
||||
}
|
||||
|
||||
User ---> CreateNote
|
||||
User --> AddImageToNote
|
||||
User --> SaveNote
|
||||
User -> DisplayNote
|
||||
User --> DisplayToDoList
|
||||
User --> ReadToDoItem
|
||||
User ---> MarkToDoItemAsDone
|
||||
|
||||
CreateNote --> 小米便签
|
||||
AddImageToNote --> 小米便签
|
||||
SaveNote --> 小米便签
|
||||
DisplayNote --> 小米便签
|
||||
DisplayToDoList --> 小米便签
|
||||
ReadToDoItem --> 小米便签
|
||||
MarkToDoItemAsDone --> 小米便签
|
||||
|
||||
@enduml
|
After Width: | Height: | Size: 50 KiB |
@ -0,0 +1,55 @@
|
||||
@startuml
|
||||
|
||||
actor 用户
|
||||
|
||||
用户 -> 小米便签: 打开小米便签
|
||||
|
||||
activate 小米便签
|
||||
|
||||
用户 -> 小米便签: 创建新的便签
|
||||
|
||||
小米便签 -> 小米便签: 显示空白便签
|
||||
|
||||
用户 -> 小米便签: 添加图片
|
||||
|
||||
小米便签 -> 小米便签: 打开图片库
|
||||
|
||||
activate 图库
|
||||
|
||||
小米便签 -> 图库: 选择图片
|
||||
|
||||
图库 --> 小米便签: 返回所选图片
|
||||
|
||||
deactivate 图库
|
||||
|
||||
小米便签 -> 小米便签: 显示添加的图片
|
||||
|
||||
用户 -> 小米便签: 保存便签
|
||||
|
||||
小米便签 -> 小米便签: 保存便签内容
|
||||
|
||||
用户 -> 小米便签: 关闭便签
|
||||
|
||||
deactivate 小米便签
|
||||
|
||||
用户 -> 小米便签: 打开待处理事件
|
||||
|
||||
activate 小米便签
|
||||
|
||||
小米便签 -> 小米便签: 显示待处理事件列表
|
||||
|
||||
用户 -> 小米便签: 选择一个待处理事件
|
||||
|
||||
小米便签 -> 小米便签: 显示待处理事件的详细信息
|
||||
|
||||
小米便签 -> 小米便签: 朗读待处理事件
|
||||
|
||||
用户 -> 小米便签: 标记待处理事件为已完成
|
||||
|
||||
小米便签 -> 小米便签: 更新待处理事件的状态
|
||||
|
||||
用户 -> 小米便签: 关闭待处理事件
|
||||
|
||||
deactivate 小米便签
|
||||
|
||||
@enduml
|
After Width: | Height: | Size: 45 KiB |
After Width: | Height: | Size: 56 KiB |
Loading…
Reference in new issue