diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..aa724b7 --- /dev/null +++ b/.gitignore @@ -0,0 +1,15 @@ +*.iml +.gradle +/local.properties +/.idea/caches +/.idea/libraries +/.idea/modules.xml +/.idea/workspace.xml +/.idea/navEditor.xml +/.idea/assetWizardSettings.xml +.DS_Store +/build +/captures +.externalNativeBuild +.cxx +local.properties diff --git a/.idea/.gitignore b/.idea/.gitignore new file mode 100644 index 0000000..26d3352 --- /dev/null +++ b/.idea/.gitignore @@ -0,0 +1,3 @@ +# Default ignored files +/shelf/ +/workspace.xml diff --git a/.idea/compiler.xml b/.idea/compiler.xml new file mode 100644 index 0000000..b589d56 --- /dev/null +++ b/.idea/compiler.xml @@ -0,0 +1,6 @@ + + + + + + \ No newline at end of file diff --git a/.idea/deploymentTargetDropDown.xml b/.idea/deploymentTargetDropDown.xml new file mode 100644 index 0000000..0c0c338 --- /dev/null +++ b/.idea/deploymentTargetDropDown.xml @@ -0,0 +1,10 @@ + + + + + + + + + + \ No newline at end of file diff --git a/.idea/gradle.xml b/.idea/gradle.xml new file mode 100644 index 0000000..0897082 --- /dev/null +++ b/.idea/gradle.xml @@ -0,0 +1,19 @@ + + + + + + + \ No newline at end of file diff --git a/.idea/migrations.xml b/.idea/migrations.xml new file mode 100644 index 0000000..f8051a6 --- /dev/null +++ b/.idea/migrations.xml @@ -0,0 +1,10 @@ + + + + + + \ No newline at end of file diff --git a/.idea/misc.xml b/.idea/misc.xml new file mode 100644 index 0000000..8978d23 --- /dev/null +++ b/.idea/misc.xml @@ -0,0 +1,9 @@ + + + + + + + + \ No newline at end of file diff --git a/.idea/vcs.xml b/.idea/vcs.xml new file mode 100644 index 0000000..94a25f7 --- /dev/null +++ b/.idea/vcs.xml @@ -0,0 +1,6 @@ + + + + + + \ No newline at end of file diff --git a/README.md b/README.md deleted file mode 100644 index b9e123b..0000000 --- a/README.md +++ /dev/null @@ -1,2 +0,0 @@ -# miNote - diff --git a/app/.gitignore b/app/.gitignore new file mode 100644 index 0000000..42afabf --- /dev/null +++ b/app/.gitignore @@ -0,0 +1 @@ +/build \ No newline at end of file diff --git a/app/build.gradle.kts b/app/build.gradle.kts new file mode 100644 index 0000000..0c95d12 --- /dev/null +++ b/app/build.gradle.kts @@ -0,0 +1,46 @@ +plugins { + alias(libs.plugins.androidApplication) +} + +android { + namespace = "net.micode.notes" + compileSdk = 34 + + defaultConfig { + applicationId = "net.micode.notes" + minSdk = 24 + targetSdk = 34 + versionCode = 1 + versionName = "1.0" + + testInstrumentationRunner = "androidx.test.runner.AndroidJUnitRunner" + } + buildTypes { + release { + isMinifyEnabled = false + proguardFiles( + getDefaultProguardFile("proguard-android-optimize.txt"), + "proguard-rules.pro" + ) + } + } + compileOptions { + sourceCompatibility = JavaVersion.VERSION_1_8 + targetCompatibility = JavaVersion.VERSION_1_8 + } + packagingOptions { resources.excludes.add("META-INF/*") } +} + +dependencies { + + implementation(libs.appcompat) + implementation(libs.material) + implementation(fileTree(mapOf( + "dir" to "D:\\Project\\Java\\miCode\\http", + "include" to listOf("*.aar", "*.jar"), + "exclude" to listOf("") + ))) + testImplementation(libs.junit) + androidTestImplementation(libs.ext.junit) + androidTestImplementation(libs.espresso.core) +} \ No newline at end of file diff --git a/app/proguard-rules.pro b/app/proguard-rules.pro new file mode 100644 index 0000000..481bb43 --- /dev/null +++ b/app/proguard-rules.pro @@ -0,0 +1,21 @@ +# Add project specific ProGuard rules here. +# You can control the set of applied configuration files using the +# proguardFiles setting in build.gradle. +# +# For more details, see +# http://developer.android.com/guide/developing/tools/proguard.html + +# If your project uses WebView with JS, uncomment the following +# and specify the fully qualified class name to the JavaScript interface +# class: +#-keepclassmembers class fqcn.of.javascript.interface.for.webview { +# public *; +#} + +# Uncomment this to preserve the line number information for +# debugging stack traces. +#-keepattributes SourceFile,LineNumberTable + +# If you keep the line number information, uncomment this to +# hide the original source file name. +#-renamesourcefileattribute SourceFile \ No newline at end of file diff --git a/app/src/androidTest/java/net/micode/notes/ExampleInstrumentedTest.java b/app/src/androidTest/java/net/micode/notes/ExampleInstrumentedTest.java new file mode 100644 index 0000000..a889a75 --- /dev/null +++ b/app/src/androidTest/java/net/micode/notes/ExampleInstrumentedTest.java @@ -0,0 +1,26 @@ +package net.micode.notes; + +import android.content.Context; + +import androidx.test.platform.app.InstrumentationRegistry; +import androidx.test.ext.junit.runners.AndroidJUnit4; + +import org.junit.Test; +import org.junit.runner.RunWith; + +import static org.junit.Assert.*; + +/** + * Instrumented test, which will execute on an Android device. + * + * @see Testing documentation + */ +@RunWith(AndroidJUnit4.class) +public class ExampleInstrumentedTest { + @Test + public void useAppContext() { + // Context of the app under test. + Context appContext = InstrumentationRegistry.getInstrumentation().getTargetContext(); + assertEquals("net.micode.notes", appContext.getPackageName()); + } +} \ No newline at end of file diff --git a/AndroidManifest.xml b/app/src/main/AndroidManifest.xml similarity index 92% rename from AndroidManifest.xml rename to app/src/main/AndroidManifest.xml index e5c7d47..822c6e8 100644 --- a/AndroidManifest.xml +++ b/app/src/main/AndroidManifest.xml @@ -20,7 +20,7 @@ android:versionCode="1" android:versionName="0.1" > - + @@ -42,7 +42,8 @@ android:launchMode="singleTop" android:theme="@style/NoteTheme" android:uiOptions="splitActionBarWhenNarrow" - android:windowSoftInputMode="adjustPan" > + android:windowSoftInputMode="adjustPan" + android:exported="true"> @@ -54,7 +55,10 @@ android:name=".ui.NoteEditActivity" android:configChanges="keyboardHidden|orientation|screenSize" android:launchMode="singleTop" - android:theme="@style/NoteTheme" > + android:theme="@style/NoteTheme" + android:exported="true" + > + @@ -87,7 +91,10 @@ + android:label="@string/app_widget2x2" + android:exported="true" + > + @@ -100,7 +107,8 @@ + android:label="@string/app_widget4x4" + android:exported="true"> @@ -113,7 +121,8 @@ android:resource="@xml/widget_4x_info" /> - + diff --git a/src/net/micode/notes/data/Contact.java b/app/src/main/java/net/micode/notes/data/Contact.java similarity index 100% rename from src/net/micode/notes/data/Contact.java rename to app/src/main/java/net/micode/notes/data/Contact.java diff --git a/src/net/micode/notes/data/Notes.java b/app/src/main/java/net/micode/notes/data/Notes.java similarity index 100% rename from src/net/micode/notes/data/Notes.java rename to app/src/main/java/net/micode/notes/data/Notes.java diff --git a/src/net/micode/notes/data/NotesDatabaseHelper.java b/app/src/main/java/net/micode/notes/data/NotesDatabaseHelper.java similarity index 100% rename from src/net/micode/notes/data/NotesDatabaseHelper.java rename to app/src/main/java/net/micode/notes/data/NotesDatabaseHelper.java diff --git a/src/net/micode/notes/data/NotesProvider.java b/app/src/main/java/net/micode/notes/data/NotesProvider.java similarity index 100% rename from src/net/micode/notes/data/NotesProvider.java rename to app/src/main/java/net/micode/notes/data/NotesProvider.java diff --git a/src/net/micode/notes/gtask/data/MetaData.java b/app/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 app/src/main/java/net/micode/notes/gtask/data/MetaData.java diff --git a/src/net/micode/notes/gtask/data/Node.java b/app/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 app/src/main/java/net/micode/notes/gtask/data/Node.java diff --git a/src/net/micode/notes/gtask/data/SqlData.java b/app/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 app/src/main/java/net/micode/notes/gtask/data/SqlData.java diff --git a/src/net/micode/notes/gtask/data/SqlNote.java b/app/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 app/src/main/java/net/micode/notes/gtask/data/SqlNote.java diff --git a/src/net/micode/notes/gtask/data/Task.java b/app/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 app/src/main/java/net/micode/notes/gtask/data/Task.java diff --git a/src/net/micode/notes/gtask/data/TaskList.java b/app/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 app/src/main/java/net/micode/notes/gtask/data/TaskList.java diff --git a/src/net/micode/notes/gtask/exception/ActionFailureException.java b/app/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 app/src/main/java/net/micode/notes/gtask/exception/ActionFailureException.java diff --git a/src/net/micode/notes/gtask/exception/NetworkFailureException.java b/app/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 app/src/main/java/net/micode/notes/gtask/exception/NetworkFailureException.java diff --git a/src/net/micode/notes/gtask/remote/GTaskASyncTask.java b/app/src/main/java/net/micode/notes/gtask/remote/GTaskASyncTask.java similarity index 82% rename from src/net/micode/notes/gtask/remote/GTaskASyncTask.java rename to app/src/main/java/net/micode/notes/gtask/remote/GTaskASyncTask.java index b3b61e7..388fe96 100644 --- a/src/net/micode/notes/gtask/remote/GTaskASyncTask.java +++ b/app/src/main/java/net/micode/notes/gtask/remote/GTaskASyncTask.java @@ -62,7 +62,7 @@ public class GTaskASyncTask extends AsyncTask { message }); } - +/* private void showNotification(int tickerId, String content) { Notification notification = new Notification(R.drawable.notification, mContext .getString(tickerId), System.currentTimeMillis()); @@ -81,6 +81,27 @@ public class GTaskASyncTask extends AsyncTask { pendingIntent); mNotifiManager.notify(GTASK_SYNC_NOTIFICATION_ID, notification); } + this function is changed to follows +*/ +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/app/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 app/src/main/java/net/micode/notes/gtask/remote/GTaskClient.java diff --git a/src/net/micode/notes/gtask/remote/GTaskManager.java b/app/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 app/src/main/java/net/micode/notes/gtask/remote/GTaskManager.java diff --git a/src/net/micode/notes/gtask/remote/GTaskSyncService.java b/app/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 app/src/main/java/net/micode/notes/gtask/remote/GTaskSyncService.java diff --git a/src/net/micode/notes/model/Note.java b/app/src/main/java/net/micode/notes/model/Note.java similarity index 100% rename from src/net/micode/notes/model/Note.java rename to app/src/main/java/net/micode/notes/model/Note.java diff --git a/src/net/micode/notes/model/WorkingNote.java b/app/src/main/java/net/micode/notes/model/WorkingNote.java similarity index 100% rename from src/net/micode/notes/model/WorkingNote.java rename to app/src/main/java/net/micode/notes/model/WorkingNote.java diff --git a/src/net/micode/notes/tool/BackupUtils.java b/app/src/main/java/net/micode/notes/tool/BackupUtils.java similarity index 100% rename from src/net/micode/notes/tool/BackupUtils.java rename to app/src/main/java/net/micode/notes/tool/BackupUtils.java diff --git a/src/net/micode/notes/tool/DataUtils.java b/app/src/main/java/net/micode/notes/tool/DataUtils.java similarity index 100% rename from src/net/micode/notes/tool/DataUtils.java rename to app/src/main/java/net/micode/notes/tool/DataUtils.java diff --git a/src/net/micode/notes/tool/GTaskStringUtils.java b/app/src/main/java/net/micode/notes/tool/GTaskStringUtils.java similarity index 100% rename from src/net/micode/notes/tool/GTaskStringUtils.java rename to app/src/main/java/net/micode/notes/tool/GTaskStringUtils.java diff --git a/src/net/micode/notes/tool/ResourceParser.java b/app/src/main/java/net/micode/notes/tool/ResourceParser.java similarity index 100% rename from src/net/micode/notes/tool/ResourceParser.java rename to app/src/main/java/net/micode/notes/tool/ResourceParser.java diff --git a/src/net/micode/notes/ui/AlarmAlertActivity.java b/app/src/main/java/net/micode/notes/ui/AlarmAlertActivity.java similarity index 100% rename from src/net/micode/notes/ui/AlarmAlertActivity.java rename to app/src/main/java/net/micode/notes/ui/AlarmAlertActivity.java diff --git a/src/net/micode/notes/ui/AlarmInitReceiver.java b/app/src/main/java/net/micode/notes/ui/AlarmInitReceiver.java similarity index 100% rename from src/net/micode/notes/ui/AlarmInitReceiver.java rename to app/src/main/java/net/micode/notes/ui/AlarmInitReceiver.java diff --git a/src/net/micode/notes/ui/AlarmReceiver.java b/app/src/main/java/net/micode/notes/ui/AlarmReceiver.java similarity index 100% rename from src/net/micode/notes/ui/AlarmReceiver.java rename to app/src/main/java/net/micode/notes/ui/AlarmReceiver.java diff --git a/src/net/micode/notes/ui/DateTimePicker.java b/app/src/main/java/net/micode/notes/ui/DateTimePicker.java similarity index 99% rename from src/net/micode/notes/ui/DateTimePicker.java rename to app/src/main/java/net/micode/notes/ui/DateTimePicker.java index 496b0cd..55d62f7 100644 --- a/src/net/micode/notes/ui/DateTimePicker.java +++ b/app/src/main/java/net/micode/notes/ui/DateTimePicker.java @@ -16,18 +16,17 @@ package net.micode.notes.ui; -import java.text.DateFormatSymbols; -import java.util.Calendar; - -import net.micode.notes.R; - - import android.content.Context; import android.text.format.DateFormat; import android.view.View; import android.widget.FrameLayout; import android.widget.NumberPicker; +import net.micode.notes.R; + +import java.text.DateFormatSymbols; +import java.util.Calendar; + public class DateTimePicker extends FrameLayout { private static final boolean DEFAULT_ENABLE_STATE = true; diff --git a/src/net/micode/notes/ui/DateTimePickerDialog.java b/app/src/main/java/net/micode/notes/ui/DateTimePickerDialog.java similarity index 98% rename from src/net/micode/notes/ui/DateTimePickerDialog.java rename to app/src/main/java/net/micode/notes/ui/DateTimePickerDialog.java index 2c47ba4..8ce234e 100644 --- a/src/net/micode/notes/ui/DateTimePickerDialog.java +++ b/app/src/main/java/net/micode/notes/ui/DateTimePickerDialog.java @@ -16,12 +16,6 @@ package net.micode.notes.ui; -import java.util.Calendar; - -import net.micode.notes.R; -import net.micode.notes.ui.DateTimePicker; -import net.micode.notes.ui.DateTimePicker.OnDateTimeChangedListener; - import android.app.AlertDialog; import android.content.Context; import android.content.DialogInterface; @@ -29,6 +23,11 @@ import android.content.DialogInterface.OnClickListener; import android.text.format.DateFormat; import android.text.format.DateUtils; +import net.micode.notes.R; +import net.micode.notes.ui.DateTimePicker.OnDateTimeChangedListener; + +import java.util.Calendar; + public class DateTimePickerDialog extends AlertDialog implements OnClickListener { private Calendar mDate = Calendar.getInstance(); diff --git a/src/net/micode/notes/ui/DropdownMenu.java b/app/src/main/java/net/micode/notes/ui/DropdownMenu.java similarity index 100% rename from src/net/micode/notes/ui/DropdownMenu.java rename to app/src/main/java/net/micode/notes/ui/DropdownMenu.java diff --git a/src/net/micode/notes/ui/FoldersListAdapter.java b/app/src/main/java/net/micode/notes/ui/FoldersListAdapter.java similarity index 100% rename from src/net/micode/notes/ui/FoldersListAdapter.java rename to app/src/main/java/net/micode/notes/ui/FoldersListAdapter.java diff --git a/src/net/micode/notes/ui/NoteEditActivity.java b/app/src/main/java/net/micode/notes/ui/NoteEditActivity.java similarity index 94% rename from src/net/micode/notes/ui/NoteEditActivity.java rename to app/src/main/java/net/micode/notes/ui/NoteEditActivity.java index 96a9ff8..2f95cc8 100644 --- a/src/net/micode/notes/ui/NoteEditActivity.java +++ b/app/src/main/java/net/micode/notes/ui/NoteEditActivity.java @@ -430,7 +430,7 @@ public class NoteEditActivity extends Activity implements OnClickListener, if (id == R.id.btn_set_bg_color) { mNoteBgColorSelector.setVisibility(View.VISIBLE); findViewById(sBgSelectorSelectionMap.get(mWorkingNote.getBgColorId())).setVisibility( - - View.VISIBLE); + View.VISIBLE); } else if (sBgSelectorBtnsMap.containsKey(id)) { findViewById(sBgSelectorSelectionMap.get(mWorkingNote.getBgColorId())).setVisibility( View.GONE); @@ -507,48 +507,37 @@ public class NoteEditActivity extends Activity implements OnClickListener, @Override public boolean onOptionsItemSelected(MenuItem item) { - switch (item.getItemId()) { - case R.id.menu_new_note: + if(item.getItemId() == R.id.menu_new_note) { createNewNote(); - break; - case R.id.menu_delete: - 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) { - deleteCurrentNote(); - finish(); - } - }); - builder.setNegativeButton(android.R.string.cancel, null); - builder.show(); - break; - case R.id.menu_font_size: - mFontSizeSelector.setVisibility(View.VISIBLE); - findViewById(sFontSelectorSelectionMap.get(mFontSizeId)).setVisibility(View.VISIBLE); - break; - case R.id.menu_list_mode: - mWorkingNote.setCheckListMode(mWorkingNote.getCheckListMode() == 0 ? - TextNote.MODE_CHECK_LIST : 0); - break; - case R.id.menu_share: - getWorkingText(); - sendTo(this, mWorkingNote.getContent()); - break; - case R.id.menu_send_to_desktop: - sendToDesktop(); - break; - case R.id.menu_alert: - setReminder(); - break; - case R.id.menu_delete_remind: - mWorkingNote.setAlertDate(0, false); - break; - default: - break; + }else if(item.getItemId() == R.id.menu_delete) { + 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) { + deleteCurrentNote(); + finish(); + } + }); + builder.setNegativeButton(android.R.string.cancel, null); + builder.show(); + }else if(item.getItemId() == R.id.menu_font_size) { + mFontSizeSelector.setVisibility(View.VISIBLE); + findViewById(sFontSelectorSelectionMap.get(mFontSizeId)).setVisibility(View.VISIBLE); + }else if(item.getItemId() == R.id.menu_list_mode) { + mWorkingNote.setCheckListMode(mWorkingNote.getCheckListMode() == 0 ? + TextNote.MODE_CHECK_LIST : 0); + }else if(item.getItemId() == R.id.menu_share){ + getWorkingText(); + sendTo(this, mWorkingNote.getContent()); + }else if(item.getItemId() == R.id.menu_send_to_desktop) { + sendToDesktop(); + }else if(item.getItemId() == R.id.menu_alert) { + setReminder(); + }else if(item.getItemId() == R.id.menu_delete_remind) { + mWorkingNote.setAlertDate(0, false); } return true; } diff --git a/src/net/micode/notes/ui/NoteEditText.java b/app/src/main/java/net/micode/notes/ui/NoteEditText.java similarity index 100% rename from src/net/micode/notes/ui/NoteEditText.java rename to app/src/main/java/net/micode/notes/ui/NoteEditText.java diff --git a/src/net/micode/notes/ui/NoteItemData.java b/app/src/main/java/net/micode/notes/ui/NoteItemData.java similarity index 100% rename from src/net/micode/notes/ui/NoteItemData.java rename to app/src/main/java/net/micode/notes/ui/NoteItemData.java diff --git a/src/net/micode/notes/ui/NotesListActivity.java b/app/src/main/java/net/micode/notes/ui/NotesListActivity.java similarity index 96% rename from src/net/micode/notes/ui/NotesListActivity.java rename to app/src/main/java/net/micode/notes/ui/NotesListActivity.java index e843aec..7d72270 100644 --- a/src/net/micode/notes/ui/NotesListActivity.java +++ b/app/src/main/java/net/micode/notes/ui/NotesListActivity.java @@ -319,28 +319,25 @@ public class NotesListActivity extends Activity implements OnClickListener, OnIt return true; } - switch (item.getItemId()) { - case R.id.delete: - AlertDialog.Builder builder = new AlertDialog.Builder(NotesListActivity.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_notes, - mNotesListAdapter.getSelectedCount())); - builder.setPositiveButton(android.R.string.ok, - new DialogInterface.OnClickListener() { - public void onClick(DialogInterface dialog, - int which) { - batchDelete(); - } - }); - builder.setNegativeButton(android.R.string.cancel, null); - builder.show(); - break; - case R.id.move: - startQueryDestinationFolders(); - break; - default: - return false; + if (item.getItemId() == R.id.delete) { + AlertDialog.Builder builder = new AlertDialog.Builder(NotesListActivity.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_notes, + mNotesListAdapter.getSelectedCount())); + builder.setPositiveButton(android.R.string.ok, + new DialogInterface.OnClickListener() { + public void onClick(DialogInterface dialog, + int which) { + batchDelete(); + } + }); + builder.setNegativeButton(android.R.string.cancel, null); + builder.show(); + }else if(item.getItemId() == R.id.move) { + startQueryDestinationFolders(); + }else{ + return false; } return true; } @@ -558,12 +555,8 @@ public class NotesListActivity extends Activity implements OnClickListener, OnIt } public void onClick(View v) { - switch (v.getId()) { - case R.id.btn_new_note: + if (v.getId() == R.id.btn_new_note) { createNewNote(); - break; - default: - break; } } diff --git a/src/net/micode/notes/ui/NotesListAdapter.java b/app/src/main/java/net/micode/notes/ui/NotesListAdapter.java similarity index 100% rename from src/net/micode/notes/ui/NotesListAdapter.java rename to app/src/main/java/net/micode/notes/ui/NotesListAdapter.java diff --git a/src/net/micode/notes/ui/NotesListItem.java b/app/src/main/java/net/micode/notes/ui/NotesListItem.java similarity index 100% rename from src/net/micode/notes/ui/NotesListItem.java rename to app/src/main/java/net/micode/notes/ui/NotesListItem.java diff --git a/src/net/micode/notes/ui/NotesPreferenceActivity.java b/app/src/main/java/net/micode/notes/ui/NotesPreferenceActivity.java similarity index 99% rename from src/net/micode/notes/ui/NotesPreferenceActivity.java rename to app/src/main/java/net/micode/notes/ui/NotesPreferenceActivity.java index 07c5f7e..b6f5f70 100644 --- a/src/net/micode/notes/ui/NotesPreferenceActivity.java +++ b/app/src/main/java/net/micode/notes/ui/NotesPreferenceActivity.java @@ -18,7 +18,6 @@ package net.micode.notes.ui; import android.accounts.Account; import android.accounts.AccountManager; -import android.app.ActionBar; import android.app.AlertDialog; import android.content.BroadcastReceiver; import android.content.ContentValues; @@ -35,7 +34,6 @@ import android.preference.PreferenceCategory; import android.text.TextUtils; import android.text.format.DateFormat; import android.view.LayoutInflater; -import android.view.Menu; import android.view.MenuItem; import android.view.View; import android.widget.Button; diff --git a/src/net/micode/notes/widget/NoteWidgetProvider.java b/app/src/main/java/net/micode/notes/widget/NoteWidgetProvider.java similarity index 100% rename from src/net/micode/notes/widget/NoteWidgetProvider.java rename to app/src/main/java/net/micode/notes/widget/NoteWidgetProvider.java diff --git a/src/net/micode/notes/widget/NoteWidgetProvider_2x.java b/app/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 app/src/main/java/net/micode/notes/widget/NoteWidgetProvider_2x.java diff --git a/src/net/micode/notes/widget/NoteWidgetProvider_4x.java b/app/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 app/src/main/java/net/micode/notes/widget/NoteWidgetProvider_4x.java diff --git a/res/color/primary_text_dark.xml b/app/src/main/res/color/primary_text_dark.xml similarity index 100% rename from res/color/primary_text_dark.xml rename to app/src/main/res/color/primary_text_dark.xml diff --git a/res/color/secondary_text_dark.xml b/app/src/main/res/color/secondary_text_dark.xml similarity index 100% rename from res/color/secondary_text_dark.xml rename to app/src/main/res/color/secondary_text_dark.xml diff --git a/res/drawable-hdpi/bg_btn_set_color.png b/app/src/main/res/drawable-hdpi/bg_btn_set_color.png similarity index 100% rename from res/drawable-hdpi/bg_btn_set_color.png rename to app/src/main/res/drawable-hdpi/bg_btn_set_color.png diff --git a/res/drawable-hdpi/bg_color_btn_mask.png b/app/src/main/res/drawable-hdpi/bg_color_btn_mask.png similarity index 100% rename from res/drawable-hdpi/bg_color_btn_mask.png rename to app/src/main/res/drawable-hdpi/bg_color_btn_mask.png diff --git a/res/drawable-hdpi/call_record.png b/app/src/main/res/drawable-hdpi/call_record.png similarity index 100% rename from res/drawable-hdpi/call_record.png rename to app/src/main/res/drawable-hdpi/call_record.png diff --git a/res/drawable-hdpi/clock.png b/app/src/main/res/drawable-hdpi/clock.png similarity index 100% rename from res/drawable-hdpi/clock.png rename to app/src/main/res/drawable-hdpi/clock.png diff --git a/res/drawable-hdpi/delete.png b/app/src/main/res/drawable-hdpi/delete.png similarity index 100% rename from res/drawable-hdpi/delete.png rename to app/src/main/res/drawable-hdpi/delete.png diff --git a/res/drawable-hdpi/dropdown_icon.9.png b/app/src/main/res/drawable-hdpi/dropdown_icon.9.png similarity index 100% rename from res/drawable-hdpi/dropdown_icon.9.png rename to app/src/main/res/drawable-hdpi/dropdown_icon.9.png diff --git a/res/drawable-hdpi/edit_blue.9.png b/app/src/main/res/drawable-hdpi/edit_blue.9.png similarity index 100% rename from res/drawable-hdpi/edit_blue.9.png rename to app/src/main/res/drawable-hdpi/edit_blue.9.png diff --git a/res/drawable-hdpi/edit_green.9.png b/app/src/main/res/drawable-hdpi/edit_green.9.png similarity index 100% rename from res/drawable-hdpi/edit_green.9.png rename to app/src/main/res/drawable-hdpi/edit_green.9.png diff --git a/res/drawable-hdpi/edit_red.9.png b/app/src/main/res/drawable-hdpi/edit_red.9.png similarity index 100% rename from res/drawable-hdpi/edit_red.9.png rename to app/src/main/res/drawable-hdpi/edit_red.9.png diff --git a/res/drawable-hdpi/edit_title_blue.9.png b/app/src/main/res/drawable-hdpi/edit_title_blue.9.png similarity index 100% rename from res/drawable-hdpi/edit_title_blue.9.png rename to app/src/main/res/drawable-hdpi/edit_title_blue.9.png diff --git a/res/drawable-hdpi/edit_title_green.9.png b/app/src/main/res/drawable-hdpi/edit_title_green.9.png similarity index 100% rename from res/drawable-hdpi/edit_title_green.9.png rename to app/src/main/res/drawable-hdpi/edit_title_green.9.png diff --git a/res/drawable-hdpi/edit_title_red.9.png b/app/src/main/res/drawable-hdpi/edit_title_red.9.png similarity index 100% rename from res/drawable-hdpi/edit_title_red.9.png rename to app/src/main/res/drawable-hdpi/edit_title_red.9.png diff --git a/res/drawable-hdpi/edit_title_white.9.png b/app/src/main/res/drawable-hdpi/edit_title_white.9.png similarity index 100% rename from res/drawable-hdpi/edit_title_white.9.png rename to app/src/main/res/drawable-hdpi/edit_title_white.9.png diff --git a/res/drawable-hdpi/edit_title_yellow.9.png b/app/src/main/res/drawable-hdpi/edit_title_yellow.9.png similarity index 100% rename from res/drawable-hdpi/edit_title_yellow.9.png rename to app/src/main/res/drawable-hdpi/edit_title_yellow.9.png diff --git a/res/drawable-hdpi/edit_white.9.png b/app/src/main/res/drawable-hdpi/edit_white.9.png similarity index 100% rename from res/drawable-hdpi/edit_white.9.png rename to app/src/main/res/drawable-hdpi/edit_white.9.png diff --git a/res/drawable-hdpi/edit_yellow.9.png b/app/src/main/res/drawable-hdpi/edit_yellow.9.png similarity index 100% rename from res/drawable-hdpi/edit_yellow.9.png rename to app/src/main/res/drawable-hdpi/edit_yellow.9.png diff --git a/res/drawable-hdpi/font_large.png b/app/src/main/res/drawable-hdpi/font_large.png similarity index 100% rename from res/drawable-hdpi/font_large.png rename to app/src/main/res/drawable-hdpi/font_large.png diff --git a/res/drawable-hdpi/font_normal.png b/app/src/main/res/drawable-hdpi/font_normal.png similarity index 100% rename from res/drawable-hdpi/font_normal.png rename to app/src/main/res/drawable-hdpi/font_normal.png diff --git a/res/drawable-hdpi/font_size_selector_bg.9.png b/app/src/main/res/drawable-hdpi/font_size_selector_bg.9.png similarity index 100% rename from res/drawable-hdpi/font_size_selector_bg.9.png rename to app/src/main/res/drawable-hdpi/font_size_selector_bg.9.png diff --git a/res/drawable-hdpi/font_small.png b/app/src/main/res/drawable-hdpi/font_small.png similarity index 100% rename from res/drawable-hdpi/font_small.png rename to app/src/main/res/drawable-hdpi/font_small.png diff --git a/res/drawable-hdpi/font_super.png b/app/src/main/res/drawable-hdpi/font_super.png similarity index 100% rename from res/drawable-hdpi/font_super.png rename to app/src/main/res/drawable-hdpi/font_super.png diff --git a/res/drawable-hdpi/icon_app.png b/app/src/main/res/drawable-hdpi/icon_app.png similarity index 100% rename from res/drawable-hdpi/icon_app.png rename to app/src/main/res/drawable-hdpi/icon_app.png diff --git a/res/drawable-hdpi/list_background.png b/app/src/main/res/drawable-hdpi/list_background.png similarity index 100% rename from res/drawable-hdpi/list_background.png rename to app/src/main/res/drawable-hdpi/list_background.png diff --git a/res/drawable-hdpi/list_blue_down.9.png b/app/src/main/res/drawable-hdpi/list_blue_down.9.png similarity index 100% rename from res/drawable-hdpi/list_blue_down.9.png rename to app/src/main/res/drawable-hdpi/list_blue_down.9.png diff --git a/res/drawable-hdpi/list_blue_middle.9.png b/app/src/main/res/drawable-hdpi/list_blue_middle.9.png similarity index 100% rename from res/drawable-hdpi/list_blue_middle.9.png rename to app/src/main/res/drawable-hdpi/list_blue_middle.9.png diff --git a/res/drawable-hdpi/list_blue_single.9.png b/app/src/main/res/drawable-hdpi/list_blue_single.9.png similarity index 100% rename from res/drawable-hdpi/list_blue_single.9.png rename to app/src/main/res/drawable-hdpi/list_blue_single.9.png diff --git a/res/drawable-hdpi/list_blue_up.9.png b/app/src/main/res/drawable-hdpi/list_blue_up.9.png similarity index 100% rename from res/drawable-hdpi/list_blue_up.9.png rename to app/src/main/res/drawable-hdpi/list_blue_up.9.png diff --git a/res/drawable-hdpi/list_folder.9.png b/app/src/main/res/drawable-hdpi/list_folder.9.png similarity index 100% rename from res/drawable-hdpi/list_folder.9.png rename to app/src/main/res/drawable-hdpi/list_folder.9.png diff --git a/res/drawable-hdpi/list_footer_bg.9.png b/app/src/main/res/drawable-hdpi/list_footer_bg.9.png similarity index 100% rename from res/drawable-hdpi/list_footer_bg.9.png rename to app/src/main/res/drawable-hdpi/list_footer_bg.9.png diff --git a/res/drawable-hdpi/list_green_down.9.png b/app/src/main/res/drawable-hdpi/list_green_down.9.png similarity index 100% rename from res/drawable-hdpi/list_green_down.9.png rename to app/src/main/res/drawable-hdpi/list_green_down.9.png diff --git a/res/drawable-hdpi/list_green_middle.9.png b/app/src/main/res/drawable-hdpi/list_green_middle.9.png similarity index 100% rename from res/drawable-hdpi/list_green_middle.9.png rename to app/src/main/res/drawable-hdpi/list_green_middle.9.png diff --git a/res/drawable-hdpi/list_green_single.9.png b/app/src/main/res/drawable-hdpi/list_green_single.9.png similarity index 100% rename from res/drawable-hdpi/list_green_single.9.png rename to app/src/main/res/drawable-hdpi/list_green_single.9.png diff --git a/res/drawable-hdpi/list_green_up.9.png b/app/src/main/res/drawable-hdpi/list_green_up.9.png similarity index 100% rename from res/drawable-hdpi/list_green_up.9.png rename to app/src/main/res/drawable-hdpi/list_green_up.9.png diff --git a/res/drawable-hdpi/list_red_down.9.png b/app/src/main/res/drawable-hdpi/list_red_down.9.png similarity index 100% rename from res/drawable-hdpi/list_red_down.9.png rename to app/src/main/res/drawable-hdpi/list_red_down.9.png diff --git a/res/drawable-hdpi/list_red_middle.9.png b/app/src/main/res/drawable-hdpi/list_red_middle.9.png similarity index 100% rename from res/drawable-hdpi/list_red_middle.9.png rename to app/src/main/res/drawable-hdpi/list_red_middle.9.png diff --git a/res/drawable-hdpi/list_red_single.9.png b/app/src/main/res/drawable-hdpi/list_red_single.9.png similarity index 100% rename from res/drawable-hdpi/list_red_single.9.png rename to app/src/main/res/drawable-hdpi/list_red_single.9.png diff --git a/res/drawable-hdpi/list_red_up.9.png b/app/src/main/res/drawable-hdpi/list_red_up.9.png similarity index 100% rename from res/drawable-hdpi/list_red_up.9.png rename to app/src/main/res/drawable-hdpi/list_red_up.9.png diff --git a/res/drawable-hdpi/list_white_down.9.png b/app/src/main/res/drawable-hdpi/list_white_down.9.png similarity index 100% rename from res/drawable-hdpi/list_white_down.9.png rename to app/src/main/res/drawable-hdpi/list_white_down.9.png diff --git a/res/drawable-hdpi/list_white_middle.9.png b/app/src/main/res/drawable-hdpi/list_white_middle.9.png similarity index 100% rename from res/drawable-hdpi/list_white_middle.9.png rename to app/src/main/res/drawable-hdpi/list_white_middle.9.png diff --git a/res/drawable-hdpi/list_white_single.9.png b/app/src/main/res/drawable-hdpi/list_white_single.9.png similarity index 100% rename from res/drawable-hdpi/list_white_single.9.png rename to app/src/main/res/drawable-hdpi/list_white_single.9.png diff --git a/res/drawable-hdpi/list_white_up.9.png b/app/src/main/res/drawable-hdpi/list_white_up.9.png similarity index 100% rename from res/drawable-hdpi/list_white_up.9.png rename to app/src/main/res/drawable-hdpi/list_white_up.9.png diff --git a/res/drawable-hdpi/list_yellow_down.9.png b/app/src/main/res/drawable-hdpi/list_yellow_down.9.png similarity index 100% rename from res/drawable-hdpi/list_yellow_down.9.png rename to app/src/main/res/drawable-hdpi/list_yellow_down.9.png diff --git a/res/drawable-hdpi/list_yellow_middle.9.png b/app/src/main/res/drawable-hdpi/list_yellow_middle.9.png similarity index 100% rename from res/drawable-hdpi/list_yellow_middle.9.png rename to app/src/main/res/drawable-hdpi/list_yellow_middle.9.png diff --git a/res/drawable-hdpi/list_yellow_single.9.png b/app/src/main/res/drawable-hdpi/list_yellow_single.9.png similarity index 100% rename from res/drawable-hdpi/list_yellow_single.9.png rename to app/src/main/res/drawable-hdpi/list_yellow_single.9.png diff --git a/res/drawable-hdpi/list_yellow_up.9.png b/app/src/main/res/drawable-hdpi/list_yellow_up.9.png similarity index 100% rename from res/drawable-hdpi/list_yellow_up.9.png rename to app/src/main/res/drawable-hdpi/list_yellow_up.9.png diff --git a/res/drawable-hdpi/menu_delete.png b/app/src/main/res/drawable-hdpi/menu_delete.png similarity index 100% rename from res/drawable-hdpi/menu_delete.png rename to app/src/main/res/drawable-hdpi/menu_delete.png diff --git a/res/drawable-hdpi/menu_move.png b/app/src/main/res/drawable-hdpi/menu_move.png similarity index 100% rename from res/drawable-hdpi/menu_move.png rename to app/src/main/res/drawable-hdpi/menu_move.png diff --git a/res/drawable-hdpi/new_note_normal.png b/app/src/main/res/drawable-hdpi/new_note_normal.png similarity index 100% rename from res/drawable-hdpi/new_note_normal.png rename to app/src/main/res/drawable-hdpi/new_note_normal.png diff --git a/res/drawable-hdpi/new_note_pressed.png b/app/src/main/res/drawable-hdpi/new_note_pressed.png similarity index 100% rename from res/drawable-hdpi/new_note_pressed.png rename to app/src/main/res/drawable-hdpi/new_note_pressed.png diff --git a/res/drawable-hdpi/note_edit_color_selector_panel.png b/app/src/main/res/drawable-hdpi/note_edit_color_selector_panel.png similarity index 100% rename from res/drawable-hdpi/note_edit_color_selector_panel.png rename to app/src/main/res/drawable-hdpi/note_edit_color_selector_panel.png diff --git a/res/drawable-hdpi/notification.png b/app/src/main/res/drawable-hdpi/notification.png similarity index 100% rename from res/drawable-hdpi/notification.png rename to app/src/main/res/drawable-hdpi/notification.png diff --git a/res/drawable-hdpi/search_result.png b/app/src/main/res/drawable-hdpi/search_result.png similarity index 100% rename from res/drawable-hdpi/search_result.png rename to app/src/main/res/drawable-hdpi/search_result.png diff --git a/res/drawable-hdpi/selected.png b/app/src/main/res/drawable-hdpi/selected.png similarity index 100% rename from res/drawable-hdpi/selected.png rename to app/src/main/res/drawable-hdpi/selected.png diff --git a/res/drawable-hdpi/title_alert.png b/app/src/main/res/drawable-hdpi/title_alert.png similarity index 100% rename from res/drawable-hdpi/title_alert.png rename to app/src/main/res/drawable-hdpi/title_alert.png diff --git a/res/drawable-hdpi/title_bar_bg.9.png b/app/src/main/res/drawable-hdpi/title_bar_bg.9.png similarity index 100% rename from res/drawable-hdpi/title_bar_bg.9.png rename to app/src/main/res/drawable-hdpi/title_bar_bg.9.png diff --git a/res/drawable-hdpi/widget_2x_blue.png b/app/src/main/res/drawable-hdpi/widget_2x_blue.png similarity index 100% rename from res/drawable-hdpi/widget_2x_blue.png rename to app/src/main/res/drawable-hdpi/widget_2x_blue.png diff --git a/res/drawable-hdpi/widget_2x_green.png b/app/src/main/res/drawable-hdpi/widget_2x_green.png similarity index 100% rename from res/drawable-hdpi/widget_2x_green.png rename to app/src/main/res/drawable-hdpi/widget_2x_green.png diff --git a/res/drawable-hdpi/widget_2x_red.png b/app/src/main/res/drawable-hdpi/widget_2x_red.png similarity index 100% rename from res/drawable-hdpi/widget_2x_red.png rename to app/src/main/res/drawable-hdpi/widget_2x_red.png diff --git a/res/drawable-hdpi/widget_2x_white.png b/app/src/main/res/drawable-hdpi/widget_2x_white.png similarity index 100% rename from res/drawable-hdpi/widget_2x_white.png rename to app/src/main/res/drawable-hdpi/widget_2x_white.png diff --git a/res/drawable-hdpi/widget_2x_yellow.png b/app/src/main/res/drawable-hdpi/widget_2x_yellow.png similarity index 100% rename from res/drawable-hdpi/widget_2x_yellow.png rename to app/src/main/res/drawable-hdpi/widget_2x_yellow.png diff --git a/res/drawable-hdpi/widget_4x_blue.png b/app/src/main/res/drawable-hdpi/widget_4x_blue.png similarity index 100% rename from res/drawable-hdpi/widget_4x_blue.png rename to app/src/main/res/drawable-hdpi/widget_4x_blue.png diff --git a/res/drawable-hdpi/widget_4x_green.png b/app/src/main/res/drawable-hdpi/widget_4x_green.png similarity index 100% rename from res/drawable-hdpi/widget_4x_green.png rename to app/src/main/res/drawable-hdpi/widget_4x_green.png diff --git a/res/drawable-hdpi/widget_4x_red.png b/app/src/main/res/drawable-hdpi/widget_4x_red.png similarity index 100% rename from res/drawable-hdpi/widget_4x_red.png rename to app/src/main/res/drawable-hdpi/widget_4x_red.png diff --git a/res/drawable-hdpi/widget_4x_white.png b/app/src/main/res/drawable-hdpi/widget_4x_white.png similarity index 100% rename from res/drawable-hdpi/widget_4x_white.png rename to app/src/main/res/drawable-hdpi/widget_4x_white.png diff --git a/res/drawable-hdpi/widget_4x_yellow.png b/app/src/main/res/drawable-hdpi/widget_4x_yellow.png similarity index 100% rename from res/drawable-hdpi/widget_4x_yellow.png rename to app/src/main/res/drawable-hdpi/widget_4x_yellow.png diff --git a/res/drawable/new_note.xml b/app/src/main/res/drawable/new_note.xml similarity index 100% rename from res/drawable/new_note.xml rename to app/src/main/res/drawable/new_note.xml diff --git a/res/layout/account_dialog_title.xml b/app/src/main/res/layout/account_dialog_title.xml similarity index 100% rename from res/layout/account_dialog_title.xml rename to app/src/main/res/layout/account_dialog_title.xml diff --git a/res/layout/add_account_text.xml b/app/src/main/res/layout/add_account_text.xml similarity index 100% rename from res/layout/add_account_text.xml rename to app/src/main/res/layout/add_account_text.xml diff --git a/res/layout/datetime_picker.xml b/app/src/main/res/layout/datetime_picker.xml similarity index 100% rename from res/layout/datetime_picker.xml rename to app/src/main/res/layout/datetime_picker.xml diff --git a/res/layout/dialog_edit_text.xml b/app/src/main/res/layout/dialog_edit_text.xml similarity index 100% rename from res/layout/dialog_edit_text.xml rename to app/src/main/res/layout/dialog_edit_text.xml diff --git a/res/layout/folder_list_item.xml b/app/src/main/res/layout/folder_list_item.xml similarity index 100% rename from res/layout/folder_list_item.xml rename to app/src/main/res/layout/folder_list_item.xml diff --git a/res/layout/note_edit.xml b/app/src/main/res/layout/note_edit.xml similarity index 100% rename from res/layout/note_edit.xml rename to app/src/main/res/layout/note_edit.xml diff --git a/res/layout/note_edit_list_item.xml b/app/src/main/res/layout/note_edit_list_item.xml similarity index 100% rename from res/layout/note_edit_list_item.xml rename to app/src/main/res/layout/note_edit_list_item.xml diff --git a/res/layout/note_item.xml b/app/src/main/res/layout/note_item.xml similarity index 100% rename from res/layout/note_item.xml rename to app/src/main/res/layout/note_item.xml diff --git a/res/layout/note_list.xml b/app/src/main/res/layout/note_list.xml similarity index 100% rename from res/layout/note_list.xml rename to app/src/main/res/layout/note_list.xml diff --git a/res/layout/note_list_dropdown_menu.xml b/app/src/main/res/layout/note_list_dropdown_menu.xml similarity index 100% rename from res/layout/note_list_dropdown_menu.xml rename to app/src/main/res/layout/note_list_dropdown_menu.xml diff --git a/res/layout/note_list_footer.xml b/app/src/main/res/layout/note_list_footer.xml similarity index 100% rename from res/layout/note_list_footer.xml rename to app/src/main/res/layout/note_list_footer.xml diff --git a/res/layout/settings_header.xml b/app/src/main/res/layout/settings_header.xml similarity index 100% rename from res/layout/settings_header.xml rename to app/src/main/res/layout/settings_header.xml diff --git a/res/layout/widget_2x.xml b/app/src/main/res/layout/widget_2x.xml similarity index 100% rename from res/layout/widget_2x.xml rename to app/src/main/res/layout/widget_2x.xml diff --git a/res/layout/widget_4x.xml b/app/src/main/res/layout/widget_4x.xml similarity index 100% rename from res/layout/widget_4x.xml rename to app/src/main/res/layout/widget_4x.xml diff --git a/res/menu/call_note_edit.xml b/app/src/main/res/menu/call_note_edit.xml similarity index 100% rename from res/menu/call_note_edit.xml rename to app/src/main/res/menu/call_note_edit.xml diff --git a/res/menu/call_record_folder.xml b/app/src/main/res/menu/call_record_folder.xml similarity index 100% rename from res/menu/call_record_folder.xml rename to app/src/main/res/menu/call_record_folder.xml diff --git a/res/menu/note_edit.xml b/app/src/main/res/menu/note_edit.xml similarity index 100% rename from res/menu/note_edit.xml rename to app/src/main/res/menu/note_edit.xml diff --git a/res/menu/note_list.xml b/app/src/main/res/menu/note_list.xml similarity index 100% rename from res/menu/note_list.xml rename to app/src/main/res/menu/note_list.xml diff --git a/res/menu/note_list_dropdown.xml b/app/src/main/res/menu/note_list_dropdown.xml similarity index 100% rename from res/menu/note_list_dropdown.xml rename to app/src/main/res/menu/note_list_dropdown.xml diff --git a/res/menu/note_list_options.xml b/app/src/main/res/menu/note_list_options.xml similarity index 100% rename from res/menu/note_list_options.xml rename to app/src/main/res/menu/note_list_options.xml diff --git a/res/menu/sub_folder.xml b/app/src/main/res/menu/sub_folder.xml similarity index 100% rename from res/menu/sub_folder.xml rename to app/src/main/res/menu/sub_folder.xml diff --git a/res/raw-zh-rCN/introduction b/app/src/main/res/raw-zh-rCN/introduction similarity index 100% rename from res/raw-zh-rCN/introduction rename to app/src/main/res/raw-zh-rCN/introduction diff --git a/res/raw/introduction b/app/src/main/res/raw/introduction similarity index 100% rename from res/raw/introduction rename to app/src/main/res/raw/introduction diff --git a/res/values-zh-rCN/arrays.xml b/app/src/main/res/values-zh-rCN/arrays.xml similarity index 100% rename from res/values-zh-rCN/arrays.xml rename to app/src/main/res/values-zh-rCN/arrays.xml diff --git a/res/values-zh-rCN/strings.xml b/app/src/main/res/values-zh-rCN/strings.xml similarity index 98% rename from res/values-zh-rCN/strings.xml rename to app/src/main/res/values-zh-rCN/strings.xml index 09f75ed..92a8a69 100644 --- a/res/values-zh-rCN/strings.xml +++ b/app/src/main/res/values-zh-rCN/strings.xml @@ -15,8 +15,7 @@ limitations under the License. --> - + 便签 便签2x2 便签4x4 diff --git a/res/values-zh-rTW/arrays.xml b/app/src/main/res/values-zh-rTW/arrays.xml similarity index 100% rename from res/values-zh-rTW/arrays.xml rename to app/src/main/res/values-zh-rTW/arrays.xml diff --git a/res/values-zh-rTW/strings.xml b/app/src/main/res/values-zh-rTW/strings.xml similarity index 98% rename from res/values-zh-rTW/strings.xml rename to app/src/main/res/values-zh-rTW/strings.xml index 3c41894..f913818 100644 --- a/res/values-zh-rTW/strings.xml +++ b/app/src/main/res/values-zh-rTW/strings.xml @@ -15,8 +15,7 @@ limitations under the License. --> - + 便簽 便簽2x2 便簽4x4 diff --git a/res/values/arrays.xml b/app/src/main/res/values/arrays.xml similarity index 100% rename from res/values/arrays.xml rename to app/src/main/res/values/arrays.xml diff --git a/res/values/colors.xml b/app/src/main/res/values/colors.xml similarity index 100% rename from res/values/colors.xml rename to app/src/main/res/values/colors.xml diff --git a/res/values/dimens.xml b/app/src/main/res/values/dimens.xml similarity index 100% rename from res/values/dimens.xml rename to app/src/main/res/values/dimens.xml diff --git a/res/values/strings.xml b/app/src/main/res/values/strings.xml similarity index 98% rename from res/values/strings.xml rename to app/src/main/res/values/strings.xml index 55df868..b78c5a4 100644 --- a/res/values/strings.xml +++ b/app/src/main/res/values/strings.xml @@ -15,8 +15,7 @@ limitations under the License. --> - + Notes Notes 2x2 Notes 4x4 diff --git a/res/values/styles.xml b/app/src/main/res/values/styles.xml similarity index 100% rename from res/values/styles.xml rename to app/src/main/res/values/styles.xml diff --git a/res/xml/preferences.xml b/app/src/main/res/xml/preferences.xml similarity index 100% rename from res/xml/preferences.xml rename to app/src/main/res/xml/preferences.xml diff --git a/res/xml/searchable.xml b/app/src/main/res/xml/searchable.xml similarity index 100% rename from res/xml/searchable.xml rename to app/src/main/res/xml/searchable.xml diff --git a/res/xml/widget_2x_info.xml b/app/src/main/res/xml/widget_2x_info.xml similarity index 100% rename from res/xml/widget_2x_info.xml rename to app/src/main/res/xml/widget_2x_info.xml diff --git a/res/xml/widget_4x_info.xml b/app/src/main/res/xml/widget_4x_info.xml similarity index 100% rename from res/xml/widget_4x_info.xml rename to app/src/main/res/xml/widget_4x_info.xml diff --git a/app/src/test/java/net/micode/notes/ExampleUnitTest.java b/app/src/test/java/net/micode/notes/ExampleUnitTest.java new file mode 100644 index 0000000..296adc2 --- /dev/null +++ b/app/src/test/java/net/micode/notes/ExampleUnitTest.java @@ -0,0 +1,17 @@ +package net.micode.notes; + +import org.junit.Test; + +import static org.junit.Assert.*; + +/** + * Example local unit test, which will execute on the development machine (host). + * + * @see Testing documentation + */ +public class ExampleUnitTest { + @Test + public void addition_isCorrect() { + assertEquals(4, 2 + 2); + } +} \ No newline at end of file diff --git a/build.gradle.kts b/build.gradle.kts new file mode 100644 index 0000000..11b0250 --- /dev/null +++ b/build.gradle.kts @@ -0,0 +1,4 @@ +// Top-level build file where you can add configuration options common to all sub-projects/modules. +plugins { + alias(libs.plugins.androidApplication) apply false +} diff --git a/doc/none.docx b/doc/none.docx deleted file mode 100644 index 0a6aad7..0000000 Binary files a/doc/none.docx and /dev/null differ diff --git a/gradle.properties b/gradle.properties new file mode 100644 index 0000000..621ae71 --- /dev/null +++ b/gradle.properties @@ -0,0 +1,25 @@ +# Project-wide Gradle settings. +# IDE (e.g. Android Studio) users: +# Gradle settings configured through the IDE *will override* +# any settings specified in this file. +# For more details on how to configure your build environment visit +# http://www.gradle.org/docs/current/userguide/build_environment.html +# Specifies the JVM arguments used for the daemon process. +# The setting is particularly useful for tweaking memory settings. +org.gradle.jvmargs=-Xmx2048m -Dfile.encoding=UTF-8 +# When configured, Gradle will run in incubating parallel mode. +# This option should only be used with decoupled projects. For more details, visit +# https://developer.android.com/r/tools/gradle-multi-project-decoupled-projects +# org.gradle.parallel=true +# AndroidX package structure to make it clearer which packages are bundled with the +# Android operating system, and which are packaged with your app's APK +# https://developer.android.com/topic/libraries/support-library/androidx-rn +android.useAndroidX=true +# Enables namespacing of each library's R class so that its R class includes only the +# resources declared in the library itself and none from the library's dependencies, +# thereby reducing the size of the R class for that library +android.nonTransitiveRClass=true +android.nonFinalResIds=false + + + diff --git a/gradle/libs.versions.toml b/gradle/libs.versions.toml new file mode 100644 index 0000000..f1ff4cf --- /dev/null +++ b/gradle/libs.versions.toml @@ -0,0 +1,18 @@ +[versions] +agp = "8.3.0" +junit = "4.13.2" +junitVersion = "1.1.5" +espressoCore = "3.5.1" +appcompat = "1.6.1" +material = "1.11.0" + +[libraries] +junit = { group = "junit", name = "junit", version.ref = "junit" } +ext-junit = { group = "androidx.test.ext", name = "junit", version.ref = "junitVersion" } +espresso-core = { group = "androidx.test.espresso", name = "espresso-core", version.ref = "espressoCore" } +appcompat = { group = "androidx.appcompat", name = "appcompat", version.ref = "appcompat" } +material = { group = "com.google.android.material", name = "material", version.ref = "material" } + +[plugins] +androidApplication = { id = "com.android.application", version.ref = "agp" } + diff --git a/gradle/wrapper/gradle-wrapper.jar b/gradle/wrapper/gradle-wrapper.jar new file mode 100644 index 0000000..e708b1c Binary files /dev/null and b/gradle/wrapper/gradle-wrapper.jar differ diff --git a/gradle/wrapper/gradle-wrapper.properties b/gradle/wrapper/gradle-wrapper.properties new file mode 100644 index 0000000..5c43cab --- /dev/null +++ b/gradle/wrapper/gradle-wrapper.properties @@ -0,0 +1,6 @@ +#Mon Apr 22 13:19:22 GMT+08:00 2024 +distributionBase=GRADLE_USER_HOME +distributionPath=wrapper/dists +distributionUrl=https\://services.gradle.org/distributions/gradle-8.4-bin.zip +zipStoreBase=GRADLE_USER_HOME +zipStorePath=wrapper/dists diff --git a/gradlew b/gradlew new file mode 100644 index 0000000..4f906e0 --- /dev/null +++ b/gradlew @@ -0,0 +1,185 @@ +#!/usr/bin/env sh + +# +# Copyright 2015 the original author or authors. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# + +############################################################################## +## +## Gradle start up script for UN*X +## +############################################################################## + +# Attempt to set APP_HOME +# Resolve links: $0 may be a link +PRG="$0" +# Need this for relative symlinks. +while [ -h "$PRG" ] ; do + ls=`ls -ld "$PRG"` + link=`expr "$ls" : '.*-> \(.*\)$'` + if expr "$link" : '/.*' > /dev/null; then + PRG="$link" + else + PRG=`dirname "$PRG"`"/$link" + fi +done +SAVED="`pwd`" +cd "`dirname \"$PRG\"`/" >/dev/null +APP_HOME="`pwd -P`" +cd "$SAVED" >/dev/null + +APP_NAME="Gradle" +APP_BASE_NAME=`basename "$0"` + +# Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. +DEFAULT_JVM_OPTS='"-Xmx64m" "-Xms64m"' + +# Use the maximum available, or set MAX_FD != -1 to use that value. +MAX_FD="maximum" + +warn () { + echo "$*" +} + +die () { + echo + echo "$*" + echo + exit 1 +} + +# OS specific support (must be 'true' or 'false'). +cygwin=false +msys=false +darwin=false +nonstop=false +case "`uname`" in + CYGWIN* ) + cygwin=true + ;; + Darwin* ) + darwin=true + ;; + MINGW* ) + msys=true + ;; + NONSTOP* ) + nonstop=true + ;; +esac + +CLASSPATH=$APP_HOME/gradle/wrapper/gradle-wrapper.jar + + +# Determine the Java command to use to start the JVM. +if [ -n "$JAVA_HOME" ] ; then + if [ -x "$JAVA_HOME/jre/sh/java" ] ; then + # IBM's JDK on AIX uses strange locations for the executables + JAVACMD="$JAVA_HOME/jre/sh/java" + else + JAVACMD="$JAVA_HOME/bin/java" + fi + if [ ! -x "$JAVACMD" ] ; then + die "ERROR: JAVA_HOME is set to an invalid directory: $JAVA_HOME + +Please set the JAVA_HOME variable in your environment to match the +location of your Java installation." + fi +else + JAVACMD="java" + which java >/dev/null 2>&1 || die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. + +Please set the JAVA_HOME variable in your environment to match the +location of your Java installation." +fi + +# Increase the maximum file descriptors if we can. +if [ "$cygwin" = "false" -a "$darwin" = "false" -a "$nonstop" = "false" ] ; then + MAX_FD_LIMIT=`ulimit -H -n` + if [ $? -eq 0 ] ; then + if [ "$MAX_FD" = "maximum" -o "$MAX_FD" = "max" ] ; then + MAX_FD="$MAX_FD_LIMIT" + fi + ulimit -n $MAX_FD + if [ $? -ne 0 ] ; then + warn "Could not set maximum file descriptor limit: $MAX_FD" + fi + else + warn "Could not query maximum file descriptor limit: $MAX_FD_LIMIT" + fi +fi + +# For Darwin, add options to specify how the application appears in the dock +if $darwin; then + GRADLE_OPTS="$GRADLE_OPTS \"-Xdock:name=$APP_NAME\" \"-Xdock:icon=$APP_HOME/media/gradle.icns\"" +fi + +# For Cygwin or MSYS, switch paths to Windows format before running java +if [ "$cygwin" = "true" -o "$msys" = "true" ] ; then + APP_HOME=`cygpath --path --mixed "$APP_HOME"` + CLASSPATH=`cygpath --path --mixed "$CLASSPATH"` + + JAVACMD=`cygpath --unix "$JAVACMD"` + + # We build the pattern for arguments to be converted via cygpath + ROOTDIRSRAW=`find -L / -maxdepth 1 -mindepth 1 -type d 2>/dev/null` + SEP="" + for dir in $ROOTDIRSRAW ; do + ROOTDIRS="$ROOTDIRS$SEP$dir" + SEP="|" + done + OURCYGPATTERN="(^($ROOTDIRS))" + # Add a user-defined pattern to the cygpath arguments + if [ "$GRADLE_CYGPATTERN" != "" ] ; then + OURCYGPATTERN="$OURCYGPATTERN|($GRADLE_CYGPATTERN)" + fi + # Now convert the arguments - kludge to limit ourselves to /bin/sh + i=0 + for arg in "$@" ; do + CHECK=`echo "$arg"|egrep -c "$OURCYGPATTERN" -` + CHECK2=`echo "$arg"|egrep -c "^-"` ### Determine if an option + + if [ $CHECK -ne 0 ] && [ $CHECK2 -eq 0 ] ; then ### Added a condition + eval `echo args$i`=`cygpath --path --ignore --mixed "$arg"` + else + eval `echo args$i`="\"$arg\"" + fi + i=`expr $i + 1` + done + case $i in + 0) set -- ;; + 1) set -- "$args0" ;; + 2) set -- "$args0" "$args1" ;; + 3) set -- "$args0" "$args1" "$args2" ;; + 4) set -- "$args0" "$args1" "$args2" "$args3" ;; + 5) set -- "$args0" "$args1" "$args2" "$args3" "$args4" ;; + 6) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" ;; + 7) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" ;; + 8) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" ;; + 9) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" "$args8" ;; + esac +fi + +# Escape application args +save () { + for i do printf %s\\n "$i" | sed "s/'/'\\\\''/g;1s/^/'/;\$s/\$/' \\\\/" ; done + echo " " +} +APP_ARGS=`save "$@"` + +# Collect all arguments for the java command, following the shell quoting and substitution rules +eval set -- $DEFAULT_JVM_OPTS $JAVA_OPTS $GRADLE_OPTS "\"-Dorg.gradle.appname=$APP_BASE_NAME\"" -classpath "\"$CLASSPATH\"" org.gradle.wrapper.GradleWrapperMain "$APP_ARGS" + +exec "$JAVACMD" "$@" diff --git a/gradlew.bat b/gradlew.bat new file mode 100644 index 0000000..107acd3 --- /dev/null +++ b/gradlew.bat @@ -0,0 +1,89 @@ +@rem +@rem Copyright 2015 the original author or authors. +@rem +@rem Licensed under the Apache License, Version 2.0 (the "License"); +@rem you may not use this file except in compliance with the License. +@rem You may obtain a copy of the License at +@rem +@rem https://www.apache.org/licenses/LICENSE-2.0 +@rem +@rem Unless required by applicable law or agreed to in writing, software +@rem distributed under the License is distributed on an "AS IS" BASIS, +@rem WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +@rem See the License for the specific language governing permissions and +@rem limitations under the License. +@rem + +@if "%DEBUG%" == "" @echo off +@rem ########################################################################## +@rem +@rem Gradle startup script for Windows +@rem +@rem ########################################################################## + +@rem Set local scope for the variables with windows NT shell +if "%OS%"=="Windows_NT" setlocal + +set DIRNAME=%~dp0 +if "%DIRNAME%" == "" set DIRNAME=. +set APP_BASE_NAME=%~n0 +set APP_HOME=%DIRNAME% + +@rem Resolve any "." and ".." in APP_HOME to make it shorter. +for %%i in ("%APP_HOME%") do set APP_HOME=%%~fi + +@rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. +set DEFAULT_JVM_OPTS="-Xmx64m" "-Xms64m" + +@rem Find java.exe +if defined JAVA_HOME goto findJavaFromJavaHome + +set JAVA_EXE=java.exe +%JAVA_EXE% -version >NUL 2>&1 +if "%ERRORLEVEL%" == "0" goto execute + +echo. +echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. +echo. +echo Please set the JAVA_HOME variable in your environment to match the +echo location of your Java installation. + +goto fail + +:findJavaFromJavaHome +set JAVA_HOME=%JAVA_HOME:"=% +set JAVA_EXE=%JAVA_HOME%/bin/java.exe + +if exist "%JAVA_EXE%" goto execute + +echo. +echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME% +echo. +echo Please set the JAVA_HOME variable in your environment to match the +echo location of your Java installation. + +goto fail + +:execute +@rem Setup the command line + +set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar + + +@rem Execute Gradle +"%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" org.gradle.wrapper.GradleWrapperMain %* + +:end +@rem End local scope for the variables with windows NT shell +if "%ERRORLEVEL%"=="0" goto mainEnd + +:fail +rem Set variable GRADLE_EXIT_CONSOLE if you need the _script_ return code instead of +rem the _cmd.exe /c_ return code! +if not "" == "%GRADLE_EXIT_CONSOLE%" exit 1 +exit /b 1 + +:mainEnd +if "%OS%"=="Windows_NT" endlocal + +:omega diff --git a/http/commons-codec-1.11.jar b/http/commons-codec-1.11.jar new file mode 100644 index 0000000..2245120 Binary files /dev/null and b/http/commons-codec-1.11.jar differ diff --git a/http/commons-logging-1.2.jar b/http/commons-logging-1.2.jar new file mode 100644 index 0000000..93a3b9f Binary files /dev/null and b/http/commons-logging-1.2.jar differ diff --git a/http/fluent-hc-4.5.14.jar b/http/fluent-hc-4.5.14.jar new file mode 100644 index 0000000..e89f593 Binary files /dev/null and b/http/fluent-hc-4.5.14.jar differ diff --git a/http/httpclient-4.5.14.jar b/http/httpclient-4.5.14.jar new file mode 100644 index 0000000..2bb7c07 Binary files /dev/null and b/http/httpclient-4.5.14.jar differ diff --git a/http/httpclient-cache-4.5.14.jar b/http/httpclient-cache-4.5.14.jar new file mode 100644 index 0000000..9a8ac70 Binary files /dev/null and b/http/httpclient-cache-4.5.14.jar differ diff --git a/http/httpclient-win-4.5.14.jar b/http/httpclient-win-4.5.14.jar new file mode 100644 index 0000000..66c75aa Binary files /dev/null and b/http/httpclient-win-4.5.14.jar differ diff --git a/http/httpcore-4.4.16.jar b/http/httpcore-4.4.16.jar new file mode 100644 index 0000000..aed581e Binary files /dev/null and b/http/httpcore-4.4.16.jar differ diff --git a/http/httpmime-4.5.14.jar b/http/httpmime-4.5.14.jar new file mode 100644 index 0000000..331e95c Binary files /dev/null and b/http/httpmime-4.5.14.jar differ diff --git a/http/jna-4.5.2.jar b/http/jna-4.5.2.jar new file mode 100644 index 0000000..78e2058 Binary files /dev/null and b/http/jna-4.5.2.jar differ diff --git a/http/jna-platform-4.5.2.jar b/http/jna-platform-4.5.2.jar new file mode 100644 index 0000000..aa34419 Binary files /dev/null and b/http/jna-platform-4.5.2.jar differ diff --git a/settings.gradle.kts b/settings.gradle.kts new file mode 100644 index 0000000..e03b080 --- /dev/null +++ b/settings.gradle.kts @@ -0,0 +1,23 @@ +pluginManagement { + repositories { + google { + content { + includeGroupByRegex("com\\.android.*") + includeGroupByRegex("com\\.google.*") + includeGroupByRegex("androidx.*") + } + } + mavenCentral() + gradlePluginPortal() + } +} +dependencyResolutionManagement { + repositoriesMode.set(RepositoriesMode.FAIL_ON_PROJECT_REPOS) + repositories { + google() + mavenCentral() + } +} + +rootProject.name = "miCode" +include(":app")