diff --git a/model/data包中类间的关系图.png b/model/data包中类间的关系图.png
new file mode 100644
index 0000000..0b61093
Binary files /dev/null and b/model/data包中类间的关系图.png differ
diff --git a/model/gtask包中类间的关系图.png b/model/gtask包中类间的关系图.png
new file mode 100644
index 0000000..d82e99b
Binary files /dev/null and b/model/gtask包中类间的关系图.png differ
diff --git a/model/model包中类间的关系图.png b/model/model包中类间的关系图.png
new file mode 100644
index 0000000..7f27faa
Binary files /dev/null and b/model/model包中类间的关系图.png differ
diff --git a/model/ui包中类间的关系图.png b/model/ui包中类间的关系图.png
new file mode 100644
index 0000000..10ad1b1
Binary files /dev/null and b/model/ui包中类间的关系图.png differ
diff --git a/model/widget包中类间的关系图.png b/model/widget包中类间的关系图.png
new file mode 100644
index 0000000..7b01fb2
Binary files /dev/null and b/model/widget包中类间的关系图.png differ
diff --git a/model/创建便签设计顺序图.png b/model/创建便签设计顺序图.png
new file mode 100644
index 0000000..bce5d12
Binary files /dev/null and b/model/创建便签设计顺序图.png differ
diff --git a/model/字体设置分析顺序图.png b/model/字体设置分析顺序图.png
new file mode 100644
index 0000000..d4bcbc7
Binary files /dev/null and b/model/字体设置分析顺序图.png differ
diff --git a/model/小米便签体系结构图.png b/model/小米便签体系结构图.png
new file mode 100644
index 0000000..035d240
Binary files /dev/null and b/model/小米便签体系结构图.png differ
diff --git a/model/小米便签用例图.png b/model/小米便签用例图.png
new file mode 100644
index 0000000..f2d468d
Binary files /dev/null and b/model/小米便签用例图.png differ
diff --git a/model/新建文件夹分析顺序图.png b/model/新建文件夹分析顺序图.png
new file mode 100644
index 0000000..e26fc42
Binary files /dev/null and b/model/新建文件夹分析顺序图.png differ
diff --git a/model/清单模式设计顺序图.png b/model/清单模式设计顺序图.png
new file mode 100644
index 0000000..85b0d1e
Binary files /dev/null and b/model/清单模式设计顺序图.png differ
diff --git a/model/闹钟提醒设计顺序图.png b/model/闹钟提醒设计顺序图.png
new file mode 100644
index 0000000..4a6ac40
Binary files /dev/null and b/model/闹钟提醒设计顺序图.png differ
diff --git a/src/main/AndroidManifest.xml b/src/main/AndroidManifest.xml
new file mode 100644
index 0000000..5e42e1a
--- /dev/null
+++ b/src/main/AndroidManifest.xml
@@ -0,0 +1,156 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ >
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/src/main/java/net/micode/notes/MainActivity.java b/src/main/java/net/micode/notes/MainActivity.java
new file mode 100644
index 0000000..8091753
--- /dev/null
+++ b/src/main/java/net/micode/notes/MainActivity.java
@@ -0,0 +1,24 @@
+package net.micode.notes;
+
+import android.os.Bundle;
+
+import androidx.activity.EdgeToEdge;
+import androidx.appcompat.app.AppCompatActivity;
+import androidx.core.graphics.Insets;
+import androidx.core.view.ViewCompat;
+import androidx.core.view.WindowInsetsCompat;
+
+public class MainActivity extends AppCompatActivity {
+
+ @Override
+ protected void onCreate(Bundle savedInstanceState) {
+ super.onCreate(savedInstanceState);
+ EdgeToEdge.enable(this);
+ setContentView(R.layout.activity_main);
+ ViewCompat.setOnApplyWindowInsetsListener(findViewById(R.id.main), (v, insets) -> {
+ Insets systemBars = insets.getInsets(WindowInsetsCompat.Type.systemBars());
+ v.setPadding(systemBars.left, systemBars.top, systemBars.right, systemBars.bottom);
+ return insets;
+ });
+ }
+}
\ No newline at end of file
diff --git a/src/net/micode/notes/data/Contact.java b/src/main/java/net/micode/notes/data/Contact.java
similarity index 100%
rename from src/net/micode/notes/data/Contact.java
rename to src/main/java/net/micode/notes/data/Contact.java
diff --git a/src/net/micode/notes/data/Notes.java b/src/main/java/net/micode/notes/data/Notes.java
similarity index 98%
rename from src/net/micode/notes/data/Notes.java
rename to src/main/java/net/micode/notes/data/Notes.java
index f240604..6e7bc32 100644
--- a/src/net/micode/notes/data/Notes.java
+++ b/src/main/java/net/micode/notes/data/Notes.java
@@ -165,6 +165,12 @@ public class Notes {
*
Type : INTEGER (long)
*/
public static final String VERSION = "version";
+
+ /**
+ * Sign to indicate whether the note is pinned
+ * Type: INTEGER
+ */
+ public static final String IS_PINNED = "is_pinned";
}
public interface DataColumns {
diff --git a/src/net/micode/notes/data/NotesDatabaseHelper.java b/src/main/java/net/micode/notes/data/NotesDatabaseHelper.java
similarity index 94%
rename from src/net/micode/notes/data/NotesDatabaseHelper.java
rename to src/main/java/net/micode/notes/data/NotesDatabaseHelper.java
index ffe5d57..f8cf859 100644
--- a/src/net/micode/notes/data/NotesDatabaseHelper.java
+++ b/src/main/java/net/micode/notes/data/NotesDatabaseHelper.java
@@ -30,7 +30,7 @@ import net.micode.notes.data.Notes.NoteColumns;
public class NotesDatabaseHelper extends SQLiteOpenHelper {
private static final String DB_NAME = "note.db";
- private static final int DB_VERSION = 4;
+ private static final int DB_VERSION = 5;
public interface TABLE {
public static final String NOTE = "note";
@@ -60,7 +60,8 @@ public class NotesDatabaseHelper extends SQLiteOpenHelper {
NoteColumns.LOCAL_MODIFIED + " INTEGER NOT NULL DEFAULT 0," +
NoteColumns.ORIGIN_PARENT_ID + " INTEGER NOT NULL DEFAULT 0," +
NoteColumns.GTASK_ID + " TEXT NOT NULL DEFAULT ''," +
- NoteColumns.VERSION + " INTEGER NOT NULL DEFAULT 0" +
+ NoteColumns.VERSION + " INTEGER NOT NULL DEFAULT 0," +
+ NoteColumns.IS_PINNED + " INTEGER NOT NULL DEFAULT 0" +
")";
private static final String CREATE_DATA_TABLE_SQL =
@@ -302,34 +303,17 @@ public class NotesDatabaseHelper extends SQLiteOpenHelper {
@Override
public void onUpgrade(SQLiteDatabase db, int oldVersion, int newVersion) {
- boolean reCreateTriggers = false;
- boolean skipV2 = false;
-
- if (oldVersion == 1) {
+ if (oldVersion < 2) {
upgradeToV2(db);
- skipV2 = true; // this upgrade including the upgrade from v2 to v3
- oldVersion++;
}
-
- if (oldVersion == 2 && !skipV2) {
+ if (oldVersion < 3) {
upgradeToV3(db);
- reCreateTriggers = true;
- oldVersion++;
}
-
- if (oldVersion == 3) {
+ if (oldVersion < 4) {
upgradeToV4(db);
- oldVersion++;
- }
-
- if (reCreateTriggers) {
- reCreateNoteTableTriggers(db);
- reCreateDataTableTriggers(db);
}
-
- if (oldVersion != newVersion) {
- throw new IllegalStateException("Upgrade notes database to version " + newVersion
- + "fails");
+ if (oldVersion < 5) {
+ upgradeToV5(db);
}
}
@@ -359,4 +343,8 @@ public class NotesDatabaseHelper extends SQLiteOpenHelper {
db.execSQL("ALTER TABLE " + TABLE.NOTE + " ADD COLUMN " + NoteColumns.VERSION
+ " INTEGER NOT NULL DEFAULT 0");
}
+
+ private void upgradeToV5(SQLiteDatabase db) {
+ db.execSQL("ALTER TABLE " + TABLE.NOTE + " ADD COLUMN " + NoteColumns.IS_PINNED + " INTEGER NOT NULL DEFAULT 0");
+ }
}
diff --git a/src/net/micode/notes/data/NotesProvider.java b/src/main/java/net/micode/notes/data/NotesProvider.java
similarity index 100%
rename from src/net/micode/notes/data/NotesProvider.java
rename to src/main/java/net/micode/notes/data/NotesProvider.java
diff --git a/src/net/micode/notes/gtask/data/MetaData.java b/src/main/java/net/micode/notes/gtask/data/MetaData.java
similarity index 100%
rename from src/net/micode/notes/gtask/data/MetaData.java
rename to src/main/java/net/micode/notes/gtask/data/MetaData.java
diff --git a/src/net/micode/notes/gtask/data/Node.java b/src/main/java/net/micode/notes/gtask/data/Node.java
similarity index 100%
rename from src/net/micode/notes/gtask/data/Node.java
rename to src/main/java/net/micode/notes/gtask/data/Node.java
diff --git a/src/net/micode/notes/gtask/data/SqlData.java b/src/main/java/net/micode/notes/gtask/data/SqlData.java
similarity index 100%
rename from src/net/micode/notes/gtask/data/SqlData.java
rename to src/main/java/net/micode/notes/gtask/data/SqlData.java
diff --git a/src/net/micode/notes/gtask/data/SqlNote.java b/src/main/java/net/micode/notes/gtask/data/SqlNote.java
similarity index 100%
rename from src/net/micode/notes/gtask/data/SqlNote.java
rename to src/main/java/net/micode/notes/gtask/data/SqlNote.java
diff --git a/src/net/micode/notes/gtask/data/Task.java b/src/main/java/net/micode/notes/gtask/data/Task.java
similarity index 100%
rename from src/net/micode/notes/gtask/data/Task.java
rename to src/main/java/net/micode/notes/gtask/data/Task.java
diff --git a/src/net/micode/notes/gtask/data/TaskList.java b/src/main/java/net/micode/notes/gtask/data/TaskList.java
similarity index 100%
rename from src/net/micode/notes/gtask/data/TaskList.java
rename to src/main/java/net/micode/notes/gtask/data/TaskList.java
diff --git a/src/net/micode/notes/gtask/exception/ActionFailureException.java b/src/main/java/net/micode/notes/gtask/exception/ActionFailureException.java
similarity index 100%
rename from src/net/micode/notes/gtask/exception/ActionFailureException.java
rename to src/main/java/net/micode/notes/gtask/exception/ActionFailureException.java
diff --git a/src/net/micode/notes/gtask/exception/NetworkFailureException.java b/src/main/java/net/micode/notes/gtask/exception/NetworkFailureException.java
similarity index 100%
rename from src/net/micode/notes/gtask/exception/NetworkFailureException.java
rename to src/main/java/net/micode/notes/gtask/exception/NetworkFailureException.java
diff --git a/src/net/micode/notes/gtask/remote/GTaskASyncTask.java b/src/main/java/net/micode/notes/gtask/remote/GTaskASyncTask.java
similarity index 65%
rename from src/net/micode/notes/gtask/remote/GTaskASyncTask.java
rename to src/main/java/net/micode/notes/gtask/remote/GTaskASyncTask.java
index b3b61e7..c54b540 100644
--- a/src/net/micode/notes/gtask/remote/GTaskASyncTask.java
+++ b/src/main/java/net/micode/notes/gtask/remote/GTaskASyncTask.java
@@ -63,24 +63,43 @@ public class GTaskASyncTask extends AsyncTask {
});
}
- 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);
+// 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);
+// }
+private void showNotification(int tickerId, String content) {
+ PendingIntent pendingIntent;
+ if (tickerId != R.string.ticker_success) {
+ pendingIntent = PendingIntent.getActivity(mContext, 0, new Intent(mContext,
+ NotesPreferenceActivity.class), PendingIntent.FLAG_IMMUTABLE);
+ } else {
+ pendingIntent = PendingIntent.getActivity(mContext, 0, new Intent(mContext,
+ NotesListActivity.class), PendingIntent.FLAG_IMMUTABLE);
}
+ Notification.Builder builder = new Notification.Builder(mContext)
+ .setAutoCancel(true)
+ .setContentTitle(mContext.getString(R.string.app_name))
+ .setContentText(content)
+ .setContentIntent(pendingIntent)
+ .setWhen(System.currentTimeMillis())
+ .setOngoing(true);
+ Notification notification=builder.getNotification();
+ mNotifiManager.notify(GTASK_SYNC_NOTIFICATION_ID, notification);
+}
@Override
protected Integer doInBackground(Void... unused) {
diff --git a/src/net/micode/notes/gtask/remote/GTaskClient.java b/src/main/java/net/micode/notes/gtask/remote/GTaskClient.java
similarity index 100%
rename from src/net/micode/notes/gtask/remote/GTaskClient.java
rename to src/main/java/net/micode/notes/gtask/remote/GTaskClient.java
diff --git a/src/net/micode/notes/gtask/remote/GTaskManager.java b/src/main/java/net/micode/notes/gtask/remote/GTaskManager.java
similarity index 100%
rename from src/net/micode/notes/gtask/remote/GTaskManager.java
rename to src/main/java/net/micode/notes/gtask/remote/GTaskManager.java
diff --git a/src/net/micode/notes/gtask/remote/GTaskSyncService.java b/src/main/java/net/micode/notes/gtask/remote/GTaskSyncService.java
similarity index 100%
rename from src/net/micode/notes/gtask/remote/GTaskSyncService.java
rename to src/main/java/net/micode/notes/gtask/remote/GTaskSyncService.java
diff --git a/src/net/micode/notes/model/Note.java b/src/main/java/net/micode/notes/model/Note.java
similarity index 100%
rename from src/net/micode/notes/model/Note.java
rename to src/main/java/net/micode/notes/model/Note.java
diff --git a/src/net/micode/notes/model/WorkingNote.java b/src/main/java/net/micode/notes/model/WorkingNote.java
similarity index 100%
rename from src/net/micode/notes/model/WorkingNote.java
rename to src/main/java/net/micode/notes/model/WorkingNote.java
diff --git a/src/net/micode/notes/tool/BackupUtils.java b/src/main/java/net/micode/notes/tool/BackupUtils.java
similarity index 100%
rename from src/net/micode/notes/tool/BackupUtils.java
rename to src/main/java/net/micode/notes/tool/BackupUtils.java
diff --git a/src/net/micode/notes/tool/DataUtils.java b/src/main/java/net/micode/notes/tool/DataUtils.java
similarity index 100%
rename from src/net/micode/notes/tool/DataUtils.java
rename to src/main/java/net/micode/notes/tool/DataUtils.java
diff --git a/src/net/micode/notes/tool/GTaskStringUtils.java b/src/main/java/net/micode/notes/tool/GTaskStringUtils.java
similarity index 100%
rename from src/net/micode/notes/tool/GTaskStringUtils.java
rename to src/main/java/net/micode/notes/tool/GTaskStringUtils.java
diff --git a/src/net/micode/notes/tool/ResourceParser.java b/src/main/java/net/micode/notes/tool/ResourceParser.java
similarity index 100%
rename from src/net/micode/notes/tool/ResourceParser.java
rename to src/main/java/net/micode/notes/tool/ResourceParser.java
diff --git a/src/net/micode/notes/ui/AlarmAlertActivity.java b/src/main/java/net/micode/notes/ui/AlarmAlertActivity.java
similarity index 100%
rename from src/net/micode/notes/ui/AlarmAlertActivity.java
rename to src/main/java/net/micode/notes/ui/AlarmAlertActivity.java
diff --git a/src/net/micode/notes/ui/AlarmInitReceiver.java b/src/main/java/net/micode/notes/ui/AlarmInitReceiver.java
similarity index 100%
rename from src/net/micode/notes/ui/AlarmInitReceiver.java
rename to src/main/java/net/micode/notes/ui/AlarmInitReceiver.java
diff --git a/src/net/micode/notes/ui/AlarmReceiver.java b/src/main/java/net/micode/notes/ui/AlarmReceiver.java
similarity index 100%
rename from src/net/micode/notes/ui/AlarmReceiver.java
rename to src/main/java/net/micode/notes/ui/AlarmReceiver.java
diff --git a/src/net/micode/notes/ui/DateTimePicker.java b/src/main/java/net/micode/notes/ui/DateTimePicker.java
similarity index 100%
rename from src/net/micode/notes/ui/DateTimePicker.java
rename to src/main/java/net/micode/notes/ui/DateTimePicker.java
diff --git a/src/net/micode/notes/ui/DateTimePickerDialog.java b/src/main/java/net/micode/notes/ui/DateTimePickerDialog.java
similarity index 100%
rename from src/net/micode/notes/ui/DateTimePickerDialog.java
rename to src/main/java/net/micode/notes/ui/DateTimePickerDialog.java
diff --git a/src/net/micode/notes/ui/DropdownMenu.java b/src/main/java/net/micode/notes/ui/DropdownMenu.java
similarity index 100%
rename from src/net/micode/notes/ui/DropdownMenu.java
rename to src/main/java/net/micode/notes/ui/DropdownMenu.java
diff --git a/src/net/micode/notes/ui/FoldersListAdapter.java b/src/main/java/net/micode/notes/ui/FoldersListAdapter.java
similarity index 100%
rename from src/net/micode/notes/ui/FoldersListAdapter.java
rename to src/main/java/net/micode/notes/ui/FoldersListAdapter.java
diff --git a/src/net/micode/notes/ui/NoteEditActivity.java b/src/main/java/net/micode/notes/ui/NoteEditActivity.java
similarity index 95%
rename from src/net/micode/notes/ui/NoteEditActivity.java
rename to src/main/java/net/micode/notes/ui/NoteEditActivity.java
index 96a9ff8..34b0b96 100644
--- a/src/net/micode/notes/ui/NoteEditActivity.java
+++ b/src/main/java/net/micode/notes/ui/NoteEditActivity.java
@@ -30,9 +30,11 @@ import android.content.SharedPreferences;
import android.graphics.Paint;
import android.os.Bundle;
import android.preference.PreferenceManager;
+import android.text.Editable;
import android.text.Spannable;
import android.text.SpannableString;
import android.text.TextUtils;
+import android.text.TextWatcher;
import android.text.format.DateUtils;
import android.text.style.BackgroundColorSpan;
import android.util.Log;
@@ -149,6 +151,8 @@ public class NoteEditActivity extends Activity implements OnClickListener,
private String mUserQuery;
private Pattern mPattern;
+ private TextView mWordCountView;
+
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
@@ -159,6 +163,28 @@ public class NoteEditActivity extends Activity implements OnClickListener,
return;
}
initResources();
+ mWordCountView = (TextView) findViewById(R.id.tv_word_count);
+
+ // Add text change listener directly to the note editor
+ mNoteEditor.addTextChangedListener(new TextWatcher() {
+ @Override
+ public void beforeTextChanged(CharSequence s, int start, int count, int after) {
+ }
+
+ @Override
+ public void onTextChanged(CharSequence s, int start, int before, int count) {
+ if (mWordCountView != null) {
+ String text = s.toString();
+ int wordCount = text.replaceAll("\\s+", "").length();
+ mWordCountView.setText(wordCount + "字");
+ Log.d(TAG, "Text changed, new count: " + wordCount);
+ }
+ }
+
+ @Override
+ public void afterTextChanged(Editable s) {
+ }
+ });
}
/**
@@ -870,4 +896,20 @@ public class NoteEditActivity extends Activity implements OnClickListener,
private void showToast(int resId, int duration) {
Toast.makeText(this, resId, duration).show();
}
+
+ @Override
+ public void onTextChanged(CharSequence s, int start, int before, int count) {
+ if (mWordCountView != null) {
+ String text = s.toString();
+ // Count all non-whitespace characters
+ int wordCount = text.replaceAll("\\s+", "").length();
+ mWordCountView.setText(wordCount + "字");
+ Log.d(TAG, "Text changed, new count: " + wordCount);
+ }
+ }
+
+ @Override
+ public void onSelectionChanged(int selStart, int selEnd) {
+ // Not used for word count
+ }
}
diff --git a/src/net/micode/notes/ui/NoteEditText.java b/src/main/java/net/micode/notes/ui/NoteEditText.java
similarity index 83%
rename from src/net/micode/notes/ui/NoteEditText.java
rename to src/main/java/net/micode/notes/ui/NoteEditText.java
index 2afe2a8..4f9dc85 100644
--- a/src/net/micode/notes/ui/NoteEditText.java
+++ b/src/main/java/net/micode/notes/ui/NoteEditText.java
@@ -22,6 +22,7 @@ import android.text.Layout;
import android.text.Selection;
import android.text.Spanned;
import android.text.TextUtils;
+import android.text.TextWatcher;
import android.text.style.URLSpan;
import android.util.AttributeSet;
import android.util.Log;
@@ -73,6 +74,10 @@ public class NoteEditText extends EditText {
* Hide or show item option when text change
*/
void onTextChange(int index, boolean hasText);
+
+ void onTextChanged(CharSequence s, int start, int before, int count);
+
+ void onSelectionChanged(int selStart, int selEnd);
}
private OnTextViewChangeListener mOnTextViewChangeListener;
@@ -96,7 +101,26 @@ public class NoteEditText extends EditText {
public NoteEditText(Context context, AttributeSet attrs, int defStyle) {
super(context, attrs, defStyle);
- // TODO Auto-generated constructor stub
+ // Add TextWatcher to track text changes
+ addTextChangedListener(new TextWatcher() {
+ @Override
+ public void beforeTextChanged(CharSequence s, int start, int count, int after) {
+ }
+
+ @Override
+ public void onTextChanged(CharSequence s, int start, int before, int count) {
+ if (mOnTextViewChangeListener != null) {
+ mOnTextViewChangeListener.onTextChanged(s, start, before, count);
+ }
+ }
+
+ @Override
+ public void afterTextChanged(android.text.Editable s) {
+ if (mOnTextViewChangeListener != null) {
+ mOnTextViewChangeListener.onTextChanged(s, 0, 0, s.length());
+ }
+ }
+ });
}
@Override
@@ -214,4 +238,20 @@ public class NoteEditText extends EditText {
}
super.onCreateContextMenu(menu);
}
+
+ @Override
+ public void onTextChanged(CharSequence s, int start, int before, int count) {
+ super.onTextChanged(s, start, before, count);
+ if (mOnTextViewChangeListener != null) {
+ mOnTextViewChangeListener.onTextChanged(s, start, before, count);
+ }
+ }
+
+ @Override
+ public void onSelectionChanged(int selStart, int selEnd) {
+ super.onSelectionChanged(selStart, selEnd);
+ if (mOnTextViewChangeListener != null) {
+ mOnTextViewChangeListener.onSelectionChanged(selStart, selEnd);
+ }
+ }
}
diff --git a/src/net/micode/notes/ui/NoteItemData.java b/src/main/java/net/micode/notes/ui/NoteItemData.java
similarity index 91%
rename from src/net/micode/notes/ui/NoteItemData.java
rename to src/main/java/net/micode/notes/ui/NoteItemData.java
index 0f5a878..6f11e20 100644
--- a/src/net/micode/notes/ui/NoteItemData.java
+++ b/src/main/java/net/micode/notes/ui/NoteItemData.java
@@ -40,6 +40,7 @@ public class NoteItemData {
NoteColumns.TYPE,
NoteColumns.WIDGET_ID,
NoteColumns.WIDGET_TYPE,
+ NoteColumns.IS_PINNED,
};
private static final int ID_COLUMN = 0;
@@ -54,7 +55,9 @@ public class NoteItemData {
private static final int TYPE_COLUMN = 9;
private static final int WIDGET_ID_COLUMN = 10;
private static final int WIDGET_TYPE_COLUMN = 11;
+ private static final int IS_PINNED_COLUMN = 12;
+ private Context mContext;
private long mId;
private long mAlertDate;
private int mBgColorId;
@@ -69,6 +72,7 @@ public class NoteItemData {
private int mWidgetType;
private String mName;
private String mPhoneNumber;
+ private boolean mIsPinned;
private boolean mIsLastItem;
private boolean mIsFirstItem;
@@ -77,6 +81,11 @@ public class NoteItemData {
private boolean mIsMultiNotesFollowingFolder;
public NoteItemData(Context context, Cursor cursor) {
+ mContext = context;
+ loadFromCursor(cursor);
+ }
+
+ private void loadFromCursor(Cursor cursor) {
mId = cursor.getLong(ID_COLUMN);
mAlertDate = cursor.getLong(ALERTED_DATE_COLUMN);
mBgColorId = cursor.getInt(BG_COLOR_ID_COLUMN);
@@ -91,12 +100,13 @@ public class NoteItemData {
mType = cursor.getInt(TYPE_COLUMN);
mWidgetId = cursor.getInt(WIDGET_ID_COLUMN);
mWidgetType = cursor.getInt(WIDGET_TYPE_COLUMN);
+ mIsPinned = cursor.getInt(IS_PINNED_COLUMN) == 1;
mPhoneNumber = "";
if (mParentId == Notes.ID_CALL_RECORD_FOLDER) {
- mPhoneNumber = DataUtils.getCallNumberByNoteId(context.getContentResolver(), mId);
+ mPhoneNumber = DataUtils.getCallNumberByNoteId(mContext.getContentResolver(), mId);
if (!TextUtils.isEmpty(mPhoneNumber)) {
- mName = Contact.getContact(context, mPhoneNumber);
+ mName = Contact.getContact(mContext, mPhoneNumber);
if (mName == null) {
mName = mPhoneNumber;
}
@@ -221,4 +231,12 @@ public class NoteItemData {
public static int getNoteType(Cursor cursor) {
return cursor.getInt(TYPE_COLUMN);
}
+
+ public boolean isPinned() {
+ return mIsPinned;
+ }
+
+ public void setPinned(boolean pinned) {
+ mIsPinned = pinned;
+ }
}
diff --git a/src/net/micode/notes/ui/NotesListActivity.java b/src/main/java/net/micode/notes/ui/NotesListActivity.java
similarity index 78%
rename from src/net/micode/notes/ui/NotesListActivity.java
rename to src/main/java/net/micode/notes/ui/NotesListActivity.java
index e843aec..d81ac65 100644
--- a/src/net/micode/notes/ui/NotesListActivity.java
+++ b/src/main/java/net/micode/notes/ui/NotesListActivity.java
@@ -28,6 +28,7 @@ import android.content.DialogInterface;
import android.content.Intent;
import android.content.SharedPreferences;
import android.database.Cursor;
+import android.net.Uri;
import android.os.AsyncTask;
import android.os.Bundle;
import android.preference.PreferenceManager;
@@ -59,6 +60,9 @@ import android.widget.ListView;
import android.widget.PopupMenu;
import android.widget.TextView;
import android.widget.Toast;
+import android.content.ContentUris;
+import android.widget.CursorAdapter;
+import android.view.ViewGroup;
import net.micode.notes.R;
import net.micode.notes.data.Notes;
@@ -239,14 +243,7 @@ public class NotesListActivity extends Activity implements OnClickListener, OnIt
public boolean onCreateActionMode(ActionMode mode, Menu menu) {
getMenuInflater().inflate(R.menu.note_list_options, menu);
menu.findItem(R.id.delete).setOnMenuItemClickListener(this);
- mMoveMenu = menu.findItem(R.id.move);
- if (mFocusNoteDataItem.getParentId() == Notes.ID_CALL_RECORD_FOLDER
- || DataUtils.getUserFolderCount(mContentResolver) == 0) {
- mMoveMenu.setVisible(false);
- } else {
- mMoveMenu.setVisible(true);
- mMoveMenu.setOnMenuItemClickListener(this);
- }
+ menu.findItem(R.id.move).setOnMenuItemClickListener(this);
mActionMode = mode;
mNotesListAdapter.setChoiceMode(true);
mNotesListView.setLongClickable(false);
@@ -264,7 +261,6 @@ public class NotesListActivity extends Activity implements OnClickListener, OnIt
updateMenu();
return true;
}
-
});
return true;
}
@@ -287,12 +283,10 @@ public class NotesListActivity extends Activity implements OnClickListener, OnIt
}
public boolean onPrepareActionMode(ActionMode mode, Menu menu) {
- // TODO Auto-generated method stub
return false;
}
public boolean onActionItemClicked(ActionMode mode, MenuItem item) {
- // TODO Auto-generated method stub
return false;
}
@@ -411,10 +405,12 @@ public class NotesListActivity extends Activity implements OnClickListener, OnIt
private void startAsyncNotesListQuery() {
String selection = (mCurrentFolderId == Notes.ID_ROOT_FOLDER) ? ROOT_FOLDER_SELECTION
: NORMAL_SELECTION;
+ String sortOrder = Notes.NoteColumns.IS_PINNED + " DESC, " +
+ Notes.NoteColumns.MODIFIED_DATE + " DESC";
mBackgroundQueryHandler.startQuery(FOLDER_NOTE_LIST_QUERY_TOKEN, null,
Notes.CONTENT_NOTE_URI, NoteItemData.PROJECTION, selection, new String[] {
String.valueOf(mCurrentFolderId)
- }, NoteColumns.TYPE + " DESC," + NoteColumns.MODIFIED_DATE + " DESC");
+ }, sortOrder);
}
private final class BackgroundQueryHandler extends AsyncQueryHandler {
@@ -446,17 +442,31 @@ public class NotesListActivity extends Activity implements OnClickListener, OnIt
builder.setTitle(R.string.menu_title_select_folder);
final FoldersListAdapter adapter = new FoldersListAdapter(this, cursor);
builder.setAdapter(adapter, new DialogInterface.OnClickListener() {
-
public void onClick(DialogInterface dialog, int which) {
- DataUtils.batchMoveToFolder(mContentResolver,
- mNotesListAdapter.getSelectedItemIds(), adapter.getItemId(which));
- Toast.makeText(
- NotesListActivity.this,
- getString(R.string.format_move_notes_to_folder,
- mNotesListAdapter.getSelectedCount(),
- adapter.getFolderName(NotesListActivity.this, which)),
- Toast.LENGTH_SHORT).show();
- mModeCallBack.finishActionMode();
+ long folderId = adapter.getItemId(which);
+ if (mFocusNoteDataItem != null) {
+ // 单个便签移动
+ HashSet ids = new HashSet();
+ ids.add(mFocusNoteDataItem.getId());
+ DataUtils.batchMoveToFolder(mContentResolver, ids, folderId);
+ Toast.makeText(
+ NotesListActivity.this,
+ getString(R.string.format_move_notes_to_folder,
+ 1,
+ adapter.getFolderName(NotesListActivity.this, which)),
+ Toast.LENGTH_SHORT).show();
+ } else {
+ // 批量移动
+ DataUtils.batchMoveToFolder(mContentResolver,
+ mNotesListAdapter.getSelectedItemIds(), folderId);
+ Toast.makeText(
+ NotesListActivity.this,
+ getString(R.string.format_move_notes_to_folder,
+ mNotesListAdapter.getSelectedCount(),
+ adapter.getFolderName(NotesListActivity.this, which)),
+ Toast.LENGTH_SHORT).show();
+ mModeCallBack.finishActionMode();
+ }
}
});
builder.show();
@@ -877,10 +887,10 @@ public class NotesListActivity extends Activity implements OnClickListener, OnIt
}
private class OnListItemClickListener implements OnItemClickListener {
-
public void onItemClick(AdapterView> parent, View view, int position, long id) {
if (view instanceof NotesListItem) {
NoteItemData item = ((NotesListItem) view).getItemData();
+
if (mNotesListAdapter.isInChoiceMode()) {
if (item.getType() == Notes.TYPE_NOTE) {
position = position - mNotesListView.getHeaderViewsCount();
@@ -914,7 +924,6 @@ public class NotesListActivity extends Activity implements OnClickListener, OnIt
}
}
}
-
}
private void startQueryDestinationFolders() {
@@ -938,17 +947,203 @@ public class NotesListActivity extends Activity implements OnClickListener, OnIt
public boolean onItemLongClick(AdapterView> parent, View view, int position, long id) {
if (view instanceof NotesListItem) {
mFocusNoteDataItem = ((NotesListItem) view).getItemData();
- if (mFocusNoteDataItem.getType() == Notes.TYPE_NOTE && !mNotesListAdapter.isInChoiceMode()) {
- if (mNotesListView.startActionMode(mModeCallBack) != null) {
- mModeCallBack.onItemCheckedStateChanged(null, position, id, true);
+ if (mFocusNoteDataItem.getType() == Notes.TYPE_NOTE) {
+ if (!mNotesListAdapter.isInChoiceMode()) {
+ // 显示便签的上下文菜单
+ showNoteContextMenu(mFocusNoteDataItem);
mNotesListView.performHapticFeedback(HapticFeedbackConstants.LONG_PRESS);
} else {
- Log.e(TAG, "startActionMode fails");
+ if (mNotesListView.startActionMode(mModeCallBack) != null) {
+ mModeCallBack.onItemCheckedStateChanged(null, position, id, true);
+ mNotesListView.performHapticFeedback(HapticFeedbackConstants.LONG_PRESS);
+ } else {
+ Log.e(TAG, "startActionMode fails");
+ }
}
} else if (mFocusNoteDataItem.getType() == Notes.TYPE_FOLDER) {
mNotesListView.setOnCreateContextMenuListener(mFolderOnCreateContextMenuListener);
}
}
- return false;
+ return true; // 返回 true 表示消费了长按事件,这样就不会触发单击事件
+ }
+
+ private void showNoteContextMenu(NoteItemData noteData) {
+ // 使用 ListView 作为锚点视图
+ PopupMenu popup = new PopupMenu(this, mNotesListView);
+ popup.getMenuInflater().inflate(R.menu.note_list_context_menu, popup.getMenu());
+
+ // 根据便签的置顶状态设置菜单项文本
+ MenuItem pinItem = popup.getMenu().findItem(R.id.menu_pin);
+ if (pinItem != null) {
+ pinItem.setTitle(noteData.isPinned() ? R.string.menu_unpin : R.string.menu_pin);
+ }
+
+ popup.setOnMenuItemClickListener(item -> {
+ int itemId = item.getItemId();
+ if (itemId == R.id.menu_pin) {
+ togglePinNote(noteData);
+ return true;
+ } else if (itemId == R.id.menu_share) {
+ shareNote(noteData);
+ return true;
+ } else if (itemId == R.id.menu_delete) {
+ deleteNote(noteData);
+ return true;
+ } else if (itemId == R.id.menu_move_to_folder) {
+ moveNoteToFolder(noteData);
+ return true;
+ }
+ return false;
+ });
+
+ popup.show();
+ }
+
+ private void togglePinNote(NoteItemData noteData) {
+ ContentValues values = new ContentValues();
+ values.put(Notes.NoteColumns.IS_PINNED, !noteData.isPinned() ? 1 : 0);
+ values.put(Notes.NoteColumns.LOCAL_MODIFIED, 1);
+ values.put(Notes.NoteColumns.MODIFIED_DATE, System.currentTimeMillis());
+
+ getContentResolver().update(
+ ContentUris.withAppendedId(Notes.CONTENT_NOTE_URI, noteData.getId()),
+ values,
+ null,
+ null
+ );
+
+ // 刷新列表视图
+ startAsyncNotesListQuery();
+ }
+
+ private void shareNote(NoteItemData noteData) {
+ Intent intent = new Intent(Intent.ACTION_SEND);
+ intent.setType("text/plain");
+ intent.putExtra(Intent.EXTRA_TEXT, noteData.getSnippet());
+ startActivity(Intent.createChooser(intent, getString(R.string.menu_share)));
+ }
+
+ private void deleteNote(NoteItemData noteData) {
+ AlertDialog.Builder builder = new AlertDialog.Builder(this);
+ builder.setTitle(getString(R.string.alert_title_delete));
+ builder.setIcon(android.R.drawable.ic_dialog_alert);
+ builder.setMessage(getString(R.string.alert_message_delete_note));
+ builder.setPositiveButton(android.R.string.ok,
+ new DialogInterface.OnClickListener() {
+ public void onClick(DialogInterface dialog, int which) {
+ HashSet ids = new HashSet();
+ ids.add(noteData.getId());
+ if (!isSyncMode()) {
+ // if not synced, delete note directly
+ DataUtils.batchDeleteNotes(mContentResolver, ids);
+ } else {
+ // in sync mode, we'll move the deleted note into the trash folder
+ DataUtils.batchMoveToFolder(mContentResolver, ids, Notes.ID_TRASH_FOLER);
+ }
+ }
+ });
+ builder.setNegativeButton(android.R.string.cancel, null);
+ builder.show();
+ }
+
+ private void moveNoteToFolder(NoteItemData noteData) {
+ // 查询所有可用的文件夹
+ String selection = NoteColumns.TYPE + "=? AND " + NoteColumns.PARENT_ID + "<>? AND " + NoteColumns.ID + "<>?";
+ selection = (mState == ListEditState.NOTE_LIST) ? selection:
+ "(" + selection + ") OR (" + NoteColumns.ID + "=" + Notes.ID_ROOT_FOLDER + ")";
+
+ mBackgroundQueryHandler.startQuery(FOLDER_LIST_QUERY_TOKEN,
+ null,
+ Notes.CONTENT_NOTE_URI,
+ FoldersListAdapter.PROJECTION,
+ selection,
+ new String[] {
+ String.valueOf(Notes.TYPE_FOLDER),
+ String.valueOf(Notes.ID_TRASH_FOLER),
+ String.valueOf(mCurrentFolderId)
+ },
+ NoteColumns.MODIFIED_DATE + " DESC");
+ }
+
+ private class NoteListAdapter extends CursorAdapter {
+ private static final String TAG = "NoteListAdapter";
+ private final String[] PROJECTION = {
+ NoteColumns.ID,
+ NoteColumns.TYPE,
+ NoteColumns.SNIPPET,
+ NoteColumns.WIDGET_ID,
+ NoteColumns.WIDGET_TYPE,
+ NoteColumns.BG_COLOR_ID,
+ NoteColumns.MODIFIED_DATE,
+ NoteColumns.ALERTED_DATE,
+ NoteColumns.PARENT_ID,
+ NoteColumns.HAS_ATTACHMENT,
+ };
+
+ private int mIdColumnIndex;
+ private int mTypeColumnIndex;
+ private int mSnippetColumnIndex;
+ private int mWidgetIdColumnIndex;
+ private int mWidgetTypeColumnIndex;
+ private int mBgColorColumnIndex;
+ private int mModifiedDateColumnIndex;
+ private int mAlertedDateColumnIndex;
+ private int mParentIdColumnIndex;
+ private int mHasAttachmentColumnIndex;
+ private LayoutInflater mInflater;
+
+ public NoteListAdapter(Context context) {
+ super(context, null);
+ mInflater = LayoutInflater.from(context);
+ }
+
+ @Override
+ public View newView(Context context, Cursor cursor, ViewGroup parent) {
+ View view = mInflater.inflate(R.layout.notes_list_item, parent, false);
+ return view;
+ }
+
+ @Override
+ public void bindView(View view, Context context, Cursor cursor) {
+ if (view == null) {
+ return;
+ }
+
+ TextView tvTitle = (TextView) view.findViewById(R.id.tv_title);
+ TextView tvWordCount = (TextView) view.findViewById(R.id.tv_word_count);
+
+ String snippet = cursor.getString(mSnippetColumnIndex);
+ tvTitle.setText(snippet);
+
+ // Calculate word count
+ int wordCount = snippet.replaceAll("\\s+", "").length();
+ tvWordCount.setText(wordCount + "字");
+ tvWordCount.setVisibility(View.VISIBLE); // 确保字数显示可见
+
+ // Set background color
+ int bgColorId = cursor.getInt(mBgColorColumnIndex);
+ if (bgColorId == ResourceParser.BG_DEFAULT_COLOR) {
+ view.setBackgroundColor(0xFFFFFF); // 白色背景
+ } else {
+ view.setBackgroundColor(bgColorId);
+ }
+ }
+
+ @Override
+ public void changeCursor(Cursor cursor) {
+ if (cursor != null) {
+ mIdColumnIndex = cursor.getColumnIndex(NoteColumns.ID);
+ mTypeColumnIndex = cursor.getColumnIndex(NoteColumns.TYPE);
+ mSnippetColumnIndex = cursor.getColumnIndex(NoteColumns.SNIPPET);
+ mWidgetIdColumnIndex = cursor.getColumnIndex(NoteColumns.WIDGET_ID);
+ mWidgetTypeColumnIndex = cursor.getColumnIndex(NoteColumns.WIDGET_TYPE);
+ mBgColorColumnIndex = cursor.getColumnIndex(NoteColumns.BG_COLOR_ID);
+ mModifiedDateColumnIndex = cursor.getColumnIndex(NoteColumns.MODIFIED_DATE);
+ mAlertedDateColumnIndex = cursor.getColumnIndex(NoteColumns.ALERTED_DATE);
+ mParentIdColumnIndex = cursor.getColumnIndex(NoteColumns.PARENT_ID);
+ mHasAttachmentColumnIndex = cursor.getColumnIndex(NoteColumns.HAS_ATTACHMENT);
+ }
+ super.changeCursor(cursor);
+ }
}
}
diff --git a/src/net/micode/notes/ui/NotesListAdapter.java b/src/main/java/net/micode/notes/ui/NotesListAdapter.java
similarity index 88%
rename from src/net/micode/notes/ui/NotesListAdapter.java
rename to src/main/java/net/micode/notes/ui/NotesListAdapter.java
index 51c9cb9..512bdff 100644
--- a/src/net/micode/notes/ui/NotesListAdapter.java
+++ b/src/main/java/net/micode/notes/ui/NotesListAdapter.java
@@ -64,6 +64,24 @@ public class NotesListAdapter extends CursorAdapter {
}
}
+ @Override
+ public Cursor getCursor() {
+ Cursor cursor = super.getCursor();
+ if (cursor != null) {
+ // 对便签进行排序:置顶的在前,然后按修改时间倒序
+ String sortOrder = Notes.NoteColumns.IS_PINNED + " DESC, " +
+ Notes.NoteColumns.MODIFIED_DATE + " DESC";
+ cursor = mContext.getContentResolver().query(
+ cursor.getNotificationUri(),
+ NoteItemData.PROJECTION, // 使用 NoteItemData 中定义的投影
+ null, // 不使用选择条件
+ null, // 不使用选择参数
+ sortOrder
+ );
+ }
+ return cursor;
+ }
+
public void setCheckedItem(final int position, final boolean checked) {
mSelectedIndex.put(position, checked);
notifyDataSetChanged();
diff --git a/src/net/micode/notes/ui/NotesListItem.java b/src/main/java/net/micode/notes/ui/NotesListItem.java
similarity index 83%
rename from src/net/micode/notes/ui/NotesListItem.java
rename to src/main/java/net/micode/notes/ui/NotesListItem.java
index 1221e80..e4c6234 100644
--- a/src/net/micode/notes/ui/NotesListItem.java
+++ b/src/main/java/net/micode/notes/ui/NotesListItem.java
@@ -32,9 +32,11 @@ import net.micode.notes.tool.ResourceParser.NoteItemBgResources;
public class NotesListItem extends LinearLayout {
private ImageView mAlert;
+ private ImageView mPinned;
private TextView mTitle;
private TextView mTime;
private TextView mCallName;
+ private TextView mWordCount;
private NoteItemData mItemData;
private CheckBox mCheckBox;
@@ -42,9 +44,11 @@ public class NotesListItem extends LinearLayout {
super(context);
inflate(context, R.layout.note_item, this);
mAlert = (ImageView) findViewById(R.id.iv_alert_icon);
+ mPinned = (ImageView) findViewById(R.id.iv_pinned_icon);
mTitle = (TextView) findViewById(R.id.tv_title);
mTime = (TextView) findViewById(R.id.tv_time);
mCallName = (TextView) findViewById(R.id.tv_name);
+ mWordCount = (TextView) findViewById(R.id.tv_word_count);
mCheckBox = (CheckBox) findViewById(android.R.id.checkbox);
}
@@ -60,6 +64,8 @@ public class NotesListItem extends LinearLayout {
if (data.getId() == Notes.ID_CALL_RECORD_FOLDER) {
mCallName.setVisibility(View.GONE);
mAlert.setVisibility(View.VISIBLE);
+ mPinned.setVisibility(View.GONE);
+ mWordCount.setVisibility(View.GONE);
mTitle.setTextAppearance(context, R.style.TextAppearancePrimaryItem);
mTitle.setText(context.getString(R.string.call_record_folder_name)
+ context.getString(R.string.format_folder_files_count, data.getNotesCount()));
@@ -75,6 +81,8 @@ public class NotesListItem extends LinearLayout {
} else {
mAlert.setVisibility(View.GONE);
}
+ mPinned.setVisibility(View.GONE);
+ mWordCount.setVisibility(View.GONE);
} else {
mCallName.setVisibility(View.GONE);
mTitle.setTextAppearance(context, R.style.TextAppearancePrimaryItem);
@@ -84,6 +92,8 @@ public class NotesListItem extends LinearLayout {
+ context.getString(R.string.format_folder_files_count,
data.getNotesCount()));
mAlert.setVisibility(View.GONE);
+ mPinned.setVisibility(View.GONE);
+ mWordCount.setVisibility(View.GONE);
} else {
mTitle.setText(DataUtils.getFormattedSnippet(data.getSnippet()));
if (data.hasAlert()) {
@@ -92,6 +102,15 @@ public class NotesListItem extends LinearLayout {
} else {
mAlert.setVisibility(View.GONE);
}
+ if (data.isPinned()) {
+ mPinned.setImageResource(R.drawable.ic_pinned);
+ mPinned.setVisibility(View.VISIBLE);
+ } else {
+ mPinned.setVisibility(View.GONE);
+ }
+ mWordCount.setVisibility(View.VISIBLE);
+ int wordCount = data.getSnippet().replaceAll("\\s+", "").length();
+ mWordCount.setText(wordCount + "字");
}
}
mTime.setText(DateUtils.getRelativeTimeSpanString(data.getModifiedDate()));
diff --git a/src/net/micode/notes/ui/NotesPreferenceActivity.java b/src/main/java/net/micode/notes/ui/NotesPreferenceActivity.java
similarity index 100%
rename from src/net/micode/notes/ui/NotesPreferenceActivity.java
rename to src/main/java/net/micode/notes/ui/NotesPreferenceActivity.java
diff --git a/src/net/micode/notes/widget/NoteWidgetProvider.java b/src/main/java/net/micode/notes/widget/NoteWidgetProvider.java
similarity index 100%
rename from src/net/micode/notes/widget/NoteWidgetProvider.java
rename to src/main/java/net/micode/notes/widget/NoteWidgetProvider.java
diff --git a/src/net/micode/notes/widget/NoteWidgetProvider_2x.java b/src/main/java/net/micode/notes/widget/NoteWidgetProvider_2x.java
similarity index 100%
rename from src/net/micode/notes/widget/NoteWidgetProvider_2x.java
rename to src/main/java/net/micode/notes/widget/NoteWidgetProvider_2x.java
diff --git a/src/net/micode/notes/widget/NoteWidgetProvider_4x.java b/src/main/java/net/micode/notes/widget/NoteWidgetProvider_4x.java
similarity index 100%
rename from src/net/micode/notes/widget/NoteWidgetProvider_4x.java
rename to src/main/java/net/micode/notes/widget/NoteWidgetProvider_4x.java
diff --git a/src/main/res/color/primary_text_dark.xml b/src/main/res/color/primary_text_dark.xml
new file mode 100644
index 0000000..7c85459
--- /dev/null
+++ b/src/main/res/color/primary_text_dark.xml
@@ -0,0 +1,22 @@
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/src/main/res/color/secondary_text_dark.xml b/src/main/res/color/secondary_text_dark.xml
new file mode 100644
index 0000000..c1c2384
--- /dev/null
+++ b/src/main/res/color/secondary_text_dark.xml
@@ -0,0 +1,20 @@
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/src/main/res/drawable-hdpi/bg_btn_set_color.png b/src/main/res/drawable-hdpi/bg_btn_set_color.png
new file mode 100644
index 0000000..5eb5d44
Binary files /dev/null and b/src/main/res/drawable-hdpi/bg_btn_set_color.png differ
diff --git a/src/main/res/drawable-hdpi/bg_color_btn_mask.png b/src/main/res/drawable-hdpi/bg_color_btn_mask.png
new file mode 100644
index 0000000..100db77
Binary files /dev/null and b/src/main/res/drawable-hdpi/bg_color_btn_mask.png differ
diff --git a/src/main/res/drawable-hdpi/call_record.png b/src/main/res/drawable-hdpi/call_record.png
new file mode 100644
index 0000000..fb88ca4
Binary files /dev/null and b/src/main/res/drawable-hdpi/call_record.png differ
diff --git a/src/main/res/drawable-hdpi/clock.png b/src/main/res/drawable-hdpi/clock.png
new file mode 100644
index 0000000..5f2ae9a
Binary files /dev/null and b/src/main/res/drawable-hdpi/clock.png differ
diff --git a/src/main/res/drawable-hdpi/delete.png b/src/main/res/drawable-hdpi/delete.png
new file mode 100644
index 0000000..643de3e
Binary files /dev/null and b/src/main/res/drawable-hdpi/delete.png differ
diff --git a/src/main/res/drawable-hdpi/dropdown_icon.9.png b/src/main/res/drawable-hdpi/dropdown_icon.9.png
new file mode 100644
index 0000000..5525025
Binary files /dev/null and b/src/main/res/drawable-hdpi/dropdown_icon.9.png differ
diff --git a/src/main/res/drawable-hdpi/edit_blue.9.png b/src/main/res/drawable-hdpi/edit_blue.9.png
new file mode 100644
index 0000000..55a1856
Binary files /dev/null and b/src/main/res/drawable-hdpi/edit_blue.9.png differ
diff --git a/src/main/res/drawable-hdpi/edit_green.9.png b/src/main/res/drawable-hdpi/edit_green.9.png
new file mode 100644
index 0000000..2cb2d60
Binary files /dev/null and b/src/main/res/drawable-hdpi/edit_green.9.png differ
diff --git a/src/main/res/drawable-hdpi/edit_red.9.png b/src/main/res/drawable-hdpi/edit_red.9.png
new file mode 100644
index 0000000..bae944a
Binary files /dev/null and b/src/main/res/drawable-hdpi/edit_red.9.png differ
diff --git a/src/main/res/drawable-hdpi/edit_title_blue.9.png b/src/main/res/drawable-hdpi/edit_title_blue.9.png
new file mode 100644
index 0000000..96e6092
Binary files /dev/null and b/src/main/res/drawable-hdpi/edit_title_blue.9.png differ
diff --git a/src/main/res/drawable-hdpi/edit_title_green.9.png b/src/main/res/drawable-hdpi/edit_title_green.9.png
new file mode 100644
index 0000000..08d8644
Binary files /dev/null and b/src/main/res/drawable-hdpi/edit_title_green.9.png differ
diff --git a/src/main/res/drawable-hdpi/edit_title_red.9.png b/src/main/res/drawable-hdpi/edit_title_red.9.png
new file mode 100644
index 0000000..9c430e5
Binary files /dev/null and b/src/main/res/drawable-hdpi/edit_title_red.9.png differ
diff --git a/src/main/res/drawable-hdpi/edit_title_white.9.png b/src/main/res/drawable-hdpi/edit_title_white.9.png
new file mode 100644
index 0000000..19e8d95
Binary files /dev/null and b/src/main/res/drawable-hdpi/edit_title_white.9.png differ
diff --git a/src/main/res/drawable-hdpi/edit_title_yellow.9.png b/src/main/res/drawable-hdpi/edit_title_yellow.9.png
new file mode 100644
index 0000000..bf8f580
Binary files /dev/null and b/src/main/res/drawable-hdpi/edit_title_yellow.9.png differ
diff --git a/src/main/res/drawable-hdpi/edit_white.9.png b/src/main/res/drawable-hdpi/edit_white.9.png
new file mode 100644
index 0000000..918f7a6
Binary files /dev/null and b/src/main/res/drawable-hdpi/edit_white.9.png differ
diff --git a/src/main/res/drawable-hdpi/edit_yellow.9.png b/src/main/res/drawable-hdpi/edit_yellow.9.png
new file mode 100644
index 0000000..10cb642
Binary files /dev/null and b/src/main/res/drawable-hdpi/edit_yellow.9.png differ
diff --git a/src/main/res/drawable-hdpi/font_large.png b/src/main/res/drawable-hdpi/font_large.png
new file mode 100644
index 0000000..78cf2e6
Binary files /dev/null and b/src/main/res/drawable-hdpi/font_large.png differ
diff --git a/src/main/res/drawable-hdpi/font_normal.png b/src/main/res/drawable-hdpi/font_normal.png
new file mode 100644
index 0000000..9de7ced
Binary files /dev/null and b/src/main/res/drawable-hdpi/font_normal.png differ
diff --git a/src/main/res/drawable-hdpi/font_size_selector_bg.9.png b/src/main/res/drawable-hdpi/font_size_selector_bg.9.png
new file mode 100644
index 0000000..be8e64c
Binary files /dev/null and b/src/main/res/drawable-hdpi/font_size_selector_bg.9.png differ
diff --git a/src/main/res/drawable-hdpi/font_small.png b/src/main/res/drawable-hdpi/font_small.png
new file mode 100644
index 0000000..d3ff104
Binary files /dev/null and b/src/main/res/drawable-hdpi/font_small.png differ
diff --git a/src/main/res/drawable-hdpi/font_super.png b/src/main/res/drawable-hdpi/font_super.png
new file mode 100644
index 0000000..85b13a1
Binary files /dev/null and b/src/main/res/drawable-hdpi/font_super.png differ
diff --git a/src/main/res/drawable-hdpi/icon_app.png b/src/main/res/drawable-hdpi/icon_app.png
new file mode 100644
index 0000000..418aadc
Binary files /dev/null and b/src/main/res/drawable-hdpi/icon_app.png differ
diff --git a/src/main/res/drawable-hdpi/list_background.png b/src/main/res/drawable-hdpi/list_background.png
new file mode 100644
index 0000000..087e1f9
Binary files /dev/null and b/src/main/res/drawable-hdpi/list_background.png differ
diff --git a/src/main/res/drawable-hdpi/list_blue_down.9.png b/src/main/res/drawable-hdpi/list_blue_down.9.png
new file mode 100644
index 0000000..b88eebf
Binary files /dev/null and b/src/main/res/drawable-hdpi/list_blue_down.9.png differ
diff --git a/src/main/res/drawable-hdpi/list_blue_middle.9.png b/src/main/res/drawable-hdpi/list_blue_middle.9.png
new file mode 100644
index 0000000..96b1c8b
Binary files /dev/null and b/src/main/res/drawable-hdpi/list_blue_middle.9.png differ
diff --git a/src/main/res/drawable-hdpi/list_blue_single.9.png b/src/main/res/drawable-hdpi/list_blue_single.9.png
new file mode 100644
index 0000000..d7e7206
Binary files /dev/null and b/src/main/res/drawable-hdpi/list_blue_single.9.png differ
diff --git a/src/main/res/drawable-hdpi/list_blue_up.9.png b/src/main/res/drawable-hdpi/list_blue_up.9.png
new file mode 100644
index 0000000..632e88c
Binary files /dev/null and b/src/main/res/drawable-hdpi/list_blue_up.9.png differ
diff --git a/src/main/res/drawable-hdpi/list_folder.9.png b/src/main/res/drawable-hdpi/list_folder.9.png
new file mode 100644
index 0000000..829f61b
Binary files /dev/null and b/src/main/res/drawable-hdpi/list_folder.9.png differ
diff --git a/src/main/res/drawable-hdpi/list_footer_bg.9.png b/src/main/res/drawable-hdpi/list_footer_bg.9.png
new file mode 100644
index 0000000..5325c25
Binary files /dev/null and b/src/main/res/drawable-hdpi/list_footer_bg.9.png differ
diff --git a/src/main/res/drawable-hdpi/list_green_down.9.png b/src/main/res/drawable-hdpi/list_green_down.9.png
new file mode 100644
index 0000000..64a39d9
Binary files /dev/null and b/src/main/res/drawable-hdpi/list_green_down.9.png differ
diff --git a/src/main/res/drawable-hdpi/list_green_middle.9.png b/src/main/res/drawable-hdpi/list_green_middle.9.png
new file mode 100644
index 0000000..897325a
Binary files /dev/null and b/src/main/res/drawable-hdpi/list_green_middle.9.png differ
diff --git a/src/main/res/drawable-hdpi/list_green_single.9.png b/src/main/res/drawable-hdpi/list_green_single.9.png
new file mode 100644
index 0000000..c83405f
Binary files /dev/null and b/src/main/res/drawable-hdpi/list_green_single.9.png differ
diff --git a/src/main/res/drawable-hdpi/list_green_up.9.png b/src/main/res/drawable-hdpi/list_green_up.9.png
new file mode 100644
index 0000000..141f9e1
Binary files /dev/null and b/src/main/res/drawable-hdpi/list_green_up.9.png differ
diff --git a/src/main/res/drawable-hdpi/list_red_down.9.png b/src/main/res/drawable-hdpi/list_red_down.9.png
new file mode 100644
index 0000000..4224309
Binary files /dev/null and b/src/main/res/drawable-hdpi/list_red_down.9.png differ
diff --git a/src/main/res/drawable-hdpi/list_red_middle.9.png b/src/main/res/drawable-hdpi/list_red_middle.9.png
new file mode 100644
index 0000000..9988f17
Binary files /dev/null and b/src/main/res/drawable-hdpi/list_red_middle.9.png differ
diff --git a/src/main/res/drawable-hdpi/list_red_single.9.png b/src/main/res/drawable-hdpi/list_red_single.9.png
new file mode 100644
index 0000000..587c348
Binary files /dev/null and b/src/main/res/drawable-hdpi/list_red_single.9.png differ
diff --git a/src/main/res/drawable-hdpi/list_red_up.9.png b/src/main/res/drawable-hdpi/list_red_up.9.png
new file mode 100644
index 0000000..46b4757
Binary files /dev/null and b/src/main/res/drawable-hdpi/list_red_up.9.png differ
diff --git a/src/main/res/drawable-hdpi/list_white_down.9.png b/src/main/res/drawable-hdpi/list_white_down.9.png
new file mode 100644
index 0000000..29f9d8c
Binary files /dev/null and b/src/main/res/drawable-hdpi/list_white_down.9.png differ
diff --git a/src/main/res/drawable-hdpi/list_white_middle.9.png b/src/main/res/drawable-hdpi/list_white_middle.9.png
new file mode 100644
index 0000000..77a4ab4
Binary files /dev/null and b/src/main/res/drawable-hdpi/list_white_middle.9.png differ
diff --git a/src/main/res/drawable-hdpi/list_white_single.9.png b/src/main/res/drawable-hdpi/list_white_single.9.png
new file mode 100644
index 0000000..3e79189
Binary files /dev/null and b/src/main/res/drawable-hdpi/list_white_single.9.png differ
diff --git a/src/main/res/drawable-hdpi/list_white_up.9.png b/src/main/res/drawable-hdpi/list_white_up.9.png
new file mode 100644
index 0000000..e23cd5c
Binary files /dev/null and b/src/main/res/drawable-hdpi/list_white_up.9.png differ
diff --git a/src/main/res/drawable-hdpi/list_yellow_down.9.png b/src/main/res/drawable-hdpi/list_yellow_down.9.png
new file mode 100644
index 0000000..31cfc1e
Binary files /dev/null and b/src/main/res/drawable-hdpi/list_yellow_down.9.png differ
diff --git a/src/main/res/drawable-hdpi/list_yellow_middle.9.png b/src/main/res/drawable-hdpi/list_yellow_middle.9.png
new file mode 100644
index 0000000..b6549b2
Binary files /dev/null and b/src/main/res/drawable-hdpi/list_yellow_middle.9.png differ
diff --git a/src/main/res/drawable-hdpi/list_yellow_single.9.png b/src/main/res/drawable-hdpi/list_yellow_single.9.png
new file mode 100644
index 0000000..3faf507
Binary files /dev/null and b/src/main/res/drawable-hdpi/list_yellow_single.9.png differ
diff --git a/src/main/res/drawable-hdpi/list_yellow_up.9.png b/src/main/res/drawable-hdpi/list_yellow_up.9.png
new file mode 100644
index 0000000..4ae791c
Binary files /dev/null and b/src/main/res/drawable-hdpi/list_yellow_up.9.png differ
diff --git a/src/main/res/drawable-hdpi/menu_delete.png b/src/main/res/drawable-hdpi/menu_delete.png
new file mode 100644
index 0000000..ccdfc4b
Binary files /dev/null and b/src/main/res/drawable-hdpi/menu_delete.png differ
diff --git a/src/main/res/drawable-hdpi/menu_move.png b/src/main/res/drawable-hdpi/menu_move.png
new file mode 100644
index 0000000..1140b71
Binary files /dev/null and b/src/main/res/drawable-hdpi/menu_move.png differ
diff --git a/src/main/res/drawable-hdpi/new_note_normal.png b/src/main/res/drawable-hdpi/new_note_normal.png
new file mode 100644
index 0000000..e24e0d1
Binary files /dev/null and b/src/main/res/drawable-hdpi/new_note_normal.png differ
diff --git a/src/main/res/drawable-hdpi/new_note_pressed.png b/src/main/res/drawable-hdpi/new_note_pressed.png
new file mode 100644
index 0000000..c748936
Binary files /dev/null and b/src/main/res/drawable-hdpi/new_note_pressed.png differ
diff --git a/src/main/res/drawable-hdpi/note_edit_color_selector_panel.png b/src/main/res/drawable-hdpi/note_edit_color_selector_panel.png
new file mode 100644
index 0000000..fc49552
Binary files /dev/null and b/src/main/res/drawable-hdpi/note_edit_color_selector_panel.png differ
diff --git a/src/main/res/drawable-hdpi/notification.png b/src/main/res/drawable-hdpi/notification.png
new file mode 100644
index 0000000..b13ab4a
Binary files /dev/null and b/src/main/res/drawable-hdpi/notification.png differ
diff --git a/src/main/res/drawable-hdpi/search_result.png b/src/main/res/drawable-hdpi/search_result.png
new file mode 100644
index 0000000..ff2befd
Binary files /dev/null and b/src/main/res/drawable-hdpi/search_result.png differ
diff --git a/src/main/res/drawable-hdpi/selected.png b/src/main/res/drawable-hdpi/selected.png
new file mode 100644
index 0000000..b889bef
Binary files /dev/null and b/src/main/res/drawable-hdpi/selected.png differ
diff --git a/src/main/res/drawable-hdpi/title_alert.png b/src/main/res/drawable-hdpi/title_alert.png
new file mode 100644
index 0000000..544ee9c
Binary files /dev/null and b/src/main/res/drawable-hdpi/title_alert.png differ
diff --git a/src/main/res/drawable-hdpi/title_bar_bg.9.png b/src/main/res/drawable-hdpi/title_bar_bg.9.png
new file mode 100644
index 0000000..eb6bff0
Binary files /dev/null and b/src/main/res/drawable-hdpi/title_bar_bg.9.png differ
diff --git a/src/main/res/drawable-hdpi/widget_2x_blue.png b/src/main/res/drawable-hdpi/widget_2x_blue.png
new file mode 100644
index 0000000..a1707f4
Binary files /dev/null and b/src/main/res/drawable-hdpi/widget_2x_blue.png differ
diff --git a/src/main/res/drawable-hdpi/widget_2x_green.png b/src/main/res/drawable-hdpi/widget_2x_green.png
new file mode 100644
index 0000000..f86886c
Binary files /dev/null and b/src/main/res/drawable-hdpi/widget_2x_green.png differ
diff --git a/src/main/res/drawable-hdpi/widget_2x_red.png b/src/main/res/drawable-hdpi/widget_2x_red.png
new file mode 100644
index 0000000..0e66c29
Binary files /dev/null and b/src/main/res/drawable-hdpi/widget_2x_red.png differ
diff --git a/src/main/res/drawable-hdpi/widget_2x_white.png b/src/main/res/drawable-hdpi/widget_2x_white.png
new file mode 100644
index 0000000..5f0619a
Binary files /dev/null and b/src/main/res/drawable-hdpi/widget_2x_white.png differ
diff --git a/src/main/res/drawable-hdpi/widget_2x_yellow.png b/src/main/res/drawable-hdpi/widget_2x_yellow.png
new file mode 100644
index 0000000..12d1c2b
Binary files /dev/null and b/src/main/res/drawable-hdpi/widget_2x_yellow.png differ
diff --git a/src/main/res/drawable-hdpi/widget_4x_blue.png b/src/main/res/drawable-hdpi/widget_4x_blue.png
new file mode 100644
index 0000000..9183738
Binary files /dev/null and b/src/main/res/drawable-hdpi/widget_4x_blue.png differ
diff --git a/src/main/res/drawable-hdpi/widget_4x_green.png b/src/main/res/drawable-hdpi/widget_4x_green.png
new file mode 100644
index 0000000..fa8b452
Binary files /dev/null and b/src/main/res/drawable-hdpi/widget_4x_green.png differ
diff --git a/src/main/res/drawable-hdpi/widget_4x_red.png b/src/main/res/drawable-hdpi/widget_4x_red.png
new file mode 100644
index 0000000..62de074
Binary files /dev/null and b/src/main/res/drawable-hdpi/widget_4x_red.png differ
diff --git a/src/main/res/drawable-hdpi/widget_4x_white.png b/src/main/res/drawable-hdpi/widget_4x_white.png
new file mode 100644
index 0000000..a37d67c
Binary files /dev/null and b/src/main/res/drawable-hdpi/widget_4x_white.png differ
diff --git a/src/main/res/drawable-hdpi/widget_4x_yellow.png b/src/main/res/drawable-hdpi/widget_4x_yellow.png
new file mode 100644
index 0000000..d7c5fa4
Binary files /dev/null and b/src/main/res/drawable-hdpi/widget_4x_yellow.png differ
diff --git a/src/main/res/drawable/ic_launcher_background.xml b/src/main/res/drawable/ic_launcher_background.xml
new file mode 100644
index 0000000..07d5da9
--- /dev/null
+++ b/src/main/res/drawable/ic_launcher_background.xml
@@ -0,0 +1,170 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/src/main/res/drawable/ic_launcher_foreground.xml b/src/main/res/drawable/ic_launcher_foreground.xml
new file mode 100644
index 0000000..2b068d1
--- /dev/null
+++ b/src/main/res/drawable/ic_launcher_foreground.xml
@@ -0,0 +1,30 @@
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/src/main/res/drawable/ic_pinned.xml b/src/main/res/drawable/ic_pinned.xml
new file mode 100644
index 0000000..37b93a1
--- /dev/null
+++ b/src/main/res/drawable/ic_pinned.xml
@@ -0,0 +1,10 @@
+
+
+
+
\ No newline at end of file
diff --git a/src/main/res/drawable/new_note.xml b/src/main/res/drawable/new_note.xml
new file mode 100644
index 0000000..2154ebc
--- /dev/null
+++ b/src/main/res/drawable/new_note.xml
@@ -0,0 +1,23 @@
+
+
+
+
+
+
+
+
diff --git a/src/main/res/layout/account_dialog_title.xml b/src/main/res/layout/account_dialog_title.xml
new file mode 100644
index 0000000..7717112
--- /dev/null
+++ b/src/main/res/layout/account_dialog_title.xml
@@ -0,0 +1,43 @@
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/src/main/res/layout/activity_main.xml b/src/main/res/layout/activity_main.xml
new file mode 100644
index 0000000..86a5d97
--- /dev/null
+++ b/src/main/res/layout/activity_main.xml
@@ -0,0 +1,19 @@
+
+
+
+
+
+
\ No newline at end of file
diff --git a/src/main/res/layout/add_account_text.xml b/src/main/res/layout/add_account_text.xml
new file mode 100644
index 0000000..c799178
--- /dev/null
+++ b/src/main/res/layout/add_account_text.xml
@@ -0,0 +1,32 @@
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/src/main/res/layout/datetime_picker.xml b/src/main/res/layout/datetime_picker.xml
new file mode 100644
index 0000000..f10d592
--- /dev/null
+++ b/src/main/res/layout/datetime_picker.xml
@@ -0,0 +1,56 @@
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/src/main/res/layout/dialog_edit_text.xml b/src/main/res/layout/dialog_edit_text.xml
new file mode 100644
index 0000000..361b39a
--- /dev/null
+++ b/src/main/res/layout/dialog_edit_text.xml
@@ -0,0 +1,23 @@
+
+
+
+
+
\ No newline at end of file
diff --git a/src/main/res/layout/folder_list_item.xml b/src/main/res/layout/folder_list_item.xml
new file mode 100644
index 0000000..77e8148
--- /dev/null
+++ b/src/main/res/layout/folder_list_item.xml
@@ -0,0 +1,29 @@
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/src/main/res/layout/note_edit.xml b/src/main/res/layout/note_edit.xml
new file mode 100644
index 0000000..1e33fd6
--- /dev/null
+++ b/src/main/res/layout/note_edit.xml
@@ -0,0 +1,409 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/src/main/res/layout/note_edit_list_item.xml b/src/main/res/layout/note_edit_list_item.xml
new file mode 100644
index 0000000..a885f9c
--- /dev/null
+++ b/src/main/res/layout/note_edit_list_item.xml
@@ -0,0 +1,39 @@
+
+
+
+
+
+
+
+
+
+
diff --git a/src/main/res/layout/note_item.xml b/src/main/res/layout/note_item.xml
new file mode 100644
index 0000000..c566526
--- /dev/null
+++ b/src/main/res/layout/note_item.xml
@@ -0,0 +1,89 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/src/main/res/layout/note_list.xml b/src/main/res/layout/note_list.xml
new file mode 100644
index 0000000..6b25d38
--- /dev/null
+++ b/src/main/res/layout/note_list.xml
@@ -0,0 +1,58 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/src/main/res/layout/note_list_dropdown_menu.xml b/src/main/res/layout/note_list_dropdown_menu.xml
new file mode 100644
index 0000000..3fa271d
--- /dev/null
+++ b/src/main/res/layout/note_list_dropdown_menu.xml
@@ -0,0 +1,32 @@
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/src/main/res/layout/note_list_footer.xml b/src/main/res/layout/note_list_footer.xml
new file mode 100644
index 0000000..5ca7b22
--- /dev/null
+++ b/src/main/res/layout/note_list_footer.xml
@@ -0,0 +1,24 @@
+
+
+
+
+
\ No newline at end of file
diff --git a/src/main/res/layout/notes_list_item.xml b/src/main/res/layout/notes_list_item.xml
new file mode 100644
index 0000000..2f3ebd6
--- /dev/null
+++ b/src/main/res/layout/notes_list_item.xml
@@ -0,0 +1,26 @@
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/src/main/res/layout/settings_header.xml b/src/main/res/layout/settings_header.xml
new file mode 100644
index 0000000..5eb8c50
--- /dev/null
+++ b/src/main/res/layout/settings_header.xml
@@ -0,0 +1,41 @@
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/src/main/res/layout/widget_2x.xml b/src/main/res/layout/widget_2x.xml
new file mode 100644
index 0000000..55970ce
--- /dev/null
+++ b/src/main/res/layout/widget_2x.xml
@@ -0,0 +1,37 @@
+
+
+
+
+
+
+
+
diff --git a/src/main/res/layout/widget_4x.xml b/src/main/res/layout/widget_4x.xml
new file mode 100644
index 0000000..dc9bb51
--- /dev/null
+++ b/src/main/res/layout/widget_4x.xml
@@ -0,0 +1,39 @@
+
+
+
+
+
+
+
+
+
+
diff --git a/src/main/res/menu/call_note_edit.xml b/src/main/res/menu/call_note_edit.xml
new file mode 100644
index 0000000..02c0528
--- /dev/null
+++ b/src/main/res/menu/call_note_edit.xml
@@ -0,0 +1,48 @@
+
+
+
+
+
diff --git a/src/main/res/menu/call_record_folder.xml b/src/main/res/menu/call_record_folder.xml
new file mode 100644
index 0000000..c664346
--- /dev/null
+++ b/src/main/res/menu/call_record_folder.xml
@@ -0,0 +1,23 @@
+
+
+
+
+
diff --git a/src/main/res/menu/note_edit.xml b/src/main/res/menu/note_edit.xml
new file mode 100644
index 0000000..35cacd1
--- /dev/null
+++ b/src/main/res/menu/note_edit.xml
@@ -0,0 +1,52 @@
+
+
+
+
+
\ No newline at end of file
diff --git a/src/main/res/menu/note_list.xml b/src/main/res/menu/note_list.xml
new file mode 100644
index 0000000..42ea736
--- /dev/null
+++ b/src/main/res/menu/note_list.xml
@@ -0,0 +1,39 @@
+
+
+
+
+
diff --git a/src/main/res/menu/note_list_context_menu.xml b/src/main/res/menu/note_list_context_menu.xml
new file mode 100644
index 0000000..df7f271
--- /dev/null
+++ b/src/main/res/menu/note_list_context_menu.xml
@@ -0,0 +1,15 @@
+
+
\ No newline at end of file
diff --git a/src/main/res/menu/note_list_dropdown.xml b/src/main/res/menu/note_list_dropdown.xml
new file mode 100644
index 0000000..7cbaadc
--- /dev/null
+++ b/src/main/res/menu/note_list_dropdown.xml
@@ -0,0 +1,20 @@
+
+
+
+
+
\ No newline at end of file
diff --git a/src/main/res/menu/note_list_options.xml b/src/main/res/menu/note_list_options.xml
new file mode 100644
index 0000000..daac008
--- /dev/null
+++ b/src/main/res/menu/note_list_options.xml
@@ -0,0 +1,31 @@
+
+
+
+
+
\ No newline at end of file
diff --git a/src/main/res/menu/sub_folder.xml b/src/main/res/menu/sub_folder.xml
new file mode 100644
index 0000000..b00de26
--- /dev/null
+++ b/src/main/res/menu/sub_folder.xml
@@ -0,0 +1,24 @@
+
+
+
+
+
\ No newline at end of file
diff --git a/src/main/res/mipmap-anydpi/ic_launcher.xml b/src/main/res/mipmap-anydpi/ic_launcher.xml
new file mode 100644
index 0000000..6f3b755
--- /dev/null
+++ b/src/main/res/mipmap-anydpi/ic_launcher.xml
@@ -0,0 +1,6 @@
+
+
+
+
+
+
\ No newline at end of file
diff --git a/src/main/res/mipmap-anydpi/ic_launcher_round.xml b/src/main/res/mipmap-anydpi/ic_launcher_round.xml
new file mode 100644
index 0000000..6f3b755
--- /dev/null
+++ b/src/main/res/mipmap-anydpi/ic_launcher_round.xml
@@ -0,0 +1,6 @@
+
+
+
+
+
+
\ No newline at end of file
diff --git a/src/main/res/mipmap-hdpi/ic_launcher.webp b/src/main/res/mipmap-hdpi/ic_launcher.webp
new file mode 100644
index 0000000..c209e78
Binary files /dev/null and b/src/main/res/mipmap-hdpi/ic_launcher.webp differ
diff --git a/src/main/res/mipmap-hdpi/ic_launcher_round.webp b/src/main/res/mipmap-hdpi/ic_launcher_round.webp
new file mode 100644
index 0000000..b2dfe3d
Binary files /dev/null and b/src/main/res/mipmap-hdpi/ic_launcher_round.webp differ
diff --git a/src/main/res/mipmap-mdpi/ic_launcher.webp b/src/main/res/mipmap-mdpi/ic_launcher.webp
new file mode 100644
index 0000000..4f0f1d6
Binary files /dev/null and b/src/main/res/mipmap-mdpi/ic_launcher.webp differ
diff --git a/src/main/res/mipmap-mdpi/ic_launcher_round.webp b/src/main/res/mipmap-mdpi/ic_launcher_round.webp
new file mode 100644
index 0000000..62b611d
Binary files /dev/null and b/src/main/res/mipmap-mdpi/ic_launcher_round.webp differ
diff --git a/src/main/res/mipmap-xhdpi/ic_launcher.webp b/src/main/res/mipmap-xhdpi/ic_launcher.webp
new file mode 100644
index 0000000..948a307
Binary files /dev/null and b/src/main/res/mipmap-xhdpi/ic_launcher.webp differ
diff --git a/src/main/res/mipmap-xhdpi/ic_launcher_round.webp b/src/main/res/mipmap-xhdpi/ic_launcher_round.webp
new file mode 100644
index 0000000..1b9a695
Binary files /dev/null and b/src/main/res/mipmap-xhdpi/ic_launcher_round.webp differ
diff --git a/src/main/res/mipmap-xxhdpi/ic_launcher.webp b/src/main/res/mipmap-xxhdpi/ic_launcher.webp
new file mode 100644
index 0000000..28d4b77
Binary files /dev/null and b/src/main/res/mipmap-xxhdpi/ic_launcher.webp differ
diff --git a/src/main/res/mipmap-xxhdpi/ic_launcher_round.webp b/src/main/res/mipmap-xxhdpi/ic_launcher_round.webp
new file mode 100644
index 0000000..9287f50
Binary files /dev/null and b/src/main/res/mipmap-xxhdpi/ic_launcher_round.webp differ
diff --git a/src/main/res/mipmap-xxxhdpi/ic_launcher.webp b/src/main/res/mipmap-xxxhdpi/ic_launcher.webp
new file mode 100644
index 0000000..aa7d642
Binary files /dev/null and b/src/main/res/mipmap-xxxhdpi/ic_launcher.webp differ
diff --git a/src/main/res/mipmap-xxxhdpi/ic_launcher_round.webp b/src/main/res/mipmap-xxxhdpi/ic_launcher_round.webp
new file mode 100644
index 0000000..9126ae3
Binary files /dev/null and b/src/main/res/mipmap-xxxhdpi/ic_launcher_round.webp differ
diff --git a/src/main/res/raw-zh-rCN/introduction b/src/main/res/raw-zh-rCN/introduction
new file mode 100644
index 0000000..7188359
--- /dev/null
+++ b/src/main/res/raw-zh-rCN/introduction
@@ -0,0 +1,7 @@
+欢迎使用MIUI便签!
+
+ 无论从软件中直接添加,还是从桌面拖出widget,MIUI便签能让你快速建立和保存便签;
+
+ 除了调整文字大小、便签背景、文件夹等基础功能外,你会发现MIUI便签也提供了清单模式、便签提醒、软件加密、导出到SD卡、同步google task的高级功能,让你的生活记录更加美好和安全;
+
+ 来分享你的使用体验吧:http://www.miui.com/index.php
diff --git a/src/main/res/raw/introduction b/src/main/res/raw/introduction
new file mode 100644
index 0000000..269cf7b
--- /dev/null
+++ b/src/main/res/raw/introduction
@@ -0,0 +1 @@
+Welcome to use MIUI notes!
\ No newline at end of file
diff --git a/src/main/res/values-night/themes.xml b/src/main/res/values-night/themes.xml
new file mode 100644
index 0000000..84331b1
--- /dev/null
+++ b/src/main/res/values-night/themes.xml
@@ -0,0 +1,7 @@
+
+
+
+
\ No newline at end of file
diff --git a/src/main/res/values-zh-rCN/arrays.xml b/src/main/res/values-zh-rCN/arrays.xml
new file mode 100644
index 0000000..a092386
--- /dev/null
+++ b/src/main/res/values-zh-rCN/arrays.xml
@@ -0,0 +1,23 @@
+
+
+
+
+
+
+ - 短信
+ - 邮件
+
+
\ No newline at end of file
diff --git a/src/main/res/values-zh-rCN/strings.xml b/src/main/res/values-zh-rCN/strings.xml
new file mode 100644
index 0000000..09f75ed
--- /dev/null
+++ b/src/main/res/values-zh-rCN/strings.xml
@@ -0,0 +1,126 @@
+
+
+
+
+
+ 便签
+ 便签2x2
+ 便签4x4
+ 没有关联内容,点击新建便签。
+ 访客模式下,便签内容不可见
+ ...
+ 新建便签
+ 成功删除提醒
+ 创建提醒
+ 已过期
+ yyyyMMdd
+ MM月dd日 kk:mm
+ 知道了
+ 查看
+ 呼叫电话
+ 发送邮件
+ 浏览网页
+ 打开地图
+
+ 新建文件夹
+ 导出文本
+ 同步
+ 取消同步
+ 设置
+ 搜索
+ 删除
+ 移动到文件夹
+ 选中了 %d 项
+ 没有选中项,操作无效
+ 全选
+ 取消全选
+ 文字大小
+ 小
+ 正常
+ 大
+ 超大
+ 进入清单模式
+ 退出清单模式
+ 查看文件夹
+ 刪除文件夹
+ 修改文件夹名称
+ 文件夹 %1$s 已存在,请重新命名
+ 分享
+ 发送到桌面
+ 提醒我
+ 删除提醒
+ 选择文件夹
+ 上一级文件夹
+ 已添加到桌面
+ 删除
+ 确认要删除所选的 %d 条便签吗?
+ 确认要删除该条便签吗?
+ 确认删除文件夹及所包含的便签吗?
+ 已将所选 %1$d 条便签移到 %2$s 文件夹
+
+ SD卡被占用,不能操作
+ 导出文本时发生错误,请检查SD卡
+ 要查看的便签不存在
+ 不能为空便签设置闹钟提醒
+ 不能将空便签发送到桌面
+ 导出成功
+ 导出失败
+ 已将文本文件(%1$s)输出至SD卡(%2$s)目录
+
+ 同步便签...
+ 同步成功
+ 同步失败
+ 同步已取消
+ 与%1$s同步成功
+ 同步失败,请检查网络和帐号设置
+ 同步失败,发生内部错误
+ 同步已取消
+ 登录%1$s...
+ 正在获取服务器便签列表...
+ 正在同步本地便签...
+
+ 设置
+ 同步账号
+ 与google task同步便签记录
+ 上次同步于 %1$s
+ 添加账号
+ 更换账号
+ 删除账号
+ 取消
+ 立即同步
+ 取消同步
+ 当前帐号 %1$s
+ 如更换同步帐号,过去的帐号同步信息将被清空,再次切换的同时可能会造成数据重复
+ 同步便签
+ 请选择google帐号,便签将与该帐号的google task内容同步。
+ 正在同步中,不能修改同步帐号
+ 同步帐号已设置为%1$s
+ 新建便签背景颜色随机
+ 删除
+ 通话便签
+ 请输入名称
+ 正在搜索便签
+ 搜索便签
+ 便签中的文字
+ 便签
+ 设置
+ 取消
+
+ - %1$s 条符合“%2$s”的搜索结果
+
+
+
diff --git a/src/main/res/values-zh-rTW/arrays.xml b/src/main/res/values-zh-rTW/arrays.xml
new file mode 100644
index 0000000..5297209
--- /dev/null
+++ b/src/main/res/values-zh-rTW/arrays.xml
@@ -0,0 +1,23 @@
+
+
+
+
+
+
+ - 短信
+ - 郵件
+
+
\ No newline at end of file
diff --git a/src/main/res/values-zh-rTW/strings.xml b/src/main/res/values-zh-rTW/strings.xml
new file mode 100644
index 0000000..3c41894
--- /dev/null
+++ b/src/main/res/values-zh-rTW/strings.xml
@@ -0,0 +1,127 @@
+
+
+
+
+
+ 便簽
+ 便簽2x2
+ 便簽4x4
+ 沒有關聯內容,點擊新建便簽。
+ 訪客模式下,便籤內容不可見
+ ...
+ 新建便簽
+ 成功刪除提醒
+ 創建提醒
+ 已過期
+ yyyyMMdd
+ MM月dd日 kk:mm
+ 知道了
+ 查看
+ 呼叫電話
+ 發送郵件
+ 浏覽網頁
+ 打開地圖
+ 已將所選 %1$d 便籤移到 %2$s 文件夾
+
+ 新建文件夾
+ 導出文本
+ 同步
+ 取消同步
+ 設置
+ 搜尋
+ 刪除
+ 移動到文件夾
+ 選中了 %d 項
+ 沒有選中項,操作無效
+ 全選
+ 取消全選
+ 文字大小
+ 小
+ 正常
+ 大
+ 超大
+ 進入清單模式
+ 退出清單模式
+ 查看文件夾
+ 刪除文件夾
+ 修改文件夾名稱
+ 文件夾 %1$s 已存在,請重新命名
+ 分享
+ 發送到桌面
+ 提醒我
+ 刪除提醒
+ 選擇文件夾
+ 上一級文件夾
+ 已添加到桌面
+ 刪除
+ 确认要刪除所選的 %d 條便籤嗎?
+ 确认要删除該條便籤嗎?
+ 確認刪除檔夾及所包含的便簽嗎?
+ SD卡被佔用,不能操作
+ 導出TXT時發生錯誤,請檢查SD卡
+ 要查看的便籤不存在
+ 不能爲空便籤設置鬧鐘提醒
+ 不能將空便籤發送到桌面
+ 導出成功
+ 導出失敗
+ 已將文本文件(%1$s)導出至SD(%2$s)目錄
+
+ 同步便簽...
+ 同步成功
+ 同步失敗
+ 同步已取消
+ 與%1$s同步成功
+ 同步失敗,請檢查網絡和帳號設置
+ 同步失敗,發生內部錯誤
+ 同步已取消
+ 登陸%1$s...
+ 正在獲取服務器便籤列表...
+ 正在同步本地便籤...
+
+ 設置
+ 同步賬號
+ 与google task同步便簽記錄
+ 上次同步于 %1$s
+ 添加賬號
+ 更換賬號
+ 刪除賬號
+ 取消
+ 立即同步
+ 取消同步
+ 當前帳號 %1$s
+ 如更換同步帳號,過去的帳號同步信息將被清空,再次切換的同時可能會造成數據重復
+ 同步便簽
+ 請選擇google帳號,便簽將與該帳號的google task內容同步。
+ 正在同步中,不能修改同步帳號
+ 同步帳號已設置為%1$s
+ 新建便籤背景顏色隨機
+
+ 刪除
+ 通話便籤
+ 請輸入名稱
+
+ 正在搜索便籤
+ 搜索便籤
+ 便籤中的文字
+ 便籤
+ 設置
+ 取消
+
+ - %1$s 條符合”%2$s“的搜尋結果
+
+
+
diff --git a/src/main/res/values/arrays.xml b/src/main/res/values/arrays.xml
new file mode 100644
index 0000000..e00210b
--- /dev/null
+++ b/src/main/res/values/arrays.xml
@@ -0,0 +1,31 @@
+
+
+
+
+
+
+
+ - -%s
+ - --%s
+ - --%s
+ - --%s
+
+
+
+ - Messaging
+ - Email
+
+
\ No newline at end of file
diff --git a/src/main/res/values/colors.xml b/src/main/res/values/colors.xml
new file mode 100644
index 0000000..123ffbf
--- /dev/null
+++ b/src/main/res/values/colors.xml
@@ -0,0 +1,20 @@
+
+
+
+
+
+ #335b5b5b
+
diff --git a/src/main/res/values/dimens.xml b/src/main/res/values/dimens.xml
new file mode 100644
index 0000000..194e84f
--- /dev/null
+++ b/src/main/res/values/dimens.xml
@@ -0,0 +1,24 @@
+
+
+
+
+
+ 33sp
+ 26sp
+ 20sp
+ 17sp
+ 14sp
+
\ No newline at end of file
diff --git a/src/main/res/values/strings.xml b/src/main/res/values/strings.xml
new file mode 100644
index 0000000..77292a1
--- /dev/null
+++ b/src/main/res/values/strings.xml
@@ -0,0 +1,140 @@
+
+
+
+
+
+ Notes
+ Notes 2x2
+ Notes 4x4
+ No associated note found, click to create associated note.
+ Privacy mode,can not see note content
+ ...
+ Add note
+ Delete reminder successfully
+ Set reminder
+ Expired
+ yyyyMMdd
+ MMMd kk:mm
+ Got it
+ Take a look
+ Call
+ Send email
+ Browse web
+ Open map
+
+ /MIUI/notes/
+ notes_%s.txt
+
+ (%d)
+ New Folder
+ Export text
+ Sync
+ Cancel syncing
+ Settings
+ Search
+ Delete
+ Move to folder
+ %d selected
+ Nothing selected, the operation is invalid
+ Select all
+ Deselect all
+ Font size
+ Small
+ Medium
+ Large
+ Super
+ Enter check list
+ Leave check list
+ View folder
+ Delete folder
+ Change folder name
+ The folder %1$s exist, please rename
+ Share
+ Send to home
+ Remind me
+ Delete reminder
+ Select folder
+ Parent folder
+ Note added to home
+ Confirm to delete folder and its notes?
+ Delete selected notes
+ Confirm to delete the selected %d notes?
+ Confirm to delete this note?
+ Have moved selected %1$d notes to %2$s folder
+
+ SD card busy, not available now
+ Export failed, please check SD card
+ The note is not exist
+ Sorry, can not set clock on empty note
+ Sorry, can not send and empty note to home
+ Export successful
+ Export fail
+ Export text file (%1$s) to SD (%2$s) directory
+
+ Syncing notes...
+ Sync is successful
+ Sync is failed
+ Sync is canceled
+ Sync is successful with account %1$s
+ Sync failed, please check network and account settings
+ Sync failed, internal error occurs
+ Sync is canceled
+ Logging into %1$s...
+ Getting remote note list...
+ Synchronize local notes with Google Task...
+
+ Settings
+ Sync account
+ Sync notes with google task
+ Last sync time %1$s
+ yyyy-MM-dd hh:mm:ss
+ Add account
+ Change sync account
+ Remove sync account
+ Cancel
+ Sync immediately
+ Cancel syncing
+ Current account %1$s
+ All sync related information will be deleted, which may result in duplicated items sometime
+ Sync notes
+ Please select a google account. Local notes will be synced with google task.
+ Cannot change the account because sync is in progress
+ %1$s has been set as the sync account
+ New note background color random
+
+ Delete
+ Call notes
+ Input name
+
+ Searching Notes
+ Search notes
+ Text in your notes
+ Notes
+ set
+ cancel
+
+ - %1$s result for \"%2$s\"
+
+ - %1$s results for \"%2$s\"
+
+
+ 置顶
+ 取消置顶
+
+ 移入文件夹
+
+
diff --git a/src/main/res/values/styles.xml b/src/main/res/values/styles.xml
new file mode 100644
index 0000000..c1eddb2
--- /dev/null
+++ b/src/main/res/values/styles.xml
@@ -0,0 +1,68 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/src/main/res/values/themes.xml b/src/main/res/values/themes.xml
new file mode 100644
index 0000000..701612a
--- /dev/null
+++ b/src/main/res/values/themes.xml
@@ -0,0 +1,9 @@
+
+
+
+
+
+
\ No newline at end of file
diff --git a/src/main/res/xml/backup_rules.xml b/src/main/res/xml/backup_rules.xml
new file mode 100644
index 0000000..4df9255
--- /dev/null
+++ b/src/main/res/xml/backup_rules.xml
@@ -0,0 +1,13 @@
+
+
+
+
\ No newline at end of file
diff --git a/src/main/res/xml/data_extraction_rules.xml b/src/main/res/xml/data_extraction_rules.xml
new file mode 100644
index 0000000..9ee9997
--- /dev/null
+++ b/src/main/res/xml/data_extraction_rules.xml
@@ -0,0 +1,19 @@
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/src/main/res/xml/preferences.xml b/src/main/res/xml/preferences.xml
new file mode 100644
index 0000000..fe58f8f
--- /dev/null
+++ b/src/main/res/xml/preferences.xml
@@ -0,0 +1,30 @@
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/src/main/res/xml/searchable.xml b/src/main/res/xml/searchable.xml
new file mode 100644
index 0000000..bf74f14
--- /dev/null
+++ b/src/main/res/xml/searchable.xml
@@ -0,0 +1,27 @@
+
+
+
+
+
diff --git a/src/main/res/xml/widget_2x_info.xml b/src/main/res/xml/widget_2x_info.xml
new file mode 100644
index 0000000..ac8b225
--- /dev/null
+++ b/src/main/res/xml/widget_2x_info.xml
@@ -0,0 +1,23 @@
+
+
+
+
+
+
diff --git a/src/main/res/xml/widget_4x_info.xml b/src/main/res/xml/widget_4x_info.xml
new file mode 100644
index 0000000..cf79f9c
--- /dev/null
+++ b/src/main/res/xml/widget_4x_info.xml
@@ -0,0 +1,23 @@
+
+
+
+
+
+