-
-
\ No newline at end of file
diff --git a/.idea/vcs.xml b/.idea/vcs.xml
deleted file mode 100644
index d843f34..0000000
--- a/.idea/vcs.xml
+++ /dev/null
@@ -1,4 +0,0 @@
-
-
-
-
\ No newline at end of file
diff --git a/.vscode/settings.json b/.vscode/settings.json
new file mode 100644
index 0000000..c5f3f6b
--- /dev/null
+++ b/.vscode/settings.json
@@ -0,0 +1,3 @@
+{
+ "java.configuration.updateBuildConfiguration": "interactive"
+}
\ No newline at end of file
diff --git a/NOTICE b/NOTICE
deleted file mode 100644
index 9a54521..0000000
--- a/NOTICE
+++ /dev/null
@@ -1,190 +0,0 @@
-
- Copyright (c) 2010-2011, The MiCode Open Source Community (www.micode.net)
-
- Licensed under the Apache License, Version 2.0 (the "License");
- you may not use this file except in compliance with the License.
-
- 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.
-
-
- Apache License
- Version 2.0, January 2004
- http://www.apache.org/licenses/
-
- TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
-
- 1. Definitions.
-
- "License" shall mean the terms and conditions for use, reproduction,
- and distribution as defined by Sections 1 through 9 of this document.
-
- "Licensor" shall mean the copyright owner or entity authorized by
- the copyright owner that is granting the License.
-
- "Legal Entity" shall mean the union of the acting entity and all
- other entities that control, are controlled by, or are under common
- control with that entity. For the purposes of this definition,
- "control" means (i) the power, direct or indirect, to cause the
- direction or management of such entity, whether by contract or
- otherwise, or (ii) ownership of fifty percent (50%) or more of the
- outstanding shares, or (iii) beneficial ownership of such entity.
-
- "You" (or "Your") shall mean an individual or Legal Entity
- exercising permissions granted by this License.
-
- "Source" form shall mean the preferred form for making modifications,
- including but not limited to software source code, documentation
- source, and configuration files.
-
- "Object" form shall mean any form resulting from mechanical
- transformation or translation of a Source form, including but
- not limited to compiled object code, generated documentation,
- and conversions to other media types.
-
- "Work" shall mean the work of authorship, whether in Source or
- Object form, made available under the License, as indicated by a
- copyright notice that is included in or attached to the work
- (an example is provided in the Appendix below).
-
- "Derivative Works" shall mean any work, whether in Source or Object
- form, that is based on (or derived from) the Work and for which the
- editorial revisions, annotations, elaborations, or other modifications
- represent, as a whole, an original work of authorship. For the purposes
- of this License, Derivative Works shall not include works that remain
- separable from, or merely link (or bind by name) to the interfaces of,
- the Work and Derivative Works thereof.
-
- "Contribution" shall mean any work of authorship, including
- the original version of the Work and any modifications or additions
- to that Work or Derivative Works thereof, that is intentionally
- submitted to Licensor for inclusion in the Work by the copyright owner
- or by an individual or Legal Entity authorized to submit on behalf of
- the copyright owner. For the purposes of this definition, "submitted"
- means any form of electronic, verbal, or written communication sent
- to the Licensor or its representatives, including but not limited to
- communication on electronic mailing lists, source code control systems,
- and issue tracking systems that are managed by, or on behalf of, the
- Licensor for the purpose of discussing and improving the Work, but
- excluding communication that is conspicuously marked or otherwise
- designated in writing by the copyright owner as "Not a Contribution."
-
- "Contributor" shall mean Licensor and any individual or Legal Entity
- on behalf of whom a Contribution has been received by Licensor and
- subsequently incorporated within the Work.
-
- 2. Grant of Copyright License. Subject to the terms and conditions of
- this License, each Contributor hereby grants to You a perpetual,
- worldwide, non-exclusive, no-charge, royalty-free, irrevocable
- copyright license to reproduce, prepare Derivative Works of,
- publicly display, publicly perform, sublicense, and distribute the
- Work and such Derivative Works in Source or Object form.
-
- 3. Grant of Patent License. Subject to the terms and conditions of
- this License, each Contributor hereby grants to You a perpetual,
- worldwide, non-exclusive, no-charge, royalty-free, irrevocable
- (except as stated in this section) patent license to make, have made,
- use, offer to sell, sell, import, and otherwise transfer the Work,
- where such license applies only to those patent claims licensable
- by such Contributor that are necessarily infringed by their
- Contribution(s) alone or by combination of their Contribution(s)
- with the Work to which such Contribution(s) was submitted. If You
- institute patent litigation against any entity (including a
- cross-claim or counterclaim in a lawsuit) alleging that the Work
- or a Contribution incorporated within the Work constitutes direct
- or contributory patent infringement, then any patent licenses
- granted to You under this License for that Work shall terminate
- as of the date such litigation is filed.
-
- 4. Redistribution. You may reproduce and distribute copies of the
- Work or Derivative Works thereof in any medium, with or without
- modifications, and in Source or Object form, provided that You
- meet the following conditions:
-
- (a) You must give any other recipients of the Work or
- Derivative Works a copy of this License; and
-
- (b) You must cause any modified files to carry prominent notices
- stating that You changed the files; and
-
- (c) You must retain, in the Source form of any Derivative Works
- that You distribute, all copyright, patent, trademark, and
- attribution notices from the Source form of the Work,
- excluding those notices that do not pertain to any part of
- the Derivative Works; and
-
- (d) If the Work includes a "NOTICE" text file as part of its
- distribution, then any Derivative Works that You distribute must
- include a readable copy of the attribution notices contained
- within such NOTICE file, excluding those notices that do not
- pertain to any part of the Derivative Works, in at least one
- of the following places: within a NOTICE text file distributed
- as part of the Derivative Works; within the Source form or
- documentation, if provided along with the Derivative Works; or,
- within a display generated by the Derivative Works, if and
- wherever such third-party notices normally appear. The contents
- of the NOTICE file are for informational purposes only and
- do not modify the License. You may add Your own attribution
- notices within Derivative Works that You distribute, alongside
- or as an addendum to the NOTICE text from the Work, provided
- that such additional attribution notices cannot be construed
- as modifying the License.
-
- You may add Your own copyright statement to Your modifications and
- may provide additional or different license terms and conditions
- for use, reproduction, or distribution of Your modifications, or
- for any such Derivative Works as a whole, provided Your use,
- reproduction, and distribution of the Work otherwise complies with
- the conditions stated in this License.
-
- 5. Submission of Contributions. Unless You explicitly state otherwise,
- any Contribution intentionally submitted for inclusion in the Work
- by You to the Licensor shall be under the terms and conditions of
- this License, without any additional terms or conditions.
- Notwithstanding the above, nothing herein shall supersede or modify
- the terms of any separate license agreement you may have executed
- with Licensor regarding such Contributions.
-
- 6. Trademarks. This License does not grant permission to use the trade
- names, trademarks, service marks, or product names of the Licensor,
- except as required for reasonable and customary use in describing the
- origin of the Work and reproducing the content of the NOTICE file.
-
- 7. Disclaimer of Warranty. Unless required by applicable law or
- agreed to in writing, Licensor provides the Work (and each
- Contributor provides its Contributions) on an "AS IS" BASIS,
- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
- implied, including, without limitation, any warranties or conditions
- of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
- PARTICULAR PURPOSE. You are solely responsible for determining the
- appropriateness of using or redistributing the Work and assume any
- risks associated with Your exercise of permissions under this License.
-
- 8. Limitation of Liability. In no event and under no legal theory,
- whether in tort (including negligence), contract, or otherwise,
- unless required by applicable law (such as deliberate and grossly
- negligent acts) or agreed to in writing, shall any Contributor be
- liable to You for damages, including any direct, indirect, special,
- incidental, or consequential damages of any character arising as a
- result of this License or out of the use or inability to use the
- Work (including but not limited to damages for loss of goodwill,
- work stoppage, computer failure or malfunction, or any and all
- other commercial damages or losses), even if such Contributor
- has been advised of the possibility of such damages.
-
- 9. Accepting Warranty or Additional Liability. While redistributing
- the Work or Derivative Works thereof, You may choose to offer,
- and charge a fee for, acceptance of support, warranty, indemnity,
- or other liability obligations and/or rights consistent with this
- License. However, in accepting such obligations, You may act only
- on Your own behalf and on Your sole responsibility, not on behalf
- of any other Contributor, and only if You agree to indemnify,
- defend, and hold each Contributor harmless for any liability
- incurred by, or claims asserted against, such Contributor by reason
- of your accepting any such warranty or additional liability.
-
- END OF TERMS AND CONDITIONS
-
diff --git a/README b/README
deleted file mode 100644
index fc0d824..0000000
--- a/README
+++ /dev/null
@@ -1,23 +0,0 @@
-[中文]
-
-1. MiCode便签是小米便签的社区开源版,由MIUI团队(www.miui.com) 发起并贡献第一批代码,遵循NOTICE文件所描述的开源协议,
- 今后为MiCode社区(www.micode.net) 拥有,并由社区发布和维护。
-
-2. Bug反馈和跟踪,请访问Github,
- https://github.com/MiCode/Notes/issues?sort=created&direction=desc&state=open
-
-3. 功能建议和综合讨论,请访问MiCode,
- http://micode.net/forum.php?mod=forumdisplay&fid=38
-
-
-[English]
-
-1. MiCode Notes is open source edition of XM notepad, it's first initiated and sponsored by MIUI team (www.miui.com).
- It's opened under license described by NOTICE file. It's owned by the MiCode community (www.micode.net). In future,
- the MiCode community will release and maintain this project.
-
-2. Regarding issue tracking, please visit Github,
- https://github.com/MiCode/Notes/issues?sort=created&direction=desc&state=open
-
-3. Regarding feature request and general discussion, please visit Micode forum,
- http://micode.net/forum.php?mod=forumdisplay&fid=38
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..d23a164
--- /dev/null
+++ b/app/build.gradle.kts
@@ -0,0 +1,73 @@
+plugins {
+ alias(libs.plugins.android.application)
+}
+
+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"
+ }
+
+ flavorDimensions += "device"
+ productFlavors {
+ create("phone") {
+ dimension = "device"
+ applicationIdSuffix = ".phone"
+ versionNameSuffix = "-phone"
+ }
+ }
+
+ buildTypes {
+ release {
+ isMinifyEnabled = false
+ proguardFiles(
+ getDefaultProguardFile("proguard-android-optimize.txt"),
+ "proguard-rules.pro"
+ )
+ }
+ }
+ compileOptions {
+ sourceCompatibility = JavaVersion.VERSION_1_8
+ targetCompatibility = JavaVersion.VERSION_1_8
+ }
+
+ packaging {
+ resources {
+ excludes += "/META-INF/{AL2.0,LGPL2.1}"
+ excludes += "META-INF/DEPENDENCIES"
+ excludes += "META-INF/LICENSE"
+ excludes += "META-INF/LICENSE.txt"
+ excludes += "META-INF/license.txt"
+ excludes += "META-INF/NOTICE"
+ excludes += "META-INF/NOTICE.txt"
+ excludes += "META-INF/notice.txt"
+ excludes += "META-INF/ASL2.0"
+ }
+ }
+}
+
+dependencies {
+ implementation(libs.appcompat)
+ implementation(libs.material)
+ implementation(libs.activity)
+ implementation(libs.constraintlayout)
+
+ // OkHttp dependencies
+ implementation("com.squareup.okhttp3:okhttp:3.14.9") {
+ exclude(group = "org.bouncycastle", module = "bcprov-jdk15on")
+ exclude(group = "org.bouncycastle", module = "bcpkix-jdk15on")
+ }
+ implementation("com.squareup.okio:okio:1.17.5")
+
+ 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 95%
rename from AndroidManifest.xml
rename to app/src/main/AndroidManifest.xml
index 3dd5709..37ae826 100644
--- a/AndroidManifest.xml
+++ b/app/src/main/AndroidManifest.xml
@@ -1,156 +1,155 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- >
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/app/src/main/java/net/micode/notes/MainActivity.java b/app/src/main/java/net/micode/notes/MainActivity.java
new file mode 100644
index 0000000..8091753
--- /dev/null
+++ b/app/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/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 84%
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..f5b5a7e 100644
--- a/src/net/micode/notes/gtask/remote/GTaskASyncTask.java
+++ b/app/src/main/java/net/micode/notes/gtask/remote/GTaskASyncTask.java
@@ -1,4 +1,3 @@
-
/*
* Copyright (c) 2010-2011, The MiCode Open Source Community (www.micode.net)
*
@@ -64,22 +63,26 @@ 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;
+ Notification.Builder builder = new Notification.Builder(mContext)
+ .setSmallIcon(R.drawable.notification)
+ .setTicker(mContext.getString(tickerId))
+ .setWhen(System.currentTimeMillis())
+ .setDefaults(Notification.DEFAULT_LIGHTS)
+ .setAutoCancel(true)
+ .setContentTitle(mContext.getString(R.string.app_name))
+ .setContentText(content);
+
PendingIntent pendingIntent;
if (tickerId != R.string.ticker_success) {
pendingIntent = PendingIntent.getActivity(mContext, 0, new Intent(mContext,
- NotesPreferenceActivity.class), 0);
-
+ NotesPreferenceActivity.class), PendingIntent.FLAG_IMMUTABLE);
} else {
pendingIntent = PendingIntent.getActivity(mContext, 0, new Intent(mContext,
- NotesListActivity.class), 0);
+ NotesListActivity.class), PendingIntent.FLAG_IMMUTABLE);
}
- notification.setLatestEventInfo(mContext, mContext.getString(R.string.app_name), content,
- pendingIntent);
- mNotifiManager.notify(GTASK_SYNC_NOTIFICATION_ID, notification);
+ builder.setContentIntent(pendingIntent);
+
+ mNotifiManager.notify(GTASK_SYNC_NOTIFICATION_ID, builder.build());
}
@Override
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 84%
rename from src/net/micode/notes/gtask/remote/GTaskClient.java
rename to app/src/main/java/net/micode/notes/gtask/remote/GTaskClient.java
index c67dfdf..9d7f0f9 100644
--- a/src/net/micode/notes/gtask/remote/GTaskClient.java
+++ b/app/src/main/java/net/micode/notes/gtask/remote/GTaskClient.java
@@ -32,20 +32,6 @@ import net.micode.notes.gtask.exception.NetworkFailureException;
import net.micode.notes.tool.GTaskStringUtils;
import net.micode.notes.ui.NotesPreferenceActivity;
-import org.apache.http.HttpEntity;
-import org.apache.http.HttpResponse;
-import org.apache.http.client.ClientProtocolException;
-import org.apache.http.client.entity.UrlEncodedFormEntity;
-import org.apache.http.client.methods.HttpGet;
-import org.apache.http.client.methods.HttpPost;
-import org.apache.http.cookie.Cookie;
-import org.apache.http.impl.client.BasicCookieStore;
-import org.apache.http.impl.client.DefaultHttpClient;
-import org.apache.http.message.BasicNameValuePair;
-import org.apache.http.params.BasicHttpParams;
-import org.apache.http.params.HttpConnectionParams;
-import org.apache.http.params.HttpParams;
-import org.apache.http.params.HttpProtocolParams;
import org.json.JSONArray;
import org.json.JSONException;
import org.json.JSONObject;
@@ -54,12 +40,25 @@ import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStream;
import java.io.InputStreamReader;
-import java.util.LinkedList;
+import java.util.ArrayList;
import java.util.List;
+import java.util.concurrent.TimeUnit;
import java.util.zip.GZIPInputStream;
import java.util.zip.Inflater;
import java.util.zip.InflaterInputStream;
+import okhttp3.Call;
+import okhttp3.Callback;
+import okhttp3.Cookie;
+import okhttp3.CookieJar;
+import okhttp3.FormBody;
+import okhttp3.HttpUrl;
+import okhttp3.MediaType;
+import okhttp3.OkHttpClient;
+import okhttp3.Request;
+import okhttp3.RequestBody;
+import okhttp3.Response;
+import okhttp3.ResponseBody;
public class GTaskClient {
private static final String TAG = GTaskClient.class.getSimpleName();
@@ -72,7 +71,7 @@ public class GTaskClient {
private static GTaskClient mInstance = null;
- private DefaultHttpClient mHttpClient;
+ private OkHttpClient mHttpClient;
private String mGetUrl;
@@ -91,7 +90,23 @@ public class GTaskClient {
private JSONArray mUpdateArray;
private GTaskClient() {
- mHttpClient = null;
+ mHttpClient = new OkHttpClient.Builder()
+ .connectTimeout(10, TimeUnit.SECONDS)
+ .readTimeout(15, TimeUnit.SECONDS)
+ .cookieJar(new CookieJar() {
+ private final List cookies = new ArrayList<>();
+
+ @Override
+ public void saveFromResponse(HttpUrl url, List cookies) {
+ this.cookies.addAll(cookies);
+ }
+
+ @Override
+ public List loadForRequest(HttpUrl url) {
+ return cookies;
+ }
+ })
+ .build();
mGetUrl = GTASK_GET_URL;
mPostUrl = GTASK_POST_URL;
mClientVersion = -1;
@@ -228,26 +243,23 @@ public class GTaskClient {
private boolean loginGtask(String authToken) {
int timeoutConnection = 10000;
int timeoutSocket = 15000;
- HttpParams httpParameters = new BasicHttpParams();
- HttpConnectionParams.setConnectionTimeout(httpParameters, timeoutConnection);
- HttpConnectionParams.setSoTimeout(httpParameters, timeoutSocket);
- mHttpClient = new DefaultHttpClient(httpParameters);
- BasicCookieStore localBasicCookieStore = new BasicCookieStore();
- mHttpClient.setCookieStore(localBasicCookieStore);
- HttpProtocolParams.setUseExpectContinue(mHttpClient.getParams(), false);
+ OkHttpClient.Builder builder = new OkHttpClient.Builder();
+ builder.connectTimeout(timeoutConnection, TimeUnit.MILLISECONDS);
+ builder.readTimeout(timeoutSocket, TimeUnit.MILLISECONDS);
+ mHttpClient = builder.build();
// login gtask
try {
- String loginUrl = mGetUrl + "?auth=" + authToken;
- HttpGet httpGet = new HttpGet(loginUrl);
- HttpResponse response = null;
- response = mHttpClient.execute(httpGet);
+ Request request = new Request.Builder()
+ .url(mGetUrl + "?auth=" + authToken)
+ .build();
+ Response response = mHttpClient.newCall(request).execute();
// get the cookie now
- List cookies = mHttpClient.getCookieStore().getCookies();
+ List cookies = mHttpClient.cookieJar().loadForRequest(request.url());
boolean hasAuthCookie = false;
for (Cookie cookie : cookies) {
- if (cookie.getName().contains("GTL")) {
+ if (cookie.name().contains("GTL")) {
hasAuthCookie = true;
}
}
@@ -256,7 +268,7 @@ public class GTaskClient {
}
// get the client version
- String resString = getResponseContent(response.getEntity());
+ String resString = getResponseContent(response.body().byteStream());
String jsBegin = "_setup(";
String jsEnd = ")}";
int begin = resString.indexOf(jsBegin);
@@ -284,26 +296,27 @@ public class GTaskClient {
return mActionId++;
}
- private HttpPost createHttpPost() {
- HttpPost httpPost = new HttpPost(mPostUrl);
- httpPost.setHeader("Content-Type", "application/x-www-form-urlencoded;charset=utf-8");
- httpPost.setHeader("AT", "1");
- return httpPost;
+ private Request createRequest() {
+ Request.Builder builder = new Request.Builder()
+ .url(mPostUrl)
+ .addHeader("Content-Type", "application/x-www-form-urlencoded;charset=utf-8")
+ .addHeader("AT", "1");
+ return builder.build();
}
- private String getResponseContent(HttpEntity entity) throws IOException {
+ private String getResponseContent(InputStream inputStream) throws IOException {
String contentEncoding = null;
- if (entity.getContentEncoding() != null) {
- contentEncoding = entity.getContentEncoding().getValue();
+ if (inputStream != null) {
+ contentEncoding = inputStream.toString();
Log.d(TAG, "encoding: " + contentEncoding);
}
- InputStream input = entity.getContent();
+ InputStream input = inputStream;
if (contentEncoding != null && contentEncoding.equalsIgnoreCase("gzip")) {
- input = new GZIPInputStream(entity.getContent());
+ input = new GZIPInputStream(inputStream);
} else if (contentEncoding != null && contentEncoding.equalsIgnoreCase("deflate")) {
Inflater inflater = new Inflater(true);
- input = new InflaterInputStream(entity.getContent(), inflater);
+ input = new InflaterInputStream(inputStream, inflater);
}
try {
@@ -329,22 +342,18 @@ public class GTaskClient {
throw new ActionFailureException("not logged in");
}
- HttpPost httpPost = createHttpPost();
+ Request request = createRequest();
+ RequestBody body = new FormBody.Builder()
+ .add("r", js.toString())
+ .build();
+ Request postRequest = request.newBuilder()
+ .post(body)
+ .build();
+
try {
- LinkedList list = new LinkedList();
- list.add(new BasicNameValuePair("r", js.toString()));
- UrlEncodedFormEntity entity = new UrlEncodedFormEntity(list, "UTF-8");
- httpPost.setEntity(entity);
-
- // execute the post
- HttpResponse response = mHttpClient.execute(httpPost);
- String jsString = getResponseContent(response.getEntity());
+ Response response = mHttpClient.newCall(postRequest).execute();
+ String jsString = getResponseContent(response.body().byteStream());
return new JSONObject(jsString);
-
- } catch (ClientProtocolException e) {
- Log.e(TAG, e.toString());
- e.printStackTrace();
- throw new NetworkFailureException("postRequest failed");
} catch (IOException e) {
Log.e(TAG, e.toString());
e.printStackTrace();
@@ -516,12 +525,13 @@ public class GTaskClient {
}
try {
- HttpGet httpGet = new HttpGet(mGetUrl);
- HttpResponse response = null;
- response = mHttpClient.execute(httpGet);
+ Request request = new Request.Builder()
+ .url(mGetUrl)
+ .build();
+ Response response = mHttpClient.newCall(request).execute();
// get the task list
- String resString = getResponseContent(response.getEntity());
+ String resString = getResponseContent(response.body().byteStream());
String jsBegin = "_setup(";
String jsEnd = ")}";
int begin = resString.indexOf(jsBegin);
@@ -532,10 +542,6 @@ public class GTaskClient {
}
JSONObject js = new JSONObject(jsString);
return js.getJSONObject("t").getJSONArray(GTaskStringUtils.GTASK_JSON_LISTS);
- } catch (ClientProtocolException e) {
- Log.e(TAG, e.toString());
- e.printStackTrace();
- throw new NetworkFailureException("gettasklists: httpget failed");
} catch (IOException e) {
Log.e(TAG, e.toString());
e.printStackTrace();
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 100%
rename from src/net/micode/notes/ui/DateTimePicker.java
rename to app/src/main/java/net/micode/notes/ui/DateTimePicker.java
diff --git a/src/net/micode/notes/ui/DateTimePickerDialog.java b/app/src/main/java/net/micode/notes/ui/DateTimePickerDialog.java
similarity index 100%
rename from src/net/micode/notes/ui/DateTimePickerDialog.java
rename to app/src/main/java/net/micode/notes/ui/DateTimePickerDialog.java
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..ecf5cd5 100644
--- a/src/net/micode/notes/ui/NoteEditActivity.java
+++ b/app/src/main/java/net/micode/notes/ui/NoteEditActivity.java
@@ -507,50 +507,48 @@ public class NoteEditActivity extends Activity implements OnClickListener,
@Override
public boolean onOptionsItemSelected(MenuItem item) {
- switch (item.getItemId()) {
- case 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;
+ int id = item.getItemId();
+ if (id == R.id.menu_new_note) {
+ createNewNote();
+ return true;
+ } else if (id == 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();
+ return true;
+ } else if (id == R.id.menu_font_size) {
+ mFontSizeSelector.setVisibility(View.VISIBLE);
+ findViewById(sFontSelectorSelectionMap.get(mFontSizeId)).setVisibility(View.VISIBLE);
+ return true;
+ } else if (id == R.id.menu_list_mode) {
+ mWorkingNote.setCheckListMode(mWorkingNote.getCheckListMode() == 0 ?
+ TextNote.MODE_CHECK_LIST : 0);
+ return true;
+ } else if (id == R.id.menu_share) {
+ getWorkingText();
+ sendTo(this, mWorkingNote.getContent());
+ return true;
+ } else if (id == R.id.menu_send_to_desktop) {
+ sendToDesktop();
+ return true;
+ } else if (id == R.id.menu_alert) {
+ setReminder();
+ return true;
+ } else if (id == R.id.menu_delete_remind) {
+ mWorkingNote.setAlertDate(0, false);
+ return true;
}
- return true;
+ return super.onOptionsItemSelected(item);
}
private void setReminder() {
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 86%
rename from src/net/micode/notes/ui/NotesListActivity.java
rename to app/src/main/java/net/micode/notes/ui/NotesListActivity.java
index e843aec..f1270ea 100644
--- a/src/net/micode/notes/ui/NotesListActivity.java
+++ b/app/src/main/java/net/micode/notes/ui/NotesListActivity.java
@@ -319,88 +319,68 @@ 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;
+ int id = item.getItemId();
+ if (id == 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();
+ return true;
+ } else if (id == R.id.move) {
+ startQueryDestinationFolders();
+ return true;
}
- return true;
+ return false;
}
}
private class NewNoteOnTouchListener implements OnTouchListener {
public boolean onTouch(View v, MotionEvent event) {
- switch (event.getAction()) {
- case MotionEvent.ACTION_DOWN: {
- Display display = getWindowManager().getDefaultDisplay();
- int screenHeight = display.getHeight();
- int newNoteViewHeight = mAddNewNote.getHeight();
- int start = screenHeight - newNoteViewHeight;
- int eventY = start + (int) event.getY();
- /**
- * Minus TitleBar's height
- */
- if (mState == ListEditState.SUB_FOLDER) {
- eventY -= mTitleBar.getHeight();
- start -= mTitleBar.getHeight();
- }
- /**
- * HACKME:When click the transparent part of "New Note" button, dispatch
- * the event to the list view behind this button. The transparent part of
- * "New Note" button could be expressed by formula y=-0.12x+94(Unit:pixel)
- * and the line top of the button. The coordinate based on left of the "New
- * Note" button. The 94 represents maximum height of the transparent part.
- * Notice that, if the background of the button changes, the formula should
- * also change. This is very bad, just for the UI designer's strong requirement.
- */
- if (event.getY() < (event.getX() * (-0.12) + 94)) {
- View view = mNotesListView.getChildAt(mNotesListView.getChildCount() - 1
- - mNotesListView.getFooterViewsCount());
- if (view != null && view.getBottom() > start
- && (view.getTop() < (start + 94))) {
- mOriginY = (int) event.getY();
- mDispatchY = eventY;
- event.setLocation(event.getX(), mDispatchY);
- mDispatch = true;
- return mNotesListView.dispatchTouchEvent(event);
- }
- }
- break;
+ int action = event.getAction();
+ if (action == MotionEvent.ACTION_DOWN) {
+ Display display = getWindowManager().getDefaultDisplay();
+ int screenHeight = display.getHeight();
+ int newNoteViewHeight = mAddNewNote.getHeight();
+ int start = screenHeight - newNoteViewHeight;
+ int eventY = start + (int) event.getY();
+ if (mState == ListEditState.SUB_FOLDER) {
+ eventY -= mTitleBar.getHeight();
+ start -= mTitleBar.getHeight();
}
- case MotionEvent.ACTION_MOVE: {
- if (mDispatch) {
- mDispatchY += (int) event.getY() - mOriginY;
+ if (event.getY() < (event.getX() * (-0.12) + 94)) {
+ View view = mNotesListView.getChildAt(mNotesListView.getChildCount() - 1
+ - mNotesListView.getFooterViewsCount());
+ if (view != null && view.getBottom() > start
+ && (view.getTop() < (start + 94))) {
+ mOriginY = (int) event.getY();
+ mDispatchY = eventY;
event.setLocation(event.getX(), mDispatchY);
+ mDispatch = true;
return mNotesListView.dispatchTouchEvent(event);
}
- break;
}
- default: {
- if (mDispatch) {
- event.setLocation(event.getX(), mDispatchY);
- mDispatch = false;
- return mNotesListView.dispatchTouchEvent(event);
- }
- break;
+ } else if (action == MotionEvent.ACTION_MOVE) {
+ if (mDispatch) {
+ mDispatchY += (int) event.getY() - mOriginY;
+ event.setLocation(event.getX(), mDispatchY);
+ return mNotesListView.dispatchTouchEvent(event);
+ }
+ } else {
+ if (mDispatch) {
+ event.setLocation(event.getX(), mDispatchY);
+ mDispatch = false;
+ return mNotesListView.dispatchTouchEvent(event);
}
}
return false;
@@ -558,12 +538,9 @@ public class NotesListActivity extends Activity implements OnClickListener, OnIt
}
public void onClick(View v) {
- switch (v.getId()) {
- case R.id.btn_new_note:
- createNewNote();
- break;
- default:
- break;
+ int id = v.getId();
+ if (id == R.id.btn_new_note) {
+ createNewNote();
}
}
@@ -780,42 +757,27 @@ public class NotesListActivity extends Activity implements OnClickListener, OnIt
@Override
public boolean onOptionsItemSelected(MenuItem item) {
- switch (item.getItemId()) {
- case R.id.menu_new_folder: {
- showCreateOrModifyFolderDialog(true);
- break;
- }
- case R.id.menu_export_text: {
- exportNoteToText();
- break;
- }
- case R.id.menu_sync: {
- if (isSyncMode()) {
- if (TextUtils.equals(item.getTitle(), getString(R.string.menu_sync))) {
- GTaskSyncService.startSync(this);
- } else {
- GTaskSyncService.cancelSync(this);
- }
- } else {
- startPreferenceActivity();
- }
- break;
- }
- case R.id.menu_setting: {
- startPreferenceActivity();
- break;
- }
- case R.id.menu_new_note: {
- createNewNote();
- break;
- }
- case R.id.menu_search:
- onSearchRequested();
- break;
- default:
- break;
+ int id = item.getItemId();
+ if (id == R.id.menu_new_folder) {
+ showCreateOrModifyFolderDialog(true);
+ return true;
+ } else if (id == R.id.menu_export_text) {
+ exportNoteToText();
+ return true;
+ } else if (id == R.id.menu_sync) {
+ showSyncDialog();
+ return true;
+ } else if (id == R.id.menu_setting) {
+ startPreferenceActivity();
+ return true;
+ } else if (id == R.id.menu_new_note) {
+ createNewNote();
+ return true;
+ } else if (id == R.id.menu_search) {
+ onSearchRequested();
+ return true;
}
- return true;
+ return super.onOptionsItemSelected(item);
}
@Override
@@ -951,4 +913,12 @@ public class NotesListActivity extends Activity implements OnClickListener, OnIt
}
return false;
}
+
+ private void showSyncDialog() {
+ if (GTaskSyncService.isSyncing()) {
+ GTaskSyncService.cancelSync(this);
+ } else {
+ GTaskSyncService.startSync(this);
+ }
+ }
}
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 100%
rename from src/net/micode/notes/ui/NotesPreferenceActivity.java
rename to app/src/main/java/net/micode/notes/ui/NotesPreferenceActivity.java
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/ic_launcher_background.xml b/app/src/main/res/drawable/ic_launcher_background.xml
similarity index 100%
rename from res/drawable/ic_launcher_background.xml
rename to app/src/main/res/drawable/ic_launcher_background.xml
diff --git a/res/drawable/ic_launcher_foreground.xml b/app/src/main/res/drawable/ic_launcher_foreground.xml
similarity index 100%
rename from res/drawable/ic_launcher_foreground.xml
rename to app/src/main/res/drawable/ic_launcher_foreground.xml
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/activity_main.xml b/app/src/main/res/layout/activity_main.xml
similarity index 100%
rename from res/layout/activity_main.xml
rename to app/src/main/res/layout/activity_main.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/app/src/main/res/mipmap-anydpi-v26/ic_launcher.xml b/app/src/main/res/mipmap-anydpi-v26/ic_launcher.xml
new file mode 100644
index 0000000..6f3b755
--- /dev/null
+++ b/app/src/main/res/mipmap-anydpi-v26/ic_launcher.xml
@@ -0,0 +1,6 @@
+
+
+
+
+
+
\ No newline at end of file
diff --git a/app/src/main/res/mipmap-anydpi-v26/ic_launcher_round.xml b/app/src/main/res/mipmap-anydpi-v26/ic_launcher_round.xml
new file mode 100644
index 0000000..6f3b755
--- /dev/null
+++ b/app/src/main/res/mipmap-anydpi-v26/ic_launcher_round.xml
@@ -0,0 +1,6 @@
+
+
+
+
+
+
\ No newline at end of file
diff --git a/app/src/main/res/mipmap-hdpi/ic_launcher.webp b/app/src/main/res/mipmap-hdpi/ic_launcher.webp
new file mode 100644
index 0000000..c209e78
Binary files /dev/null and b/app/src/main/res/mipmap-hdpi/ic_launcher.webp differ
diff --git a/app/src/main/res/mipmap-hdpi/ic_launcher_round.webp b/app/src/main/res/mipmap-hdpi/ic_launcher_round.webp
new file mode 100644
index 0000000..b2dfe3d
Binary files /dev/null and b/app/src/main/res/mipmap-hdpi/ic_launcher_round.webp differ
diff --git a/app/src/main/res/mipmap-mdpi/ic_launcher.webp b/app/src/main/res/mipmap-mdpi/ic_launcher.webp
new file mode 100644
index 0000000..4f0f1d6
Binary files /dev/null and b/app/src/main/res/mipmap-mdpi/ic_launcher.webp differ
diff --git a/app/src/main/res/mipmap-mdpi/ic_launcher_round.webp b/app/src/main/res/mipmap-mdpi/ic_launcher_round.webp
new file mode 100644
index 0000000..62b611d
Binary files /dev/null and b/app/src/main/res/mipmap-mdpi/ic_launcher_round.webp differ
diff --git a/app/src/main/res/mipmap-xhdpi/ic_launcher.webp b/app/src/main/res/mipmap-xhdpi/ic_launcher.webp
new file mode 100644
index 0000000..948a307
Binary files /dev/null and b/app/src/main/res/mipmap-xhdpi/ic_launcher.webp differ
diff --git a/app/src/main/res/mipmap-xhdpi/ic_launcher_round.webp b/app/src/main/res/mipmap-xhdpi/ic_launcher_round.webp
new file mode 100644
index 0000000..1b9a695
Binary files /dev/null and b/app/src/main/res/mipmap-xhdpi/ic_launcher_round.webp differ
diff --git a/app/src/main/res/mipmap-xxhdpi/ic_launcher.webp b/app/src/main/res/mipmap-xxhdpi/ic_launcher.webp
new file mode 100644
index 0000000..28d4b77
Binary files /dev/null and b/app/src/main/res/mipmap-xxhdpi/ic_launcher.webp differ
diff --git a/app/src/main/res/mipmap-xxhdpi/ic_launcher_round.webp b/app/src/main/res/mipmap-xxhdpi/ic_launcher_round.webp
new file mode 100644
index 0000000..9287f50
Binary files /dev/null and b/app/src/main/res/mipmap-xxhdpi/ic_launcher_round.webp differ
diff --git a/app/src/main/res/mipmap-xxxhdpi/ic_launcher.webp b/app/src/main/res/mipmap-xxxhdpi/ic_launcher.webp
new file mode 100644
index 0000000..aa7d642
Binary files /dev/null and b/app/src/main/res/mipmap-xxxhdpi/ic_launcher.webp differ
diff --git a/app/src/main/res/mipmap-xxxhdpi/ic_launcher_round.webp b/app/src/main/res/mipmap-xxxhdpi/ic_launcher_round.webp
new file mode 100644
index 0000000..9126ae3
Binary files /dev/null and b/app/src/main/res/mipmap-xxxhdpi/ic_launcher_round.webp differ
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/app/src/main/res/values-night/themes.xml b/app/src/main/res/values-night/themes.xml
new file mode 100644
index 0000000..ad0fd96
--- /dev/null
+++ b/app/src/main/res/values-night/themes.xml
@@ -0,0 +1,7 @@
+
+
+
+
\ No newline at end of file
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 100%
rename from res/values-zh-rCN/strings.xml
rename to app/src/main/res/values-zh-rCN/strings.xml
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 100%
rename from res/values-zh-rTW/strings.xml
rename to app/src/main/res/values-zh-rTW/strings.xml
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 100%
rename from res/values/strings.xml
rename to app/src/main/res/values/strings.xml
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/values/themes.xml b/app/src/main/res/values/themes.xml
similarity index 57%
rename from res/values/themes.xml
rename to app/src/main/res/values/themes.xml
index 65db06a..aa02b68 100644
--- a/res/values/themes.xml
+++ b/app/src/main/res/values/themes.xml
@@ -1,9 +1,9 @@
-
-
+
\ No newline at end of file
diff --git a/res/xml/backup_rules.xml b/app/src/main/res/xml/backup_rules.xml
similarity index 100%
rename from res/xml/backup_rules.xml
rename to app/src/main/res/xml/backup_rules.xml
diff --git a/res/xml/data_extraction_rules.xml b/app/src/main/res/xml/data_extraction_rules.xml
similarity index 100%
rename from res/xml/data_extraction_rules.xml
rename to app/src/main/res/xml/data_extraction_rules.xml
diff --git a/app/src/main/res/xml/network_security_config.xml b/app/src/main/res/xml/network_security_config.xml
new file mode 100644
index 0000000..22d0adf
--- /dev/null
+++ b/app/src/main/res/xml/network_security_config.xml
@@ -0,0 +1,8 @@
+
+
+
+
+
+
+
+
\ No newline at end of file
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..3756278
--- /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.android.application) apply false
+}
\ No newline at end of file
diff --git a/gradle.properties b/gradle.properties
new file mode 100644
index 0000000..4387edc
--- /dev/null
+++ b/gradle.properties
@@ -0,0 +1,21 @@
+# 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
\ No newline at end of file
diff --git a/gradle/libs.versions.toml b/gradle/libs.versions.toml
new file mode 100644
index 0000000..bdc2b99
--- /dev/null
+++ b/gradle/libs.versions.toml
@@ -0,0 +1,22 @@
+[versions]
+agp = "8.6.0"
+junit = "4.13.2"
+junitVersion = "1.1.5"
+espressoCore = "3.5.1"
+appcompat = "1.6.1"
+material = "1.10.0"
+activity = "1.8.0"
+constraintlayout = "2.1.4"
+
+[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" }
+activity = { group = "androidx.activity", name = "activity", version.ref = "activity" }
+constraintlayout = { group = "androidx.constraintlayout", name = "constraintlayout", version.ref = "constraintlayout" }
+
+[plugins]
+android-application = { 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..a2b91c1
--- /dev/null
+++ b/gradle/wrapper/gradle-wrapper.properties
@@ -0,0 +1,6 @@
+#Thu May 29 11:47:37 GMT+08:00 2025
+distributionBase=GRADLE_USER_HOME
+distributionPath=wrapper/dists
+distributionUrl=https\://services.gradle.org/distributions/gradle-8.7-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/settings.gradle.kts b/settings.gradle.kts
new file mode 100644
index 0000000..ddce4c6
--- /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 = "notes"
+include(":app")