Compare commits

...

3 Commits

@ -0,0 +1,280 @@
/*
* 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.model;
import android.content.ContentProviderOperation;
import android.content.ContentProviderResult;
import android.content.ContentUris;
import android.content.ContentValues;
import android.content.Context;
import android.content.OperationApplicationException;
import android.net.Uri;
import android.os.RemoteException;
import android.util.Log;
import net.micode.notes.data.Notes;
import net.micode.notes.data.Notes.CallNote;
import net.micode.notes.data.Notes.DataColumns;
import net.micode.notes.data.Notes.NoteColumns;
import net.micode.notes.data.Notes.TextNote;
import java.util.ArrayList;
public class Note {
// 定义一个ContentValues对象用于存储note的差值
private ContentValues mNoteDiffValues;
// 定义一个NoteData对象用于存储note的数据
private NoteData mNoteData;
private static final String TAG = "Note";
/**
* Create a new note id for adding a new note to databases
*/
// 获取新笔记的ID
public static synchronized long getNewNoteId(Context context, long folderId) {
// Create a new note in the database
// 创建一个ContentValues对象用于存储要插入的数据
ContentValues values = new ContentValues();
// 获取当前时间戳
long createdTime = System.currentTimeMillis();
// 将创建时间插入到values中
values.put(NoteColumns.CREATED_DATE, createdTime);
// 将修改时间插入到values中
values.put(NoteColumns.MODIFIED_DATE, createdTime);
// 将类型插入到values中
values.put(NoteColumns.TYPE, Notes.TYPE_NOTE);
// 将本地修改标记插入到values中
values.put(NoteColumns.LOCAL_MODIFIED, 1);
// 将父文件夹ID插入到values中
values.put(NoteColumns.PARENT_ID, folderId);
// 使用ContentResolver的insert方法将values插入到Notes.CONTENT_NOTE_URI中并返回插入的Uri
Uri uri = context.getContentResolver().insert(Notes.CONTENT_NOTE_URI, values);
// 声明一个noteId变量用于存储插入的笔记ID
long noteId = 0;
try {
// 从uri中获取noteId
noteId = Long.valueOf(uri.getPathSegments().get(1));
} catch (NumberFormatException e) {
// 如果获取noteId出错则打印错误日志并将noteId设为0
Log.e(TAG, "Get note id error :" + e.toString());
noteId = 0;
}
// 如果noteId为-1则抛出异常
if (noteId == -1) {
throw new IllegalStateException("Wrong note id:" + noteId);
}
// 返回noteId
// 返回noteId
return noteId;
}
// 构造函数初始化mNoteDiffValues和mNoteData
public Note() {
mNoteDiffValues = new ContentValues();
mNoteData = new NoteData();
}
// 设置note的值并更新LOCAL_MODIFIED和MODIFIED_DATE字段
public void setNoteValue(String key, String value) {
mNoteDiffValues.put(key, value);
mNoteDiffValues.put(NoteColumns.LOCAL_MODIFIED, 1);
mNoteDiffValues.put(NoteColumns.MODIFIED_DATE, System.currentTimeMillis());
}
// 设置文本数据
public void setTextData(String key, String value) {
mNoteData.setTextData(key, value);
}
// 设置文本数据ID
public void setTextDataId(long id) {
mNoteData.setTextDataId(id);
}
// 获取文本数据ID
public long getTextDataId() {
return mNoteData.mTextDataId;
}
// 设置通话数据ID
public void setCallDataId(long id) {
mNoteData.setCallDataId(id);
}
// 设置通话数据
public void setCallData(String key, String value) {
mNoteData.setCallData(key, value);
}
// 判断是否本地修改
public boolean isLocalModified() {
return mNoteDiffValues.size() > 0 || mNoteData.isLocalModified();
}
public boolean syncNote(Context context, long noteId) {
// 检查noteId是否小于等于0如果是则抛出异常
if (noteId <= 0) {
throw new IllegalArgumentException("Wrong note id:" + noteId);
}
// 如果本地没有修改则直接返回true
if (!isLocalModified()) {
return true;
}
/**
* In theory, once data changed, the note should be updated on {@link NoteColumns#LOCAL_MODIFIED} and
* {@link NoteColumns#MODIFIED_DATE}. For data safety, though update note fails, we also update the
* note data info
*/
if (context.getContentResolver().update(
ContentUris.withAppendedId(Notes.CONTENT_NOTE_URI, noteId), mNoteDiffValues, null,
null) == 0) {
Log.e(TAG, "Update note error, should not happen");
// Do not return, fall through
}
mNoteDiffValues.clear();
if (mNoteData.isLocalModified()
&& (mNoteData.pushIntoContentResolver(context, noteId) == null)) {
return false;
}
return true;
}
private class NoteData {
private long mTextDataId;
private ContentValues mTextDataValues;
private long mCallDataId;
private ContentValues mCallDataValues;
private static final String TAG = "NoteData";
public NoteData() {
mTextDataValues = new ContentValues();
mCallDataValues = new ContentValues();
mTextDataId = 0;
mCallDataId = 0;
}
boolean isLocalModified() {
return mTextDataValues.size() > 0 || mCallDataValues.size() > 0;
}
void setTextDataId(long id) {
if(id <= 0) {
throw new IllegalArgumentException("Text data id should larger than 0");
}
mTextDataId = id;
}
void setCallDataId(long id) {
if (id <= 0) {
throw new IllegalArgumentException("Call data id should larger than 0");
}
mCallDataId = id;
}
void setCallData(String key, String value) {
mCallDataValues.put(key, value);
mNoteDiffValues.put(NoteColumns.LOCAL_MODIFIED, 1);
mNoteDiffValues.put(NoteColumns.MODIFIED_DATE, System.currentTimeMillis());
}
void setTextData(String key, String value) {
mTextDataValues.put(key, value);
mNoteDiffValues.put(NoteColumns.LOCAL_MODIFIED, 1);
mNoteDiffValues.put(NoteColumns.MODIFIED_DATE, System.currentTimeMillis());
}
Uri pushIntoContentResolver(Context context, long noteId) {
/**
* Check for safety
*/
if (noteId <= 0) {
throw new IllegalArgumentException("Wrong note id:" + noteId);
}
ArrayList<ContentProviderOperation> operationList = new ArrayList<ContentProviderOperation>();
ContentProviderOperation.Builder builder = null;
if(mTextDataValues.size() > 0) {
mTextDataValues.put(DataColumns.NOTE_ID, noteId);
if (mTextDataId == 0) {
mTextDataValues.put(DataColumns.MIME_TYPE, TextNote.CONTENT_ITEM_TYPE);
Uri uri = context.getContentResolver().insert(Notes.CONTENT_DATA_URI,
mTextDataValues);
try {
setTextDataId(Long.valueOf(uri.getPathSegments().get(1)));
} catch (NumberFormatException e) {
Log.e(TAG, "Insert new text data fail with noteId" + noteId);
mTextDataValues.clear();
return null;
}
} else {
builder = ContentProviderOperation.newUpdate(ContentUris.withAppendedId(
Notes.CONTENT_DATA_URI, mTextDataId));
builder.withValues(mTextDataValues);
operationList.add(builder.build());
}
mTextDataValues.clear();
}
if(mCallDataValues.size() > 0) {
mCallDataValues.put(DataColumns.NOTE_ID, noteId);
if (mCallDataId == 0) {
mCallDataValues.put(DataColumns.MIME_TYPE, CallNote.CONTENT_ITEM_TYPE);
Uri uri = context.getContentResolver().insert(Notes.CONTENT_DATA_URI,
mCallDataValues);
try {
setCallDataId(Long.valueOf(uri.getPathSegments().get(1)));
} catch (NumberFormatException e) {
Log.e(TAG, "Insert new call data fail with noteId" + noteId);
mCallDataValues.clear();
return null;
}
} else {
builder = ContentProviderOperation.newUpdate(ContentUris.withAppendedId(
Notes.CONTENT_DATA_URI, mCallDataId));
builder.withValues(mCallDataValues);
operationList.add(builder.build());
}
mCallDataValues.clear();
}
if (operationList.size() > 0) {
try {
ContentProviderResult[] results = context.getContentResolver().applyBatch(
Notes.AUTHORITY, operationList);
return (results == null || results.length == 0 || results[0] == null) ? null
: ContentUris.withAppendedId(Notes.CONTENT_NOTE_URI, noteId);
} catch (RemoteException e) {
Log.e(TAG, String.format("%s: %s", e.toString(), e.getMessage()));
return null;
} catch (OperationApplicationException e) {
Log.e(TAG, String.format("%s: %s", e.toString(), e.getMessage()));
return null;
}
}
return null;
}
}
}

@ -0,0 +1,515 @@
/*
* 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.model;
import android.appwidget.AppWidgetManager;
import android.content.ContentUris;
import android.content.Context;
import android.database.Cursor;
import android.text.TextUtils;
import android.util.Log;
import net.micode.notes.data.Notes;
import net.micode.notes.data.Notes.CallNote;
import net.micode.notes.data.Notes.DataColumns;
import net.micode.notes.data.Notes.DataConstants;
import net.micode.notes.data.Notes.NoteColumns;
import net.micode.notes.data.Notes.TextNote;
import net.micode.notes.tool.ResourceParser.NoteBgResources;
public class WorkingNote {
// Note for the working note
private Note mNote;
// Note Id
private long mNoteId;
// Note content
private String mContent;
// Note mode
private int mMode;
// Alert date
private long mAlertDate;
// Modified date
private long mModifiedDate;
// Background color id
private int mBgColorId;
// Widget id
private int mWidgetId;
// Widget type
private int mWidgetType;
// Folder id
private long mFolderId;
// Context
private Context mContext;
// Tag for logging
private static final String TAG = "WorkingNote";
// Whether the note is deleted
private boolean mIsDeleted;
// Listener for note setting changes
// 声明一个NoteSettingChangedListener类型的变量mNoteSettingStatusListener
private NoteSettingChangedListener mNoteSettingStatusListener;
// 定义一个常量DATA_PROJECTION用于存储数据列的名称
public static final String[] DATA_PROJECTION = new String[] {
// 数据列ID
DataColumns.ID,
// 数据列内容
DataColumns.CONTENT,
// 数据列MIME类型
DataColumns.MIME_TYPE,
// 数据列DATA1
DataColumns.DATA1,
// 数据列DATA2
DataColumns.DATA2,
// 数据列DATA3
DataColumns.DATA3,
// 数据列DATA4
DataColumns.DATA4,
};
// 定义一个常量数组用于存储NoteColumns中的字段
public static final String[] NOTE_PROJECTION = new String[] {
// 存储NoteColumns中的PARENT_ID字段
NoteColumns.PARENT_ID,
// 存储NoteColumns中的ALERTED_DATE字段
NoteColumns.ALERTED_DATE,
// 存储NoteColumns中的BG_COLOR_ID字段
NoteColumns.BG_COLOR_ID,
// 存储NoteColumns中的WIDGET_ID字段
NoteColumns.WIDGET_ID,
// 存储NoteColumns中的WIDGET_TYPE字段
NoteColumns.WIDGET_TYPE,
// 存储NoteColumns中的MODIFIED_DATE字段
NoteColumns.MODIFIED_DATE
};
// 数据ID列
private static final int DATA_ID_COLUMN = 0;
// 数据内容列
private static final int DATA_CONTENT_COLUMN = 1;
// 数据MIME类型列
private static final int DATA_MIME_TYPE_COLUMN = 2;
// 数据模式列
private static final int DATA_MODE_COLUMN = 3;
// 笔记父ID列
private static final int NOTE_PARENT_ID_COLUMN = 0;
// 笔记提醒日期列
private static final int NOTE_ALERTED_DATE_COLUMN = 1;
// 笔记背景颜色ID列
private static final int NOTE_BG_COLOR_ID_COLUMN = 2;
// 笔记小部件ID列
private static final int NOTE_WIDGET_ID_COLUMN = 3;
// 笔记小部件类型列
private static final int NOTE_WIDGET_TYPE_COLUMN = 4;
// 笔记修改日期列
private static final int NOTE_MODIFIED_DATE_COLUMN = 5;
// New note construct
// 构造函数用于创建一个WorkingNote对象
private WorkingNote(Context context, long folderId) {
// 保存上下文对象
mContext = context;
// 初始化提醒日期为0
mAlertDate = 0;
// 初始化修改日期为当前时间
mModifiedDate = System.currentTimeMillis();
// 保存文件夹ID
mFolderId = folderId;
// 创建一个新的Note对象
mNote = new Note();
// 初始化NoteID为0
mNoteId = 0;
// 初始化删除状态为false
mIsDeleted = false;
// 初始化模式为0
mMode = 0;
// 初始化小部件类型为无效类型
mWidgetType = Notes.TYPE_WIDGET_INVALIDE;
}
// Existing note construct
// 构造函数用于创建一个WorkingNote对象
private WorkingNote(Context context, long noteId, long folderId) {
// 保存上下文对象
mContext = context;
// 保存笔记ID
mNoteId = noteId;
// 保存文件夹ID
mFolderId = folderId;
// 初始化删除标志为false
mIsDeleted = false;
// 创建一个新的Note对象
mNote = new Note();
// 加载笔记
loadNote();
}
// 加载笔记
private void loadNote() {
// 从内容解析器中查询指定ID的笔记返回一个游标
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)
}, null);
if (cursor != null) {
// 如果游标不为空
if (cursor.moveToFirst()) {
// 将游标移动到第一行
do {
// 循环遍历游标中的每一行
String type = cursor.getString(DATA_MIME_TYPE_COLUMN);
// 获取当前行的MIME类型
if (DataConstants.NOTE.equals(type)) {
// 如果MIME类型为NOTE
mContent = cursor.getString(DATA_CONTENT_COLUMN);
// 获取当前行的内容
mMode = cursor.getInt(DATA_MODE_COLUMN);
// 获取当前行的模式
mNote.setTextDataId(cursor.getLong(DATA_ID_COLUMN));
// 设置文本数据ID
} else if (DataConstants.CALL_NOTE.equals(type)) {
// 如果MIME类型为CALL_NOTE
mNote.setCallDataId(cursor.getLong(DATA_ID_COLUMN));
// 设置电话数据ID
} else {
// 如果MIME类型不是NOTE或CALL_NOTE
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);
// 抛出异常
}
}
// 创建一个空的WorkingNote对象
public static WorkingNote createEmptyNote(Context context, long folderId, int widgetId,
int widgetType, int defaultBgColorId) {
// 创建一个新的WorkingNote对象传入上下文和文件夹ID
WorkingNote note = new WorkingNote(context, folderId);
// 设置背景颜色ID
note.setBgColorId(defaultBgColorId);
// 设置小部件ID
note.setWidgetId(widgetId);
// 设置小部件类型
note.setWidgetType(widgetType);
// 返回创建的WorkingNote对象
return note;
}
public static WorkingNote load(Context context, long id) {
// 根据传入的context和id创建一个新的WorkingNote对象
return new WorkingNote(context, id, 0);
}
public synchronized boolean saveNote() {
// 同步方法,保存工作笔记
if (isWorthSaving()) {
// 如果工作笔记值得保存
if (!existInDatabase()) {
// 如果工作笔记不存在于数据库中
if ((mNoteId = Note.getNewNoteId(mContext, mFolderId)) == 0) {
// 获取新的笔记id失败
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
*/
// 判断mWidgetId是否不等于AppWidgetManager.INVALID_APPWIDGET_IDmWidgetType是否不等于Notes.TYPE_WIDGET_INVALIDEmNoteSettingStatusListener是否不为空
if (mWidgetId != AppWidgetManager.INVALID_APPWIDGET_ID
&& mWidgetType != Notes.TYPE_WIDGET_INVALIDE
&& mNoteSettingStatusListener != null) {
// 如果满足上述条件则调用mNoteSettingStatusListener的onWidgetChanged方法
mNoteSettingStatusListener.onWidgetChanged();
}
// 返回true
return true;
} else {
// 如果不满足上述条件则返回false
return false;
}
}
public boolean existInDatabase() {
// 判断mNoteId是否大于0如果大于0则表示该笔记存在于数据库中
return mNoteId > 0;
}
private boolean isWorthSaving() {
// 判断是否需要保存笔记
if (mIsDeleted || (!existInDatabase() && TextUtils.isEmpty(mContent))
|| (existInDatabase() && !mNote.isLocalModified())) {
// 如果笔记被删除,或者笔记不存在于数据库中且内容为空,或者笔记存在于数据库中且未修改,则不需要保存
return false;
} else {
// 否则,需要保存
return true;
}
}
public void setOnSettingStatusChangedListener(NoteSettingChangedListener l) {
// 设置NoteSettingChangedListener监听器
mNoteSettingStatusListener = l;
}
public void setAlertDate(long date, boolean set) {
// 设置提醒日期
if (date != mAlertDate) {
mAlertDate = date;
mNote.setNoteValue(NoteColumns.ALERTED_DATE, String.valueOf(mAlertDate));
}
// 如果NoteSettingChangedListener监听器不为空则调用onClockAlertChanged方法
if (mNoteSettingStatusListener != null) {
mNoteSettingStatusListener.onClockAlertChanged(date, set);
}
}
public void markDeleted(boolean mark) {
// 标记是否已删除
mIsDeleted = mark;
// 如果widgetId不为无效widgetType不为无效并且NoteSettingStatusListener不为空则调用onWidgetChanged方法
if (mWidgetId != AppWidgetManager.INVALID_APPWIDGET_ID
&& mWidgetType != Notes.TYPE_WIDGET_INVALIDE && mNoteSettingStatusListener != null) {
mNoteSettingStatusListener.onWidgetChanged();
}
}
public void setBgColorId(int id) {
// 如果传入的id和当前背景颜色id不同
if (id != mBgColorId) {
// 更新背景颜色id
mBgColorId = id;
// 如果有监听器则调用监听器的onBackgroundColorChanged方法
if (mNoteSettingStatusListener != null) {
mNoteSettingStatusListener.onBackgroundColorChanged();
}
// 更新笔记的背景颜色id
mNote.setNoteValue(NoteColumns.BG_COLOR_ID, String.valueOf(id));
}
}
public void setCheckListMode(int mode) {
// 如果当前模式与传入的模式不同
if (mMode != mode) {
// 如果有监听器则调用监听器的onCheckListModeChanged方法传入当前模式和传入的模式
if (mNoteSettingStatusListener != null) {
mNoteSettingStatusListener.onCheckListModeChanged(mMode, mode);
}
// 将当前模式设置为传入的模式
mMode = mode;
// 将当前模式保存到文本数据中
mNote.setTextData(TextNote.MODE, String.valueOf(mMode));
}
}
// 设置小部件类型
public void setWidgetType(int type) {
// 如果传入的type与mWidgetType不同则更新mWidgetType的值并将新的值保存到mNote中
// 如果type不等于mWidgetType则执行以下操作
if (type != mWidgetType) {
// 将mWidgetType赋值为type
mWidgetType = type;
// 将mWidgetType的值设置为NoteColumns.WIDGET_TYPE
mNote.setNoteValue(NoteColumns.WIDGET_TYPE, String.valueOf(mWidgetType));
}
}
// 设置小部件ID
public void setWidgetId(int id) {
// 如果传入的id与mWidgetId不同则更新mWidgetId的值并将新的值保存到mNote中
// 如果id不等于mWidgetId
if (id != mWidgetId) {
// 将mWidgetId赋值为id
mWidgetId = id;
// 将mWidgetId的值设置为NoteColumns.WIDGET_ID
mNote.setNoteValue(NoteColumns.WIDGET_ID, String.valueOf(mWidgetId));
}
}
public void setWorkingText(String text) {
// 如果传入的文本和当前文本不相等
if (!TextUtils.equals(mContent, text)) {
// 将当前文本设置为传入的文本
mContent = text;
// 将传入的文本设置到Note对象中
mNote.setTextData(DataColumns.CONTENT, mContent);
}
}
public void convertToCallNote(String phoneNumber, long callDate) {
// 将通话日期转换为字符串并设置到mNote中
mNote.setCallData(CallNote.CALL_DATE, String.valueOf(callDate));
// 将电话号码设置到mNote中
mNote.setCallData(CallNote.PHONE_NUMBER, phoneNumber);
// 将父ID设置为通话记录文件夹的ID
mNote.setNoteValue(NoteColumns.PARENT_ID, String.valueOf(Notes.ID_CALL_RECORD_FOLDER));
}
public boolean hasClockAlert() {
// 判断mAlertDate是否大于0如果是则返回true否则返回false
return (mAlertDate > 0 ? true : false);
}
public String getContent() {
// 返回mContent的值
return mContent;
}
public long getAlertDate() {
// 返回提醒日期
return mAlertDate;
}
public long getModifiedDate() {
// 返回修改日期
return mModifiedDate;
}
// 获取背景颜色资源ID
public int getBgColorResId() {
// 从NoteBgResources类中获取背景颜色资源ID
return NoteBgResources.getNoteBgResource(mBgColorId);
}
// 获取背景颜色ID
public int getBgColorId() {
return mBgColorId;
}
public int getTitleBgResId() {
// 获取标题背景资源ID
return NoteBgResources.getNoteTitleBgResource(mBgColorId);
}
public int getCheckListMode() {
// 获取清单模式
return mMode;
}
public long getNoteId() {
// 获取笔记ID
return mNoteId;
}
public long getFolderId() {
// 获取文件夹ID
return mFolderId;
}
public int getWidgetId() {
// 返回mWidgetId的值
return mWidgetId;
}
public int getWidgetType() {
// 返回mWidgetType的值
return mWidgetType;
}
public interface NoteSettingChangedListener {
/**
* Called when the background color of current note has just changed
*/
void onBackgroundColorChanged();
/**
* Called when user set clock
*/
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
*/
void onCheckListModeChanged(int oldMode, int newMode);
}
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 102 KiB

Loading…
Cancel
Save