|
|
|
@ -29,6 +29,7 @@ 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.data.NotesProvider;
|
|
|
|
|
import net.micode.notes.tool.ResourceParser.NoteBgResources;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@ -62,6 +63,8 @@ public class WorkingNote {
|
|
|
|
|
|
|
|
|
|
private String mTop = "0";
|
|
|
|
|
|
|
|
|
|
private String mStar = "0";
|
|
|
|
|
|
|
|
|
|
private NoteSettingChangedListener mNoteSettingStatusListener;
|
|
|
|
|
|
|
|
|
|
public static final String[] DATA_PROJECTION = new String[] {
|
|
|
|
@ -81,7 +84,8 @@ public class WorkingNote {
|
|
|
|
|
NoteColumns.WIDGET_ID,
|
|
|
|
|
NoteColumns.WIDGET_TYPE,
|
|
|
|
|
NoteColumns.MODIFIED_DATE,
|
|
|
|
|
NoteColumns.TOP
|
|
|
|
|
NoteColumns.TOP,
|
|
|
|
|
NoteColumns.STAR,
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
private static final int DATA_ID_COLUMN = 0;
|
|
|
|
@ -106,6 +110,8 @@ public class WorkingNote {
|
|
|
|
|
|
|
|
|
|
private static final int NOTE_TOP_COLUMN = 6;
|
|
|
|
|
|
|
|
|
|
private static final int NOTE_STAR_COLUMN = 7;
|
|
|
|
|
|
|
|
|
|
// New note construct
|
|
|
|
|
private WorkingNote(Context context, long folderId) {
|
|
|
|
|
mContext = context;
|
|
|
|
@ -118,6 +124,7 @@ public class WorkingNote {
|
|
|
|
|
mMode = 0;
|
|
|
|
|
mWidgetType = Notes.TYPE_WIDGET_INVALIDE;
|
|
|
|
|
mTop = String.valueOf(getTopId());
|
|
|
|
|
mStar = String.valueOf(getStarId());
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// Existing note construct
|
|
|
|
@ -144,6 +151,7 @@ public class WorkingNote {
|
|
|
|
|
mAlertDate = cursor.getLong(NOTE_ALERTED_DATE_COLUMN);
|
|
|
|
|
mModifiedDate = cursor.getLong(NOTE_MODIFIED_DATE_COLUMN);
|
|
|
|
|
mTop = cursor.getString(NOTE_TOP_COLUMN);
|
|
|
|
|
mStar = cursor.getString(NOTE_STAR_COLUMN);
|
|
|
|
|
}
|
|
|
|
|
cursor.close();
|
|
|
|
|
} else {
|
|
|
|
@ -248,6 +256,17 @@ public class WorkingNote {
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public void setStar(String Star){
|
|
|
|
|
if (!mStar.equals(Star)){
|
|
|
|
|
mStar = Star;
|
|
|
|
|
mNote.setStarValue(NoteColumns.STAR,mStar);
|
|
|
|
|
NotesProvider.setStarFolder(mFolderId, NotesProvider.isStarFolder(mNoteId, mFolderId,Star.equals("1")));
|
|
|
|
|
if (mNoteSettingStatusListener != null) {
|
|
|
|
|
mNoteSettingStatusListener.onStarChanged(Star);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
public void setAlertDate(long date, boolean set) {
|
|
|
|
|
if (date != mAlertDate) {
|
|
|
|
@ -326,6 +345,14 @@ public class WorkingNote {
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public int getStarId() {
|
|
|
|
|
if (mStar.equals("1")) {
|
|
|
|
|
return 1;
|
|
|
|
|
} else {
|
|
|
|
|
return 0;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public String getContent() {
|
|
|
|
|
return mContent;
|
|
|
|
|
}
|
|
|
|
@ -381,6 +408,11 @@ public class WorkingNote {
|
|
|
|
|
*/
|
|
|
|
|
void onTopChanged(String Top);
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* Called when user set star
|
|
|
|
|
*/
|
|
|
|
|
void onStarChanged(String Star);
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* Called when user set clock
|
|
|
|
|
*/
|
|
|
|
|