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 @@ + + + + + + + + + + + + + +