Compare commits

...

2 Commits

@ -53,7 +53,9 @@ public class Note {
values.put(NoteColumns.LOCAL_MODIFIED, 1);
values.put(NoteColumns.PARENT_ID, folderId);
Uri uri = context.getContentResolver().insert(Notes.CONTENT_NOTE_URI, values);
/**
ContentResolver()ContentProvider
*/
long noteId = 0;
try {
noteId = Long.valueOf(uri.getPathSegments().get(1));
@ -67,6 +69,9 @@ public class Note {
return noteId;
}
/**
便便便
*/
public Note() {
mNoteDiffValues = new ContentValues();
mNoteData = new NoteData();
@ -81,18 +86,30 @@ public class Note {
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);
}
/**
ID
*/
public void setCallData(String key, String value) {
mNoteData.setCallData(key, value);
@ -132,6 +149,9 @@ public class Note {
return true;
}
/**
* 便
*/
private class NoteData {
private long mTextDataId;
@ -187,6 +207,9 @@ public class Note {
if (noteId <= 0) {
throw new IllegalArgumentException("Wrong note id:" + noteId);
}
/**
*
*/
ArrayList<ContentProviderOperation> operationList = new ArrayList<ContentProviderOperation>();
ContentProviderOperation.Builder builder = null;
@ -212,6 +235,9 @@ public class Note {
}
mTextDataValues.clear();
}
/**
* DataColumns
*/
if (mCallDataValues.size() > 0) {
mCallDataValues.put(DataColumns.NOTE_ID, noteId);

@ -62,6 +62,9 @@ public class WorkingNote {
private NoteSettingChangedListener mNoteSettingStatusListener;
/**
* DATA_PROJECTION
*/
public static final String[] DATA_PROJECTION = new String[]{
DataColumns.ID,
DataColumns.CONTENT,
@ -102,6 +105,10 @@ public class WorkingNote {
private static final int NOTE_MODIFIED_DATE_COLUMN = 5;
// New note construct
/**
* WorkingNote
* */
private WorkingNote(Context context, long folderId) {
mContext = context;
mAlertDate = 0;
@ -124,6 +131,9 @@ public class WorkingNote {
loadNote();
}
/**
* query
*/
private void loadNote() {
Cursor cursor = mContext.getContentResolver().query(
ContentUris.withAppendedId(Notes.CONTENT_NOTE_URI, mNoteId), NOTE_PROJECTION, null,
@ -151,7 +161,9 @@ public class WorkingNote {
DataColumns.NOTE_ID + "=?", new String[]{
String.valueOf(mNoteId)
}, null);
/**
*
*/
if (cursor != null) {
if (cursor.moveToFirst()) {
do {
@ -174,6 +186,9 @@ public class WorkingNote {
}
}
/**
* Note contextidwidget
*/
public static WorkingNote createEmptyNote(Context context, long folderId, int widgetId,
int widgetType, int defaultBgColorId) {
WorkingNote note = new WorkingNote(context, folderId);
@ -229,6 +244,10 @@ public class WorkingNote {
mNoteSettingStatusListener = l;
}
/**
* AlertDate
* mAlertDatedatamAlertDateNoteValue
*/
public void setAlertDate(long date, boolean set) {
if (date != mAlertDate) {
mAlertDate = date;
@ -239,6 +258,9 @@ public class WorkingNote {
}
}
/**
*
*/
public void markDeleted(boolean mark) {
mIsDeleted = mark;
if (mWidgetId != AppWidgetManager.INVALID_APPWIDGET_ID
@ -247,6 +269,9 @@ public class WorkingNote {
}
}
/**
*
*/
public void setBgColorId(int id) {
if (id != mBgColorId) {
mBgColorId = id;
@ -257,6 +282,9 @@ public class WorkingNote {
}
}
/**
*
*/
public void setCheckListMode(int mode) {
if (mMode != mode) {
if (mNoteSettingStatusListener != null) {
@ -267,6 +295,9 @@ public class WorkingNote {
}
}
/**
*WidgetType
*/
public void setWidgetType(int type) {
if (type != mWidgetType) {
mWidgetType = type;
@ -274,6 +305,9 @@ public class WorkingNote {
}
}
/**
*WidgetId
*/
public void setWidgetId(int id) {
if (id != mWidgetId) {
mWidgetId = id;
@ -281,6 +315,9 @@ public class WorkingNote {
}
}
/**
*setWorkingText
*/
public void setWorkingText(String text) {
if (!TextUtils.equals(mContent, text)) {
mContent = text;

Loading…
Cancel
Save