|
|
|
@ -31,37 +31,40 @@ import net.micode.notes.data.Notes.NoteColumns;
|
|
|
|
|
import net.micode.notes.data.Notes.TextNote;
|
|
|
|
|
import net.micode.notes.tool.ResourceParser.NoteBgResources;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* WorkingNote 类用于管理便签的操作,包括便签的创建、加载、保存等操作。
|
|
|
|
|
*/
|
|
|
|
|
public class WorkingNote {
|
|
|
|
|
// Note for the working note
|
|
|
|
|
// 便签对象,用于管理便签的具体数据
|
|
|
|
|
private Note mNote;
|
|
|
|
|
// Note Id
|
|
|
|
|
// 便签的 ID
|
|
|
|
|
private long mNoteId;
|
|
|
|
|
// Note content
|
|
|
|
|
// 便签的内容
|
|
|
|
|
private String mContent;
|
|
|
|
|
// Note mode
|
|
|
|
|
// 便签的模式
|
|
|
|
|
private int mMode;
|
|
|
|
|
|
|
|
|
|
// 便签的提醒日期
|
|
|
|
|
private long mAlertDate;
|
|
|
|
|
|
|
|
|
|
// 便签的修改日期
|
|
|
|
|
private long mModifiedDate;
|
|
|
|
|
|
|
|
|
|
// 便签的背景颜色 ID
|
|
|
|
|
private int mBgColorId;
|
|
|
|
|
|
|
|
|
|
// 便签小部件的 ID
|
|
|
|
|
private int mWidgetId;
|
|
|
|
|
|
|
|
|
|
// 便签小部件的类型
|
|
|
|
|
private int mWidgetType;
|
|
|
|
|
|
|
|
|
|
// 便签所属文件夹的 ID
|
|
|
|
|
private long mFolderId;
|
|
|
|
|
|
|
|
|
|
// 上下文对象,用于访问系统服务和资源
|
|
|
|
|
private Context mContext;
|
|
|
|
|
|
|
|
|
|
// 日志标签,用于在日志中标识该类的信息
|
|
|
|
|
private static final String TAG = "WorkingNote";
|
|
|
|
|
|
|
|
|
|
// 标记便签是否被删除
|
|
|
|
|
private boolean mIsDeleted;
|
|
|
|
|
|
|
|
|
|
// 便签设置更改监听器,用于监听便签设置的变化
|
|
|
|
|
private NoteSettingChangedListener mNoteSettingStatusListener;
|
|
|
|
|
|
|
|
|
|
// 用于查询便签数据的投影,指定需要查询的列
|
|
|
|
|
public static final String[] DATA_PROJECTION = new String[] {
|
|
|
|
|
DataColumns.ID,
|
|
|
|
|
DataColumns.CONTENT,
|
|
|
|
@ -72,6 +75,7 @@ public class WorkingNote {
|
|
|
|
|
DataColumns.DATA4,
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
// 用于查询便签信息的投影,指定需要查询的列
|
|
|
|
|
public static final String[] NOTE_PROJECTION = new String[] {
|
|
|
|
|
NoteColumns.PARENT_ID,
|
|
|
|
|
NoteColumns.ALERTED_DATE,
|
|
|
|
@ -81,27 +85,32 @@ public class WorkingNote {
|
|
|
|
|
NoteColumns.MODIFIED_DATE
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
// DATA_PROJECTION 中 ID 列的索引
|
|
|
|
|
private static final int DATA_ID_COLUMN = 0;
|
|
|
|
|
|
|
|
|
|
// DATA_PROJECTION 中内容列的索引
|
|
|
|
|
private static final int DATA_CONTENT_COLUMN = 1;
|
|
|
|
|
|
|
|
|
|
// DATA_PROJECTION 中 MIME 类型列的索引
|
|
|
|
|
private static final int DATA_MIME_TYPE_COLUMN = 2;
|
|
|
|
|
|
|
|
|
|
// DATA_PROJECTION 中模式列的索引
|
|
|
|
|
private static final int DATA_MODE_COLUMN = 3;
|
|
|
|
|
|
|
|
|
|
// NOTE_PROJECTION 中父文件夹 ID 列的索引
|
|
|
|
|
private static final int NOTE_PARENT_ID_COLUMN = 0;
|
|
|
|
|
|
|
|
|
|
// NOTE_PROJECTION 中提醒日期列的索引
|
|
|
|
|
private static final int NOTE_ALERTED_DATE_COLUMN = 1;
|
|
|
|
|
|
|
|
|
|
// NOTE_PROJECTION 中背景颜色 ID 列的索引
|
|
|
|
|
private static final int NOTE_BG_COLOR_ID_COLUMN = 2;
|
|
|
|
|
|
|
|
|
|
// NOTE_PROJECTION 中小部件 ID 列的索引
|
|
|
|
|
private static final int NOTE_WIDGET_ID_COLUMN = 3;
|
|
|
|
|
|
|
|
|
|
// NOTE_PROJECTION 中小部件类型列的索引
|
|
|
|
|
private static final int NOTE_WIDGET_TYPE_COLUMN = 4;
|
|
|
|
|
|
|
|
|
|
// NOTE_PROJECTION 中修改日期列的索引
|
|
|
|
|
private static final int NOTE_MODIFIED_DATE_COLUMN = 5;
|
|
|
|
|
|
|
|
|
|
// New note construct
|
|
|
|
|
/**
|
|
|
|
|
* 构造函数,用于创建一个新的便签对象。
|
|
|
|
|
* @param context 上下文对象
|
|
|
|
|
* @param folderId 便签所属文件夹的 ID
|
|
|
|
|
*/
|
|
|
|
|
private WorkingNote(Context context, long folderId) {
|
|
|
|
|
mContext = context;
|
|
|
|
|
mAlertDate = 0;
|
|
|
|
@ -114,7 +123,12 @@ public class WorkingNote {
|
|
|
|
|
mWidgetType = Notes.TYPE_WIDGET_INVALIDE;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// Existing note construct
|
|
|
|
|
/**
|
|
|
|
|
* 构造函数,用于加载一个已存在的便签对象。
|
|
|
|
|
* @param context 上下文对象
|
|
|
|
|
* @param noteId 便签的 ID
|
|
|
|
|
* @param folderId 便签所属文件夹的 ID
|
|
|
|
|
*/
|
|
|
|
|
private WorkingNote(Context context, long noteId, long folderId) {
|
|
|
|
|
mContext = context;
|
|
|
|
|
mNoteId = noteId;
|
|
|
|
@ -124,29 +138,45 @@ public class WorkingNote {
|
|
|
|
|
loadNote();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* 加载便签的信息,包括便签的基本信息和便签的数据。
|
|
|
|
|
*/
|
|
|
|
|
private void loadNote() {
|
|
|
|
|
// 查询便签的基本信息
|
|
|
|
|
Cursor cursor = mContext.getContentResolver().query(
|
|
|
|
|
ContentUris.withAppendedId(Notes.CONTENT_NOTE_URI, mNoteId), NOTE_PROJECTION, null,
|
|
|
|
|
null, null);
|
|
|
|
|
|
|
|
|
|
if (cursor != null) {
|
|
|
|
|
if (cursor.moveToFirst()) {
|
|
|
|
|
// 获取便签所属文件夹的 ID
|
|
|
|
|
mFolderId = cursor.getLong(NOTE_PARENT_ID_COLUMN);
|
|
|
|
|
// 获取便签的背景颜色 ID
|
|
|
|
|
mBgColorId = cursor.getInt(NOTE_BG_COLOR_ID_COLUMN);
|
|
|
|
|
// 获取便签小部件的 ID
|
|
|
|
|
mWidgetId = cursor.getInt(NOTE_WIDGET_ID_COLUMN);
|
|
|
|
|
// 获取便签小部件的类型
|
|
|
|
|
mWidgetType = cursor.getInt(NOTE_WIDGET_TYPE_COLUMN);
|
|
|
|
|
// 获取便签的提醒日期
|
|
|
|
|
mAlertDate = cursor.getLong(NOTE_ALERTED_DATE_COLUMN);
|
|
|
|
|
// 获取便签的修改日期
|
|
|
|
|
mModifiedDate = cursor.getLong(NOTE_MODIFIED_DATE_COLUMN);
|
|
|
|
|
}
|
|
|
|
|
cursor.close();
|
|
|
|
|
} else {
|
|
|
|
|
// 若未查询到便签信息,记录错误日志并抛出异常
|
|
|
|
|
Log.e(TAG, "No note with id:" + mNoteId);
|
|
|
|
|
throw new IllegalArgumentException("Unable to find note with id " + mNoteId);
|
|
|
|
|
}
|
|
|
|
|
// 加载便签的数据
|
|
|
|
|
loadNoteData();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* 加载便签的数据,包括便签的内容和模式等信息。
|
|
|
|
|
*/
|
|
|
|
|
private void loadNoteData() {
|
|
|
|
|
// 查询便签的数据
|
|
|
|
|
Cursor cursor = mContext.getContentResolver().query(Notes.CONTENT_DATA_URI, DATA_PROJECTION,
|
|
|
|
|
DataColumns.NOTE_ID + "=?", new String[] {
|
|
|
|
|
String.valueOf(mNoteId)
|
|
|
|
@ -155,25 +185,40 @@ public class WorkingNote {
|
|
|
|
|
if (cursor != null) {
|
|
|
|
|
if (cursor.moveToFirst()) {
|
|
|
|
|
do {
|
|
|
|
|
// 获取便签数据的 MIME 类型
|
|
|
|
|
String type = cursor.getString(DATA_MIME_TYPE_COLUMN);
|
|
|
|
|
if (DataConstants.NOTE.equals(type)) {
|
|
|
|
|
// 若为文本便签类型,获取便签的内容和模式
|
|
|
|
|
mContent = cursor.getString(DATA_CONTENT_COLUMN);
|
|
|
|
|
mMode = cursor.getInt(DATA_MODE_COLUMN);
|
|
|
|
|
// 设置文本数据的 ID
|
|
|
|
|
mNote.setTextDataId(cursor.getLong(DATA_ID_COLUMN));
|
|
|
|
|
} else if (DataConstants.CALL_NOTE.equals(type)) {
|
|
|
|
|
// 若为通话便签类型,设置通话数据的 ID
|
|
|
|
|
mNote.setCallDataId(cursor.getLong(DATA_ID_COLUMN));
|
|
|
|
|
} else {
|
|
|
|
|
// 若为其他类型,记录日志
|
|
|
|
|
Log.d(TAG, "Wrong note type with type:" + type);
|
|
|
|
|
}
|
|
|
|
|
} while (cursor.moveToNext());
|
|
|
|
|
}
|
|
|
|
|
cursor.close();
|
|
|
|
|
} else {
|
|
|
|
|
// 若未查询到便签数据,记录错误日志并抛出异常
|
|
|
|
|
Log.e(TAG, "No data with id:" + mNoteId);
|
|
|
|
|
throw new IllegalArgumentException("Unable to find note's data with id " + mNoteId);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* 创建一个空的便签对象。
|
|
|
|
|
* @param context 上下文对象
|
|
|
|
|
* @param folderId 便签所属文件夹的 ID
|
|
|
|
|
* @param widgetId 便签小部件的 ID
|
|
|
|
|
* @param widgetType 便签小部件的类型
|
|
|
|
|
* @param defaultBgColorId 便签的默认背景颜色 ID
|
|
|
|
|
* @return 新创建的便签对象
|
|
|
|
|
*/
|
|
|
|
|
public static WorkingNote createEmptyNote(Context context, long folderId, int widgetId,
|
|
|
|
|
int widgetType, int defaultBgColorId) {
|
|
|
|
|
WorkingNote note = new WorkingNote(context, folderId);
|
|
|
|
@ -183,23 +228,35 @@ public class WorkingNote {
|
|
|
|
|
return note;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* 加载一个已存在的便签对象。
|
|
|
|
|
* @param context 上下文对象
|
|
|
|
|
* @param id 便签的 ID
|
|
|
|
|
* @return 加载的便签对象
|
|
|
|
|
*/
|
|
|
|
|
public static WorkingNote load(Context context, long id) {
|
|
|
|
|
return new WorkingNote(context, id, 0);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* 保存便签的信息。
|
|
|
|
|
* @return 保存成功返回 true,否则返回 false
|
|
|
|
|
*/
|
|
|
|
|
public synchronized boolean saveNote() {
|
|
|
|
|
if (isWorthSaving()) {
|
|
|
|
|
if (!existInDatabase()) {
|
|
|
|
|
// 若便签不存在于数据库中,创建新的便签 ID
|
|
|
|
|
if ((mNoteId = Note.getNewNoteId(mContext, mFolderId)) == 0) {
|
|
|
|
|
// 若创建失败,记录错误日志并返回 false
|
|
|
|
|
Log.e(TAG, "Create new note fail with id:" + mNoteId);
|
|
|
|
|
return false;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// 同步便签信息到数据库
|
|
|
|
|
mNote.syncNote(mContext, mNoteId);
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* Update widget content if there exist any widget of this note
|
|
|
|
|
* 若存在便签的小部件,更新小部件的内容
|
|
|
|
|
*/
|
|
|
|
|
if (mWidgetId != AppWidgetManager.INVALID_APPWIDGET_ID
|
|
|
|
|
&& mWidgetType != Notes.TYPE_WIDGET_INVALIDE
|
|
|
|
@ -212,10 +269,18 @@ public class WorkingNote {
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* 判断便签是否存在于数据库中。
|
|
|
|
|
* @return 存在返回 true,否则返回 false
|
|
|
|
|
*/
|
|
|
|
|
public boolean existInDatabase() {
|
|
|
|
|
return mNoteId > 0;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* 判断便签是否值得保存。
|
|
|
|
|
* @return 值得保存返回 true,否则返回 false
|
|
|
|
|
*/
|
|
|
|
|
private boolean isWorthSaving() {
|
|
|
|
|
if (mIsDeleted || (!existInDatabase() && TextUtils.isEmpty(mContent))
|
|
|
|
|
|| (existInDatabase() && !mNote.isLocalModified())) {
|
|
|
|
@ -225,10 +290,19 @@ public class WorkingNote {
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* 设置便签设置更改监听器。
|
|
|
|
|
* @param l 监听器对象
|
|
|
|
|
*/
|
|
|
|
|
public void setOnSettingStatusChangedListener(NoteSettingChangedListener l) {
|
|
|
|
|
mNoteSettingStatusListener = l;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* 设置便签的提醒日期。
|
|
|
|
|
* @param date 提醒日期
|
|
|
|
|
* @param set 是否设置提醒
|
|
|
|
|
*/
|
|
|
|
|
public void setAlertDate(long date, boolean set) {
|
|
|
|
|
if (date != mAlertDate) {
|
|
|
|
|
mAlertDate = date;
|
|
|
|
@ -239,6 +313,10 @@ public class WorkingNote {
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* 标记便签是否被删除。
|
|
|
|
|
* @param mark 是否删除
|
|
|
|
|
*/
|
|
|
|
|
public void markDeleted(boolean mark) {
|
|
|
|
|
mIsDeleted = mark;
|
|
|
|
|
if (mWidgetId != AppWidgetManager.INVALID_APPWIDGET_ID
|
|
|
|
@ -247,6 +325,10 @@ public class WorkingNote {
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* 设置便签的背景颜色 ID。
|
|
|
|
|
* @param id 背景颜色 ID
|
|
|
|
|
*/
|
|
|
|
|
public void setBgColorId(int id) {
|
|
|
|
|
if (id != mBgColorId) {
|
|
|
|
|
mBgColorId = id;
|
|
|
|
@ -257,6 +339,10 @@ public class WorkingNote {
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* 设置便签的清单模式。
|
|
|
|
|
* @param mode 清单模式
|
|
|
|
|
*/
|
|
|
|
|
public void setCheckListMode(int mode) {
|
|
|
|
|
if (mMode != mode) {
|
|
|
|
|
if (mNoteSettingStatusListener != null) {
|
|
|
|
@ -267,6 +353,10 @@ public class WorkingNote {
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* 设置便签小部件的类型。
|
|
|
|
|
* @param type 小部件类型
|
|
|
|
|
*/
|
|
|
|
|
public void setWidgetType(int type) {
|
|
|
|
|
if (type != mWidgetType) {
|
|
|
|
|
mWidgetType = type;
|
|
|
|
@ -274,6 +364,10 @@ public class WorkingNote {
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* 设置便签小部件的 ID。
|
|
|
|
|
* @param id 小部件 ID
|
|
|
|
|
*/
|
|
|
|
|
public void setWidgetId(int id) {
|
|
|
|
|
if (id != mWidgetId) {
|
|
|
|
|
mWidgetId = id;
|
|
|
|
@ -281,6 +375,10 @@ public class WorkingNote {
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* 设置便签的工作文本。
|
|
|
|
|
* @param text 工作文本
|
|
|
|
|
*/
|
|
|
|
|
public void setWorkingText(String text) {
|
|
|
|
|
if (!TextUtils.equals(mContent, text)) {
|
|
|
|
|
mContent = text;
|
|
|
|
@ -288,81 +386,139 @@ public class WorkingNote {
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* 将便签转换为通话便签。
|
|
|
|
|
* @param phoneNumber 电话号码
|
|
|
|
|
* @param callDate 通话日期
|
|
|
|
|
*/
|
|
|
|
|
public void convertToCallNote(String phoneNumber, long callDate) {
|
|
|
|
|
mNote.setCallData(CallNote.CALL_DATE, String.valueOf(callDate));
|
|
|
|
|
mNote.setCallData(CallNote.PHONE_NUMBER, phoneNumber);
|
|
|
|
|
mNote.setNoteValue(NoteColumns.PARENT_ID, String.valueOf(Notes.ID_CALL_RECORD_FOLDER));
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* 判断便签是否设置了提醒。
|
|
|
|
|
* @return 设置了提醒返回 true,否则返回 false
|
|
|
|
|
*/
|
|
|
|
|
public boolean hasClockAlert() {
|
|
|
|
|
return (mAlertDate > 0 ? true : false);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* 获取便签的内容。
|
|
|
|
|
* @return 便签的内容
|
|
|
|
|
*/
|
|
|
|
|
public String getContent() {
|
|
|
|
|
return mContent;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* 获取便签的提醒日期。
|
|
|
|
|
* @return 便签的提醒日期
|
|
|
|
|
*/
|
|
|
|
|
public long getAlertDate() {
|
|
|
|
|
return mAlertDate;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* 获取便签的修改日期。
|
|
|
|
|
* @return 便签的修改日期
|
|
|
|
|
*/
|
|
|
|
|
public long getModifiedDate() {
|
|
|
|
|
return mModifiedDate;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* 获取便签背景的资源 ID。
|
|
|
|
|
* @return 便签背景的资源 ID
|
|
|
|
|
*/
|
|
|
|
|
public int getBgColorResId() {
|
|
|
|
|
return NoteBgResources.getNoteBgResource(mBgColorId);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* 获取便签的背景颜色 ID。
|
|
|
|
|
* @return 便签的背景颜色 ID
|
|
|
|
|
*/
|
|
|
|
|
public int getBgColorId() {
|
|
|
|
|
return mBgColorId;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* 获取便签标题背景的资源 ID。
|
|
|
|
|
* @return 便签标题背景的资源 ID
|
|
|
|
|
*/
|
|
|
|
|
public int getTitleBgResId() {
|
|
|
|
|
return NoteBgResources.getNoteTitleBgResource(mBgColorId);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* 获取便签的清单模式。
|
|
|
|
|
* @return 便签的清单模式
|
|
|
|
|
*/
|
|
|
|
|
public int getCheckListMode() {
|
|
|
|
|
return mMode;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* 获取便签的 ID。
|
|
|
|
|
* @return 便签的 ID
|
|
|
|
|
*/
|
|
|
|
|
public long getNoteId() {
|
|
|
|
|
return mNoteId;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* 获取便签所属文件夹的 ID。
|
|
|
|
|
* @return 便签所属文件夹的 ID
|
|
|
|
|
*/
|
|
|
|
|
public long getFolderId() {
|
|
|
|
|
return mFolderId;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* 获取便签小部件的 ID。
|
|
|
|
|
* @return 便签小部件的 ID
|
|
|
|
|
*/
|
|
|
|
|
public int getWidgetId() {
|
|
|
|
|
return mWidgetId;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* 获取便签小部件的类型。
|
|
|
|
|
* @return 便签小部件的类型
|
|
|
|
|
*/
|
|
|
|
|
public int getWidgetType() {
|
|
|
|
|
return mWidgetType;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* 便签设置更改监听器接口,用于监听便签设置的变化。
|
|
|
|
|
*/
|
|
|
|
|
public interface NoteSettingChangedListener {
|
|
|
|
|
/**
|
|
|
|
|
* Called when the background color of current note has just changed
|
|
|
|
|
* 当便签的背景颜色发生变化时调用。
|
|
|
|
|
*/
|
|
|
|
|
void onBackgroundColorChanged();
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* Called when user set clock
|
|
|
|
|
* 当用户设置提醒时调用。
|
|
|
|
|
* @param date 提醒日期
|
|
|
|
|
* @param set 是否设置提醒
|
|
|
|
|
*/
|
|
|
|
|
void onClockAlertChanged(long date, boolean set);
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* Call when user create note from widget
|
|
|
|
|
* 当用户从小部件创建便签时调用。
|
|
|
|
|
*/
|
|
|
|
|
void onWidgetChanged();
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* Call when switch between check list mode and normal mode
|
|
|
|
|
* @param oldMode is previous mode before change
|
|
|
|
|
* @param newMode is new mode
|
|
|
|
|
* 当便签在清单模式和普通模式之间切换时调用。
|
|
|
|
|
* @param oldMode 切换前的模式
|
|
|
|
|
* @param newMode 切换后的模式
|
|
|
|
|
*/
|
|
|
|
|
void onCheckListModeChanged(int oldMode, int newMode);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|