Compare commits
1 Commits
Author | SHA1 | Date |
---|---|---|
|
dae864f9ce | 2 months ago |
@ -1 +0,0 @@
|
||||
xiaomibianqian
|
@ -1,18 +0,0 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<project version="4">
|
||||
<component name="GradleSettings">
|
||||
<option name="linkedExternalProjectsSettings">
|
||||
<GradleProjectSettings>
|
||||
<option name="testRunner" value="CHOOSE_PER_TEST" />
|
||||
<option name="externalProjectPath" value="$PROJECT_DIR$" />
|
||||
<option name="gradleJvm" value="#GRADLE_LOCAL_JAVA_HOME" />
|
||||
<option name="modules">
|
||||
<set>
|
||||
<option value="$PROJECT_DIR$" />
|
||||
<option value="$PROJECT_DIR$/app" />
|
||||
</set>
|
||||
</option>
|
||||
</GradleProjectSettings>
|
||||
</option>
|
||||
</component>
|
||||
</project>
|
@ -1,6 +0,0 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<project version="4">
|
||||
<component name="VcsDirectoryMappings">
|
||||
<mapping directory="$PROJECT_DIR$/.." vcs="Git" />
|
||||
</component>
|
||||
</project>
|
@ -1,43 +0,0 @@
|
||||
plugins {
|
||||
alias(libs.plugins.android.application)
|
||||
}
|
||||
|
||||
android {
|
||||
namespace = "net.micode.notes"
|
||||
compileSdk = 35
|
||||
|
||||
defaultConfig {
|
||||
applicationId = "net.micode.notes"
|
||||
minSdk = 24
|
||||
targetSdk = 35
|
||||
versionCode = 1
|
||||
versionName = "1.0"
|
||||
|
||||
testInstrumentationRunner = "androidx.test.runner.AndroidJUnitRunner"
|
||||
}
|
||||
|
||||
buildTypes {
|
||||
release {
|
||||
isMinifyEnabled = false
|
||||
proguardFiles(
|
||||
getDefaultProguardFile("proguard-android-optimize.txt"),
|
||||
"proguard-rules.pro"
|
||||
)
|
||||
}
|
||||
}
|
||||
compileOptions {
|
||||
sourceCompatibility = JavaVersion.VERSION_11
|
||||
targetCompatibility = JavaVersion.VERSION_11
|
||||
}
|
||||
}
|
||||
|
||||
dependencies {
|
||||
|
||||
implementation(libs.appcompat)
|
||||
implementation(libs.material)
|
||||
implementation(libs.activity)
|
||||
implementation(libs.constraintlayout)
|
||||
testImplementation(libs.junit)
|
||||
androidTestImplementation(libs.ext.junit)
|
||||
androidTestImplementation(libs.espresso.core)
|
||||
}
|
@ -1,82 +0,0 @@
|
||||
/*
|
||||
* 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.gtask.data;
|
||||
|
||||
import android.database.Cursor;
|
||||
import android.util.Log;
|
||||
|
||||
import net.micode.notes.tool.GTaskStringUtils;
|
||||
|
||||
import org.json.JSONException;
|
||||
import org.json.JSONObject;
|
||||
|
||||
|
||||
public class MetaData extends Task {
|
||||
private final static String TAG = MetaData.class.getSimpleName();
|
||||
|
||||
private String mRelatedGid = null;
|
||||
|
||||
public void setMeta(String gid, JSONObject metaInfo) {
|
||||
try {
|
||||
metaInfo.put(GTaskStringUtils.META_HEAD_GTASK_ID, gid);
|
||||
} catch (JSONException e) {
|
||||
Log.e(TAG, "failed to put related gid");
|
||||
}
|
||||
setNotes(metaInfo.toString());
|
||||
setName(GTaskStringUtils.META_NOTE_NAME);
|
||||
}
|
||||
|
||||
public String getRelatedGid() {
|
||||
return mRelatedGid;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isWorthSaving() {
|
||||
return getNotes() != null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setContentByRemoteJSON(JSONObject js) {
|
||||
super.setContentByRemoteJSON(js);
|
||||
if (getNotes() != null) {
|
||||
try {
|
||||
JSONObject metaInfo = new JSONObject(getNotes().trim());
|
||||
mRelatedGid = metaInfo.getString(GTaskStringUtils.META_HEAD_GTASK_ID);
|
||||
} catch (JSONException e) {
|
||||
Log.w(TAG, "failed to get related gid");
|
||||
mRelatedGid = null;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setContentByLocalJSON(JSONObject js) {
|
||||
// this function should not be called
|
||||
throw new IllegalAccessError("MetaData:setContentByLocalJSON should not be called");
|
||||
}
|
||||
|
||||
@Override
|
||||
public JSONObject getLocalJSONFromContent() {
|
||||
throw new IllegalAccessError("MetaData:getLocalJSONFromContent should not be called");
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getSyncAction(Cursor c) {
|
||||
throw new IllegalAccessError("MetaData:getSyncAction should not be called");
|
||||
}
|
||||
|
||||
}
|
@ -1,101 +0,0 @@
|
||||
/*
|
||||
* 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.gtask.data;
|
||||
|
||||
import android.database.Cursor;
|
||||
|
||||
import org.json.JSONObject;
|
||||
|
||||
public abstract class Node {
|
||||
public static final int SYNC_ACTION_NONE = 0;
|
||||
|
||||
public static final int SYNC_ACTION_ADD_REMOTE = 1;
|
||||
|
||||
public static final int SYNC_ACTION_ADD_LOCAL = 2;
|
||||
|
||||
public static final int SYNC_ACTION_DEL_REMOTE = 3;
|
||||
|
||||
public static final int SYNC_ACTION_DEL_LOCAL = 4;
|
||||
|
||||
public static final int SYNC_ACTION_UPDATE_REMOTE = 5;
|
||||
|
||||
public static final int SYNC_ACTION_UPDATE_LOCAL = 6;
|
||||
|
||||
public static final int SYNC_ACTION_UPDATE_CONFLICT = 7;
|
||||
|
||||
public static final int SYNC_ACTION_ERROR = 8;
|
||||
|
||||
private String mGid;
|
||||
|
||||
private String mName;
|
||||
|
||||
private long mLastModified;
|
||||
|
||||
private boolean mDeleted;
|
||||
|
||||
public Node() {
|
||||
mGid = null;
|
||||
mName = "";
|
||||
mLastModified = 0;
|
||||
mDeleted = false;
|
||||
}
|
||||
|
||||
public abstract JSONObject getCreateAction(int actionId);
|
||||
|
||||
public abstract JSONObject getUpdateAction(int actionId);
|
||||
|
||||
public abstract void setContentByRemoteJSON(JSONObject js);
|
||||
|
||||
public abstract void setContentByLocalJSON(JSONObject js);
|
||||
|
||||
public abstract JSONObject getLocalJSONFromContent();
|
||||
|
||||
public abstract int getSyncAction(Cursor c);
|
||||
|
||||
public void setGid(String gid) {
|
||||
this.mGid = gid;
|
||||
}
|
||||
|
||||
public void setName(String name) {
|
||||
this.mName = name;
|
||||
}
|
||||
|
||||
public void setLastModified(long lastModified) {
|
||||
this.mLastModified = lastModified;
|
||||
}
|
||||
|
||||
public void setDeleted(boolean deleted) {
|
||||
this.mDeleted = deleted;
|
||||
}
|
||||
|
||||
public String getGid() {
|
||||
return this.mGid;
|
||||
}
|
||||
|
||||
public String getName() {
|
||||
return this.mName;
|
||||
}
|
||||
|
||||
public long getLastModified() {
|
||||
return this.mLastModified;
|
||||
}
|
||||
|
||||
public boolean getDeleted() {
|
||||
return this.mDeleted;
|
||||
}
|
||||
|
||||
}
|
@ -1,189 +0,0 @@
|
||||
/*
|
||||
* 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.gtask.data;
|
||||
|
||||
import android.content.ContentResolver;
|
||||
import android.content.ContentUris;
|
||||
import android.content.ContentValues;
|
||||
import android.content.Context;
|
||||
import android.database.Cursor;
|
||||
import android.net.Uri;
|
||||
import android.util.Log;
|
||||
|
||||
import net.micode.notes.data.Notes;
|
||||
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.NotesDatabaseHelper.TABLE;
|
||||
import net.micode.notes.gtask.exception.ActionFailureException;
|
||||
|
||||
import org.json.JSONException;
|
||||
import org.json.JSONObject;
|
||||
|
||||
|
||||
public class SqlData {
|
||||
private static final String TAG = SqlData.class.getSimpleName();
|
||||
|
||||
private static final int INVALID_ID = -99999;
|
||||
|
||||
public static final String[] PROJECTION_DATA = new String[] {
|
||||
DataColumns.ID, DataColumns.MIME_TYPE, DataColumns.CONTENT, DataColumns.DATA1,
|
||||
DataColumns.DATA3
|
||||
};
|
||||
|
||||
public static final int DATA_ID_COLUMN = 0;
|
||||
|
||||
public static final int DATA_MIME_TYPE_COLUMN = 1;
|
||||
|
||||
public static final int DATA_CONTENT_COLUMN = 2;
|
||||
|
||||
public static final int DATA_CONTENT_DATA_1_COLUMN = 3;
|
||||
|
||||
public static final int DATA_CONTENT_DATA_3_COLUMN = 4;
|
||||
|
||||
private ContentResolver mContentResolver;
|
||||
|
||||
private boolean mIsCreate;
|
||||
|
||||
private long mDataId;
|
||||
|
||||
private String mDataMimeType;
|
||||
|
||||
private String mDataContent;
|
||||
|
||||
private long mDataContentData1;
|
||||
|
||||
private String mDataContentData3;
|
||||
|
||||
private ContentValues mDiffDataValues;
|
||||
|
||||
public SqlData(Context context) {
|
||||
mContentResolver = context.getContentResolver();
|
||||
mIsCreate = true;
|
||||
mDataId = INVALID_ID;
|
||||
mDataMimeType = DataConstants.NOTE;
|
||||
mDataContent = "";
|
||||
mDataContentData1 = 0;
|
||||
mDataContentData3 = "";
|
||||
mDiffDataValues = new ContentValues();
|
||||
}
|
||||
|
||||
public SqlData(Context context, Cursor c) {
|
||||
mContentResolver = context.getContentResolver();
|
||||
mIsCreate = false;
|
||||
loadFromCursor(c);
|
||||
mDiffDataValues = new ContentValues();
|
||||
}
|
||||
|
||||
private void loadFromCursor(Cursor c) {
|
||||
mDataId = c.getLong(DATA_ID_COLUMN);
|
||||
mDataMimeType = c.getString(DATA_MIME_TYPE_COLUMN);
|
||||
mDataContent = c.getString(DATA_CONTENT_COLUMN);
|
||||
mDataContentData1 = c.getLong(DATA_CONTENT_DATA_1_COLUMN);
|
||||
mDataContentData3 = c.getString(DATA_CONTENT_DATA_3_COLUMN);
|
||||
}
|
||||
|
||||
public void setContent(JSONObject js) throws JSONException {
|
||||
long dataId = js.has(DataColumns.ID) ? js.getLong(DataColumns.ID) : INVALID_ID;
|
||||
if (mIsCreate || mDataId != dataId) {
|
||||
mDiffDataValues.put(DataColumns.ID, dataId);
|
||||
}
|
||||
mDataId = dataId;
|
||||
|
||||
String dataMimeType = js.has(DataColumns.MIME_TYPE) ? js.getString(DataColumns.MIME_TYPE)
|
||||
: DataConstants.NOTE;
|
||||
if (mIsCreate || !mDataMimeType.equals(dataMimeType)) {
|
||||
mDiffDataValues.put(DataColumns.MIME_TYPE, dataMimeType);
|
||||
}
|
||||
mDataMimeType = dataMimeType;
|
||||
|
||||
String dataContent = js.has(DataColumns.CONTENT) ? js.getString(DataColumns.CONTENT) : "";
|
||||
if (mIsCreate || !mDataContent.equals(dataContent)) {
|
||||
mDiffDataValues.put(DataColumns.CONTENT, dataContent);
|
||||
}
|
||||
mDataContent = dataContent;
|
||||
|
||||
long dataContentData1 = js.has(DataColumns.DATA1) ? js.getLong(DataColumns.DATA1) : 0;
|
||||
if (mIsCreate || mDataContentData1 != dataContentData1) {
|
||||
mDiffDataValues.put(DataColumns.DATA1, dataContentData1);
|
||||
}
|
||||
mDataContentData1 = dataContentData1;
|
||||
|
||||
String dataContentData3 = js.has(DataColumns.DATA3) ? js.getString(DataColumns.DATA3) : "";
|
||||
if (mIsCreate || !mDataContentData3.equals(dataContentData3)) {
|
||||
mDiffDataValues.put(DataColumns.DATA3, dataContentData3);
|
||||
}
|
||||
mDataContentData3 = dataContentData3;
|
||||
}
|
||||
|
||||
public JSONObject getContent() throws JSONException {
|
||||
if (mIsCreate) {
|
||||
Log.e(TAG, "it seems that we haven't created this in database yet");
|
||||
return null;
|
||||
}
|
||||
JSONObject js = new JSONObject();
|
||||
js.put(DataColumns.ID, mDataId);
|
||||
js.put(DataColumns.MIME_TYPE, mDataMimeType);
|
||||
js.put(DataColumns.CONTENT, mDataContent);
|
||||
js.put(DataColumns.DATA1, mDataContentData1);
|
||||
js.put(DataColumns.DATA3, mDataContentData3);
|
||||
return js;
|
||||
}
|
||||
|
||||
public void commit(long noteId, boolean validateVersion, long version) {
|
||||
|
||||
if (mIsCreate) {
|
||||
if (mDataId == INVALID_ID && mDiffDataValues.containsKey(DataColumns.ID)) {
|
||||
mDiffDataValues.remove(DataColumns.ID);
|
||||
}
|
||||
|
||||
mDiffDataValues.put(DataColumns.NOTE_ID, noteId);
|
||||
Uri uri = mContentResolver.insert(Notes.CONTENT_DATA_URI, mDiffDataValues);
|
||||
try {
|
||||
mDataId = Long.valueOf(uri.getPathSegments().get(1));
|
||||
} catch (NumberFormatException e) {
|
||||
Log.e(TAG, "Get note id error :" + e.toString());
|
||||
throw new ActionFailureException("create note failed");
|
||||
}
|
||||
} else {
|
||||
if (mDiffDataValues.size() > 0) {
|
||||
int result = 0;
|
||||
if (!validateVersion) {
|
||||
result = mContentResolver.update(ContentUris.withAppendedId(
|
||||
Notes.CONTENT_DATA_URI, mDataId), mDiffDataValues, null, null);
|
||||
} else {
|
||||
result = mContentResolver.update(ContentUris.withAppendedId(
|
||||
Notes.CONTENT_DATA_URI, mDataId), mDiffDataValues,
|
||||
" ? in (SELECT " + NoteColumns.ID + " FROM " + TABLE.NOTE
|
||||
+ " WHERE " + NoteColumns.VERSION + "=?)", new String[] {
|
||||
String.valueOf(noteId), String.valueOf(version)
|
||||
});
|
||||
}
|
||||
if (result == 0) {
|
||||
Log.w(TAG, "there is no update. maybe user updates note when syncing");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
mDiffDataValues.clear();
|
||||
mIsCreate = false;
|
||||
}
|
||||
|
||||
public long getId() {
|
||||
return mDataId;
|
||||
}
|
||||
}
|
@ -1,505 +0,0 @@
|
||||
/*
|
||||
* 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.gtask.data;
|
||||
|
||||
import android.appwidget.AppWidgetManager;
|
||||
import android.content.ContentResolver;
|
||||
import android.content.ContentValues;
|
||||
import android.content.Context;
|
||||
import android.database.Cursor;
|
||||
import android.net.Uri;
|
||||
import android.util.Log;
|
||||
|
||||
import net.micode.notes.data.Notes;
|
||||
import net.micode.notes.data.Notes.DataColumns;
|
||||
import net.micode.notes.data.Notes.NoteColumns;
|
||||
import net.micode.notes.gtask.exception.ActionFailureException;
|
||||
import net.micode.notes.tool.GTaskStringUtils;
|
||||
import net.micode.notes.tool.ResourceParser;
|
||||
|
||||
import org.json.JSONArray;
|
||||
import org.json.JSONException;
|
||||
import org.json.JSONObject;
|
||||
|
||||
import java.util.ArrayList;
|
||||
|
||||
|
||||
public class SqlNote {
|
||||
private static final String TAG = SqlNote.class.getSimpleName();
|
||||
|
||||
private static final int INVALID_ID = -99999;
|
||||
|
||||
public static final String[] PROJECTION_NOTE = new String[] {
|
||||
NoteColumns.ID, NoteColumns.ALERTED_DATE, NoteColumns.BG_COLOR_ID,
|
||||
NoteColumns.CREATED_DATE, NoteColumns.HAS_ATTACHMENT, NoteColumns.MODIFIED_DATE,
|
||||
NoteColumns.NOTES_COUNT, NoteColumns.PARENT_ID, NoteColumns.SNIPPET, NoteColumns.TYPE,
|
||||
NoteColumns.WIDGET_ID, NoteColumns.WIDGET_TYPE, NoteColumns.SYNC_ID,
|
||||
NoteColumns.LOCAL_MODIFIED, NoteColumns.ORIGIN_PARENT_ID, NoteColumns.GTASK_ID,
|
||||
NoteColumns.VERSION
|
||||
};
|
||||
|
||||
public static final int ID_COLUMN = 0;
|
||||
|
||||
public static final int ALERTED_DATE_COLUMN = 1;
|
||||
|
||||
public static final int BG_COLOR_ID_COLUMN = 2;
|
||||
|
||||
public static final int CREATED_DATE_COLUMN = 3;
|
||||
|
||||
public static final int HAS_ATTACHMENT_COLUMN = 4;
|
||||
|
||||
public static final int MODIFIED_DATE_COLUMN = 5;
|
||||
|
||||
public static final int NOTES_COUNT_COLUMN = 6;
|
||||
|
||||
public static final int PARENT_ID_COLUMN = 7;
|
||||
|
||||
public static final int SNIPPET_COLUMN = 8;
|
||||
|
||||
public static final int TYPE_COLUMN = 9;
|
||||
|
||||
public static final int WIDGET_ID_COLUMN = 10;
|
||||
|
||||
public static final int WIDGET_TYPE_COLUMN = 11;
|
||||
|
||||
public static final int SYNC_ID_COLUMN = 12;
|
||||
|
||||
public static final int LOCAL_MODIFIED_COLUMN = 13;
|
||||
|
||||
public static final int ORIGIN_PARENT_ID_COLUMN = 14;
|
||||
|
||||
public static final int GTASK_ID_COLUMN = 15;
|
||||
|
||||
public static final int VERSION_COLUMN = 16;
|
||||
|
||||
private Context mContext;
|
||||
|
||||
private ContentResolver mContentResolver;
|
||||
|
||||
private boolean mIsCreate;
|
||||
|
||||
private long mId;
|
||||
|
||||
private long mAlertDate;
|
||||
|
||||
private int mBgColorId;
|
||||
|
||||
private long mCreatedDate;
|
||||
|
||||
private int mHasAttachment;
|
||||
|
||||
private long mModifiedDate;
|
||||
|
||||
private long mParentId;
|
||||
|
||||
private String mSnippet;
|
||||
|
||||
private int mType;
|
||||
|
||||
private int mWidgetId;
|
||||
|
||||
private int mWidgetType;
|
||||
|
||||
private long mOriginParent;
|
||||
|
||||
private long mVersion;
|
||||
|
||||
private ContentValues mDiffNoteValues;
|
||||
|
||||
private ArrayList<SqlData> mDataList;
|
||||
|
||||
public SqlNote(Context context) {
|
||||
mContext = context;
|
||||
mContentResolver = context.getContentResolver();
|
||||
mIsCreate = true;
|
||||
mId = INVALID_ID;
|
||||
mAlertDate = 0;
|
||||
mBgColorId = ResourceParser.getDefaultBgId(context);
|
||||
mCreatedDate = System.currentTimeMillis();
|
||||
mHasAttachment = 0;
|
||||
mModifiedDate = System.currentTimeMillis();
|
||||
mParentId = 0;
|
||||
mSnippet = "";
|
||||
mType = Notes.TYPE_NOTE;
|
||||
mWidgetId = AppWidgetManager.INVALID_APPWIDGET_ID;
|
||||
mWidgetType = Notes.TYPE_WIDGET_INVALIDE;
|
||||
mOriginParent = 0;
|
||||
mVersion = 0;
|
||||
mDiffNoteValues = new ContentValues();
|
||||
mDataList = new ArrayList<SqlData>();
|
||||
}
|
||||
|
||||
public SqlNote(Context context, Cursor c) {
|
||||
mContext = context;
|
||||
mContentResolver = context.getContentResolver();
|
||||
mIsCreate = false;
|
||||
loadFromCursor(c);
|
||||
mDataList = new ArrayList<SqlData>();
|
||||
if (mType == Notes.TYPE_NOTE)
|
||||
loadDataContent();
|
||||
mDiffNoteValues = new ContentValues();
|
||||
}
|
||||
|
||||
public SqlNote(Context context, long id) {
|
||||
mContext = context;
|
||||
mContentResolver = context.getContentResolver();
|
||||
mIsCreate = false;
|
||||
loadFromCursor(id);
|
||||
mDataList = new ArrayList<SqlData>();
|
||||
if (mType == Notes.TYPE_NOTE)
|
||||
loadDataContent();
|
||||
mDiffNoteValues = new ContentValues();
|
||||
|
||||
}
|
||||
|
||||
private void loadFromCursor(long id) {
|
||||
Cursor c = null;
|
||||
try {
|
||||
c = mContentResolver.query(Notes.CONTENT_NOTE_URI, PROJECTION_NOTE, "(_id=?)",
|
||||
new String[] {
|
||||
String.valueOf(id)
|
||||
}, null);
|
||||
if (c != null) {
|
||||
c.moveToNext();
|
||||
loadFromCursor(c);
|
||||
} else {
|
||||
Log.w(TAG, "loadFromCursor: cursor = null");
|
||||
}
|
||||
} finally {
|
||||
if (c != null)
|
||||
c.close();
|
||||
}
|
||||
}
|
||||
|
||||
private void loadFromCursor(Cursor c) {
|
||||
mId = c.getLong(ID_COLUMN);
|
||||
mAlertDate = c.getLong(ALERTED_DATE_COLUMN);
|
||||
mBgColorId = c.getInt(BG_COLOR_ID_COLUMN);
|
||||
mCreatedDate = c.getLong(CREATED_DATE_COLUMN);
|
||||
mHasAttachment = c.getInt(HAS_ATTACHMENT_COLUMN);
|
||||
mModifiedDate = c.getLong(MODIFIED_DATE_COLUMN);
|
||||
mParentId = c.getLong(PARENT_ID_COLUMN);
|
||||
mSnippet = c.getString(SNIPPET_COLUMN);
|
||||
mType = c.getInt(TYPE_COLUMN);
|
||||
mWidgetId = c.getInt(WIDGET_ID_COLUMN);
|
||||
mWidgetType = c.getInt(WIDGET_TYPE_COLUMN);
|
||||
mVersion = c.getLong(VERSION_COLUMN);
|
||||
}
|
||||
|
||||
private void loadDataContent() {
|
||||
Cursor c = null;
|
||||
mDataList.clear();
|
||||
try {
|
||||
c = mContentResolver.query(Notes.CONTENT_DATA_URI, SqlData.PROJECTION_DATA,
|
||||
"(note_id=?)", new String[] {
|
||||
String.valueOf(mId)
|
||||
}, null);
|
||||
if (c != null) {
|
||||
if (c.getCount() == 0) {
|
||||
Log.w(TAG, "it seems that the note has not data");
|
||||
return;
|
||||
}
|
||||
while (c.moveToNext()) {
|
||||
SqlData data = new SqlData(mContext, c);
|
||||
mDataList.add(data);
|
||||
}
|
||||
} else {
|
||||
Log.w(TAG, "loadDataContent: cursor = null");
|
||||
}
|
||||
} finally {
|
||||
if (c != null)
|
||||
c.close();
|
||||
}
|
||||
}
|
||||
|
||||
public boolean setContent(JSONObject js) {
|
||||
try {
|
||||
JSONObject note = js.getJSONObject(GTaskStringUtils.META_HEAD_NOTE);
|
||||
if (note.getInt(NoteColumns.TYPE) == Notes.TYPE_SYSTEM) {
|
||||
Log.w(TAG, "cannot set system folder");
|
||||
} else if (note.getInt(NoteColumns.TYPE) == Notes.TYPE_FOLDER) {
|
||||
// for folder we can only update the snnipet and type
|
||||
String snippet = note.has(NoteColumns.SNIPPET) ? note
|
||||
.getString(NoteColumns.SNIPPET) : "";
|
||||
if (mIsCreate || !mSnippet.equals(snippet)) {
|
||||
mDiffNoteValues.put(NoteColumns.SNIPPET, snippet);
|
||||
}
|
||||
mSnippet = snippet;
|
||||
|
||||
int type = note.has(NoteColumns.TYPE) ? note.getInt(NoteColumns.TYPE)
|
||||
: Notes.TYPE_NOTE;
|
||||
if (mIsCreate || mType != type) {
|
||||
mDiffNoteValues.put(NoteColumns.TYPE, type);
|
||||
}
|
||||
mType = type;
|
||||
} else if (note.getInt(NoteColumns.TYPE) == Notes.TYPE_NOTE) {
|
||||
JSONArray dataArray = js.getJSONArray(GTaskStringUtils.META_HEAD_DATA);
|
||||
long id = note.has(NoteColumns.ID) ? note.getLong(NoteColumns.ID) : INVALID_ID;
|
||||
if (mIsCreate || mId != id) {
|
||||
mDiffNoteValues.put(NoteColumns.ID, id);
|
||||
}
|
||||
mId = id;
|
||||
|
||||
long alertDate = note.has(NoteColumns.ALERTED_DATE) ? note
|
||||
.getLong(NoteColumns.ALERTED_DATE) : 0;
|
||||
if (mIsCreate || mAlertDate != alertDate) {
|
||||
mDiffNoteValues.put(NoteColumns.ALERTED_DATE, alertDate);
|
||||
}
|
||||
mAlertDate = alertDate;
|
||||
|
||||
int bgColorId = note.has(NoteColumns.BG_COLOR_ID) ? note
|
||||
.getInt(NoteColumns.BG_COLOR_ID) : ResourceParser.getDefaultBgId(mContext);
|
||||
if (mIsCreate || mBgColorId != bgColorId) {
|
||||
mDiffNoteValues.put(NoteColumns.BG_COLOR_ID, bgColorId);
|
||||
}
|
||||
mBgColorId = bgColorId;
|
||||
|
||||
long createDate = note.has(NoteColumns.CREATED_DATE) ? note
|
||||
.getLong(NoteColumns.CREATED_DATE) : System.currentTimeMillis();
|
||||
if (mIsCreate || mCreatedDate != createDate) {
|
||||
mDiffNoteValues.put(NoteColumns.CREATED_DATE, createDate);
|
||||
}
|
||||
mCreatedDate = createDate;
|
||||
|
||||
int hasAttachment = note.has(NoteColumns.HAS_ATTACHMENT) ? note
|
||||
.getInt(NoteColumns.HAS_ATTACHMENT) : 0;
|
||||
if (mIsCreate || mHasAttachment != hasAttachment) {
|
||||
mDiffNoteValues.put(NoteColumns.HAS_ATTACHMENT, hasAttachment);
|
||||
}
|
||||
mHasAttachment = hasAttachment;
|
||||
|
||||
long modifiedDate = note.has(NoteColumns.MODIFIED_DATE) ? note
|
||||
.getLong(NoteColumns.MODIFIED_DATE) : System.currentTimeMillis();
|
||||
if (mIsCreate || mModifiedDate != modifiedDate) {
|
||||
mDiffNoteValues.put(NoteColumns.MODIFIED_DATE, modifiedDate);
|
||||
}
|
||||
mModifiedDate = modifiedDate;
|
||||
|
||||
long parentId = note.has(NoteColumns.PARENT_ID) ? note
|
||||
.getLong(NoteColumns.PARENT_ID) : 0;
|
||||
if (mIsCreate || mParentId != parentId) {
|
||||
mDiffNoteValues.put(NoteColumns.PARENT_ID, parentId);
|
||||
}
|
||||
mParentId = parentId;
|
||||
|
||||
String snippet = note.has(NoteColumns.SNIPPET) ? note
|
||||
.getString(NoteColumns.SNIPPET) : "";
|
||||
if (mIsCreate || !mSnippet.equals(snippet)) {
|
||||
mDiffNoteValues.put(NoteColumns.SNIPPET, snippet);
|
||||
}
|
||||
mSnippet = snippet;
|
||||
|
||||
int type = note.has(NoteColumns.TYPE) ? note.getInt(NoteColumns.TYPE)
|
||||
: Notes.TYPE_NOTE;
|
||||
if (mIsCreate || mType != type) {
|
||||
mDiffNoteValues.put(NoteColumns.TYPE, type);
|
||||
}
|
||||
mType = type;
|
||||
|
||||
int widgetId = note.has(NoteColumns.WIDGET_ID) ? note.getInt(NoteColumns.WIDGET_ID)
|
||||
: AppWidgetManager.INVALID_APPWIDGET_ID;
|
||||
if (mIsCreate || mWidgetId != widgetId) {
|
||||
mDiffNoteValues.put(NoteColumns.WIDGET_ID, widgetId);
|
||||
}
|
||||
mWidgetId = widgetId;
|
||||
|
||||
int widgetType = note.has(NoteColumns.WIDGET_TYPE) ? note
|
||||
.getInt(NoteColumns.WIDGET_TYPE) : Notes.TYPE_WIDGET_INVALIDE;
|
||||
if (mIsCreate || mWidgetType != widgetType) {
|
||||
mDiffNoteValues.put(NoteColumns.WIDGET_TYPE, widgetType);
|
||||
}
|
||||
mWidgetType = widgetType;
|
||||
|
||||
long originParent = note.has(NoteColumns.ORIGIN_PARENT_ID) ? note
|
||||
.getLong(NoteColumns.ORIGIN_PARENT_ID) : 0;
|
||||
if (mIsCreate || mOriginParent != originParent) {
|
||||
mDiffNoteValues.put(NoteColumns.ORIGIN_PARENT_ID, originParent);
|
||||
}
|
||||
mOriginParent = originParent;
|
||||
|
||||
for (int i = 0; i < dataArray.length(); i++) {
|
||||
JSONObject data = dataArray.getJSONObject(i);
|
||||
SqlData sqlData = null;
|
||||
if (data.has(DataColumns.ID)) {
|
||||
long dataId = data.getLong(DataColumns.ID);
|
||||
for (SqlData temp : mDataList) {
|
||||
if (dataId == temp.getId()) {
|
||||
sqlData = temp;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (sqlData == null) {
|
||||
sqlData = new SqlData(mContext);
|
||||
mDataList.add(sqlData);
|
||||
}
|
||||
|
||||
sqlData.setContent(data);
|
||||
}
|
||||
}
|
||||
} catch (JSONException e) {
|
||||
Log.e(TAG, e.toString());
|
||||
e.printStackTrace();
|
||||
return false;
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
public JSONObject getContent() {
|
||||
try {
|
||||
JSONObject js = new JSONObject();
|
||||
|
||||
if (mIsCreate) {
|
||||
Log.e(TAG, "it seems that we haven't created this in database yet");
|
||||
return null;
|
||||
}
|
||||
|
||||
JSONObject note = new JSONObject();
|
||||
if (mType == Notes.TYPE_NOTE) {
|
||||
note.put(NoteColumns.ID, mId);
|
||||
note.put(NoteColumns.ALERTED_DATE, mAlertDate);
|
||||
note.put(NoteColumns.BG_COLOR_ID, mBgColorId);
|
||||
note.put(NoteColumns.CREATED_DATE, mCreatedDate);
|
||||
note.put(NoteColumns.HAS_ATTACHMENT, mHasAttachment);
|
||||
note.put(NoteColumns.MODIFIED_DATE, mModifiedDate);
|
||||
note.put(NoteColumns.PARENT_ID, mParentId);
|
||||
note.put(NoteColumns.SNIPPET, mSnippet);
|
||||
note.put(NoteColumns.TYPE, mType);
|
||||
note.put(NoteColumns.WIDGET_ID, mWidgetId);
|
||||
note.put(NoteColumns.WIDGET_TYPE, mWidgetType);
|
||||
note.put(NoteColumns.ORIGIN_PARENT_ID, mOriginParent);
|
||||
js.put(GTaskStringUtils.META_HEAD_NOTE, note);
|
||||
|
||||
JSONArray dataArray = new JSONArray();
|
||||
for (SqlData sqlData : mDataList) {
|
||||
JSONObject data = sqlData.getContent();
|
||||
if (data != null) {
|
||||
dataArray.put(data);
|
||||
}
|
||||
}
|
||||
js.put(GTaskStringUtils.META_HEAD_DATA, dataArray);
|
||||
} else if (mType == Notes.TYPE_FOLDER || mType == Notes.TYPE_SYSTEM) {
|
||||
note.put(NoteColumns.ID, mId);
|
||||
note.put(NoteColumns.TYPE, mType);
|
||||
note.put(NoteColumns.SNIPPET, mSnippet);
|
||||
js.put(GTaskStringUtils.META_HEAD_NOTE, note);
|
||||
}
|
||||
|
||||
return js;
|
||||
} catch (JSONException e) {
|
||||
Log.e(TAG, e.toString());
|
||||
e.printStackTrace();
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
public void setParentId(long id) {
|
||||
mParentId = id;
|
||||
mDiffNoteValues.put(NoteColumns.PARENT_ID, id);
|
||||
}
|
||||
|
||||
public void setGtaskId(String gid) {
|
||||
mDiffNoteValues.put(NoteColumns.GTASK_ID, gid);
|
||||
}
|
||||
|
||||
public void setSyncId(long syncId) {
|
||||
mDiffNoteValues.put(NoteColumns.SYNC_ID, syncId);
|
||||
}
|
||||
|
||||
public void resetLocalModified() {
|
||||
mDiffNoteValues.put(NoteColumns.LOCAL_MODIFIED, 0);
|
||||
}
|
||||
|
||||
public long getId() {
|
||||
return mId;
|
||||
}
|
||||
|
||||
public long getParentId() {
|
||||
return mParentId;
|
||||
}
|
||||
|
||||
public String getSnippet() {
|
||||
return mSnippet;
|
||||
}
|
||||
|
||||
public boolean isNoteType() {
|
||||
return mType == Notes.TYPE_NOTE;
|
||||
}
|
||||
|
||||
public void commit(boolean validateVersion) {
|
||||
if (mIsCreate) {
|
||||
if (mId == INVALID_ID && mDiffNoteValues.containsKey(NoteColumns.ID)) {
|
||||
mDiffNoteValues.remove(NoteColumns.ID);
|
||||
}
|
||||
|
||||
Uri uri = mContentResolver.insert(Notes.CONTENT_NOTE_URI, mDiffNoteValues);
|
||||
try {
|
||||
mId = Long.valueOf(uri.getPathSegments().get(1));
|
||||
} catch (NumberFormatException e) {
|
||||
Log.e(TAG, "Get note id error :" + e.toString());
|
||||
throw new ActionFailureException("create note failed");
|
||||
}
|
||||
if (mId == 0) {
|
||||
throw new IllegalStateException("Create thread id failed");
|
||||
}
|
||||
|
||||
if (mType == Notes.TYPE_NOTE) {
|
||||
for (SqlData sqlData : mDataList) {
|
||||
sqlData.commit(mId, false, -1);
|
||||
}
|
||||
}
|
||||
} else {
|
||||
if (mId <= 0 && mId != Notes.ID_ROOT_FOLDER && mId != Notes.ID_CALL_RECORD_FOLDER) {
|
||||
Log.e(TAG, "No such note");
|
||||
throw new IllegalStateException("Try to update note with invalid id");
|
||||
}
|
||||
if (mDiffNoteValues.size() > 0) {
|
||||
mVersion ++;
|
||||
int result = 0;
|
||||
if (!validateVersion) {
|
||||
result = mContentResolver.update(Notes.CONTENT_NOTE_URI, mDiffNoteValues, "("
|
||||
+ NoteColumns.ID + "=?)", new String[] {
|
||||
String.valueOf(mId)
|
||||
});
|
||||
} else {
|
||||
result = mContentResolver.update(Notes.CONTENT_NOTE_URI, mDiffNoteValues, "("
|
||||
+ NoteColumns.ID + "=?) AND (" + NoteColumns.VERSION + "<=?)",
|
||||
new String[] {
|
||||
String.valueOf(mId), String.valueOf(mVersion)
|
||||
});
|
||||
}
|
||||
if (result == 0) {
|
||||
Log.w(TAG, "there is no update. maybe user updates note when syncing");
|
||||
}
|
||||
}
|
||||
|
||||
if (mType == Notes.TYPE_NOTE) {
|
||||
for (SqlData sqlData : mDataList) {
|
||||
sqlData.commit(mId, validateVersion, mVersion);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// refresh local info
|
||||
loadFromCursor(mId);
|
||||
if (mType == Notes.TYPE_NOTE)
|
||||
loadDataContent();
|
||||
|
||||
mDiffNoteValues.clear();
|
||||
mIsCreate = false;
|
||||
}
|
||||
}
|
@ -1,351 +0,0 @@
|
||||
/*
|
||||
* 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.gtask.data;
|
||||
|
||||
import android.database.Cursor;
|
||||
import android.text.TextUtils;
|
||||
import android.util.Log;
|
||||
|
||||
import net.micode.notes.data.Notes;
|
||||
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.gtask.exception.ActionFailureException;
|
||||
import net.micode.notes.tool.GTaskStringUtils;
|
||||
|
||||
import org.json.JSONArray;
|
||||
import org.json.JSONException;
|
||||
import org.json.JSONObject;
|
||||
|
||||
|
||||
public class Task extends Node {
|
||||
private static final String TAG = Task.class.getSimpleName();
|
||||
|
||||
private boolean mCompleted;
|
||||
|
||||
private String mNotes;
|
||||
|
||||
private JSONObject mMetaInfo;
|
||||
|
||||
private Task mPriorSibling;
|
||||
|
||||
private TaskList mParent;
|
||||
|
||||
public Task() {
|
||||
super();
|
||||
mCompleted = false;
|
||||
mNotes = null;
|
||||
mPriorSibling = null;
|
||||
mParent = null;
|
||||
mMetaInfo = null;
|
||||
}
|
||||
|
||||
public JSONObject getCreateAction(int actionId) {
|
||||
JSONObject js = new JSONObject();
|
||||
|
||||
try {
|
||||
// action_type
|
||||
js.put(GTaskStringUtils.GTASK_JSON_ACTION_TYPE,
|
||||
GTaskStringUtils.GTASK_JSON_ACTION_TYPE_CREATE);
|
||||
|
||||
// action_id
|
||||
js.put(GTaskStringUtils.GTASK_JSON_ACTION_ID, actionId);
|
||||
|
||||
// index
|
||||
js.put(GTaskStringUtils.GTASK_JSON_INDEX, mParent.getChildTaskIndex(this));
|
||||
|
||||
// entity_delta
|
||||
JSONObject entity = new JSONObject();
|
||||
entity.put(GTaskStringUtils.GTASK_JSON_NAME, getName());
|
||||
entity.put(GTaskStringUtils.GTASK_JSON_CREATOR_ID, "null");
|
||||
entity.put(GTaskStringUtils.GTASK_JSON_ENTITY_TYPE,
|
||||
GTaskStringUtils.GTASK_JSON_TYPE_TASK);
|
||||
if (getNotes() != null) {
|
||||
entity.put(GTaskStringUtils.GTASK_JSON_NOTES, getNotes());
|
||||
}
|
||||
js.put(GTaskStringUtils.GTASK_JSON_ENTITY_DELTA, entity);
|
||||
|
||||
// parent_id
|
||||
js.put(GTaskStringUtils.GTASK_JSON_PARENT_ID, mParent.getGid());
|
||||
|
||||
// dest_parent_type
|
||||
js.put(GTaskStringUtils.GTASK_JSON_DEST_PARENT_TYPE,
|
||||
GTaskStringUtils.GTASK_JSON_TYPE_GROUP);
|
||||
|
||||
// list_id
|
||||
js.put(GTaskStringUtils.GTASK_JSON_LIST_ID, mParent.getGid());
|
||||
|
||||
// prior_sibling_id
|
||||
if (mPriorSibling != null) {
|
||||
js.put(GTaskStringUtils.GTASK_JSON_PRIOR_SIBLING_ID, mPriorSibling.getGid());
|
||||
}
|
||||
|
||||
} catch (JSONException e) {
|
||||
Log.e(TAG, e.toString());
|
||||
e.printStackTrace();
|
||||
throw new ActionFailureException("fail to generate task-create jsonobject");
|
||||
}
|
||||
|
||||
return js;
|
||||
}
|
||||
|
||||
public JSONObject getUpdateAction(int actionId) {
|
||||
JSONObject js = new JSONObject();
|
||||
|
||||
try {
|
||||
// action_type
|
||||
js.put(GTaskStringUtils.GTASK_JSON_ACTION_TYPE,
|
||||
GTaskStringUtils.GTASK_JSON_ACTION_TYPE_UPDATE);
|
||||
|
||||
// action_id
|
||||
js.put(GTaskStringUtils.GTASK_JSON_ACTION_ID, actionId);
|
||||
|
||||
// id
|
||||
js.put(GTaskStringUtils.GTASK_JSON_ID, getGid());
|
||||
|
||||
// entity_delta
|
||||
JSONObject entity = new JSONObject();
|
||||
entity.put(GTaskStringUtils.GTASK_JSON_NAME, getName());
|
||||
if (getNotes() != null) {
|
||||
entity.put(GTaskStringUtils.GTASK_JSON_NOTES, getNotes());
|
||||
}
|
||||
entity.put(GTaskStringUtils.GTASK_JSON_DELETED, getDeleted());
|
||||
js.put(GTaskStringUtils.GTASK_JSON_ENTITY_DELTA, entity);
|
||||
|
||||
} catch (JSONException e) {
|
||||
Log.e(TAG, e.toString());
|
||||
e.printStackTrace();
|
||||
throw new ActionFailureException("fail to generate task-update jsonobject");
|
||||
}
|
||||
|
||||
return js;
|
||||
}
|
||||
|
||||
public void setContentByRemoteJSON(JSONObject js) {
|
||||
if (js != null) {
|
||||
try {
|
||||
// id
|
||||
if (js.has(GTaskStringUtils.GTASK_JSON_ID)) {
|
||||
setGid(js.getString(GTaskStringUtils.GTASK_JSON_ID));
|
||||
}
|
||||
|
||||
// last_modified
|
||||
if (js.has(GTaskStringUtils.GTASK_JSON_LAST_MODIFIED)) {
|
||||
setLastModified(js.getLong(GTaskStringUtils.GTASK_JSON_LAST_MODIFIED));
|
||||
}
|
||||
|
||||
// name
|
||||
if (js.has(GTaskStringUtils.GTASK_JSON_NAME)) {
|
||||
setName(js.getString(GTaskStringUtils.GTASK_JSON_NAME));
|
||||
}
|
||||
|
||||
// notes
|
||||
if (js.has(GTaskStringUtils.GTASK_JSON_NOTES)) {
|
||||
setNotes(js.getString(GTaskStringUtils.GTASK_JSON_NOTES));
|
||||
}
|
||||
|
||||
// deleted
|
||||
if (js.has(GTaskStringUtils.GTASK_JSON_DELETED)) {
|
||||
setDeleted(js.getBoolean(GTaskStringUtils.GTASK_JSON_DELETED));
|
||||
}
|
||||
|
||||
// completed
|
||||
if (js.has(GTaskStringUtils.GTASK_JSON_COMPLETED)) {
|
||||
setCompleted(js.getBoolean(GTaskStringUtils.GTASK_JSON_COMPLETED));
|
||||
}
|
||||
} catch (JSONException e) {
|
||||
Log.e(TAG, e.toString());
|
||||
e.printStackTrace();
|
||||
throw new ActionFailureException("fail to get task content from jsonobject");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public void setContentByLocalJSON(JSONObject js) {
|
||||
if (js == null || !js.has(GTaskStringUtils.META_HEAD_NOTE)
|
||||
|| !js.has(GTaskStringUtils.META_HEAD_DATA)) {
|
||||
Log.w(TAG, "setContentByLocalJSON: nothing is avaiable");
|
||||
}
|
||||
|
||||
try {
|
||||
JSONObject note = js.getJSONObject(GTaskStringUtils.META_HEAD_NOTE);
|
||||
JSONArray dataArray = js.getJSONArray(GTaskStringUtils.META_HEAD_DATA);
|
||||
|
||||
if (note.getInt(NoteColumns.TYPE) != Notes.TYPE_NOTE) {
|
||||
Log.e(TAG, "invalid type");
|
||||
return;
|
||||
}
|
||||
|
||||
for (int i = 0; i < dataArray.length(); i++) {
|
||||
JSONObject data = dataArray.getJSONObject(i);
|
||||
if (TextUtils.equals(data.getString(DataColumns.MIME_TYPE), DataConstants.NOTE)) {
|
||||
setName(data.getString(DataColumns.CONTENT));
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
} catch (JSONException e) {
|
||||
Log.e(TAG, e.toString());
|
||||
e.printStackTrace();
|
||||
}
|
||||
}
|
||||
|
||||
public JSONObject getLocalJSONFromContent() {
|
||||
String name = getName();
|
||||
try {
|
||||
if (mMetaInfo == null) {
|
||||
// new task created from web
|
||||
if (name == null) {
|
||||
Log.w(TAG, "the note seems to be an empty one");
|
||||
return null;
|
||||
}
|
||||
|
||||
JSONObject js = new JSONObject();
|
||||
JSONObject note = new JSONObject();
|
||||
JSONArray dataArray = new JSONArray();
|
||||
JSONObject data = new JSONObject();
|
||||
data.put(DataColumns.CONTENT, name);
|
||||
dataArray.put(data);
|
||||
js.put(GTaskStringUtils.META_HEAD_DATA, dataArray);
|
||||
note.put(NoteColumns.TYPE, Notes.TYPE_NOTE);
|
||||
js.put(GTaskStringUtils.META_HEAD_NOTE, note);
|
||||
return js;
|
||||
} else {
|
||||
// synced task
|
||||
JSONObject note = mMetaInfo.getJSONObject(GTaskStringUtils.META_HEAD_NOTE);
|
||||
JSONArray dataArray = mMetaInfo.getJSONArray(GTaskStringUtils.META_HEAD_DATA);
|
||||
|
||||
for (int i = 0; i < dataArray.length(); i++) {
|
||||
JSONObject data = dataArray.getJSONObject(i);
|
||||
if (TextUtils.equals(data.getString(DataColumns.MIME_TYPE), DataConstants.NOTE)) {
|
||||
data.put(DataColumns.CONTENT, getName());
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
note.put(NoteColumns.TYPE, Notes.TYPE_NOTE);
|
||||
return mMetaInfo;
|
||||
}
|
||||
} catch (JSONException e) {
|
||||
Log.e(TAG, e.toString());
|
||||
e.printStackTrace();
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
public void setMetaInfo(MetaData metaData) {
|
||||
if (metaData != null && metaData.getNotes() != null) {
|
||||
try {
|
||||
mMetaInfo = new JSONObject(metaData.getNotes());
|
||||
} catch (JSONException e) {
|
||||
Log.w(TAG, e.toString());
|
||||
mMetaInfo = null;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public int getSyncAction(Cursor c) {
|
||||
try {
|
||||
JSONObject noteInfo = null;
|
||||
if (mMetaInfo != null && mMetaInfo.has(GTaskStringUtils.META_HEAD_NOTE)) {
|
||||
noteInfo = mMetaInfo.getJSONObject(GTaskStringUtils.META_HEAD_NOTE);
|
||||
}
|
||||
|
||||
if (noteInfo == null) {
|
||||
Log.w(TAG, "it seems that note meta has been deleted");
|
||||
return SYNC_ACTION_UPDATE_REMOTE;
|
||||
}
|
||||
|
||||
if (!noteInfo.has(NoteColumns.ID)) {
|
||||
Log.w(TAG, "remote note id seems to be deleted");
|
||||
return SYNC_ACTION_UPDATE_LOCAL;
|
||||
}
|
||||
|
||||
// validate the note id now
|
||||
if (c.getLong(SqlNote.ID_COLUMN) != noteInfo.getLong(NoteColumns.ID)) {
|
||||
Log.w(TAG, "note id doesn't match");
|
||||
return SYNC_ACTION_UPDATE_LOCAL;
|
||||
}
|
||||
|
||||
if (c.getInt(SqlNote.LOCAL_MODIFIED_COLUMN) == 0) {
|
||||
// there is no local update
|
||||
if (c.getLong(SqlNote.SYNC_ID_COLUMN) == getLastModified()) {
|
||||
// no update both side
|
||||
return SYNC_ACTION_NONE;
|
||||
} else {
|
||||
// apply remote to local
|
||||
return SYNC_ACTION_UPDATE_LOCAL;
|
||||
}
|
||||
} else {
|
||||
// validate gtask id
|
||||
if (!c.getString(SqlNote.GTASK_ID_COLUMN).equals(getGid())) {
|
||||
Log.e(TAG, "gtask id doesn't match");
|
||||
return SYNC_ACTION_ERROR;
|
||||
}
|
||||
if (c.getLong(SqlNote.SYNC_ID_COLUMN) == getLastModified()) {
|
||||
// local modification only
|
||||
return SYNC_ACTION_UPDATE_REMOTE;
|
||||
} else {
|
||||
return SYNC_ACTION_UPDATE_CONFLICT;
|
||||
}
|
||||
}
|
||||
} catch (Exception e) {
|
||||
Log.e(TAG, e.toString());
|
||||
e.printStackTrace();
|
||||
}
|
||||
|
||||
return SYNC_ACTION_ERROR;
|
||||
}
|
||||
|
||||
public boolean isWorthSaving() {
|
||||
return mMetaInfo != null || (getName() != null && getName().trim().length() > 0)
|
||||
|| (getNotes() != null && getNotes().trim().length() > 0);
|
||||
}
|
||||
|
||||
public void setCompleted(boolean completed) {
|
||||
this.mCompleted = completed;
|
||||
}
|
||||
|
||||
public void setNotes(String notes) {
|
||||
this.mNotes = notes;
|
||||
}
|
||||
|
||||
public void setPriorSibling(Task priorSibling) {
|
||||
this.mPriorSibling = priorSibling;
|
||||
}
|
||||
|
||||
public void setParent(TaskList parent) {
|
||||
this.mParent = parent;
|
||||
}
|
||||
|
||||
public boolean getCompleted() {
|
||||
return this.mCompleted;
|
||||
}
|
||||
|
||||
public String getNotes() {
|
||||
return this.mNotes;
|
||||
}
|
||||
|
||||
public Task getPriorSibling() {
|
||||
return this.mPriorSibling;
|
||||
}
|
||||
|
||||
public TaskList getParent() {
|
||||
return this.mParent;
|
||||
}
|
||||
|
||||
}
|
@ -1,343 +0,0 @@
|
||||
/*
|
||||
* 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.gtask.data;
|
||||
|
||||
import android.database.Cursor;
|
||||
import android.util.Log;
|
||||
|
||||
import net.micode.notes.data.Notes;
|
||||
import net.micode.notes.data.Notes.NoteColumns;
|
||||
import net.micode.notes.gtask.exception.ActionFailureException;
|
||||
import net.micode.notes.tool.GTaskStringUtils;
|
||||
|
||||
import org.json.JSONException;
|
||||
import org.json.JSONObject;
|
||||
|
||||
import java.util.ArrayList;
|
||||
|
||||
|
||||
public class TaskList extends Node {
|
||||
private static final String TAG = TaskList.class.getSimpleName();
|
||||
|
||||
private int mIndex;
|
||||
|
||||
private ArrayList<Task> mChildren;
|
||||
|
||||
public TaskList() {
|
||||
super();
|
||||
mChildren = new ArrayList<Task>();
|
||||
mIndex = 1;
|
||||
}
|
||||
|
||||
public JSONObject getCreateAction(int actionId) {
|
||||
JSONObject js = new JSONObject();
|
||||
|
||||
try {
|
||||
// action_type
|
||||
js.put(GTaskStringUtils.GTASK_JSON_ACTION_TYPE,
|
||||
GTaskStringUtils.GTASK_JSON_ACTION_TYPE_CREATE);
|
||||
|
||||
// action_id
|
||||
js.put(GTaskStringUtils.GTASK_JSON_ACTION_ID, actionId);
|
||||
|
||||
// index
|
||||
js.put(GTaskStringUtils.GTASK_JSON_INDEX, mIndex);
|
||||
|
||||
// entity_delta
|
||||
JSONObject entity = new JSONObject();
|
||||
entity.put(GTaskStringUtils.GTASK_JSON_NAME, getName());
|
||||
entity.put(GTaskStringUtils.GTASK_JSON_CREATOR_ID, "null");
|
||||
entity.put(GTaskStringUtils.GTASK_JSON_ENTITY_TYPE,
|
||||
GTaskStringUtils.GTASK_JSON_TYPE_GROUP);
|
||||
js.put(GTaskStringUtils.GTASK_JSON_ENTITY_DELTA, entity);
|
||||
|
||||
} catch (JSONException e) {
|
||||
Log.e(TAG, e.toString());
|
||||
e.printStackTrace();
|
||||
throw new ActionFailureException("fail to generate tasklist-create jsonobject");
|
||||
}
|
||||
|
||||
return js;
|
||||
}
|
||||
|
||||
public JSONObject getUpdateAction(int actionId) {
|
||||
JSONObject js = new JSONObject();
|
||||
|
||||
try {
|
||||
// action_type
|
||||
js.put(GTaskStringUtils.GTASK_JSON_ACTION_TYPE,
|
||||
GTaskStringUtils.GTASK_JSON_ACTION_TYPE_UPDATE);
|
||||
|
||||
// action_id
|
||||
js.put(GTaskStringUtils.GTASK_JSON_ACTION_ID, actionId);
|
||||
|
||||
// id
|
||||
js.put(GTaskStringUtils.GTASK_JSON_ID, getGid());
|
||||
|
||||
// entity_delta
|
||||
JSONObject entity = new JSONObject();
|
||||
entity.put(GTaskStringUtils.GTASK_JSON_NAME, getName());
|
||||
entity.put(GTaskStringUtils.GTASK_JSON_DELETED, getDeleted());
|
||||
js.put(GTaskStringUtils.GTASK_JSON_ENTITY_DELTA, entity);
|
||||
|
||||
} catch (JSONException e) {
|
||||
Log.e(TAG, e.toString());
|
||||
e.printStackTrace();
|
||||
throw new ActionFailureException("fail to generate tasklist-update jsonobject");
|
||||
}
|
||||
|
||||
return js;
|
||||
}
|
||||
|
||||
public void setContentByRemoteJSON(JSONObject js) {
|
||||
if (js != null) {
|
||||
try {
|
||||
// id
|
||||
if (js.has(GTaskStringUtils.GTASK_JSON_ID)) {
|
||||
setGid(js.getString(GTaskStringUtils.GTASK_JSON_ID));
|
||||
}
|
||||
|
||||
// last_modified
|
||||
if (js.has(GTaskStringUtils.GTASK_JSON_LAST_MODIFIED)) {
|
||||
setLastModified(js.getLong(GTaskStringUtils.GTASK_JSON_LAST_MODIFIED));
|
||||
}
|
||||
|
||||
// name
|
||||
if (js.has(GTaskStringUtils.GTASK_JSON_NAME)) {
|
||||
setName(js.getString(GTaskStringUtils.GTASK_JSON_NAME));
|
||||
}
|
||||
|
||||
} catch (JSONException e) {
|
||||
Log.e(TAG, e.toString());
|
||||
e.printStackTrace();
|
||||
throw new ActionFailureException("fail to get tasklist content from jsonobject");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public void setContentByLocalJSON(JSONObject js) {
|
||||
if (js == null || !js.has(GTaskStringUtils.META_HEAD_NOTE)) {
|
||||
Log.w(TAG, "setContentByLocalJSON: nothing is avaiable");
|
||||
}
|
||||
|
||||
try {
|
||||
JSONObject folder = js.getJSONObject(GTaskStringUtils.META_HEAD_NOTE);
|
||||
|
||||
if (folder.getInt(NoteColumns.TYPE) == Notes.TYPE_FOLDER) {
|
||||
String name = folder.getString(NoteColumns.SNIPPET);
|
||||
setName(GTaskStringUtils.MIUI_FOLDER_PREFFIX + name);
|
||||
} else if (folder.getInt(NoteColumns.TYPE) == Notes.TYPE_SYSTEM) {
|
||||
if (folder.getLong(NoteColumns.ID) == Notes.ID_ROOT_FOLDER)
|
||||
setName(GTaskStringUtils.MIUI_FOLDER_PREFFIX + GTaskStringUtils.FOLDER_DEFAULT);
|
||||
else if (folder.getLong(NoteColumns.ID) == Notes.ID_CALL_RECORD_FOLDER)
|
||||
setName(GTaskStringUtils.MIUI_FOLDER_PREFFIX
|
||||
+ GTaskStringUtils.FOLDER_CALL_NOTE);
|
||||
else
|
||||
Log.e(TAG, "invalid system folder");
|
||||
} else {
|
||||
Log.e(TAG, "error type");
|
||||
}
|
||||
} catch (JSONException e) {
|
||||
Log.e(TAG, e.toString());
|
||||
e.printStackTrace();
|
||||
}
|
||||
}
|
||||
|
||||
public JSONObject getLocalJSONFromContent() {
|
||||
try {
|
||||
JSONObject js = new JSONObject();
|
||||
JSONObject folder = new JSONObject();
|
||||
|
||||
String folderName = getName();
|
||||
if (getName().startsWith(GTaskStringUtils.MIUI_FOLDER_PREFFIX))
|
||||
folderName = folderName.substring(GTaskStringUtils.MIUI_FOLDER_PREFFIX.length(),
|
||||
folderName.length());
|
||||
folder.put(NoteColumns.SNIPPET, folderName);
|
||||
if (folderName.equals(GTaskStringUtils.FOLDER_DEFAULT)
|
||||
|| folderName.equals(GTaskStringUtils.FOLDER_CALL_NOTE))
|
||||
folder.put(NoteColumns.TYPE, Notes.TYPE_SYSTEM);
|
||||
else
|
||||
folder.put(NoteColumns.TYPE, Notes.TYPE_FOLDER);
|
||||
|
||||
js.put(GTaskStringUtils.META_HEAD_NOTE, folder);
|
||||
|
||||
return js;
|
||||
} catch (JSONException e) {
|
||||
Log.e(TAG, e.toString());
|
||||
e.printStackTrace();
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
public int getSyncAction(Cursor c) {
|
||||
try {
|
||||
if (c.getInt(SqlNote.LOCAL_MODIFIED_COLUMN) == 0) {
|
||||
// there is no local update
|
||||
if (c.getLong(SqlNote.SYNC_ID_COLUMN) == getLastModified()) {
|
||||
// no update both side
|
||||
return SYNC_ACTION_NONE;
|
||||
} else {
|
||||
// apply remote to local
|
||||
return SYNC_ACTION_UPDATE_LOCAL;
|
||||
}
|
||||
} else {
|
||||
// validate gtask id
|
||||
if (!c.getString(SqlNote.GTASK_ID_COLUMN).equals(getGid())) {
|
||||
Log.e(TAG, "gtask id doesn't match");
|
||||
return SYNC_ACTION_ERROR;
|
||||
}
|
||||
if (c.getLong(SqlNote.SYNC_ID_COLUMN) == getLastModified()) {
|
||||
// local modification only
|
||||
return SYNC_ACTION_UPDATE_REMOTE;
|
||||
} else {
|
||||
// for folder conflicts, just apply local modification
|
||||
return SYNC_ACTION_UPDATE_REMOTE;
|
||||
}
|
||||
}
|
||||
} catch (Exception e) {
|
||||
Log.e(TAG, e.toString());
|
||||
e.printStackTrace();
|
||||
}
|
||||
|
||||
return SYNC_ACTION_ERROR;
|
||||
}
|
||||
|
||||
public int getChildTaskCount() {
|
||||
return mChildren.size();
|
||||
}
|
||||
|
||||
public boolean addChildTask(Task task) {
|
||||
boolean ret = false;
|
||||
if (task != null && !mChildren.contains(task)) {
|
||||
ret = mChildren.add(task);
|
||||
if (ret) {
|
||||
// need to set prior sibling and parent
|
||||
task.setPriorSibling(mChildren.isEmpty() ? null : mChildren
|
||||
.get(mChildren.size() - 1));
|
||||
task.setParent(this);
|
||||
}
|
||||
}
|
||||
return ret;
|
||||
}
|
||||
|
||||
public boolean addChildTask(Task task, int index) {
|
||||
if (index < 0 || index > mChildren.size()) {
|
||||
Log.e(TAG, "add child task: invalid index");
|
||||
return false;
|
||||
}
|
||||
|
||||
int pos = mChildren.indexOf(task);
|
||||
if (task != null && pos == -1) {
|
||||
mChildren.add(index, task);
|
||||
|
||||
// update the task list
|
||||
Task preTask = null;
|
||||
Task afterTask = null;
|
||||
if (index != 0)
|
||||
preTask = mChildren.get(index - 1);
|
||||
if (index != mChildren.size() - 1)
|
||||
afterTask = mChildren.get(index + 1);
|
||||
|
||||
task.setPriorSibling(preTask);
|
||||
if (afterTask != null)
|
||||
afterTask.setPriorSibling(task);
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
public boolean removeChildTask(Task task) {
|
||||
boolean ret = false;
|
||||
int index = mChildren.indexOf(task);
|
||||
if (index != -1) {
|
||||
ret = mChildren.remove(task);
|
||||
|
||||
if (ret) {
|
||||
// reset prior sibling and parent
|
||||
task.setPriorSibling(null);
|
||||
task.setParent(null);
|
||||
|
||||
// update the task list
|
||||
if (index != mChildren.size()) {
|
||||
mChildren.get(index).setPriorSibling(
|
||||
index == 0 ? null : mChildren.get(index - 1));
|
||||
}
|
||||
}
|
||||
}
|
||||
return ret;
|
||||
}
|
||||
|
||||
public boolean moveChildTask(Task task, int index) {
|
||||
|
||||
if (index < 0 || index >= mChildren.size()) {
|
||||
Log.e(TAG, "move child task: invalid index");
|
||||
return false;
|
||||
}
|
||||
|
||||
int pos = mChildren.indexOf(task);
|
||||
if (pos == -1) {
|
||||
Log.e(TAG, "move child task: the task should in the list");
|
||||
return false;
|
||||
}
|
||||
|
||||
if (pos == index)
|
||||
return true;
|
||||
return (removeChildTask(task) && addChildTask(task, index));
|
||||
}
|
||||
|
||||
public Task findChildTaskByGid(String gid) {
|
||||
for (int i = 0; i < mChildren.size(); i++) {
|
||||
Task t = mChildren.get(i);
|
||||
if (t.getGid().equals(gid)) {
|
||||
return t;
|
||||
}
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
public int getChildTaskIndex(Task task) {
|
||||
return mChildren.indexOf(task);
|
||||
}
|
||||
|
||||
public Task getChildTaskByIndex(int index) {
|
||||
if (index < 0 || index >= mChildren.size()) {
|
||||
Log.e(TAG, "getTaskByIndex: invalid index");
|
||||
return null;
|
||||
}
|
||||
return mChildren.get(index);
|
||||
}
|
||||
|
||||
public Task getChilTaskByGid(String gid) {
|
||||
for (Task task : mChildren) {
|
||||
if (task.getGid().equals(gid))
|
||||
return task;
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
public ArrayList<Task> getChildTaskList() {
|
||||
return this.mChildren;
|
||||
}
|
||||
|
||||
public void setIndex(int index) {
|
||||
this.mIndex = index;
|
||||
}
|
||||
|
||||
public int getIndex() {
|
||||
return this.mIndex;
|
||||
}
|
||||
}
|
@ -1,123 +0,0 @@
|
||||
|
||||
/*
|
||||
* 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.gtask.remote;
|
||||
|
||||
import android.app.Notification;
|
||||
import android.app.NotificationManager;
|
||||
import android.app.PendingIntent;
|
||||
import android.content.Context;
|
||||
import android.content.Intent;
|
||||
import android.os.AsyncTask;
|
||||
|
||||
import net.micode.notes.R;
|
||||
import net.micode.notes.ui.NotesListActivity;
|
||||
import net.micode.notes.ui.NotesPreferenceActivity;
|
||||
|
||||
|
||||
public class GTaskASyncTask extends AsyncTask<Void, String, Integer> {
|
||||
|
||||
private static int GTASK_SYNC_NOTIFICATION_ID = 5234235;
|
||||
|
||||
public interface OnCompleteListener {
|
||||
void onComplete();
|
||||
}
|
||||
|
||||
private Context mContext;
|
||||
|
||||
private NotificationManager mNotifiManager;
|
||||
|
||||
private GTaskManager mTaskManager;
|
||||
|
||||
private OnCompleteListener mOnCompleteListener;
|
||||
|
||||
public GTaskASyncTask(Context context, OnCompleteListener listener) {
|
||||
mContext = context;
|
||||
mOnCompleteListener = listener;
|
||||
mNotifiManager = (NotificationManager) mContext
|
||||
.getSystemService(Context.NOTIFICATION_SERVICE);
|
||||
mTaskManager = GTaskManager.getInstance();
|
||||
}
|
||||
|
||||
public void cancelSync() {
|
||||
mTaskManager.cancelSync();
|
||||
}
|
||||
|
||||
public void publishProgess(String message) {
|
||||
publishProgress(new String[] {
|
||||
message
|
||||
});
|
||||
}
|
||||
|
||||
private void showNotification(int tickerId, String content) {
|
||||
Notification notification = new Notification(R.drawable.notification, mContext
|
||||
.getString(tickerId), System.currentTimeMillis());
|
||||
notification.defaults = Notification.DEFAULT_LIGHTS;
|
||||
notification.flags = Notification.FLAG_AUTO_CANCEL;
|
||||
PendingIntent pendingIntent;
|
||||
if (tickerId != R.string.ticker_success) {
|
||||
pendingIntent = PendingIntent.getActivity(mContext, 0, new Intent(mContext,
|
||||
NotesPreferenceActivity.class), 0);
|
||||
|
||||
} else {
|
||||
pendingIntent = PendingIntent.getActivity(mContext, 0, new Intent(mContext,
|
||||
NotesListActivity.class), 0);
|
||||
}
|
||||
notification.setLatestEventInfo(mContext, mContext.getString(R.string.app_name), content,
|
||||
pendingIntent);
|
||||
mNotifiManager.notify(GTASK_SYNC_NOTIFICATION_ID, notification);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected Integer doInBackground(Void... unused) {
|
||||
publishProgess(mContext.getString(R.string.sync_progress_login, NotesPreferenceActivity
|
||||
.getSyncAccountName(mContext)));
|
||||
return mTaskManager.sync(mContext, this);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void onProgressUpdate(String... progress) {
|
||||
showNotification(R.string.ticker_syncing, progress[0]);
|
||||
if (mContext instanceof GTaskSyncService) {
|
||||
((GTaskSyncService) mContext).sendBroadcast(progress[0]);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void onPostExecute(Integer result) {
|
||||
if (result == GTaskManager.STATE_SUCCESS) {
|
||||
showNotification(R.string.ticker_success, mContext.getString(
|
||||
R.string.success_sync_account, mTaskManager.getSyncAccount()));
|
||||
NotesPreferenceActivity.setLastSyncTime(mContext, System.currentTimeMillis());
|
||||
} else if (result == GTaskManager.STATE_NETWORK_ERROR) {
|
||||
showNotification(R.string.ticker_fail, mContext.getString(R.string.error_sync_network));
|
||||
} else if (result == GTaskManager.STATE_INTERNAL_ERROR) {
|
||||
showNotification(R.string.ticker_fail, mContext.getString(R.string.error_sync_internal));
|
||||
} else if (result == GTaskManager.STATE_SYNC_CANCELLED) {
|
||||
showNotification(R.string.ticker_cancel, mContext
|
||||
.getString(R.string.error_sync_cancelled));
|
||||
}
|
||||
if (mOnCompleteListener != null) {
|
||||
new Thread(new Runnable() {
|
||||
|
||||
public void run() {
|
||||
mOnCompleteListener.onComplete();
|
||||
}
|
||||
}).start();
|
||||
}
|
||||
}
|
||||
}
|
@ -1,48 +0,0 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
|
||||
<!-- 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.
|
||||
-->
|
||||
|
||||
<menu
|
||||
xmlns:android="http://schemas.android.com/apk/res/android">
|
||||
|
||||
<item
|
||||
android:id="@+id/menu_delete"
|
||||
android:title="@string/menu_delete" />
|
||||
|
||||
<item
|
||||
android:id="@+id/menu_font_size"
|
||||
android:title="@string/menu_font_size"/>
|
||||
|
||||
<item
|
||||
android:id="@+id/menu_list_mode"
|
||||
android:title="@string/menu_list_mode" />
|
||||
|
||||
<item
|
||||
android:id="@+id/menu_share"
|
||||
android:title="@string/menu_share"/>
|
||||
|
||||
<item
|
||||
android:id="@+id/menu_send_to_desktop"
|
||||
android:title="@string/menu_send_to_desktop"/>
|
||||
|
||||
<item
|
||||
android:id="@+id/menu_alert"
|
||||
android:title="@string/menu_alert" />
|
||||
|
||||
<item
|
||||
android:id="@+id/menu_delete_remind"
|
||||
android:title="@string/menu_remove_remind" />
|
||||
</menu>
|
@ -1,24 +0,0 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
|
||||
<!-- 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.
|
||||
-->
|
||||
|
||||
<menu
|
||||
xmlns:android="http://schemas.android.com/apk/res/android">
|
||||
|
||||
<item
|
||||
android:id="@+id/menu_new_note"
|
||||
android:title="@string/notelist_menu_new"/>
|
||||
</menu>
|
@ -1,253 +0,0 @@
|
||||
/*
|
||||
* 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 {
|
||||
private ContentValues mNoteDiffValues;
|
||||
private NoteData mNoteData;
|
||||
private static final String TAG = "Note";
|
||||
/**
|
||||
* Create a new note id for adding a new note to databases
|
||||
*/
|
||||
public static synchronized long getNewNoteId(Context context, long folderId) {
|
||||
// Create a new note in the database
|
||||
ContentValues values = new ContentValues();
|
||||
long createdTime = System.currentTimeMillis();
|
||||
values.put(NoteColumns.CREATED_DATE, createdTime);
|
||||
values.put(NoteColumns.MODIFIED_DATE, createdTime);
|
||||
values.put(NoteColumns.TYPE, Notes.TYPE_NOTE);
|
||||
values.put(NoteColumns.LOCAL_MODIFIED, 1);
|
||||
values.put(NoteColumns.PARENT_ID, folderId);
|
||||
Uri uri = context.getContentResolver().insert(Notes.CONTENT_NOTE_URI, values);
|
||||
|
||||
long noteId = 0;
|
||||
try {
|
||||
noteId = Long.valueOf(uri.getPathSegments().get(1));
|
||||
} catch (NumberFormatException e) {
|
||||
Log.e(TAG, "Get note id error :" + e.toString());
|
||||
noteId = 0;
|
||||
}
|
||||
if (noteId == -1) {
|
||||
throw new IllegalStateException("Wrong note id:" + noteId);
|
||||
}
|
||||
return noteId;
|
||||
}
|
||||
|
||||
public Note() {
|
||||
mNoteDiffValues = new ContentValues();
|
||||
mNoteData = new NoteData();
|
||||
}
|
||||
|
||||
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);
|
||||
}
|
||||
|
||||
public void setTextDataId(long id) {
|
||||
mNoteData.setTextDataId(id);
|
||||
}
|
||||
|
||||
public long getTextDataId() {
|
||||
return mNoteData.mTextDataId;
|
||||
}
|
||||
|
||||
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) {
|
||||
if (noteId <= 0) {
|
||||
throw new IllegalArgumentException("Wrong note id:" + noteId);
|
||||
}
|
||||
|
||||
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;
|
||||
}
|
||||
}
|
||||
}
|
@ -1,368 +0,0 @@
|
||||
/*
|
||||
* 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;
|
||||
|
||||
private long mAlertDate;
|
||||
|
||||
private long mModifiedDate;
|
||||
|
||||
private int mBgColorId;
|
||||
|
||||
private int mWidgetId;
|
||||
|
||||
private int mWidgetType;
|
||||
|
||||
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,
|
||||
DataColumns.MIME_TYPE,
|
||||
DataColumns.DATA1,
|
||||
DataColumns.DATA2,
|
||||
DataColumns.DATA3,
|
||||
DataColumns.DATA4,
|
||||
};
|
||||
|
||||
public static final String[] NOTE_PROJECTION = new String[] {
|
||||
NoteColumns.PARENT_ID,
|
||||
NoteColumns.ALERTED_DATE,
|
||||
NoteColumns.BG_COLOR_ID,
|
||||
NoteColumns.WIDGET_ID,
|
||||
NoteColumns.WIDGET_TYPE,
|
||||
NoteColumns.MODIFIED_DATE
|
||||
};
|
||||
|
||||
private static final int DATA_ID_COLUMN = 0;
|
||||
|
||||
private static final int DATA_CONTENT_COLUMN = 1;
|
||||
|
||||
private static final int DATA_MIME_TYPE_COLUMN = 2;
|
||||
|
||||
private static final int DATA_MODE_COLUMN = 3;
|
||||
|
||||
private static final int NOTE_PARENT_ID_COLUMN = 0;
|
||||
|
||||
private static final int NOTE_ALERTED_DATE_COLUMN = 1;
|
||||
|
||||
private static final int NOTE_BG_COLOR_ID_COLUMN = 2;
|
||||
|
||||
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
|
||||
private WorkingNote(Context context, long folderId) {
|
||||
mContext = context;
|
||||
mAlertDate = 0;
|
||||
mModifiedDate = System.currentTimeMillis();
|
||||
mFolderId = folderId;
|
||||
mNote = new Note();
|
||||
mNoteId = 0;
|
||||
mIsDeleted = false;
|
||||
mMode = 0;
|
||||
mWidgetType = Notes.TYPE_WIDGET_INVALIDE;
|
||||
}
|
||||
|
||||
// Existing note construct
|
||||
private WorkingNote(Context context, long noteId, long folderId) {
|
||||
mContext = context;
|
||||
mNoteId = noteId;
|
||||
mFolderId = folderId;
|
||||
mIsDeleted = false;
|
||||
mNote = new Note();
|
||||
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()) {
|
||||
mFolderId = cursor.getLong(NOTE_PARENT_ID_COLUMN);
|
||||
mBgColorId = cursor.getInt(NOTE_BG_COLOR_ID_COLUMN);
|
||||
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);
|
||||
if (DataConstants.NOTE.equals(type)) {
|
||||
mContent = cursor.getString(DATA_CONTENT_COLUMN);
|
||||
mMode = cursor.getInt(DATA_MODE_COLUMN);
|
||||
mNote.setTextDataId(cursor.getLong(DATA_ID_COLUMN));
|
||||
} else if (DataConstants.CALL_NOTE.equals(type)) {
|
||||
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);
|
||||
}
|
||||
}
|
||||
|
||||
public static WorkingNote createEmptyNote(Context context, long folderId, int widgetId,
|
||||
int widgetType, int defaultBgColorId) {
|
||||
WorkingNote note = new WorkingNote(context, folderId);
|
||||
note.setBgColorId(defaultBgColorId);
|
||||
note.setWidgetId(widgetId);
|
||||
note.setWidgetType(widgetType);
|
||||
return note;
|
||||
}
|
||||
|
||||
public static WorkingNote load(Context context, long id) {
|
||||
return new WorkingNote(context, id, 0);
|
||||
}
|
||||
|
||||
public synchronized boolean saveNote() {
|
||||
if (isWorthSaving()) {
|
||||
if (!existInDatabase()) {
|
||||
if ((mNoteId = Note.getNewNoteId(mContext, mFolderId)) == 0) {
|
||||
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
|
||||
&& mNoteSettingStatusListener != null) {
|
||||
mNoteSettingStatusListener.onWidgetChanged();
|
||||
}
|
||||
return true;
|
||||
} else {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
public boolean existInDatabase() {
|
||||
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) {
|
||||
mNoteSettingStatusListener = l;
|
||||
}
|
||||
|
||||
public void setAlertDate(long date, boolean set) {
|
||||
if (date != mAlertDate) {
|
||||
mAlertDate = date;
|
||||
mNote.setNoteValue(NoteColumns.ALERTED_DATE, String.valueOf(mAlertDate));
|
||||
}
|
||||
if (mNoteSettingStatusListener != null) {
|
||||
mNoteSettingStatusListener.onClockAlertChanged(date, set);
|
||||
}
|
||||
}
|
||||
|
||||
public void markDeleted(boolean mark) {
|
||||
mIsDeleted = mark;
|
||||
if (mWidgetId != AppWidgetManager.INVALID_APPWIDGET_ID
|
||||
&& mWidgetType != Notes.TYPE_WIDGET_INVALIDE && mNoteSettingStatusListener != null) {
|
||||
mNoteSettingStatusListener.onWidgetChanged();
|
||||
}
|
||||
}
|
||||
|
||||
public void setBgColorId(int id) {
|
||||
if (id != mBgColorId) {
|
||||
mBgColorId = id;
|
||||
if (mNoteSettingStatusListener != null) {
|
||||
mNoteSettingStatusListener.onBackgroundColorChanged();
|
||||
}
|
||||
mNote.setNoteValue(NoteColumns.BG_COLOR_ID, String.valueOf(id));
|
||||
}
|
||||
}
|
||||
|
||||
public void setCheckListMode(int mode) {
|
||||
if (mMode != mode) {
|
||||
if (mNoteSettingStatusListener != null) {
|
||||
mNoteSettingStatusListener.onCheckListModeChanged(mMode, mode);
|
||||
}
|
||||
mMode = mode;
|
||||
mNote.setTextData(TextNote.MODE, String.valueOf(mMode));
|
||||
}
|
||||
}
|
||||
|
||||
public void setWidgetType(int type) {
|
||||
if (type != mWidgetType) {
|
||||
mWidgetType = type;
|
||||
mNote.setNoteValue(NoteColumns.WIDGET_TYPE, String.valueOf(mWidgetType));
|
||||
}
|
||||
}
|
||||
|
||||
public void setWidgetId(int id) {
|
||||
if (id != mWidgetId) {
|
||||
mWidgetId = id;
|
||||
mNote.setNoteValue(NoteColumns.WIDGET_ID, String.valueOf(mWidgetId));
|
||||
}
|
||||
}
|
||||
|
||||
public void setWorkingText(String text) {
|
||||
if (!TextUtils.equals(mContent, text)) {
|
||||
mContent = text;
|
||||
mNote.setTextData(DataColumns.CONTENT, mContent);
|
||||
}
|
||||
}
|
||||
|
||||
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));
|
||||
}
|
||||
|
||||
public boolean hasClockAlert() {
|
||||
return (mAlertDate > 0 ? true : false);
|
||||
}
|
||||
|
||||
public String getContent() {
|
||||
return mContent;
|
||||
}
|
||||
|
||||
public long getAlertDate() {
|
||||
return mAlertDate;
|
||||
}
|
||||
|
||||
public long getModifiedDate() {
|
||||
return mModifiedDate;
|
||||
}
|
||||
|
||||
public int getBgColorResId() {
|
||||
return NoteBgResources.getNoteBgResource(mBgColorId);
|
||||
}
|
||||
|
||||
public int getBgColorId() {
|
||||
return mBgColorId;
|
||||
}
|
||||
|
||||
public int getTitleBgResId() {
|
||||
return NoteBgResources.getNoteTitleBgResource(mBgColorId);
|
||||
}
|
||||
|
||||
public int getCheckListMode() {
|
||||
return mMode;
|
||||
}
|
||||
|
||||
public long getNoteId() {
|
||||
return mNoteId;
|
||||
}
|
||||
|
||||
public long getFolderId() {
|
||||
return mFolderId;
|
||||
}
|
||||
|
||||
public int getWidgetId() {
|
||||
return mWidgetId;
|
||||
}
|
||||
|
||||
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
|
||||
*/
|
||||
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);
|
||||
}
|
||||
}
|
@ -1,7 +0,0 @@
|
||||
<resources xmlns:tools="http://schemas.android.com/tools">
|
||||
<!-- Base application theme. -->
|
||||
<style name="Base.Theme.Xiaomibianqian" parent="Theme.Material3.DayNight.NoActionBar">
|
||||
<!-- Customize your dark theme here. -->
|
||||
<!-- <item name="colorPrimary">@color/my_dark_primary</item> -->
|
||||
</style>
|
||||
</resources>
|
@ -1,69 +0,0 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
|
||||
<!-- 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.
|
||||
-->
|
||||
|
||||
<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>
|
@ -1,9 +0,0 @@
|
||||
<resources xmlns:tools="http://schemas.android.com/tools">
|
||||
<!-- Base application theme. -->
|
||||
<style name="Base.Theme.Xiaomibianqian" parent="Theme.Material3.DayNight.NoActionBar">
|
||||
<!-- Customize your light theme here. -->
|
||||
<!-- <item name="colorPrimary">@color/my_light_primary</item> -->
|
||||
</style>
|
||||
|
||||
<style name="Theme.Xiaomibianqian" parent="Base.Theme.Xiaomibianqian" />
|
||||
</resources>
|
@ -1,13 +0,0 @@
|
||||
<?xml version="1.0" encoding="utf-8"?><!--
|
||||
Sample backup rules file; uncomment and customize as necessary.
|
||||
See https://developer.android.com/guide/topics/data/autobackup
|
||||
for details.
|
||||
Note: This file is ignored for devices older than API 31
|
||||
See https://developer.android.com/about/versions/12/backup-restore
|
||||
-->
|
||||
<full-backup-content>
|
||||
<!--
|
||||
<include domain="sharedpref" path="."/>
|
||||
<exclude domain="sharedpref" path="device.xml"/>
|
||||
-->
|
||||
</full-backup-content>
|
@ -1,21 +0,0 @@
|
||||
# Project-wide Gradle settings.
|
||||
# IDE (e.g. Android Studio) users:
|
||||
# Gradle settings configured through the IDE *will override*
|
||||
# any settings specified in this file.
|
||||
# For more details on how to configure your build environment visit
|
||||
# http://www.gradle.org/docs/current/userguide/build_environment.html
|
||||
# Specifies the JVM arguments used for the daemon process.
|
||||
# The setting is particularly useful for tweaking memory settings.
|
||||
org.gradle.jvmargs=-Xmx2048m -Dfile.encoding=UTF-8
|
||||
# When configured, Gradle will run in incubating parallel mode.
|
||||
# This option should only be used with decoupled projects. For more details, visit
|
||||
# https://developer.android.com/r/tools/gradle-multi-project-decoupled-projects
|
||||
# org.gradle.parallel=true
|
||||
# AndroidX package structure to make it clearer which packages are bundled with the
|
||||
# Android operating system, and which are packaged with your app's APK
|
||||
# https://developer.android.com/topic/libraries/support-library/androidx-rn
|
||||
android.useAndroidX=true
|
||||
# Enables namespacing of each library's R class so that its R class includes only the
|
||||
# resources declared in the library itself and none from the library's dependencies,
|
||||
# thereby reducing the size of the R class for that library
|
||||
android.nonTransitiveRClass=true
|
Binary file not shown.
@ -1,6 +0,0 @@
|
||||
#Wed May 14 18:29:24 CST 2025
|
||||
distributionBase=GRADLE_USER_HOME
|
||||
distributionPath=wrapper/dists
|
||||
distributionUrl=https\://services.gradle.org/distributions/gradle-8.11.1-bin.zip
|
||||
zipStoreBase=GRADLE_USER_HOME
|
||||
zipStorePath=wrapper/dists
|
@ -1,185 +0,0 @@
|
||||
#!/usr/bin/env sh
|
||||
|
||||
#
|
||||
# Copyright 2015 the original author or authors.
|
||||
#
|
||||
# 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
|
||||
#
|
||||
# https://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.
|
||||
#
|
||||
|
||||
##############################################################################
|
||||
##
|
||||
## Gradle start up script for UN*X
|
||||
##
|
||||
##############################################################################
|
||||
|
||||
# Attempt to set APP_HOME
|
||||
# Resolve links: $0 may be a link
|
||||
PRG="$0"
|
||||
# Need this for relative symlinks.
|
||||
while [ -h "$PRG" ] ; do
|
||||
ls=`ls -ld "$PRG"`
|
||||
link=`expr "$ls" : '.*-> \(.*\)$'`
|
||||
if expr "$link" : '/.*' > /dev/null; then
|
||||
PRG="$link"
|
||||
else
|
||||
PRG=`dirname "$PRG"`"/$link"
|
||||
fi
|
||||
done
|
||||
SAVED="`pwd`"
|
||||
cd "`dirname \"$PRG\"`/" >/dev/null
|
||||
APP_HOME="`pwd -P`"
|
||||
cd "$SAVED" >/dev/null
|
||||
|
||||
APP_NAME="Gradle"
|
||||
APP_BASE_NAME=`basename "$0"`
|
||||
|
||||
# Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
|
||||
DEFAULT_JVM_OPTS='"-Xmx64m" "-Xms64m"'
|
||||
|
||||
# Use the maximum available, or set MAX_FD != -1 to use that value.
|
||||
MAX_FD="maximum"
|
||||
|
||||
warn () {
|
||||
echo "$*"
|
||||
}
|
||||
|
||||
die () {
|
||||
echo
|
||||
echo "$*"
|
||||
echo
|
||||
exit 1
|
||||
}
|
||||
|
||||
# OS specific support (must be 'true' or 'false').
|
||||
cygwin=false
|
||||
msys=false
|
||||
darwin=false
|
||||
nonstop=false
|
||||
case "`uname`" in
|
||||
CYGWIN* )
|
||||
cygwin=true
|
||||
;;
|
||||
Darwin* )
|
||||
darwin=true
|
||||
;;
|
||||
MINGW* )
|
||||
msys=true
|
||||
;;
|
||||
NONSTOP* )
|
||||
nonstop=true
|
||||
;;
|
||||
esac
|
||||
|
||||
CLASSPATH=$APP_HOME/gradle/wrapper/gradle-wrapper.jar
|
||||
|
||||
|
||||
# Determine the Java command to use to start the JVM.
|
||||
if [ -n "$JAVA_HOME" ] ; then
|
||||
if [ -x "$JAVA_HOME/jre/sh/java" ] ; then
|
||||
# IBM's JDK on AIX uses strange locations for the executables
|
||||
JAVACMD="$JAVA_HOME/jre/sh/java"
|
||||
else
|
||||
JAVACMD="$JAVA_HOME/bin/java"
|
||||
fi
|
||||
if [ ! -x "$JAVACMD" ] ; then
|
||||
die "ERROR: JAVA_HOME is set to an invalid directory: $JAVA_HOME
|
||||
|
||||
Please set the JAVA_HOME variable in your environment to match the
|
||||
location of your Java installation."
|
||||
fi
|
||||
else
|
||||
JAVACMD="java"
|
||||
which java >/dev/null 2>&1 || die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.
|
||||
|
||||
Please set the JAVA_HOME variable in your environment to match the
|
||||
location of your Java installation."
|
||||
fi
|
||||
|
||||
# Increase the maximum file descriptors if we can.
|
||||
if [ "$cygwin" = "false" -a "$darwin" = "false" -a "$nonstop" = "false" ] ; then
|
||||
MAX_FD_LIMIT=`ulimit -H -n`
|
||||
if [ $? -eq 0 ] ; then
|
||||
if [ "$MAX_FD" = "maximum" -o "$MAX_FD" = "max" ] ; then
|
||||
MAX_FD="$MAX_FD_LIMIT"
|
||||
fi
|
||||
ulimit -n $MAX_FD
|
||||
if [ $? -ne 0 ] ; then
|
||||
warn "Could not set maximum file descriptor limit: $MAX_FD"
|
||||
fi
|
||||
else
|
||||
warn "Could not query maximum file descriptor limit: $MAX_FD_LIMIT"
|
||||
fi
|
||||
fi
|
||||
|
||||
# For Darwin, add options to specify how the application appears in the dock
|
||||
if $darwin; then
|
||||
GRADLE_OPTS="$GRADLE_OPTS \"-Xdock:name=$APP_NAME\" \"-Xdock:icon=$APP_HOME/media/gradle.icns\""
|
||||
fi
|
||||
|
||||
# For Cygwin or MSYS, switch paths to Windows format before running java
|
||||
if [ "$cygwin" = "true" -o "$msys" = "true" ] ; then
|
||||
APP_HOME=`cygpath --path --mixed "$APP_HOME"`
|
||||
CLASSPATH=`cygpath --path --mixed "$CLASSPATH"`
|
||||
|
||||
JAVACMD=`cygpath --unix "$JAVACMD"`
|
||||
|
||||
# We build the pattern for arguments to be converted via cygpath
|
||||
ROOTDIRSRAW=`find -L / -maxdepth 1 -mindepth 1 -type d 2>/dev/null`
|
||||
SEP=""
|
||||
for dir in $ROOTDIRSRAW ; do
|
||||
ROOTDIRS="$ROOTDIRS$SEP$dir"
|
||||
SEP="|"
|
||||
done
|
||||
OURCYGPATTERN="(^($ROOTDIRS))"
|
||||
# Add a user-defined pattern to the cygpath arguments
|
||||
if [ "$GRADLE_CYGPATTERN" != "" ] ; then
|
||||
OURCYGPATTERN="$OURCYGPATTERN|($GRADLE_CYGPATTERN)"
|
||||
fi
|
||||
# Now convert the arguments - kludge to limit ourselves to /bin/sh
|
||||
i=0
|
||||
for arg in "$@" ; do
|
||||
CHECK=`echo "$arg"|egrep -c "$OURCYGPATTERN" -`
|
||||
CHECK2=`echo "$arg"|egrep -c "^-"` ### Determine if an option
|
||||
|
||||
if [ $CHECK -ne 0 ] && [ $CHECK2 -eq 0 ] ; then ### Added a condition
|
||||
eval `echo args$i`=`cygpath --path --ignore --mixed "$arg"`
|
||||
else
|
||||
eval `echo args$i`="\"$arg\""
|
||||
fi
|
||||
i=`expr $i + 1`
|
||||
done
|
||||
case $i in
|
||||
0) set -- ;;
|
||||
1) set -- "$args0" ;;
|
||||
2) set -- "$args0" "$args1" ;;
|
||||
3) set -- "$args0" "$args1" "$args2" ;;
|
||||
4) set -- "$args0" "$args1" "$args2" "$args3" ;;
|
||||
5) set -- "$args0" "$args1" "$args2" "$args3" "$args4" ;;
|
||||
6) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" ;;
|
||||
7) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" ;;
|
||||
8) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" ;;
|
||||
9) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" "$args8" ;;
|
||||
esac
|
||||
fi
|
||||
|
||||
# Escape application args
|
||||
save () {
|
||||
for i do printf %s\\n "$i" | sed "s/'/'\\\\''/g;1s/^/'/;\$s/\$/' \\\\/" ; done
|
||||
echo " "
|
||||
}
|
||||
APP_ARGS=`save "$@"`
|
||||
|
||||
# Collect all arguments for the java command, following the shell quoting and substitution rules
|
||||
eval set -- $DEFAULT_JVM_OPTS $JAVA_OPTS $GRADLE_OPTS "\"-Dorg.gradle.appname=$APP_BASE_NAME\"" -classpath "\"$CLASSPATH\"" org.gradle.wrapper.GradleWrapperMain "$APP_ARGS"
|
||||
|
||||
exec "$JAVACMD" "$@"
|
@ -1,24 +0,0 @@
|
||||
pluginManagement {
|
||||
repositories {
|
||||
google {
|
||||
content {
|
||||
includeGroupByRegex("com\\.android.*")
|
||||
includeGroupByRegex("com\\.google.*")
|
||||
includeGroupByRegex("androidx.*")
|
||||
}
|
||||
}
|
||||
mavenCentral()
|
||||
gradlePluginPortal()
|
||||
}
|
||||
}
|
||||
dependencyResolutionManagement {
|
||||
repositoriesMode.set(RepositoriesMode.FAIL_ON_PROJECT_REPOS)
|
||||
repositories {
|
||||
google()
|
||||
mavenCentral()
|
||||
}
|
||||
}
|
||||
|
||||
rootProject.name = "xiaomibianqian"
|
||||
include(":app")
|
||||
|
@ -1,6 +0,0 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<project version="4">
|
||||
<component name="AndroidProjectSystem">
|
||||
<option name="providerId" value="com.android.tools.idea.GradleProjectSystem" />
|
||||
</component>
|
||||
</project>
|
@ -1,6 +0,0 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<project version="4">
|
||||
<component name="CompilerConfiguration">
|
||||
<bytecodeTargetLevel target="21" />
|
||||
</component>
|
||||
</project>
|
@ -1,10 +0,0 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<project version="4">
|
||||
<component name="deploymentTargetSelector">
|
||||
<selectionStates>
|
||||
<SelectionState runConfigName="app">
|
||||
<option name="selectionMode" value="DROPDOWN" />
|
||||
</SelectionState>
|
||||
</selectionStates>
|
||||
</component>
|
||||
</project>
|
@ -1,10 +0,0 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<project version="4">
|
||||
<component name="ProjectMigrations">
|
||||
<option name="MigrateToGradleLocalJavaHome">
|
||||
<set>
|
||||
<option value="$PROJECT_DIR$" />
|
||||
</set>
|
||||
</option>
|
||||
</component>
|
||||
</project>
|
@ -1,10 +0,0 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<project version="4">
|
||||
<component name="ExternalStorageConfigurationManager" enabled="true" />
|
||||
<component name="ProjectRootManager" version="2" languageLevel="JDK_21" default="true" project-jdk-name="jbr-21" project-jdk-type="JavaSDK">
|
||||
<output url="file://$PROJECT_DIR$/build/classes" />
|
||||
</component>
|
||||
<component name="ProjectType">
|
||||
<option name="id" value="Android" />
|
||||
</component>
|
||||
</project>
|
@ -1,17 +0,0 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<project version="4">
|
||||
<component name="RunConfigurationProducerService">
|
||||
<option name="ignoredProducers">
|
||||
<set>
|
||||
<option value="com.intellij.execution.junit.AbstractAllInDirectoryConfigurationProducer" />
|
||||
<option value="com.intellij.execution.junit.AllInPackageConfigurationProducer" />
|
||||
<option value="com.intellij.execution.junit.PatternConfigurationProducer" />
|
||||
<option value="com.intellij.execution.junit.TestInClassConfigurationProducer" />
|
||||
<option value="com.intellij.execution.junit.UniqueIdConfigurationProducer" />
|
||||
<option value="com.intellij.execution.junit.testDiscovery.JUnitTestDiscoveryConfigurationProducer" />
|
||||
<option value="org.jetbrains.kotlin.idea.junit.KotlinJUnitRunConfigurationProducer" />
|
||||
<option value="org.jetbrains.kotlin.idea.junit.KotlinPatternConfigurationProducer" />
|
||||
</set>
|
||||
</option>
|
||||
</component>
|
||||
</project>
|
@ -1,6 +0,0 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<project version="4">
|
||||
<component name="VcsDirectoryMappings">
|
||||
<mapping directory="$PROJECT_DIR$/.." vcs="Git" />
|
||||
</component>
|
||||
</project>
|
@ -1,187 +0,0 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<project version="4">
|
||||
<component name="AndroidLayouts">
|
||||
<shared>
|
||||
<config />
|
||||
</shared>
|
||||
</component>
|
||||
<component name="AutoImportSettings">
|
||||
<option name="autoReloadType" value="NONE" />
|
||||
</component>
|
||||
<component name="ChangeListManager">
|
||||
<list default="true" id="01cbe245-bdf9-4806-97ed-33f674eb53d6" name="Changes" comment="">
|
||||
<change afterPath="$PROJECT_DIR$/myapplication/.gitignore" afterDir="false" />
|
||||
<change afterPath="$PROJECT_DIR$/myapplication/build.gradle.kts" afterDir="false" />
|
||||
<change afterPath="$PROJECT_DIR$/myapplication/proguard-rules.pro" afterDir="false" />
|
||||
<change afterPath="$PROJECT_DIR$/myapplication/src/androidTest/java/net/micode/myapplication/ExampleInstrumentedTest.java" afterDir="false" />
|
||||
<change afterPath="$PROJECT_DIR$/myapplication/src/main/AndroidManifest.xml" afterDir="false" />
|
||||
<change afterPath="$PROJECT_DIR$/myapplication/src/main/java/net/micode/myapplication/MainActivity.java" afterDir="false" />
|
||||
<change afterPath="$PROJECT_DIR$/myapplication/src/main/res/drawable/ic_launcher_background.xml" afterDir="false" />
|
||||
<change afterPath="$PROJECT_DIR$/myapplication/src/main/res/drawable/ic_launcher_foreground.xml" afterDir="false" />
|
||||
<change afterPath="$PROJECT_DIR$/myapplication/src/main/res/layout/activity_main.xml" afterDir="false" />
|
||||
<change afterPath="$PROJECT_DIR$/myapplication/src/main/res/mipmap-anydpi-v26/ic_launcher.xml" afterDir="false" />
|
||||
<change afterPath="$PROJECT_DIR$/myapplication/src/main/res/mipmap-anydpi-v26/ic_launcher_round.xml" afterDir="false" />
|
||||
<change afterPath="$PROJECT_DIR$/myapplication/src/main/res/mipmap-hdpi/ic_launcher.webp" afterDir="false" />
|
||||
<change afterPath="$PROJECT_DIR$/myapplication/src/main/res/mipmap-hdpi/ic_launcher_round.webp" afterDir="false" />
|
||||
<change afterPath="$PROJECT_DIR$/myapplication/src/main/res/mipmap-mdpi/ic_launcher.webp" afterDir="false" />
|
||||
<change afterPath="$PROJECT_DIR$/myapplication/src/main/res/mipmap-mdpi/ic_launcher_round.webp" afterDir="false" />
|
||||
<change afterPath="$PROJECT_DIR$/myapplication/src/main/res/mipmap-xhdpi/ic_launcher.webp" afterDir="false" />
|
||||
<change afterPath="$PROJECT_DIR$/myapplication/src/main/res/mipmap-xhdpi/ic_launcher_round.webp" afterDir="false" />
|
||||
<change afterPath="$PROJECT_DIR$/myapplication/src/main/res/mipmap-xxhdpi/ic_launcher.webp" afterDir="false" />
|
||||
<change afterPath="$PROJECT_DIR$/myapplication/src/main/res/mipmap-xxhdpi/ic_launcher_round.webp" afterDir="false" />
|
||||
<change afterPath="$PROJECT_DIR$/myapplication/src/main/res/mipmap-xxxhdpi/ic_launcher.webp" afterDir="false" />
|
||||
<change afterPath="$PROJECT_DIR$/myapplication/src/main/res/mipmap-xxxhdpi/ic_launcher_round.webp" afterDir="false" />
|
||||
<change afterPath="$PROJECT_DIR$/myapplication/src/main/res/values-night/themes.xml" afterDir="false" />
|
||||
<change afterPath="$PROJECT_DIR$/myapplication/src/main/res/values/colors.xml" afterDir="false" />
|
||||
<change afterPath="$PROJECT_DIR$/myapplication/src/main/res/values/strings.xml" afterDir="false" />
|
||||
<change afterPath="$PROJECT_DIR$/myapplication/src/main/res/values/themes.xml" afterDir="false" />
|
||||
<change afterPath="$PROJECT_DIR$/myapplication/src/test/java/net/micode/myapplication/ExampleUnitTest.java" afterDir="false" />
|
||||
</list>
|
||||
<option name="SHOW_DIALOG" value="false" />
|
||||
<option name="HIGHLIGHT_CONFLICTS" value="true" />
|
||||
<option name="HIGHLIGHT_NON_ACTIVE_CHANGELIST" value="false" />
|
||||
<option name="LAST_RESOLUTION" value="IGNORE" />
|
||||
</component>
|
||||
<component name="ClangdSettings">
|
||||
<option name="formatViaClangd" value="false" />
|
||||
</component>
|
||||
<component name="ExecutionTargetManager" SELECTED_TARGET="device_and_snapshot_combo_box_target[DeviceId(pluginId=LocalEmulator, isTemplate=false, identifier=path=E:\android_AVD\.android\avd\Pixel_8_Pro.avd)]" />
|
||||
<component name="ExternalProjectsData">
|
||||
<projectState path="$PROJECT_DIR$">
|
||||
<ProjectState />
|
||||
</projectState>
|
||||
</component>
|
||||
<component name="Git.Settings">
|
||||
<option name="RECENT_GIT_ROOT_PATH" value="$PROJECT_DIR$/.." />
|
||||
</component>
|
||||
<component name="ProjectColorInfo"><![CDATA[{
|
||||
"associatedIndex": 6
|
||||
}]]></component>
|
||||
<component name="ProjectId" id="2x57M8CNTP6CmaguqrS7q71dXAa" />
|
||||
<component name="ProjectViewState">
|
||||
<option name="hideEmptyMiddlePackages" value="true" />
|
||||
<option name="showLibraryContents" value="true" />
|
||||
</component>
|
||||
<component name="PropertiesComponent"><![CDATA[{
|
||||
"keyToString": {
|
||||
"Android App.app.executor": "Run",
|
||||
"RunOnceActivity.ShowReadmeOnStart": "true",
|
||||
"RunOnceActivity.cidr.known.project.marker": "true",
|
||||
"RunOnceActivity.readMode.enableVisualFormatting": "true",
|
||||
"cf.first.check.clang-format": "false",
|
||||
"cidr.known.project.marker": "true",
|
||||
"git-widget-placeholder": "master",
|
||||
"kotlin-language-version-configured": "true",
|
||||
"last_opened_file_path": "E:/software/MiNote/Notes-master/app/src/main/java/net/micode/notes",
|
||||
"project.structure.last.edited": "Dependencies",
|
||||
"project.structure.proportion": "0.17",
|
||||
"project.structure.side.proportion": "0.2"
|
||||
}
|
||||
}]]></component>
|
||||
<component name="RecentsManager">
|
||||
<key name="CopyFile.RECENT_KEYS">
|
||||
<recent name="E:\software\MiNote\Notes-master\app\src\main\java\net\micode\notes" />
|
||||
</key>
|
||||
</component>
|
||||
<component name="RunManager">
|
||||
<configuration name="app" type="AndroidRunConfigurationType" factoryName="Android App" activateToolWindowBeforeRun="false">
|
||||
<module name="Notes-master.app" />
|
||||
<option name="ANDROID_RUN_CONFIGURATION_SCHEMA_VERSION" value="1" />
|
||||
<option name="DEPLOY" value="true" />
|
||||
<option name="DEPLOY_APK_FROM_BUNDLE" value="false" />
|
||||
<option name="DEPLOY_AS_INSTANT" value="false" />
|
||||
<option name="ARTIFACT_NAME" value="" />
|
||||
<option name="PM_INSTALL_OPTIONS" value="" />
|
||||
<option name="ALL_USERS" value="false" />
|
||||
<option name="ALWAYS_INSTALL_WITH_PM" value="false" />
|
||||
<option name="ALLOW_ASSUME_VERIFIED" value="false" />
|
||||
<option name="CLEAR_APP_STORAGE" value="false" />
|
||||
<option name="DYNAMIC_FEATURES_DISABLED_LIST" value="" />
|
||||
<option name="ACTIVITY_EXTRA_FLAGS" value="" />
|
||||
<option name="MODE" value="default_activity" />
|
||||
<option name="RESTORE_ENABLED" value="false" />
|
||||
<option name="RESTORE_FILE" value="" />
|
||||
<option name="RESTORE_FRESH_INSTALL_ONLY" value="false" />
|
||||
<option name="CLEAR_LOGCAT" value="false" />
|
||||
<option name="SHOW_LOGCAT_AUTOMATICALLY" value="false" />
|
||||
<option name="TARGET_SELECTION_MODE" value="DEVICE_AND_SNAPSHOT_COMBO_BOX" />
|
||||
<option name="SELECTED_CLOUD_MATRIX_CONFIGURATION_ID" value="-1" />
|
||||
<option name="SELECTED_CLOUD_MATRIX_PROJECT_ID" value="" />
|
||||
<option name="DEBUGGER_TYPE" value="Auto" />
|
||||
<Auto>
|
||||
<option name="USE_JAVA_AWARE_DEBUGGER" value="false" />
|
||||
<option name="SHOW_STATIC_VARS" value="true" />
|
||||
<option name="WORKING_DIR" value="" />
|
||||
<option name="TARGET_LOGGING_CHANNELS" value="lldb process:gdb-remote packets" />
|
||||
<option name="SHOW_OPTIMIZED_WARNING" value="true" />
|
||||
<option name="ATTACH_ON_WAIT_FOR_DEBUGGER" value="false" />
|
||||
<option name="DEBUG_SANDBOX_SDK" value="false" />
|
||||
</Auto>
|
||||
<Hybrid>
|
||||
<option name="USE_JAVA_AWARE_DEBUGGER" value="false" />
|
||||
<option name="SHOW_STATIC_VARS" value="true" />
|
||||
<option name="WORKING_DIR" value="" />
|
||||
<option name="TARGET_LOGGING_CHANNELS" value="lldb process:gdb-remote packets" />
|
||||
<option name="SHOW_OPTIMIZED_WARNING" value="true" />
|
||||
<option name="ATTACH_ON_WAIT_FOR_DEBUGGER" value="false" />
|
||||
<option name="DEBUG_SANDBOX_SDK" value="false" />
|
||||
</Hybrid>
|
||||
<Java>
|
||||
<option name="ATTACH_ON_WAIT_FOR_DEBUGGER" value="false" />
|
||||
<option name="DEBUG_SANDBOX_SDK" value="false" />
|
||||
</Java>
|
||||
<Native>
|
||||
<option name="USE_JAVA_AWARE_DEBUGGER" value="false" />
|
||||
<option name="SHOW_STATIC_VARS" value="true" />
|
||||
<option name="WORKING_DIR" value="" />
|
||||
<option name="TARGET_LOGGING_CHANNELS" value="lldb process:gdb-remote packets" />
|
||||
<option name="SHOW_OPTIMIZED_WARNING" value="true" />
|
||||
<option name="ATTACH_ON_WAIT_FOR_DEBUGGER" value="false" />
|
||||
<option name="DEBUG_SANDBOX_SDK" value="false" />
|
||||
</Native>
|
||||
<Profilers>
|
||||
<option name="ADVANCED_PROFILING_ENABLED" value="false" />
|
||||
<option name="STARTUP_PROFILING_ENABLED" value="false" />
|
||||
<option name="STARTUP_CPU_PROFILING_ENABLED" value="false" />
|
||||
<option name="STARTUP_CPU_PROFILING_CONFIGURATION_NAME" value="Java/Kotlin Method Sample (legacy)" />
|
||||
<option name="STARTUP_NATIVE_MEMORY_PROFILING_ENABLED" value="false" />
|
||||
<option name="NATIVE_MEMORY_SAMPLE_RATE_BYTES" value="2048" />
|
||||
</Profilers>
|
||||
<option name="DEEP_LINK" value="" />
|
||||
<option name="ACTIVITY" value="" />
|
||||
<option name="ACTIVITY_CLASS" value="" />
|
||||
<option name="SEARCH_ACTIVITY_IN_GLOBAL_SCOPE" value="false" />
|
||||
<option name="SKIP_ACTIVITY_VALIDATION" value="false" />
|
||||
<method v="2">
|
||||
<option name="Android.Gradle.BeforeRunTask" enabled="true" />
|
||||
</method>
|
||||
</configuration>
|
||||
</component>
|
||||
<component name="SpellCheckerSettings" RuntimeDictionaries="0" Folders="0" CustomDictionaries="0" DefaultDictionary="application-level" UseSingleDictionary="true" transferred="true" />
|
||||
<component name="TaskManager">
|
||||
<task active="true" id="Default" summary="Default task">
|
||||
<changelist id="01cbe245-bdf9-4806-97ed-33f674eb53d6" name="Changes" comment="" />
|
||||
<created>1747216030129</created>
|
||||
<option name="number" value="Default" />
|
||||
<option name="presentableId" value="Default" />
|
||||
<updated>1747216030129</updated>
|
||||
</task>
|
||||
<servers />
|
||||
</component>
|
||||
<component name="play_dynamic_filters_status">
|
||||
<option name="appIdToCheckInfo">
|
||||
<map>
|
||||
<entry key="net.micode.notes">
|
||||
<value>
|
||||
<CheckInfo lastCheckTimestamp="1747216587003" />
|
||||
</value>
|
||||
</entry>
|
||||
<entry key="net.micode.notes.test">
|
||||
<value>
|
||||
<CheckInfo lastCheckTimestamp="1747216587003" />
|
||||
</value>
|
||||
</entry>
|
||||
</map>
|
||||
</option>
|
||||
</component>
|
||||
</project>
|
@ -1 +0,0 @@
|
||||
{}
|
@ -1,2 +0,0 @@
|
||||
appMetadataVersion=1.1
|
||||
androidGradlePluginVersion=8.9.1
|
@ -1,10 +0,0 @@
|
||||
{
|
||||
"version": 3,
|
||||
"artifactType": {
|
||||
"type": "COMPATIBLE_SCREEN_MANIFEST",
|
||||
"kind": "Directory"
|
||||
},
|
||||
"applicationId": "net.micode.notes",
|
||||
"variantName": "debug",
|
||||
"elements": []
|
||||
}
|
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
@ -1,113 +0,0 @@
|
||||
#Wed May 14 17:50:41 CST 2025
|
||||
net.micode.notes.app-main-33\:/color/primary_text_dark.xml=E\:\\software\\MiNote\\Notes-master\\app\\build\\intermediates\\merged_res\\debug\\mergeDebugResources\\color_primary_text_dark.xml.flat
|
||||
net.micode.notes.app-main-33\:/color/secondary_text_dark.xml=E\:\\software\\MiNote\\Notes-master\\app\\build\\intermediates\\merged_res\\debug\\mergeDebugResources\\color_secondary_text_dark.xml.flat
|
||||
net.micode.notes.app-main-33\:/drawable-hdpi/bg_btn_set_color.png=E\:\\software\\MiNote\\Notes-master\\app\\build\\intermediates\\merged_res\\debug\\mergeDebugResources\\drawable-hdpi_bg_btn_set_color.png.flat
|
||||
net.micode.notes.app-main-33\:/drawable-hdpi/bg_color_btn_mask.png=E\:\\software\\MiNote\\Notes-master\\app\\build\\intermediates\\merged_res\\debug\\mergeDebugResources\\drawable-hdpi_bg_color_btn_mask.png.flat
|
||||
net.micode.notes.app-main-33\:/drawable-hdpi/call_record.png=E\:\\software\\MiNote\\Notes-master\\app\\build\\intermediates\\merged_res\\debug\\mergeDebugResources\\drawable-hdpi_call_record.png.flat
|
||||
net.micode.notes.app-main-33\:/drawable-hdpi/clock.png=E\:\\software\\MiNote\\Notes-master\\app\\build\\intermediates\\merged_res\\debug\\mergeDebugResources\\drawable-hdpi_clock.png.flat
|
||||
net.micode.notes.app-main-33\:/drawable-hdpi/delete.png=E\:\\software\\MiNote\\Notes-master\\app\\build\\intermediates\\merged_res\\debug\\mergeDebugResources\\drawable-hdpi_delete.png.flat
|
||||
net.micode.notes.app-main-33\:/drawable-hdpi/dropdown_icon.9.png=E\:\\software\\MiNote\\Notes-master\\app\\build\\intermediates\\merged_res\\debug\\mergeDebugResources\\drawable-hdpi_dropdown_icon.9.png.flat
|
||||
net.micode.notes.app-main-33\:/drawable-hdpi/edit_blue.9.png=E\:\\software\\MiNote\\Notes-master\\app\\build\\intermediates\\merged_res\\debug\\mergeDebugResources\\drawable-hdpi_edit_blue.9.png.flat
|
||||
net.micode.notes.app-main-33\:/drawable-hdpi/edit_green.9.png=E\:\\software\\MiNote\\Notes-master\\app\\build\\intermediates\\merged_res\\debug\\mergeDebugResources\\drawable-hdpi_edit_green.9.png.flat
|
||||
net.micode.notes.app-main-33\:/drawable-hdpi/edit_red.9.png=E\:\\software\\MiNote\\Notes-master\\app\\build\\intermediates\\merged_res\\debug\\mergeDebugResources\\drawable-hdpi_edit_red.9.png.flat
|
||||
net.micode.notes.app-main-33\:/drawable-hdpi/edit_title_blue.9.png=E\:\\software\\MiNote\\Notes-master\\app\\build\\intermediates\\merged_res\\debug\\mergeDebugResources\\drawable-hdpi_edit_title_blue.9.png.flat
|
||||
net.micode.notes.app-main-33\:/drawable-hdpi/edit_title_green.9.png=E\:\\software\\MiNote\\Notes-master\\app\\build\\intermediates\\merged_res\\debug\\mergeDebugResources\\drawable-hdpi_edit_title_green.9.png.flat
|
||||
net.micode.notes.app-main-33\:/drawable-hdpi/edit_title_red.9.png=E\:\\software\\MiNote\\Notes-master\\app\\build\\intermediates\\merged_res\\debug\\mergeDebugResources\\drawable-hdpi_edit_title_red.9.png.flat
|
||||
net.micode.notes.app-main-33\:/drawable-hdpi/edit_title_white.9.png=E\:\\software\\MiNote\\Notes-master\\app\\build\\intermediates\\merged_res\\debug\\mergeDebugResources\\drawable-hdpi_edit_title_white.9.png.flat
|
||||
net.micode.notes.app-main-33\:/drawable-hdpi/edit_title_yellow.9.png=E\:\\software\\MiNote\\Notes-master\\app\\build\\intermediates\\merged_res\\debug\\mergeDebugResources\\drawable-hdpi_edit_title_yellow.9.png.flat
|
||||
net.micode.notes.app-main-33\:/drawable-hdpi/edit_white.9.png=E\:\\software\\MiNote\\Notes-master\\app\\build\\intermediates\\merged_res\\debug\\mergeDebugResources\\drawable-hdpi_edit_white.9.png.flat
|
||||
net.micode.notes.app-main-33\:/drawable-hdpi/edit_yellow.9.png=E\:\\software\\MiNote\\Notes-master\\app\\build\\intermediates\\merged_res\\debug\\mergeDebugResources\\drawable-hdpi_edit_yellow.9.png.flat
|
||||
net.micode.notes.app-main-33\:/drawable-hdpi/font_large.png=E\:\\software\\MiNote\\Notes-master\\app\\build\\intermediates\\merged_res\\debug\\mergeDebugResources\\drawable-hdpi_font_large.png.flat
|
||||
net.micode.notes.app-main-33\:/drawable-hdpi/font_normal.png=E\:\\software\\MiNote\\Notes-master\\app\\build\\intermediates\\merged_res\\debug\\mergeDebugResources\\drawable-hdpi_font_normal.png.flat
|
||||
net.micode.notes.app-main-33\:/drawable-hdpi/font_size_selector_bg.9.png=E\:\\software\\MiNote\\Notes-master\\app\\build\\intermediates\\merged_res\\debug\\mergeDebugResources\\drawable-hdpi_font_size_selector_bg.9.png.flat
|
||||
net.micode.notes.app-main-33\:/drawable-hdpi/font_small.png=E\:\\software\\MiNote\\Notes-master\\app\\build\\intermediates\\merged_res\\debug\\mergeDebugResources\\drawable-hdpi_font_small.png.flat
|
||||
net.micode.notes.app-main-33\:/drawable-hdpi/font_super.png=E\:\\software\\MiNote\\Notes-master\\app\\build\\intermediates\\merged_res\\debug\\mergeDebugResources\\drawable-hdpi_font_super.png.flat
|
||||
net.micode.notes.app-main-33\:/drawable-hdpi/icon_app.png=E\:\\software\\MiNote\\Notes-master\\app\\build\\intermediates\\merged_res\\debug\\mergeDebugResources\\drawable-hdpi_icon_app.png.flat
|
||||
net.micode.notes.app-main-33\:/drawable-hdpi/list_background.png=E\:\\software\\MiNote\\Notes-master\\app\\build\\intermediates\\merged_res\\debug\\mergeDebugResources\\drawable-hdpi_list_background.png.flat
|
||||
net.micode.notes.app-main-33\:/drawable-hdpi/list_blue_down.9.png=E\:\\software\\MiNote\\Notes-master\\app\\build\\intermediates\\merged_res\\debug\\mergeDebugResources\\drawable-hdpi_list_blue_down.9.png.flat
|
||||
net.micode.notes.app-main-33\:/drawable-hdpi/list_blue_middle.9.png=E\:\\software\\MiNote\\Notes-master\\app\\build\\intermediates\\merged_res\\debug\\mergeDebugResources\\drawable-hdpi_list_blue_middle.9.png.flat
|
||||
net.micode.notes.app-main-33\:/drawable-hdpi/list_blue_single.9.png=E\:\\software\\MiNote\\Notes-master\\app\\build\\intermediates\\merged_res\\debug\\mergeDebugResources\\drawable-hdpi_list_blue_single.9.png.flat
|
||||
net.micode.notes.app-main-33\:/drawable-hdpi/list_blue_up.9.png=E\:\\software\\MiNote\\Notes-master\\app\\build\\intermediates\\merged_res\\debug\\mergeDebugResources\\drawable-hdpi_list_blue_up.9.png.flat
|
||||
net.micode.notes.app-main-33\:/drawable-hdpi/list_folder.9.png=E\:\\software\\MiNote\\Notes-master\\app\\build\\intermediates\\merged_res\\debug\\mergeDebugResources\\drawable-hdpi_list_folder.9.png.flat
|
||||
net.micode.notes.app-main-33\:/drawable-hdpi/list_footer_bg.9.png=E\:\\software\\MiNote\\Notes-master\\app\\build\\intermediates\\merged_res\\debug\\mergeDebugResources\\drawable-hdpi_list_footer_bg.9.png.flat
|
||||
net.micode.notes.app-main-33\:/drawable-hdpi/list_green_down.9.png=E\:\\software\\MiNote\\Notes-master\\app\\build\\intermediates\\merged_res\\debug\\mergeDebugResources\\drawable-hdpi_list_green_down.9.png.flat
|
||||
net.micode.notes.app-main-33\:/drawable-hdpi/list_green_middle.9.png=E\:\\software\\MiNote\\Notes-master\\app\\build\\intermediates\\merged_res\\debug\\mergeDebugResources\\drawable-hdpi_list_green_middle.9.png.flat
|
||||
net.micode.notes.app-main-33\:/drawable-hdpi/list_green_single.9.png=E\:\\software\\MiNote\\Notes-master\\app\\build\\intermediates\\merged_res\\debug\\mergeDebugResources\\drawable-hdpi_list_green_single.9.png.flat
|
||||
net.micode.notes.app-main-33\:/drawable-hdpi/list_green_up.9.png=E\:\\software\\MiNote\\Notes-master\\app\\build\\intermediates\\merged_res\\debug\\mergeDebugResources\\drawable-hdpi_list_green_up.9.png.flat
|
||||
net.micode.notes.app-main-33\:/drawable-hdpi/list_red_down.9.png=E\:\\software\\MiNote\\Notes-master\\app\\build\\intermediates\\merged_res\\debug\\mergeDebugResources\\drawable-hdpi_list_red_down.9.png.flat
|
||||
net.micode.notes.app-main-33\:/drawable-hdpi/list_red_middle.9.png=E\:\\software\\MiNote\\Notes-master\\app\\build\\intermediates\\merged_res\\debug\\mergeDebugResources\\drawable-hdpi_list_red_middle.9.png.flat
|
||||
net.micode.notes.app-main-33\:/drawable-hdpi/list_red_single.9.png=E\:\\software\\MiNote\\Notes-master\\app\\build\\intermediates\\merged_res\\debug\\mergeDebugResources\\drawable-hdpi_list_red_single.9.png.flat
|
||||
net.micode.notes.app-main-33\:/drawable-hdpi/list_red_up.9.png=E\:\\software\\MiNote\\Notes-master\\app\\build\\intermediates\\merged_res\\debug\\mergeDebugResources\\drawable-hdpi_list_red_up.9.png.flat
|
||||
net.micode.notes.app-main-33\:/drawable-hdpi/list_white_down.9.png=E\:\\software\\MiNote\\Notes-master\\app\\build\\intermediates\\merged_res\\debug\\mergeDebugResources\\drawable-hdpi_list_white_down.9.png.flat
|
||||
net.micode.notes.app-main-33\:/drawable-hdpi/list_white_middle.9.png=E\:\\software\\MiNote\\Notes-master\\app\\build\\intermediates\\merged_res\\debug\\mergeDebugResources\\drawable-hdpi_list_white_middle.9.png.flat
|
||||
net.micode.notes.app-main-33\:/drawable-hdpi/list_white_single.9.png=E\:\\software\\MiNote\\Notes-master\\app\\build\\intermediates\\merged_res\\debug\\mergeDebugResources\\drawable-hdpi_list_white_single.9.png.flat
|
||||
net.micode.notes.app-main-33\:/drawable-hdpi/list_white_up.9.png=E\:\\software\\MiNote\\Notes-master\\app\\build\\intermediates\\merged_res\\debug\\mergeDebugResources\\drawable-hdpi_list_white_up.9.png.flat
|
||||
net.micode.notes.app-main-33\:/drawable-hdpi/list_yellow_down.9.png=E\:\\software\\MiNote\\Notes-master\\app\\build\\intermediates\\merged_res\\debug\\mergeDebugResources\\drawable-hdpi_list_yellow_down.9.png.flat
|
||||
net.micode.notes.app-main-33\:/drawable-hdpi/list_yellow_middle.9.png=E\:\\software\\MiNote\\Notes-master\\app\\build\\intermediates\\merged_res\\debug\\mergeDebugResources\\drawable-hdpi_list_yellow_middle.9.png.flat
|
||||
net.micode.notes.app-main-33\:/drawable-hdpi/list_yellow_single.9.png=E\:\\software\\MiNote\\Notes-master\\app\\build\\intermediates\\merged_res\\debug\\mergeDebugResources\\drawable-hdpi_list_yellow_single.9.png.flat
|
||||
net.micode.notes.app-main-33\:/drawable-hdpi/list_yellow_up.9.png=E\:\\software\\MiNote\\Notes-master\\app\\build\\intermediates\\merged_res\\debug\\mergeDebugResources\\drawable-hdpi_list_yellow_up.9.png.flat
|
||||
net.micode.notes.app-main-33\:/drawable-hdpi/menu_delete.png=E\:\\software\\MiNote\\Notes-master\\app\\build\\intermediates\\merged_res\\debug\\mergeDebugResources\\drawable-hdpi_menu_delete.png.flat
|
||||
net.micode.notes.app-main-33\:/drawable-hdpi/menu_move.png=E\:\\software\\MiNote\\Notes-master\\app\\build\\intermediates\\merged_res\\debug\\mergeDebugResources\\drawable-hdpi_menu_move.png.flat
|
||||
net.micode.notes.app-main-33\:/drawable-hdpi/new_note_normal.png=E\:\\software\\MiNote\\Notes-master\\app\\build\\intermediates\\merged_res\\debug\\mergeDebugResources\\drawable-hdpi_new_note_normal.png.flat
|
||||
net.micode.notes.app-main-33\:/drawable-hdpi/new_note_pressed.png=E\:\\software\\MiNote\\Notes-master\\app\\build\\intermediates\\merged_res\\debug\\mergeDebugResources\\drawable-hdpi_new_note_pressed.png.flat
|
||||
net.micode.notes.app-main-33\:/drawable-hdpi/note_edit_color_selector_panel.png=E\:\\software\\MiNote\\Notes-master\\app\\build\\intermediates\\merged_res\\debug\\mergeDebugResources\\drawable-hdpi_note_edit_color_selector_panel.png.flat
|
||||
net.micode.notes.app-main-33\:/drawable-hdpi/notification.png=E\:\\software\\MiNote\\Notes-master\\app\\build\\intermediates\\merged_res\\debug\\mergeDebugResources\\drawable-hdpi_notification.png.flat
|
||||
net.micode.notes.app-main-33\:/drawable-hdpi/search_result.png=E\:\\software\\MiNote\\Notes-master\\app\\build\\intermediates\\merged_res\\debug\\mergeDebugResources\\drawable-hdpi_search_result.png.flat
|
||||
net.micode.notes.app-main-33\:/drawable-hdpi/selected.png=E\:\\software\\MiNote\\Notes-master\\app\\build\\intermediates\\merged_res\\debug\\mergeDebugResources\\drawable-hdpi_selected.png.flat
|
||||
net.micode.notes.app-main-33\:/drawable-hdpi/title_alert.png=E\:\\software\\MiNote\\Notes-master\\app\\build\\intermediates\\merged_res\\debug\\mergeDebugResources\\drawable-hdpi_title_alert.png.flat
|
||||
net.micode.notes.app-main-33\:/drawable-hdpi/title_bar_bg.9.png=E\:\\software\\MiNote\\Notes-master\\app\\build\\intermediates\\merged_res\\debug\\mergeDebugResources\\drawable-hdpi_title_bar_bg.9.png.flat
|
||||
net.micode.notes.app-main-33\:/drawable-hdpi/widget_2x_blue.png=E\:\\software\\MiNote\\Notes-master\\app\\build\\intermediates\\merged_res\\debug\\mergeDebugResources\\drawable-hdpi_widget_2x_blue.png.flat
|
||||
net.micode.notes.app-main-33\:/drawable-hdpi/widget_2x_green.png=E\:\\software\\MiNote\\Notes-master\\app\\build\\intermediates\\merged_res\\debug\\mergeDebugResources\\drawable-hdpi_widget_2x_green.png.flat
|
||||
net.micode.notes.app-main-33\:/drawable-hdpi/widget_2x_red.png=E\:\\software\\MiNote\\Notes-master\\app\\build\\intermediates\\merged_res\\debug\\mergeDebugResources\\drawable-hdpi_widget_2x_red.png.flat
|
||||
net.micode.notes.app-main-33\:/drawable-hdpi/widget_2x_white.png=E\:\\software\\MiNote\\Notes-master\\app\\build\\intermediates\\merged_res\\debug\\mergeDebugResources\\drawable-hdpi_widget_2x_white.png.flat
|
||||
net.micode.notes.app-main-33\:/drawable-hdpi/widget_2x_yellow.png=E\:\\software\\MiNote\\Notes-master\\app\\build\\intermediates\\merged_res\\debug\\mergeDebugResources\\drawable-hdpi_widget_2x_yellow.png.flat
|
||||
net.micode.notes.app-main-33\:/drawable-hdpi/widget_4x_blue.png=E\:\\software\\MiNote\\Notes-master\\app\\build\\intermediates\\merged_res\\debug\\mergeDebugResources\\drawable-hdpi_widget_4x_blue.png.flat
|
||||
net.micode.notes.app-main-33\:/drawable-hdpi/widget_4x_green.png=E\:\\software\\MiNote\\Notes-master\\app\\build\\intermediates\\merged_res\\debug\\mergeDebugResources\\drawable-hdpi_widget_4x_green.png.flat
|
||||
net.micode.notes.app-main-33\:/drawable-hdpi/widget_4x_red.png=E\:\\software\\MiNote\\Notes-master\\app\\build\\intermediates\\merged_res\\debug\\mergeDebugResources\\drawable-hdpi_widget_4x_red.png.flat
|
||||
net.micode.notes.app-main-33\:/drawable-hdpi/widget_4x_white.png=E\:\\software\\MiNote\\Notes-master\\app\\build\\intermediates\\merged_res\\debug\\mergeDebugResources\\drawable-hdpi_widget_4x_white.png.flat
|
||||
net.micode.notes.app-main-33\:/drawable-hdpi/widget_4x_yellow.png=E\:\\software\\MiNote\\Notes-master\\app\\build\\intermediates\\merged_res\\debug\\mergeDebugResources\\drawable-hdpi_widget_4x_yellow.png.flat
|
||||
net.micode.notes.app-main-33\:/drawable/ic_launcher_background.xml=E\:\\software\\MiNote\\Notes-master\\app\\build\\intermediates\\merged_res\\debug\\mergeDebugResources\\drawable_ic_launcher_background.xml.flat
|
||||
net.micode.notes.app-main-33\:/drawable/ic_launcher_foreground.xml=E\:\\software\\MiNote\\Notes-master\\app\\build\\intermediates\\merged_res\\debug\\mergeDebugResources\\drawable_ic_launcher_foreground.xml.flat
|
||||
net.micode.notes.app-main-33\:/drawable/new_note.xml=E\:\\software\\MiNote\\Notes-master\\app\\build\\intermediates\\merged_res\\debug\\mergeDebugResources\\drawable_new_note.xml.flat
|
||||
net.micode.notes.app-main-33\:/layout/account_dialog_title.xml=E\:\\software\\MiNote\\Notes-master\\app\\build\\intermediates\\merged_res\\debug\\mergeDebugResources\\layout_account_dialog_title.xml.flat
|
||||
net.micode.notes.app-main-33\:/layout/activity_main.xml=E\:\\software\\MiNote\\Notes-master\\app\\build\\intermediates\\merged_res\\debug\\mergeDebugResources\\layout_activity_main.xml.flat
|
||||
net.micode.notes.app-main-33\:/layout/add_account_text.xml=E\:\\software\\MiNote\\Notes-master\\app\\build\\intermediates\\merged_res\\debug\\mergeDebugResources\\layout_add_account_text.xml.flat
|
||||
net.micode.notes.app-main-33\:/layout/datetime_picker.xml=E\:\\software\\MiNote\\Notes-master\\app\\build\\intermediates\\merged_res\\debug\\mergeDebugResources\\layout_datetime_picker.xml.flat
|
||||
net.micode.notes.app-main-33\:/layout/dialog_edit_text.xml=E\:\\software\\MiNote\\Notes-master\\app\\build\\intermediates\\merged_res\\debug\\mergeDebugResources\\layout_dialog_edit_text.xml.flat
|
||||
net.micode.notes.app-main-33\:/layout/folder_list_item.xml=E\:\\software\\MiNote\\Notes-master\\app\\build\\intermediates\\merged_res\\debug\\mergeDebugResources\\layout_folder_list_item.xml.flat
|
||||
net.micode.notes.app-main-33\:/layout/note_edit.xml=E\:\\software\\MiNote\\Notes-master\\app\\build\\intermediates\\merged_res\\debug\\mergeDebugResources\\layout_note_edit.xml.flat
|
||||
net.micode.notes.app-main-33\:/layout/note_edit_list_item.xml=E\:\\software\\MiNote\\Notes-master\\app\\build\\intermediates\\merged_res\\debug\\mergeDebugResources\\layout_note_edit_list_item.xml.flat
|
||||
net.micode.notes.app-main-33\:/layout/note_item.xml=E\:\\software\\MiNote\\Notes-master\\app\\build\\intermediates\\merged_res\\debug\\mergeDebugResources\\layout_note_item.xml.flat
|
||||
net.micode.notes.app-main-33\:/layout/note_list.xml=E\:\\software\\MiNote\\Notes-master\\app\\build\\intermediates\\merged_res\\debug\\mergeDebugResources\\layout_note_list.xml.flat
|
||||
net.micode.notes.app-main-33\:/layout/note_list_dropdown_menu.xml=E\:\\software\\MiNote\\Notes-master\\app\\build\\intermediates\\merged_res\\debug\\mergeDebugResources\\layout_note_list_dropdown_menu.xml.flat
|
||||
net.micode.notes.app-main-33\:/layout/note_list_footer.xml=E\:\\software\\MiNote\\Notes-master\\app\\build\\intermediates\\merged_res\\debug\\mergeDebugResources\\layout_note_list_footer.xml.flat
|
||||
net.micode.notes.app-main-33\:/layout/settings_header.xml=E\:\\software\\MiNote\\Notes-master\\app\\build\\intermediates\\merged_res\\debug\\mergeDebugResources\\layout_settings_header.xml.flat
|
||||
net.micode.notes.app-main-33\:/layout/widget_2x.xml=E\:\\software\\MiNote\\Notes-master\\app\\build\\intermediates\\merged_res\\debug\\mergeDebugResources\\layout_widget_2x.xml.flat
|
||||
net.micode.notes.app-main-33\:/layout/widget_4x.xml=E\:\\software\\MiNote\\Notes-master\\app\\build\\intermediates\\merged_res\\debug\\mergeDebugResources\\layout_widget_4x.xml.flat
|
||||
net.micode.notes.app-main-33\:/menu/call_note_edit.xml=E\:\\software\\MiNote\\Notes-master\\app\\build\\intermediates\\merged_res\\debug\\mergeDebugResources\\menu_call_note_edit.xml.flat
|
||||
net.micode.notes.app-main-33\:/menu/call_record_folder.xml=E\:\\software\\MiNote\\Notes-master\\app\\build\\intermediates\\merged_res\\debug\\mergeDebugResources\\menu_call_record_folder.xml.flat
|
||||
net.micode.notes.app-main-33\:/menu/note_edit.xml=E\:\\software\\MiNote\\Notes-master\\app\\build\\intermediates\\merged_res\\debug\\mergeDebugResources\\menu_note_edit.xml.flat
|
||||
net.micode.notes.app-main-33\:/menu/note_list.xml=E\:\\software\\MiNote\\Notes-master\\app\\build\\intermediates\\merged_res\\debug\\mergeDebugResources\\menu_note_list.xml.flat
|
||||
net.micode.notes.app-main-33\:/menu/note_list_dropdown.xml=E\:\\software\\MiNote\\Notes-master\\app\\build\\intermediates\\merged_res\\debug\\mergeDebugResources\\menu_note_list_dropdown.xml.flat
|
||||
net.micode.notes.app-main-33\:/menu/note_list_options.xml=E\:\\software\\MiNote\\Notes-master\\app\\build\\intermediates\\merged_res\\debug\\mergeDebugResources\\menu_note_list_options.xml.flat
|
||||
net.micode.notes.app-main-33\:/menu/sub_folder.xml=E\:\\software\\MiNote\\Notes-master\\app\\build\\intermediates\\merged_res\\debug\\mergeDebugResources\\menu_sub_folder.xml.flat
|
||||
net.micode.notes.app-main-33\:/mipmap-anydpi-v26/ic_launcher.xml=E\:\\software\\MiNote\\Notes-master\\app\\build\\intermediates\\merged_res\\debug\\mergeDebugResources\\mipmap-anydpi-v26_ic_launcher.xml.flat
|
||||
net.micode.notes.app-main-33\:/mipmap-anydpi-v26/ic_launcher_round.xml=E\:\\software\\MiNote\\Notes-master\\app\\build\\intermediates\\merged_res\\debug\\mergeDebugResources\\mipmap-anydpi-v26_ic_launcher_round.xml.flat
|
||||
net.micode.notes.app-main-33\:/mipmap-hdpi/ic_launcher.webp=E\:\\software\\MiNote\\Notes-master\\app\\build\\intermediates\\merged_res\\debug\\mergeDebugResources\\mipmap-hdpi_ic_launcher.webp.flat
|
||||
net.micode.notes.app-main-33\:/mipmap-hdpi/ic_launcher_round.webp=E\:\\software\\MiNote\\Notes-master\\app\\build\\intermediates\\merged_res\\debug\\mergeDebugResources\\mipmap-hdpi_ic_launcher_round.webp.flat
|
||||
net.micode.notes.app-main-33\:/mipmap-mdpi/ic_launcher.webp=E\:\\software\\MiNote\\Notes-master\\app\\build\\intermediates\\merged_res\\debug\\mergeDebugResources\\mipmap-mdpi_ic_launcher.webp.flat
|
||||
net.micode.notes.app-main-33\:/mipmap-mdpi/ic_launcher_round.webp=E\:\\software\\MiNote\\Notes-master\\app\\build\\intermediates\\merged_res\\debug\\mergeDebugResources\\mipmap-mdpi_ic_launcher_round.webp.flat
|
||||
net.micode.notes.app-main-33\:/mipmap-xhdpi/ic_launcher.webp=E\:\\software\\MiNote\\Notes-master\\app\\build\\intermediates\\merged_res\\debug\\mergeDebugResources\\mipmap-xhdpi_ic_launcher.webp.flat
|
||||
net.micode.notes.app-main-33\:/mipmap-xhdpi/ic_launcher_round.webp=E\:\\software\\MiNote\\Notes-master\\app\\build\\intermediates\\merged_res\\debug\\mergeDebugResources\\mipmap-xhdpi_ic_launcher_round.webp.flat
|
||||
net.micode.notes.app-main-33\:/mipmap-xxhdpi/ic_launcher.webp=E\:\\software\\MiNote\\Notes-master\\app\\build\\intermediates\\merged_res\\debug\\mergeDebugResources\\mipmap-xxhdpi_ic_launcher.webp.flat
|
||||
net.micode.notes.app-main-33\:/mipmap-xxhdpi/ic_launcher_round.webp=E\:\\software\\MiNote\\Notes-master\\app\\build\\intermediates\\merged_res\\debug\\mergeDebugResources\\mipmap-xxhdpi_ic_launcher_round.webp.flat
|
||||
net.micode.notes.app-main-33\:/mipmap-xxxhdpi/ic_launcher.webp=E\:\\software\\MiNote\\Notes-master\\app\\build\\intermediates\\merged_res\\debug\\mergeDebugResources\\mipmap-xxxhdpi_ic_launcher.webp.flat
|
||||
net.micode.notes.app-main-33\:/mipmap-xxxhdpi/ic_launcher_round.webp=E\:\\software\\MiNote\\Notes-master\\app\\build\\intermediates\\merged_res\\debug\\mergeDebugResources\\mipmap-xxxhdpi_ic_launcher_round.webp.flat
|
||||
net.micode.notes.app-main-33\:/raw-zh-rCN/introduction=E\:\\software\\MiNote\\Notes-master\\app\\build\\intermediates\\merged_res\\debug\\mergeDebugResources\\raw-zh-rCN_introduction.flat
|
||||
net.micode.notes.app-main-33\:/raw/introduction=E\:\\software\\MiNote\\Notes-master\\app\\build\\intermediates\\merged_res\\debug\\mergeDebugResources\\raw_introduction.flat
|
||||
net.micode.notes.app-main-33\:/xml/backup_rules.xml=E\:\\software\\MiNote\\Notes-master\\app\\build\\intermediates\\merged_res\\debug\\mergeDebugResources\\xml_backup_rules.xml.flat
|
||||
net.micode.notes.app-main-33\:/xml/data_extraction_rules.xml=E\:\\software\\MiNote\\Notes-master\\app\\build\\intermediates\\merged_res\\debug\\mergeDebugResources\\xml_data_extraction_rules.xml.flat
|
||||
net.micode.notes.app-main-33\:/xml/preferences.xml=E\:\\software\\MiNote\\Notes-master\\app\\build\\intermediates\\merged_res\\debug\\mergeDebugResources\\xml_preferences.xml.flat
|
||||
net.micode.notes.app-main-33\:/xml/searchable.xml=E\:\\software\\MiNote\\Notes-master\\app\\build\\intermediates\\merged_res\\debug\\mergeDebugResources\\xml_searchable.xml.flat
|
||||
net.micode.notes.app-main-33\:/xml/widget_2x_info.xml=E\:\\software\\MiNote\\Notes-master\\app\\build\\intermediates\\merged_res\\debug\\mergeDebugResources\\xml_widget_2x_info.xml.flat
|
||||
net.micode.notes.app-main-33\:/xml/widget_4x_info.xml=E\:\\software\\MiNote\\Notes-master\\app\\build\\intermediates\\merged_res\\debug\\mergeDebugResources\\xml_widget_4x_info.xml.flat
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in new issue