diff --git a/doc/小米便签开源代码阅读-泛读报告.docx b/doc/01-泛读报告-孔圣博.docx similarity index 69% rename from doc/小米便签开源代码阅读-泛读报告.docx rename to doc/01-泛读报告-孔圣博.docx index 9d64d70..5695f05 100644 Binary files a/doc/小米便签开源代码阅读-泛读报告.docx and b/doc/01-泛读报告-孔圣博.docx differ diff --git a/doc/小米便签开源代码阅读-精读报告 .docx b/doc/02-精读报告-所有人 .docx similarity index 100% rename from doc/小米便签开源代码阅读-精读报告 .docx rename to doc/02-精读报告-所有人 .docx diff --git a/doc/小米便签开源代码的质量分析报告.docx b/doc/03质量分析报告-孔圣博.docx similarity index 100% rename from doc/小米便签开源代码的质量分析报告.docx rename to doc/03质量分析报告-孔圣博.docx diff --git a/doc/04-维护需求与设计方案-孔圣博.docx b/doc/04-维护需求与设计方案-孔圣博.docx new file mode 100644 index 0000000..c3287d0 Binary files /dev/null and b/doc/04-维护需求与设计方案-孔圣博.docx differ diff --git a/model/model.keepgit.txt b/model/model.keepgit.txt deleted file mode 100644 index e69de29..0000000 diff --git a/model/原始UML/data包中类间的关系图.png b/model/原始UML/data包中类间的关系图.png new file mode 100644 index 0000000..e320ee4 Binary files /dev/null and b/model/原始UML/data包中类间的关系图.png differ diff --git a/model/原始UML/gtask包中类间的关系图.png b/model/原始UML/gtask包中类间的关系图.png new file mode 100644 index 0000000..0308fdd Binary files /dev/null and b/model/原始UML/gtask包中类间的关系图.png differ diff --git a/model/原始UML/model包中类间的关系图.png b/model/原始UML/model包中类间的关系图.png new file mode 100644 index 0000000..ddc9775 Binary files /dev/null and b/model/原始UML/model包中类间的关系图.png differ diff --git a/model/原始UML/ui包中类间的关系图.png b/model/原始UML/ui包中类间的关系图.png new file mode 100644 index 0000000..64551ca Binary files /dev/null and b/model/原始UML/ui包中类间的关系图.png differ diff --git a/model/原始UML/widget包中类间的关系图.png b/model/原始UML/widget包中类间的关系图.png new file mode 100644 index 0000000..003678c Binary files /dev/null and b/model/原始UML/widget包中类间的关系图.png differ diff --git a/model/原始UML/小米便签体系结构图.png b/model/原始UML/小米便签体系结构图.png new file mode 100644 index 0000000..b513ade Binary files /dev/null and b/model/原始UML/小米便签体系结构图.png differ diff --git a/model/原始UML/用例图.png b/model/原始UML/用例图.png new file mode 100644 index 0000000..6bbc334 Binary files /dev/null and b/model/原始UML/用例图.png differ diff --git a/model/新增UML/修改背景分析顺序图.png b/model/新增UML/修改背景分析顺序图.png new file mode 100644 index 0000000..6e58d5d Binary files /dev/null and b/model/新增UML/修改背景分析顺序图.png differ diff --git a/model/新增UML/修改背景设计顺序图.png.png b/model/新增UML/修改背景设计顺序图.png.png new file mode 100644 index 0000000..bb5417e Binary files /dev/null and b/model/新增UML/修改背景设计顺序图.png.png differ diff --git a/model/新增UML/分析类图.png b/model/新增UML/分析类图.png new file mode 100644 index 0000000..db305e8 Binary files /dev/null and b/model/新增UML/分析类图.png differ diff --git a/model/新增UML/插入图片分析顺序图.png b/model/新增UML/插入图片分析顺序图.png new file mode 100644 index 0000000..996a221 Binary files /dev/null and b/model/新增UML/插入图片分析顺序图.png differ diff --git a/model/新增UML/插入图片设计顺序图.png.png b/model/新增UML/插入图片设计顺序图.png.png new file mode 100644 index 0000000..d3a6c2a Binary files /dev/null and b/model/新增UML/插入图片设计顺序图.png.png differ diff --git a/model/新增UML/新增用例图.png b/model/新增UML/新增用例图.png new file mode 100644 index 0000000..0d4b8fe Binary files /dev/null and b/model/新增UML/新增用例图.png differ diff --git a/model/新增UML/界面 (1).png b/model/新增UML/界面 (1).png new file mode 100644 index 0000000..057363d Binary files /dev/null and b/model/新增UML/界面 (1).png differ diff --git a/model/新增UML/界面1(2).png b/model/新增UML/界面1(2).png new file mode 100644 index 0000000..17b81e2 Binary files /dev/null and b/model/新增UML/界面1(2).png differ diff --git a/model/新增UML/设计类图.png b/model/新增UML/设计类图.png new file mode 100644 index 0000000..a9cfb67 Binary files /dev/null and b/model/新增UML/设计类图.png differ diff --git a/other/小米便签阅读与维护-汇报_孔圣博.pptx b/other/05-小米便签阅读与维护-汇报_孔圣博.pptx similarity index 93% rename from other/小米便签阅读与维护-汇报_孔圣博.pptx rename to other/05-小米便签阅读与维护-汇报_孔圣博.pptx index 7550798..10a266a 100644 Binary files a/other/小米便签阅读与维护-汇报_孔圣博.pptx and b/other/05-小米便签阅读与维护-汇报_孔圣博.pptx differ diff --git a/other/06-系统演示录屏_孔圣博/修改背景.mp4 b/other/06-系统演示录屏_孔圣博/修改背景.mp4 new file mode 100644 index 0000000..45af910 Binary files /dev/null and b/other/06-系统演示录屏_孔圣博/修改背景.mp4 differ diff --git a/other/06-系统演示录屏_孔圣博/插入图片.mp4 b/other/06-系统演示录屏_孔圣博/插入图片.mp4 new file mode 100644 index 0000000..7ff33db Binary files /dev/null and b/other/06-系统演示录屏_孔圣博/插入图片.mp4 differ diff --git a/other/07_贡献度Excel_孔圣博.xlsx b/other/07_贡献度Excel_孔圣博.xlsx new file mode 100644 index 0000000..3455eba Binary files /dev/null and b/other/07_贡献度Excel_孔圣博.xlsx differ diff --git a/other/08_实践总结报告_221340001薄镕欣 .docx b/other/08_实践总结报告_221340001薄镕欣 .docx new file mode 100644 index 0000000..f84baed Binary files /dev/null and b/other/08_实践总结报告_221340001薄镕欣 .docx differ diff --git a/other/08_实践总结报告_230340064孔圣博 .docx b/other/08_实践总结报告_230340064孔圣博 .docx new file mode 100644 index 0000000..f83d973 Binary files /dev/null and b/other/08_实践总结报告_230340064孔圣博 .docx differ diff --git a/other/08_实践总结报告_230340068孙贵鑫 .docx b/other/08_实践总结报告_230340068孙贵鑫 .docx new file mode 100644 index 0000000..2830e5c Binary files /dev/null and b/other/08_实践总结报告_230340068孙贵鑫 .docx differ diff --git a/src/Notesmaster/.gitignore b/src/Notesmaster/.gitignore new file mode 100644 index 0000000..aa724b7 --- /dev/null +++ b/src/Notesmaster/.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/src/Notesmaster/.idea/.gitignore b/src/Notesmaster/.idea/.gitignore new file mode 100644 index 0000000..26d3352 --- /dev/null +++ b/src/Notesmaster/.idea/.gitignore @@ -0,0 +1,3 @@ +# Default ignored files +/shelf/ +/workspace.xml diff --git a/src/Notesmaster/.idea/.name b/src/Notesmaster/.idea/.name new file mode 100644 index 0000000..7efc0ae --- /dev/null +++ b/src/Notesmaster/.idea/.name @@ -0,0 +1 @@ +Notes-master \ No newline at end of file diff --git a/src/Notesmaster/.idea/AndroidProjectSystem.xml b/src/Notesmaster/.idea/AndroidProjectSystem.xml new file mode 100644 index 0000000..4a53bee --- /dev/null +++ b/src/Notesmaster/.idea/AndroidProjectSystem.xml @@ -0,0 +1,6 @@ + + + + + \ No newline at end of file diff --git a/src/Notesmaster/.idea/compiler.xml b/src/Notesmaster/.idea/compiler.xml new file mode 100644 index 0000000..b86273d --- /dev/null +++ b/src/Notesmaster/.idea/compiler.xml @@ -0,0 +1,6 @@ + + + + + + \ No newline at end of file diff --git a/src/Notesmaster/.idea/deploymentTargetSelector.xml b/src/Notesmaster/.idea/deploymentTargetSelector.xml new file mode 100644 index 0000000..b63bcaa --- /dev/null +++ b/src/Notesmaster/.idea/deploymentTargetSelector.xml @@ -0,0 +1,18 @@ + + + + + + + + + \ No newline at end of file diff --git a/src/Notesmaster/.idea/gradle.xml b/src/Notesmaster/.idea/gradle.xml new file mode 100644 index 0000000..639c779 --- /dev/null +++ b/src/Notesmaster/.idea/gradle.xml @@ -0,0 +1,19 @@ + + + + + + + \ No newline at end of file diff --git a/src/Notesmaster/.idea/migrations.xml b/src/Notesmaster/.idea/migrations.xml new file mode 100644 index 0000000..f8051a6 --- /dev/null +++ b/src/Notesmaster/.idea/migrations.xml @@ -0,0 +1,10 @@ + + + + + + \ No newline at end of file diff --git a/src/Notesmaster/.idea/misc.xml b/src/Notesmaster/.idea/misc.xml new file mode 100644 index 0000000..b2c751a --- /dev/null +++ b/src/Notesmaster/.idea/misc.xml @@ -0,0 +1,9 @@ + + + + + + + + \ No newline at end of file diff --git a/src/Notesmaster/.idea/runConfigurations.xml b/src/Notesmaster/.idea/runConfigurations.xml new file mode 100644 index 0000000..16660f1 --- /dev/null +++ b/src/Notesmaster/.idea/runConfigurations.xml @@ -0,0 +1,17 @@ + + + + + + \ No newline at end of file diff --git a/src/Notesmaster/Screenshot_20250526_221239.png b/src/Notesmaster/Screenshot_20250526_221239.png new file mode 100644 index 0000000..a64b594 Binary files /dev/null and b/src/Notesmaster/Screenshot_20250526_221239.png differ diff --git a/src/Notesmaster/app/.gitignore b/src/Notesmaster/app/.gitignore new file mode 100644 index 0000000..42afabf --- /dev/null +++ b/src/Notesmaster/app/.gitignore @@ -0,0 +1 @@ +/build \ No newline at end of file diff --git a/src/Notesmaster/app/build.gradle.kts b/src/Notesmaster/app/build.gradle.kts new file mode 100644 index 0000000..f2f3a53 --- /dev/null +++ b/src/Notesmaster/app/build.gradle.kts @@ -0,0 +1,59 @@ +plugins { + alias(libs.plugins.android.application) +} + +android { + namespace = "net.micode.notes" + compileSdk = 35 + + defaultConfig { + applicationId = "net.micode.notes" + minSdk = 30 + targetSdk = 35 + versionCode = 1 + versionName = "1.0" + + testInstrumentationRunner = "androidx.test.runner.AndroidJUnitRunner" + } + + buildTypes { + release { + isMinifyEnabled = false + proguardFiles( + getDefaultProguardFile("proguard-android-optimize.txt"), + "proguard-rules.pro" + ) + } + } + compileOptions { + sourceCompatibility = JavaVersion.VERSION_11 + targetCompatibility = JavaVersion.VERSION_11 + } + packaging { + resources.excludes.add("META-INF/DEPENDENCIES"); + resources.excludes.add("META-INF/NOTICE"); + resources.excludes.add("META-INF/LICENSE"); + resources.excludes.add("META-INF/LICENSE.txt"); + resources.excludes.add("META-INF/NOTICE.txt"); + } +} + +dependencies { + + implementation(libs.appcompat) + implementation(libs.material) + implementation(libs.activity) + implementation(libs.constraintlayout) + // implementation(fileTree(mapOf( +// "dir" to "D:\\Code\\AndroidCode\\Notesmaster\\httpcomponents-client-4.5.14-bin\\lib", +// "include" to listOf("*.aar", "*.jar"), +// "exclude" to listOf("") +// ))) + //修改为如下代码: + implementation(files("D:\\Android studio\\Notesmaster\\httt\\lib\\httpclient-osgi-4.5.14.jar")) + implementation(files("D:\\Android studio\\Notesmaster\\httt\\lib\\httpclient-win-4.5.14.jar")) + implementation(files("D:\\Android studio\\Notesmaster\\httt\\lib\\httpcore-4.4.16.jar")) + testImplementation(libs.junit) + androidTestImplementation(libs.ext.junit) + androidTestImplementation(libs.espresso.core) +} \ No newline at end of file diff --git a/src/Notesmaster/app/proguard-rules.pro b/src/Notesmaster/app/proguard-rules.pro new file mode 100644 index 0000000..481bb43 --- /dev/null +++ b/src/Notesmaster/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/src/Notesmaster/app/src/androidTest/java/net/micode/notes/ExampleInstrumentedTest.java b/src/Notesmaster/app/src/androidTest/java/net/micode/notes/ExampleInstrumentedTest.java new file mode 100644 index 0000000..a889a75 --- /dev/null +++ b/src/Notesmaster/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/src/Notesmaster/app/src/main/AndroidManifest.xml b/src/Notesmaster/app/src/main/AndroidManifest.xml new file mode 100644 index 0000000..4010b4f --- /dev/null +++ b/src/Notesmaster/app/src/main/AndroidManifest.xml @@ -0,0 +1,156 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + > + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/src/Notesmaster/app/src/main/java/net/micode/notes/MainActivity.java b/src/Notesmaster/app/src/main/java/net/micode/notes/MainActivity.java new file mode 100644 index 0000000..8091753 --- /dev/null +++ b/src/Notesmaster/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/data/Contact.java b/src/Notesmaster/app/src/main/java/net/micode/notes/data/Contact.java similarity index 100% rename from src/data/Contact.java rename to src/Notesmaster/app/src/main/java/net/micode/notes/data/Contact.java diff --git a/src/data/Notes.java b/src/Notesmaster/app/src/main/java/net/micode/notes/data/Notes.java similarity index 100% rename from src/data/Notes.java rename to src/Notesmaster/app/src/main/java/net/micode/notes/data/Notes.java diff --git a/src/data/NotesDatabaseHelper.java b/src/Notesmaster/app/src/main/java/net/micode/notes/data/NotesDatabaseHelper.java similarity index 99% rename from src/data/NotesDatabaseHelper.java rename to src/Notesmaster/app/src/main/java/net/micode/notes/data/NotesDatabaseHelper.java index ffe5d57..9689a97 100644 --- a/src/data/NotesDatabaseHelper.java +++ b/src/Notesmaster/app/src/main/java/net/micode/notes/data/NotesDatabaseHelper.java @@ -1,4 +1,4 @@ -/* + /* * Copyright (c) 2010-2011, The MiCode Open Source Community (www.micode.net) * * Licensed under the Apache License, Version 2.0 (the "License"); diff --git a/src/data/NotesProvider.java b/src/Notesmaster/app/src/main/java/net/micode/notes/data/NotesProvider.java similarity index 100% rename from src/data/NotesProvider.java rename to src/Notesmaster/app/src/main/java/net/micode/notes/data/NotesProvider.java diff --git a/src/gtask/data/MetaData.java b/src/Notesmaster/app/src/main/java/net/micode/notes/gtask/data/MetaData.java similarity index 100% rename from src/gtask/data/MetaData.java rename to src/Notesmaster/app/src/main/java/net/micode/notes/gtask/data/MetaData.java diff --git a/src/gtask/data/Node.java b/src/Notesmaster/app/src/main/java/net/micode/notes/gtask/data/Node.java similarity index 100% rename from src/gtask/data/Node.java rename to src/Notesmaster/app/src/main/java/net/micode/notes/gtask/data/Node.java diff --git a/src/gtask/data/SqlData.java b/src/Notesmaster/app/src/main/java/net/micode/notes/gtask/data/SqlData.java similarity index 100% rename from src/gtask/data/SqlData.java rename to src/Notesmaster/app/src/main/java/net/micode/notes/gtask/data/SqlData.java diff --git a/src/gtask/data/SqlNote.java b/src/Notesmaster/app/src/main/java/net/micode/notes/gtask/data/SqlNote.java similarity index 100% rename from src/gtask/data/SqlNote.java rename to src/Notesmaster/app/src/main/java/net/micode/notes/gtask/data/SqlNote.java diff --git a/src/gtask/data/Task.java b/src/Notesmaster/app/src/main/java/net/micode/notes/gtask/data/Task.java similarity index 100% rename from src/gtask/data/Task.java rename to src/Notesmaster/app/src/main/java/net/micode/notes/gtask/data/Task.java diff --git a/src/gtask/data/TaskList.java b/src/Notesmaster/app/src/main/java/net/micode/notes/gtask/data/TaskList.java similarity index 100% rename from src/gtask/data/TaskList.java rename to src/Notesmaster/app/src/main/java/net/micode/notes/gtask/data/TaskList.java diff --git a/src/gtask/exception/ActionFailureException.java b/src/Notesmaster/app/src/main/java/net/micode/notes/gtask/exception/ActionFailureException.java similarity index 100% rename from src/gtask/exception/ActionFailureException.java rename to src/Notesmaster/app/src/main/java/net/micode/notes/gtask/exception/ActionFailureException.java diff --git a/src/gtask/exception/NetworkFailureException.java b/src/Notesmaster/app/src/main/java/net/micode/notes/gtask/exception/NetworkFailureException.java similarity index 100% rename from src/gtask/exception/NetworkFailureException.java rename to src/Notesmaster/app/src/main/java/net/micode/notes/gtask/exception/NetworkFailureException.java diff --git a/src/gtask/remote/GTaskASyncTask.java b/src/Notesmaster/app/src/main/java/net/micode/notes/gtask/remote/GTaskASyncTask.java similarity index 99% rename from src/gtask/remote/GTaskASyncTask.java rename to src/Notesmaster/app/src/main/java/net/micode/notes/gtask/remote/GTaskASyncTask.java index 0f99390..52c898a 100644 --- a/src/gtask/remote/GTaskASyncTask.java +++ b/src/Notesmaster/app/src/main/java/net/micode/notes/gtask/remote/GTaskASyncTask.java @@ -73,14 +73,14 @@ public class GTaskASyncTask extends AsyncTask { // pendingIntent = PendingIntent.getActivity(mContext, 0, new Intent(mContext, // NotesPreferenceActivity.class), 0); // - // } else { +// } else { // pendingIntent = PendingIntent.getActivity(mContext, 0, new Intent(mContext, // NotesListActivity.class), 0); // } // notification.setLatestEventInfo(mContext, mContext.getString(R.string.app_name), content, // pendingIntent); // mNotifiManager.notify(GTASK_SYNC_NOTIFICATION_ID, notification); - // } +// } private void showNotification(int tickerId, String content) { PendingIntent pendingIntent; if (tickerId != R.string.ticker_success) { @@ -100,6 +100,7 @@ private void showNotification(int tickerId, String content) { Notification notification=builder.getNotification(); mNotifiManager.notify(GTASK_SYNC_NOTIFICATION_ID, notification); } + @Override protected Integer doInBackground(Void... unused) { publishProgess(mContext.getString(R.string.sync_progress_login, NotesPreferenceActivity diff --git a/src/gtask/remote/GTaskClient.java b/src/Notesmaster/app/src/main/java/net/micode/notes/gtask/remote/GTaskClient.java similarity index 100% rename from src/gtask/remote/GTaskClient.java rename to src/Notesmaster/app/src/main/java/net/micode/notes/gtask/remote/GTaskClient.java diff --git a/src/gtask/remote/GTaskManager.java b/src/Notesmaster/app/src/main/java/net/micode/notes/gtask/remote/GTaskManager.java similarity index 100% rename from src/gtask/remote/GTaskManager.java rename to src/Notesmaster/app/src/main/java/net/micode/notes/gtask/remote/GTaskManager.java diff --git a/src/gtask/remote/GTaskSyncService.java b/src/Notesmaster/app/src/main/java/net/micode/notes/gtask/remote/GTaskSyncService.java similarity index 100% rename from src/gtask/remote/GTaskSyncService.java rename to src/Notesmaster/app/src/main/java/net/micode/notes/gtask/remote/GTaskSyncService.java diff --git a/src/model/Note.java b/src/Notesmaster/app/src/main/java/net/micode/notes/model/Note.java similarity index 100% rename from src/model/Note.java rename to src/Notesmaster/app/src/main/java/net/micode/notes/model/Note.java diff --git a/src/model/WorkingNote.java b/src/Notesmaster/app/src/main/java/net/micode/notes/model/WorkingNote.java similarity index 95% rename from src/model/WorkingNote.java rename to src/Notesmaster/app/src/main/java/net/micode/notes/model/WorkingNote.java index be081e4..54af090 100644 --- a/src/model/WorkingNote.java +++ b/src/Notesmaster/app/src/main/java/net/micode/notes/model/WorkingNote.java @@ -38,7 +38,7 @@ public class WorkingNote { // Note Id private long mNoteId; // Note content - private String mContent; + public String mContent; // Note mode private int mMode; @@ -58,9 +58,12 @@ public class WorkingNote { private static final String TAG = "WorkingNote"; + private boolean mIsDeleted; private NoteSettingChangedListener mNoteSettingStatusListener; + private String mPassword; + public static final String[] DATA_PROJECTION = new String[] { DataColumns.ID, @@ -78,7 +81,10 @@ public class WorkingNote { NoteColumns.BG_COLOR_ID, NoteColumns.WIDGET_ID, NoteColumns.WIDGET_TYPE, - NoteColumns.MODIFIED_DATE +// NoteColumns.MODIFIED_DATE + NoteColumns.MODIFIED_DATE, + NoteColumns.VERSION + //adding }; private static final int DATA_ID_COLUMN = 0; @@ -100,6 +106,7 @@ public class WorkingNote { private static final int NOTE_WIDGET_TYPE_COLUMN = 4; private static final int NOTE_MODIFIED_DATE_COLUMN = 5; + private static final int NOTE_MPASSWORD_COLUMN = 6; // New note construct private WorkingNote(Context context, long folderId) { @@ -113,6 +120,15 @@ public class WorkingNote { mMode = 0; mWidgetType = Notes.TYPE_WIDGET_INVALIDE; } + public void setPassword(String password) + { + mPassword = password; + } + public boolean hasPassword() + { + return mPassword != null; + } + public String getPassword(){return mPassword;} // Existing note construct private WorkingNote(Context context, long noteId, long folderId) { @@ -137,6 +153,7 @@ public class WorkingNote { mWidgetType = cursor.getInt(NOTE_WIDGET_TYPE_COLUMN); mAlertDate = cursor.getLong(NOTE_ALERTED_DATE_COLUMN); mModifiedDate = cursor.getLong(NOTE_MODIFIED_DATE_COLUMN); + mPassword = String.valueOf(cursor.getLong(NOTE_MPASSWORD_COLUMN)); } cursor.close(); } else { diff --git a/src/tool/BackupUtils.java b/src/Notesmaster/app/src/main/java/net/micode/notes/tool/BackupUtils.java similarity index 100% rename from src/tool/BackupUtils.java rename to src/Notesmaster/app/src/main/java/net/micode/notes/tool/BackupUtils.java diff --git a/src/tool/DataUtils.java b/src/Notesmaster/app/src/main/java/net/micode/notes/tool/DataUtils.java similarity index 100% rename from src/tool/DataUtils.java rename to src/Notesmaster/app/src/main/java/net/micode/notes/tool/DataUtils.java diff --git a/src/tool/GTaskStringUtils.java b/src/Notesmaster/app/src/main/java/net/micode/notes/tool/GTaskStringUtils.java similarity index 100% rename from src/tool/GTaskStringUtils.java rename to src/Notesmaster/app/src/main/java/net/micode/notes/tool/GTaskStringUtils.java diff --git a/src/tool/ResourceParser.java b/src/Notesmaster/app/src/main/java/net/micode/notes/tool/ResourceParser.java similarity index 100% rename from src/tool/ResourceParser.java rename to src/Notesmaster/app/src/main/java/net/micode/notes/tool/ResourceParser.java diff --git a/src/Notesmaster/app/src/main/java/net/micode/notes/ui/AlarmAlertActivity.java b/src/Notesmaster/app/src/main/java/net/micode/notes/ui/AlarmAlertActivity.java new file mode 100644 index 0000000..677ccfb --- /dev/null +++ b/src/Notesmaster/app/src/main/java/net/micode/notes/ui/AlarmAlertActivity.java @@ -0,0 +1,301 @@ +/* + * Copyright (c) 2010-2011, The MiCode Open Source Community (www.micode.net) + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package net.micode.notes.ui; + +import static androidx.constraintlayout.helper.widget.MotionEffect.TAG; + +import android.app.Activity; +import android.app.AlertDialog; +import android.content.Context; +import android.content.DialogInterface; +import android.content.DialogInterface.OnClickListener; +import android.content.DialogInterface.OnDismissListener; +import android.content.Intent; +import android.media.AudioManager; +import android.media.MediaPlayer; +import android.media.RingtoneManager; +import android.net.Uri; +import android.os.Bundle; +import android.os.PowerManager; +import android.provider.Settings; +import android.text.Editable; +import android.util.Log; +import android.view.Window; +import android.view.WindowManager; +import android.widget.ImageButton; +import android.view.View; +import android.graphics.Bitmap; +import android.graphics.BitmapFactory; +import android.graphics.drawable.BitmapDrawable; +import android.text.Spannable; +import android.text.SpannableString; +import android.text.style.ImageSpan; +import android.widget.TextView; +import android.widget.Toast; +import android.database.Cursor; +import android.provider.MediaStore; +import android.net.Uri; +import android.os.Build; +import android.provider.DocumentsContract; + +import net.micode.notes.R; +import net.micode.notes.data.Notes; +import net.micode.notes.tool.DataUtils; + +import java.io.IOException; + + +public class AlarmAlertActivity extends Activity implements OnClickListener, OnDismissListener { + private long mNoteId; + private String mSnippet; + private static final int SNIPPET_PREW_MAX_LEN = 60; + MediaPlayer mPlayer; + private final int PHOTO_REQUEST = 1;//请求码 + + @Override + protected void onCreate(Bundle savedInstanceState) { + super.onCreate(savedInstanceState); + requestWindowFeature(Window.FEATURE_NO_TITLE); + + final Window win = getWindow(); + win.addFlags(WindowManager.LayoutParams.FLAG_SHOW_WHEN_LOCKED); + + if (!isScreenOn()) { + win.addFlags(WindowManager.LayoutParams.FLAG_KEEP_SCREEN_ON + | WindowManager.LayoutParams.FLAG_TURN_SCREEN_ON + | WindowManager.LayoutParams.FLAG_ALLOW_LOCK_WHILE_SCREEN_ON + | WindowManager.LayoutParams.FLAG_LAYOUT_INSET_DECOR); + } + + Intent intent = getIntent(); + + try { + mNoteId = Long.valueOf(intent.getData().getPathSegments().get(1)); + mSnippet = DataUtils.getSnippetById(this.getContentResolver(), mNoteId); + mSnippet = mSnippet.length() > SNIPPET_PREW_MAX_LEN ? mSnippet.substring(0, + SNIPPET_PREW_MAX_LEN) + getResources().getString(R.string.notelist_string_info) + : mSnippet; + } catch (IllegalArgumentException e) { + e.printStackTrace(); + return; + } + + mPlayer = new MediaPlayer(); + if (DataUtils.visibleInNoteDatabase(getContentResolver(), mNoteId, Notes.TYPE_NOTE)) { + showActionDialog(); + playAlarmSound(); + } else { + finish(); + } + + //根据id获取添加图片按钮 + final ImageButton add_img_btn = (ImageButton) findViewById(R.id.add_img_btn); + //为点击图片按钮设置监听器 + add_img_btn.setOnClickListener(new View.OnClickListener() { + @Override + public void onClick(View view) { + Log.d(TAG, "onClick: click add image button"); + //ACTION_GET_CONTENT: 允许用户选择特殊种类的数据,并返回(特殊种类的数据:照一张相片或录一段音) + Intent loadImage = new Intent(Intent.ACTION_GET_CONTENT); + //Category属性用于指定当前动作(Action)被执行的环境. + //CATEGORY_OPENABLE; 用来指示一个ACTION_GET_CONTENT的intent + loadImage.addCategory(Intent.CATEGORY_OPENABLE); + loadImage.setType("image/*"); + startActivityForResult(loadImage, PHOTO_REQUEST); + } + }); + } + + private boolean isScreenOn() { + PowerManager pm = (PowerManager) getSystemService(Context.POWER_SERVICE); + return pm.isScreenOn(); + } + + private void playAlarmSound() { + Uri url = RingtoneManager.getActualDefaultRingtoneUri(this, RingtoneManager.TYPE_ALARM); + + int silentModeStreams = Settings.System.getInt(getContentResolver(), + Settings.System.MODE_RINGER_STREAMS_AFFECTED, 0); + + if ((silentModeStreams & (1 << AudioManager.STREAM_ALARM)) != 0) { + mPlayer.setAudioStreamType(silentModeStreams); + } else { + mPlayer.setAudioStreamType(AudioManager.STREAM_ALARM); + } + try { + mPlayer.setDataSource(this, url); + mPlayer.prepare(); + mPlayer.setLooping(true); + mPlayer.start(); + } catch (IllegalArgumentException e) { + // TODO Auto-generated catch block + e.printStackTrace(); + } catch (SecurityException e) { + // TODO Auto-generated catch block + e.printStackTrace(); + } catch (IllegalStateException e) { + // TODO Auto-generated catch block + e.printStackTrace(); + } catch (IOException e) { + // TODO Auto-generated catch block + e.printStackTrace(); + } + } + + private void showActionDialog() { + AlertDialog.Builder dialog = new AlertDialog.Builder(this); + dialog.setTitle(R.string.app_name); + dialog.setMessage(mSnippet); + dialog.setPositiveButton(R.string.notealert_ok, this); + if (isScreenOn()) { + dialog.setNegativeButton(R.string.notealert_enter, this); + } + dialog.show().setOnDismissListener(this); + } + + public void onClick(DialogInterface dialog, int which) { + switch (which) { + case DialogInterface.BUTTON_NEGATIVE: + Intent intent = new Intent(this, NoteEditActivity.class); + intent.setAction(Intent.ACTION_VIEW); + intent.putExtra(Intent.EXTRA_UID, mNoteId); + startActivity(intent); + break; + default: + break; + } + } + + public void onDismiss(DialogInterface dialog) { + stopAlarmSound(); + finish(); + } + + private void stopAlarmSound() { + if (mPlayer != null) { + mPlayer.stop(); + mPlayer.release(); + mPlayer = null; + } + } + + @Override + protected void onActivityResult(int requestCode, int resultCode, Intent intent) { + super.onActivityResult(requestCode, resultCode, intent); + if (resultCode == Activity.RESULT_OK && requestCode == PHOTO_REQUEST) { + try { + Uri selectedImage = intent.getData(); + String imagePath = getPath(this, selectedImage); + if (imagePath != null) { + // Load the image with appropriate scaling + BitmapFactory.Options options = new BitmapFactory.Options(); + options.inJustDecodeBounds = true; + BitmapFactory.decodeFile(imagePath, options); + + // Calculate scaling factor + int scaleFactor = Math.min(options.outWidth / 800, options.outHeight / 800); + if (scaleFactor < 1) scaleFactor = 1; + + options.inJustDecodeBounds = false; + options.inSampleSize = scaleFactor; + Bitmap bitmap = BitmapFactory.decodeFile(imagePath, options); + + if (bitmap != null) { + // Scale the bitmap to a reasonable size + TextView mNoteEditor = null; + float maxWidth = mNoteEditor.getWidth() * 0.8f; // 80% of editor width + if (bitmap.getWidth() > maxWidth) { + float ratio = maxWidth / bitmap.getWidth(); + int newHeight = (int) (bitmap.getHeight() * ratio); + bitmap = Bitmap.createScaledBitmap(bitmap, (int) maxWidth, newHeight, true); + } + + // Create drawable and insert into text + BitmapDrawable drawable = new BitmapDrawable(getResources(), bitmap); + drawable.setBounds(0, 0, drawable.getIntrinsicWidth(), drawable.getIntrinsicHeight()); + + // Create image span and insert at cursor position + ImageSpan imageSpan = new ImageSpan(drawable, ImageSpan.ALIGN_BASELINE); + SpannableString spannableString = new SpannableString(" \n"); + spannableString.setSpan(imageSpan, 0, 1, Spannable.SPAN_EXCLUSIVE_EXCLUSIVE); + + int cursorPosition = mNoteEditor.getSelectionStart(); + Editable editable = mNoteEditor.getEditableText(); + editable.insert(cursorPosition, spannableString); + } + } + } catch (Exception e) { + Log.e(TAG, "Failed to load image", e); + Toast.makeText(this, R.string.failed_to_insert_image, Toast.LENGTH_SHORT).show(); + } + } + } + + // Helper method to get file path from URI + public String getPath(final Context context, final Uri uri) { + // DocumentProvider + if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.KITKAT && DocumentsContract.isDocumentUri(context, uri)) { + // MediaProvider + if (isMediaDocument(uri)) { + final String docId = DocumentsContract.getDocumentId(uri); + final String[] split = docId.split(":"); + final String type = split[0]; + + Uri contentUri = null; + if ("image".equals(type)) { + contentUri = MediaStore.Images.Media.EXTERNAL_CONTENT_URI; + } + + final String selection = "_id=?"; + final String[] selectionArgs = new String[]{split[1]}; + + return getDataColumn(context, contentUri, selection, selectionArgs); + } + } + // MediaStore (and general) + else if ("content".equalsIgnoreCase(uri.getScheme())) { + return getDataColumn(context, uri, null, null); + } + // File + else if ("file".equalsIgnoreCase(uri.getScheme())) { + return uri.getPath(); + } + + return null; + } + + public String getDataColumn(Context context, Uri uri, String selection, String[] selectionArgs) { + Cursor cursor = null; + final String column = "_data"; + final String[] projection = {column}; + + try { + cursor = context.getContentResolver().query(uri, projection, selection, selectionArgs, null); + if (cursor != null && cursor.moveToFirst()) { + final int column_index = cursor.getColumnIndexOrThrow(column); + return cursor.getString(column_index); + } + } finally { + if (cursor != null) cursor.close(); + } + return null; + } + + public boolean isMediaDocument(Uri uri) { + return "com.android.providers.media.documents".equals(uri.getAuthority()); + } +} diff --git a/src/ui/AlarmInitReceiver.java b/src/Notesmaster/app/src/main/java/net/micode/notes/ui/AlarmInitReceiver.java similarity index 100% rename from src/ui/AlarmInitReceiver.java rename to src/Notesmaster/app/src/main/java/net/micode/notes/ui/AlarmInitReceiver.java diff --git a/src/ui/AlarmReceiver.java b/src/Notesmaster/app/src/main/java/net/micode/notes/ui/AlarmReceiver.java similarity index 100% rename from src/ui/AlarmReceiver.java rename to src/Notesmaster/app/src/main/java/net/micode/notes/ui/AlarmReceiver.java diff --git a/src/ui/DateTimePicker.java b/src/Notesmaster/app/src/main/java/net/micode/notes/ui/DateTimePicker.java similarity index 100% rename from src/ui/DateTimePicker.java rename to src/Notesmaster/app/src/main/java/net/micode/notes/ui/DateTimePicker.java diff --git a/src/ui/DateTimePickerDialog.java b/src/Notesmaster/app/src/main/java/net/micode/notes/ui/DateTimePickerDialog.java similarity index 100% rename from src/ui/DateTimePickerDialog.java rename to src/Notesmaster/app/src/main/java/net/micode/notes/ui/DateTimePickerDialog.java diff --git a/src/ui/DropdownMenu.java b/src/Notesmaster/app/src/main/java/net/micode/notes/ui/DropdownMenu.java similarity index 100% rename from src/ui/DropdownMenu.java rename to src/Notesmaster/app/src/main/java/net/micode/notes/ui/DropdownMenu.java diff --git a/src/ui/FoldersListAdapter.java b/src/Notesmaster/app/src/main/java/net/micode/notes/ui/FoldersListAdapter.java similarity index 100% rename from src/ui/FoldersListAdapter.java rename to src/Notesmaster/app/src/main/java/net/micode/notes/ui/FoldersListAdapter.java diff --git a/src/ui/NoteEditActivity.java b/src/Notesmaster/app/src/main/java/net/micode/notes/ui/NoteEditActivity.java similarity index 77% rename from src/ui/NoteEditActivity.java rename to src/Notesmaster/app/src/main/java/net/micode/notes/ui/NoteEditActivity.java index 96a9ff8..6ee52dd 100644 --- a/src/ui/NoteEditActivity.java +++ b/src/Notesmaster/app/src/main/java/net/micode/notes/ui/NoteEditActivity.java @@ -22,19 +22,34 @@ import android.app.AlertDialog; import android.app.PendingIntent; import android.app.SearchManager; import android.appwidget.AppWidgetManager; +import android.content.ContentResolver; import android.content.ContentUris; +import android.content.ContentValues; import android.content.Context; import android.content.DialogInterface; import android.content.Intent; import android.content.SharedPreferences; +import android.database.Cursor; +import android.graphics.Bitmap; +import android.graphics.BitmapFactory; +import android.graphics.Matrix; import android.graphics.Paint; +import android.graphics.drawable.BitmapDrawable; +import android.graphics.drawable.Drawable; +import android.net.Uri; +import android.os.Build; import android.os.Bundle; +import android.os.Environment; import android.preference.PreferenceManager; +import android.provider.DocumentsContract; +import android.provider.MediaStore; +import android.text.Editable; import android.text.Spannable; import android.text.SpannableString; import android.text.TextUtils; import android.text.format.DateUtils; import android.text.style.BackgroundColorSpan; +import android.text.style.ImageSpan; import android.util.Log; import android.view.LayoutInflater; import android.view.Menu; @@ -43,10 +58,12 @@ import android.view.MotionEvent; import android.view.View; import android.view.View.OnClickListener; import android.view.WindowManager; +import android.widget.Button; import android.widget.CheckBox; import android.widget.CompoundButton; import android.widget.CompoundButton.OnCheckedChangeListener; import android.widget.EditText; +import android.widget.ImageButton; import android.widget.ImageView; import android.widget.LinearLayout; import android.widget.TextView; @@ -65,6 +82,7 @@ import net.micode.notes.ui.NoteEditText.OnTextViewChangeListener; import net.micode.notes.widget.NoteWidgetProvider_2x; import net.micode.notes.widget.NoteWidgetProvider_4x; +import java.io.FileNotFoundException; import java.util.HashMap; import java.util.HashSet; import java.util.Map; @@ -149,6 +167,8 @@ public class NoteEditActivity extends Activity implements OnClickListener, private String mUserQuery; private Pattern mPattern; + private final int PHOTO_REQUEST = 1;//请求码 + @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); @@ -159,12 +179,27 @@ public class NoteEditActivity extends Activity implements OnClickListener, return; } initResources(); + + + //根据id获取添加图片按钮 + final ImageButton add_img_btn = (ImageButton) findViewById(R.id.add_img_btn); + //为点击图片按钮设置监听器 + add_img_btn.setOnClickListener(new OnClickListener() { + @Override + public void onClick(View view) { + Log.d(TAG, "onClick: click add image button"); + //ACTION_GET_CONTENT: 允许用户选择特殊种类的数据,并返回(特殊种类的数据:照一张相片或录一段音) + Intent loadImage = new Intent(Intent.ACTION_GET_CONTENT); + //Category属性用于指定当前动作(Action)被执行的环境. + //CATEGORY_OPENABLE; 用来指示一个ACTION_GET_CONTENT的intent + loadImage.addCategory(Intent.CATEGORY_OPENABLE); + loadImage.setType("image/*"); + startActivityForResult(loadImage, PHOTO_REQUEST); + } + }); } - /** - * Current activity may be killed when the memory is low. Once it is killed, for another time - * user load this activity, we should restore the former state - */ + @Override protected void onRestoreInstanceState(Bundle savedInstanceState) { super.onRestoreInstanceState(savedInstanceState); @@ -263,14 +298,13 @@ public class NoteEditActivity extends Activity implements OnClickListener, } @Override - protected void onResume() { + protected void onResume() {//能获得用户焦点:可以操作 super.onResume(); - initNoteScreen(); + initNoteScreen();//初始化便签屏幕 } private void initNoteScreen() { - mNoteEditor.setTextAppearance(this, TextAppearanceResources - .getTexAppearanceResource(mFontSizeId)); + mNoteEditor.setTextAppearance(this, TextAppearanceResources.getTexAppearanceResource(mFontSizeId)); if (mWorkingNote.getCheckListMode() == TextNote.MODE_CHECK_LIST) { switchToListMode(mWorkingNote.getContent()); } else { @@ -288,11 +322,9 @@ public class NoteEditActivity extends Activity implements OnClickListener, | DateUtils.FORMAT_NUMERIC_DATE | DateUtils.FORMAT_SHOW_TIME | DateUtils.FORMAT_SHOW_YEAR)); - /** - * TODO: Add the menu for setting alert. Currently disable it because the DateTimePicker - * is not ready - */ showAlertHeader(); + //将有图片路径的位置转换为图片 + convertToImage(); } private void showAlertHeader() { @@ -312,6 +344,47 @@ public class NoteEditActivity extends Activity implements OnClickListener, }; } + //路径字符串格式 转换为 图片image格式 + private void convertToImage() { + NoteEditText noteEditText = (NoteEditText) findViewById(R.id.note_edit_view); //获取当前的edit + Editable editable = noteEditText.getText();//1.获取text + String noteText = editable.toString(); //2.将note内容转换为字符串 + int length = editable.length(); //内容的长度 + //3.截取img片段 [local]+uri+[local],提取uri + for(int i = 0; i < length; i++) { + for(int j = i; j < length; j++) { + String img_fragment = noteText.substring(i, j+1); //img_fragment:关于图片路径的片段 + if(img_fragment.length() > 15 && img_fragment.endsWith("[/local]") && img_fragment.startsWith("[local]")){ + int limit = 7; //[local]为7个字符 + //[local][/local]共15个字符,剩下的为真正的path长度 + int len = img_fragment.length()-15; + //从[local]之后的len个字符就是path + String path = img_fragment.substring(limit,limit+len);//获取到了图片路径 + Bitmap bitmap = null; + Log.d(TAG, "图片的路径是:"+path); + try { + bitmap = BitmapFactory.decodeFile(path);//将图片路径解码为图片格式 + } catch (Exception e) { + e.printStackTrace(); + } + if(bitmap!=null){ //若图片存在 + Log.d(TAG, "图片不为null"); + ImageSpan imageSpan = new ImageSpan(NoteEditActivity.this, bitmap); + //4.创建一个SpannableString对象,以便插入用ImageSpan对象封装的图像 + String ss = "[local]" + path + "[/local]"; + SpannableString spannableString = new SpannableString(ss); + //5.将指定的标记对象附加到文本的开始...结束范围 + spannableString.setSpan(imageSpan, 0, ss.length(), Spannable.SPAN_EXCLUSIVE_EXCLUSIVE); + Log.d(TAG, "Create spannable string success!"); + Editable edit_text = noteEditText.getEditableText(); + edit_text.delete(i,i+len+15); //6.删掉图片路径的文字 + edit_text.insert(i, spannableString); //7.在路径的起始位置插入图片 + } + } + } + } + } + @Override protected void onNewIntent(Intent intent) { super.onNewIntent(intent); @@ -358,8 +431,8 @@ public class NoteEditActivity extends Activity implements OnClickListener, || ev.getX() > (x + view.getWidth()) || ev.getY() < y || ev.getY() > (y + view.getHeight())) { - return false; - } + return false; + } return true; } @@ -418,7 +491,7 @@ public class NoteEditActivity extends Activity implements OnClickListener, } intent.putExtra(AppWidgetManager.EXTRA_APPWIDGET_IDS, new int[] { - mWorkingNote.getWidgetId() + mWorkingNote.getWidgetId() }); sendBroadcast(intent); @@ -430,7 +503,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); @@ -563,10 +636,6 @@ public class NoteEditActivity extends Activity implements OnClickListener, d.show(); } - /** - * Share note to apps that support {@link Intent#ACTION_SEND} action - * and {@text/plain} type - */ private void sendTo(Context context, String info) { Intent intent = new Intent(Intent.ACTION_SEND); intent.putExtra(Intent.EXTRA_TEXT, info); @@ -773,12 +842,12 @@ public class NoteEditActivity extends Activity implements OnClickListener, switchToListMode(mNoteEditor.getText().toString()); } else { if (!getWorkingText()) { - mWorkingNote.setWorkingText(mWorkingNote.getContent().replace(TAG_UNCHECKED + " ", - "")); + mWorkingNote.setWorkingText(mWorkingNote.getContent().replace(TAG_UNCHECKED + " ", "")); } mNoteEditor.setText(getHighlightQueryResult(mWorkingNote.getContent(), mUserQuery)); mEditTextList.setVisibility(View.GONE); mNoteEditor.setVisibility(View.VISIBLE); + convertToImage(); //退出清单模式,应该将有图片的地方显示出来 } } @@ -870,4 +939,110 @@ public class NoteEditActivity extends Activity implements OnClickListener, private void showToast(int resId, int duration) { Toast.makeText(this, resId, duration).show(); } + + @Override + protected void onActivityResult(int requestCode, int resultCode, Intent intent) { + super.onActivityResult(requestCode, resultCode, intent); + ContentResolver resolver = getContentResolver(); + switch (requestCode) { + case PHOTO_REQUEST: + Uri originalUri = intent.getData(); //1.获得图片的真实路径 + Bitmap bitmap = null; + try { + bitmap = BitmapFactory.decodeStream(resolver.openInputStream(originalUri));//2.解码图片 + } catch (FileNotFoundException e) { + Log.d(TAG, "onActivityResult: get file_exception"); + e.printStackTrace(); + } + + if(bitmap != null){ + //3.根据Bitmap对象创建ImageSpan对象 + Log.d(TAG, "onActivityResult: bitmap is not null"); + ImageSpan imageSpan = new ImageSpan(NoteEditActivity.this, bitmap); + String path = getPath(this,originalUri); + //4.使用[local][/local]将path括起来,用于之后方便识别图片路径在note中的位置 + String img_fragment= "[local]" + path + "[/local]"; + //创建一个SpannableString对象,以便插入用ImageSpan对象封装的图像 + SpannableString spannableString = new SpannableString(img_fragment); + spannableString.setSpan(imageSpan, 0, img_fragment.length(), Spannable.SPAN_EXCLUSIVE_EXCLUSIVE); + //5.将选择的图片追加到EditText中光标所在位置 + NoteEditText e = (NoteEditText) findViewById(R.id.note_edit_view); + int index = e.getSelectionStart(); //获取光标所在位置 + Log.d(TAG, "Index是: " + index); + Editable edit_text = e.getEditableText(); + edit_text.insert(index, spannableString); //将图片插入到光标所在位置 + + mWorkingNote.mContent = e.getText().toString(); + //6.把改动提交到数据库中,两个数据库表都要改的 + ContentResolver contentResolver = getContentResolver(); + ContentValues contentValues = new ContentValues(); + final long id = mWorkingNote.getNoteId(); + contentValues.put("snippet",mWorkingNote.mContent); + contentResolver.update(Uri.parse("content://micode_notes/note"), contentValues,"_id=?",new String[]{""+id}); + ContentValues contentValues1 = new ContentValues(); + contentValues1.put("content",mWorkingNote.mContent); + contentResolver.update(Uri.parse("content://micode_notes/data"), contentValues1,"mime_type=? and note_id=?", new String[]{"vnd.android.cursor.item/text_note",""+id}); + + }else{ + Toast.makeText(NoteEditActivity.this, "获取图片失败", Toast.LENGTH_SHORT).show(); + } + break; + default: + break; + } + } + + // Helper method to get file path from URI + public String getPath(final Context context, final Uri uri) { + // DocumentProvider + if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.KITKAT && DocumentsContract.isDocumentUri(context, uri)) { + // MediaProvider + if (isMediaDocument(uri)) { + final String docId = DocumentsContract.getDocumentId(uri); + final String[] split = docId.split(":"); + final String type = split[0]; + + Uri contentUri = null; + if ("image".equals(type)) { + contentUri = MediaStore.Images.Media.EXTERNAL_CONTENT_URI; + } + + final String selection = "_id=?"; + final String[] selectionArgs = new String[]{split[1]}; + + return getDataColumn(context, contentUri, selection, selectionArgs); + } + } + // MediaStore (and general) + else if ("content".equalsIgnoreCase(uri.getScheme())) { + return getDataColumn(context, uri, null, null); + } + // File + else if ("file".equalsIgnoreCase(uri.getScheme())) { + return uri.getPath(); + } + + return null; + } + + public String getDataColumn(Context context, Uri uri, String selection, String[] selectionArgs) { + Cursor cursor = null; + final String column = "_data"; + final String[] projection = {column}; + + try { + cursor = context.getContentResolver().query(uri, projection, selection, selectionArgs, null); + if (cursor != null && cursor.moveToFirst()) { + final int column_index = cursor.getColumnIndexOrThrow(column); + return cursor.getString(column_index); + } + } finally { + if (cursor != null) cursor.close(); + } + return null; + } + + public boolean isMediaDocument(Uri uri) { + return "com.android.providers.media.documents".equals(uri.getAuthority()); + } } diff --git a/src/ui/NoteEditText.java b/src/Notesmaster/app/src/main/java/net/micode/notes/ui/NoteEditText.java similarity index 98% rename from src/ui/NoteEditText.java rename to src/Notesmaster/app/src/main/java/net/micode/notes/ui/NoteEditText.java index 2afe2a8..c8958d3 100644 --- a/src/ui/NoteEditText.java +++ b/src/Notesmaster/app/src/main/java/net/micode/notes/ui/NoteEditText.java @@ -32,12 +32,14 @@ import android.view.MenuItem.OnMenuItemClickListener; import android.view.MotionEvent; import android.widget.EditText; +import androidx.appcompat.widget.AppCompatEditText; + import net.micode.notes.R; import java.util.HashMap; import java.util.Map; -public class NoteEditText extends EditText { +public class NoteEditText extends AppCompatEditText { private static final String TAG = "NoteEditText"; private int mIndex; private int mSelectionStartBeforeDelete; diff --git a/src/ui/NoteItemData.java b/src/Notesmaster/app/src/main/java/net/micode/notes/ui/NoteItemData.java similarity index 100% rename from src/ui/NoteItemData.java rename to src/Notesmaster/app/src/main/java/net/micode/notes/ui/NoteItemData.java diff --git a/src/ui/NotesListActivity.java b/src/Notesmaster/app/src/main/java/net/micode/notes/ui/NotesListActivity.java similarity index 97% rename from src/ui/NotesListActivity.java rename to src/Notesmaster/app/src/main/java/net/micode/notes/ui/NotesListActivity.java index e843aec..037d859 100644 --- a/src/ui/NotesListActivity.java +++ b/src/Notesmaster/app/src/main/java/net/micode/notes/ui/NotesListActivity.java @@ -79,6 +79,7 @@ import java.io.InputStreamReader; import java.util.HashSet; public class NotesListActivity extends Activity implements OnClickListener, OnItemLongClickListener { + private int mode=-1; private static final int FOLDER_NOTE_LIST_QUERY_TOKEN = 0; private static final int FOLDER_LIST_QUERY_TOKEN = 1; @@ -139,6 +140,11 @@ public class NotesListActivity extends Activity implements OnClickListener, OnIt protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.note_list); + + getWindow().setBackgroundDrawableResource(R.drawable.fly); + getWindow().setBackgroundDrawableResource(R.drawable.pink); + getWindow().setBackgroundDrawableResource(R.drawable.falus); + initResources(); /** @@ -775,12 +781,35 @@ public class NotesListActivity extends Activity implements OnClickListener, OnIt } else { Log.e(TAG, "Wrong state:" + mState); } + + if(mode==-1) + menu.findItem(R.id.menu_fly).setVisible(false); + else if(mode==0) + menu.findItem(R.id.menu_falus).setVisible(false); + else if(mode==1) + menu.findItem(R.id.menu_pink).setVisible(false); + return true; } @Override public boolean onOptionsItemSelected(MenuItem item) { switch (item.getItemId()) { + case R.id.menu_falus: { + mode=-1; + getWindow().setBackgroundDrawableResource(R.drawable.falus); + break; + } + case R.id.menu_pink: { + mode=0; + getWindow().setBackgroundDrawableResource(R.drawable.pink); + break; + } + case R.id.menu_fly: { + mode=1; + getWindow().setBackgroundDrawableResource(R.drawable.fly); + break; + } case R.id.menu_new_folder: { showCreateOrModifyFolderDialog(true); break; diff --git a/src/ui/NotesListAdapter.java b/src/Notesmaster/app/src/main/java/net/micode/notes/ui/NotesListAdapter.java similarity index 100% rename from src/ui/NotesListAdapter.java rename to src/Notesmaster/app/src/main/java/net/micode/notes/ui/NotesListAdapter.java diff --git a/src/ui/NotesListItem.java b/src/Notesmaster/app/src/main/java/net/micode/notes/ui/NotesListItem.java similarity index 100% rename from src/ui/NotesListItem.java rename to src/Notesmaster/app/src/main/java/net/micode/notes/ui/NotesListItem.java diff --git a/src/ui/NotesPreferenceActivity.java b/src/Notesmaster/app/src/main/java/net/micode/notes/ui/NotesPreferenceActivity.java similarity index 100% rename from src/ui/NotesPreferenceActivity.java rename to src/Notesmaster/app/src/main/java/net/micode/notes/ui/NotesPreferenceActivity.java diff --git a/src/widget/NoteWidgetProvider.java b/src/Notesmaster/app/src/main/java/net/micode/notes/widget/NoteWidgetProvider.java similarity index 100% rename from src/widget/NoteWidgetProvider.java rename to src/Notesmaster/app/src/main/java/net/micode/notes/widget/NoteWidgetProvider.java diff --git a/src/widget/NoteWidgetProvider_2x.java b/src/Notesmaster/app/src/main/java/net/micode/notes/widget/NoteWidgetProvider_2x.java similarity index 100% rename from src/widget/NoteWidgetProvider_2x.java rename to src/Notesmaster/app/src/main/java/net/micode/notes/widget/NoteWidgetProvider_2x.java diff --git a/src/widget/NoteWidgetProvider_4x.java b/src/Notesmaster/app/src/main/java/net/micode/notes/widget/NoteWidgetProvider_4x.java similarity index 100% rename from src/widget/NoteWidgetProvider_4x.java rename to src/Notesmaster/app/src/main/java/net/micode/notes/widget/NoteWidgetProvider_4x.java diff --git a/src/Notesmaster/app/src/main/res/color/background.xml b/src/Notesmaster/app/src/main/res/color/background.xml new file mode 100644 index 0000000..a8b409b --- /dev/null +++ b/src/Notesmaster/app/src/main/res/color/background.xml @@ -0,0 +1,4 @@ + + + + \ No newline at end of file diff --git a/src/Notesmaster/app/src/main/res/color/primary_text_dark.xml b/src/Notesmaster/app/src/main/res/color/primary_text_dark.xml new file mode 100644 index 0000000..7c85459 --- /dev/null +++ b/src/Notesmaster/app/src/main/res/color/primary_text_dark.xml @@ -0,0 +1,22 @@ + + + + + + + + + \ No newline at end of file diff --git a/src/Notesmaster/app/src/main/res/color/secondary_text_dark.xml b/src/Notesmaster/app/src/main/res/color/secondary_text_dark.xml new file mode 100644 index 0000000..c1c2384 --- /dev/null +++ b/src/Notesmaster/app/src/main/res/color/secondary_text_dark.xml @@ -0,0 +1,20 @@ + + + + + + + \ No newline at end of file diff --git a/src/Notesmaster/app/src/main/res/drawable-hdpi/bg_btn_set_color.png b/src/Notesmaster/app/src/main/res/drawable-hdpi/bg_btn_set_color.png new file mode 100644 index 0000000..5eb5d44 Binary files /dev/null and b/src/Notesmaster/app/src/main/res/drawable-hdpi/bg_btn_set_color.png differ diff --git a/src/Notesmaster/app/src/main/res/drawable-hdpi/bg_color_btn_mask.png b/src/Notesmaster/app/src/main/res/drawable-hdpi/bg_color_btn_mask.png new file mode 100644 index 0000000..100db77 Binary files /dev/null and b/src/Notesmaster/app/src/main/res/drawable-hdpi/bg_color_btn_mask.png differ diff --git a/src/Notesmaster/app/src/main/res/drawable-hdpi/call_record.png b/src/Notesmaster/app/src/main/res/drawable-hdpi/call_record.png new file mode 100644 index 0000000..fb88ca4 Binary files /dev/null and b/src/Notesmaster/app/src/main/res/drawable-hdpi/call_record.png differ diff --git a/src/Notesmaster/app/src/main/res/drawable-hdpi/clock.png b/src/Notesmaster/app/src/main/res/drawable-hdpi/clock.png new file mode 100644 index 0000000..5f2ae9a Binary files /dev/null and b/src/Notesmaster/app/src/main/res/drawable-hdpi/clock.png differ diff --git a/src/Notesmaster/app/src/main/res/drawable-hdpi/delete.png b/src/Notesmaster/app/src/main/res/drawable-hdpi/delete.png new file mode 100644 index 0000000..643de3e Binary files /dev/null and b/src/Notesmaster/app/src/main/res/drawable-hdpi/delete.png differ diff --git a/src/Notesmaster/app/src/main/res/drawable-hdpi/dropdown_icon.9.png b/src/Notesmaster/app/src/main/res/drawable-hdpi/dropdown_icon.9.png new file mode 100644 index 0000000..5525025 Binary files /dev/null and b/src/Notesmaster/app/src/main/res/drawable-hdpi/dropdown_icon.9.png differ diff --git a/src/Notesmaster/app/src/main/res/drawable-hdpi/edit_blue.9.png b/src/Notesmaster/app/src/main/res/drawable-hdpi/edit_blue.9.png new file mode 100644 index 0000000..55a1856 Binary files /dev/null and b/src/Notesmaster/app/src/main/res/drawable-hdpi/edit_blue.9.png differ diff --git a/src/Notesmaster/app/src/main/res/drawable-hdpi/edit_green.9.png b/src/Notesmaster/app/src/main/res/drawable-hdpi/edit_green.9.png new file mode 100644 index 0000000..2cb2d60 Binary files /dev/null and b/src/Notesmaster/app/src/main/res/drawable-hdpi/edit_green.9.png differ diff --git a/src/Notesmaster/app/src/main/res/drawable-hdpi/edit_red.9.png b/src/Notesmaster/app/src/main/res/drawable-hdpi/edit_red.9.png new file mode 100644 index 0000000..bae944a Binary files /dev/null and b/src/Notesmaster/app/src/main/res/drawable-hdpi/edit_red.9.png differ diff --git a/src/Notesmaster/app/src/main/res/drawable-hdpi/edit_title_blue.9.png b/src/Notesmaster/app/src/main/res/drawable-hdpi/edit_title_blue.9.png new file mode 100644 index 0000000..96e6092 Binary files /dev/null and b/src/Notesmaster/app/src/main/res/drawable-hdpi/edit_title_blue.9.png differ diff --git a/src/Notesmaster/app/src/main/res/drawable-hdpi/edit_title_green.9.png b/src/Notesmaster/app/src/main/res/drawable-hdpi/edit_title_green.9.png new file mode 100644 index 0000000..08d8644 Binary files /dev/null and b/src/Notesmaster/app/src/main/res/drawable-hdpi/edit_title_green.9.png differ diff --git a/src/Notesmaster/app/src/main/res/drawable-hdpi/edit_title_red.9.png b/src/Notesmaster/app/src/main/res/drawable-hdpi/edit_title_red.9.png new file mode 100644 index 0000000..9c430e5 Binary files /dev/null and b/src/Notesmaster/app/src/main/res/drawable-hdpi/edit_title_red.9.png differ diff --git a/src/Notesmaster/app/src/main/res/drawable-hdpi/edit_title_white.9.png b/src/Notesmaster/app/src/main/res/drawable-hdpi/edit_title_white.9.png new file mode 100644 index 0000000..19e8d95 Binary files /dev/null and b/src/Notesmaster/app/src/main/res/drawable-hdpi/edit_title_white.9.png differ diff --git a/src/Notesmaster/app/src/main/res/drawable-hdpi/edit_title_yellow.9.png b/src/Notesmaster/app/src/main/res/drawable-hdpi/edit_title_yellow.9.png new file mode 100644 index 0000000..bf8f580 Binary files /dev/null and b/src/Notesmaster/app/src/main/res/drawable-hdpi/edit_title_yellow.9.png differ diff --git a/src/Notesmaster/app/src/main/res/drawable-hdpi/edit_white.9.png b/src/Notesmaster/app/src/main/res/drawable-hdpi/edit_white.9.png new file mode 100644 index 0000000..918f7a6 Binary files /dev/null and b/src/Notesmaster/app/src/main/res/drawable-hdpi/edit_white.9.png differ diff --git a/src/Notesmaster/app/src/main/res/drawable-hdpi/edit_yellow.9.png b/src/Notesmaster/app/src/main/res/drawable-hdpi/edit_yellow.9.png new file mode 100644 index 0000000..10cb642 Binary files /dev/null and b/src/Notesmaster/app/src/main/res/drawable-hdpi/edit_yellow.9.png differ diff --git a/src/Notesmaster/app/src/main/res/drawable-hdpi/falus.png b/src/Notesmaster/app/src/main/res/drawable-hdpi/falus.png new file mode 100644 index 0000000..970f9a9 Binary files /dev/null and b/src/Notesmaster/app/src/main/res/drawable-hdpi/falus.png differ diff --git a/src/Notesmaster/app/src/main/res/drawable-hdpi/fly.png b/src/Notesmaster/app/src/main/res/drawable-hdpi/fly.png new file mode 100644 index 0000000..e545915 Binary files /dev/null and b/src/Notesmaster/app/src/main/res/drawable-hdpi/fly.png differ diff --git a/src/Notesmaster/app/src/main/res/drawable-hdpi/font_large.png b/src/Notesmaster/app/src/main/res/drawable-hdpi/font_large.png new file mode 100644 index 0000000..78cf2e6 Binary files /dev/null and b/src/Notesmaster/app/src/main/res/drawable-hdpi/font_large.png differ diff --git a/src/Notesmaster/app/src/main/res/drawable-hdpi/font_normal.png b/src/Notesmaster/app/src/main/res/drawable-hdpi/font_normal.png new file mode 100644 index 0000000..9de7ced Binary files /dev/null and b/src/Notesmaster/app/src/main/res/drawable-hdpi/font_normal.png differ diff --git a/src/Notesmaster/app/src/main/res/drawable-hdpi/font_size_selector_bg.9.png b/src/Notesmaster/app/src/main/res/drawable-hdpi/font_size_selector_bg.9.png new file mode 100644 index 0000000..be8e64c Binary files /dev/null and b/src/Notesmaster/app/src/main/res/drawable-hdpi/font_size_selector_bg.9.png differ diff --git a/src/Notesmaster/app/src/main/res/drawable-hdpi/font_small.png b/src/Notesmaster/app/src/main/res/drawable-hdpi/font_small.png new file mode 100644 index 0000000..d3ff104 Binary files /dev/null and b/src/Notesmaster/app/src/main/res/drawable-hdpi/font_small.png differ diff --git a/src/Notesmaster/app/src/main/res/drawable-hdpi/font_super.png b/src/Notesmaster/app/src/main/res/drawable-hdpi/font_super.png new file mode 100644 index 0000000..85b13a1 Binary files /dev/null and b/src/Notesmaster/app/src/main/res/drawable-hdpi/font_super.png differ diff --git a/src/Notesmaster/app/src/main/res/drawable-hdpi/icon_app.png b/src/Notesmaster/app/src/main/res/drawable-hdpi/icon_app.png new file mode 100644 index 0000000..418aadc Binary files /dev/null and b/src/Notesmaster/app/src/main/res/drawable-hdpi/icon_app.png differ diff --git a/src/Notesmaster/app/src/main/res/drawable-hdpi/list_background.png b/src/Notesmaster/app/src/main/res/drawable-hdpi/list_background.png new file mode 100644 index 0000000..087e1f9 Binary files /dev/null and b/src/Notesmaster/app/src/main/res/drawable-hdpi/list_background.png differ diff --git a/src/Notesmaster/app/src/main/res/drawable-hdpi/list_blue_down.9.png b/src/Notesmaster/app/src/main/res/drawable-hdpi/list_blue_down.9.png new file mode 100644 index 0000000..b88eebf Binary files /dev/null and b/src/Notesmaster/app/src/main/res/drawable-hdpi/list_blue_down.9.png differ diff --git a/src/Notesmaster/app/src/main/res/drawable-hdpi/list_blue_middle.9.png b/src/Notesmaster/app/src/main/res/drawable-hdpi/list_blue_middle.9.png new file mode 100644 index 0000000..96b1c8b Binary files /dev/null and b/src/Notesmaster/app/src/main/res/drawable-hdpi/list_blue_middle.9.png differ diff --git a/src/Notesmaster/app/src/main/res/drawable-hdpi/list_blue_single.9.png b/src/Notesmaster/app/src/main/res/drawable-hdpi/list_blue_single.9.png new file mode 100644 index 0000000..d7e7206 Binary files /dev/null and b/src/Notesmaster/app/src/main/res/drawable-hdpi/list_blue_single.9.png differ diff --git a/src/Notesmaster/app/src/main/res/drawable-hdpi/list_blue_up.9.png b/src/Notesmaster/app/src/main/res/drawable-hdpi/list_blue_up.9.png new file mode 100644 index 0000000..632e88c Binary files /dev/null and b/src/Notesmaster/app/src/main/res/drawable-hdpi/list_blue_up.9.png differ diff --git a/src/Notesmaster/app/src/main/res/drawable-hdpi/list_folder.9.png b/src/Notesmaster/app/src/main/res/drawable-hdpi/list_folder.9.png new file mode 100644 index 0000000..829f61b Binary files /dev/null and b/src/Notesmaster/app/src/main/res/drawable-hdpi/list_folder.9.png differ diff --git a/src/Notesmaster/app/src/main/res/drawable-hdpi/list_footer_bg.9.png b/src/Notesmaster/app/src/main/res/drawable-hdpi/list_footer_bg.9.png new file mode 100644 index 0000000..5325c25 Binary files /dev/null and b/src/Notesmaster/app/src/main/res/drawable-hdpi/list_footer_bg.9.png differ diff --git a/src/Notesmaster/app/src/main/res/drawable-hdpi/list_green_down.9.png b/src/Notesmaster/app/src/main/res/drawable-hdpi/list_green_down.9.png new file mode 100644 index 0000000..64a39d9 Binary files /dev/null and b/src/Notesmaster/app/src/main/res/drawable-hdpi/list_green_down.9.png differ diff --git a/src/Notesmaster/app/src/main/res/drawable-hdpi/list_green_middle.9.png b/src/Notesmaster/app/src/main/res/drawable-hdpi/list_green_middle.9.png new file mode 100644 index 0000000..897325a Binary files /dev/null and b/src/Notesmaster/app/src/main/res/drawable-hdpi/list_green_middle.9.png differ diff --git a/src/Notesmaster/app/src/main/res/drawable-hdpi/list_green_single.9.png b/src/Notesmaster/app/src/main/res/drawable-hdpi/list_green_single.9.png new file mode 100644 index 0000000..c83405f Binary files /dev/null and b/src/Notesmaster/app/src/main/res/drawable-hdpi/list_green_single.9.png differ diff --git a/src/Notesmaster/app/src/main/res/drawable-hdpi/list_green_up.9.png b/src/Notesmaster/app/src/main/res/drawable-hdpi/list_green_up.9.png new file mode 100644 index 0000000..141f9e1 Binary files /dev/null and b/src/Notesmaster/app/src/main/res/drawable-hdpi/list_green_up.9.png differ diff --git a/src/Notesmaster/app/src/main/res/drawable-hdpi/list_red_down.9.png b/src/Notesmaster/app/src/main/res/drawable-hdpi/list_red_down.9.png new file mode 100644 index 0000000..4224309 Binary files /dev/null and b/src/Notesmaster/app/src/main/res/drawable-hdpi/list_red_down.9.png differ diff --git a/src/Notesmaster/app/src/main/res/drawable-hdpi/list_red_middle.9.png b/src/Notesmaster/app/src/main/res/drawable-hdpi/list_red_middle.9.png new file mode 100644 index 0000000..9988f17 Binary files /dev/null and b/src/Notesmaster/app/src/main/res/drawable-hdpi/list_red_middle.9.png differ diff --git a/src/Notesmaster/app/src/main/res/drawable-hdpi/list_red_single.9.png b/src/Notesmaster/app/src/main/res/drawable-hdpi/list_red_single.9.png new file mode 100644 index 0000000..587c348 Binary files /dev/null and b/src/Notesmaster/app/src/main/res/drawable-hdpi/list_red_single.9.png differ diff --git a/src/Notesmaster/app/src/main/res/drawable-hdpi/list_red_up.9.png b/src/Notesmaster/app/src/main/res/drawable-hdpi/list_red_up.9.png new file mode 100644 index 0000000..46b4757 Binary files /dev/null and b/src/Notesmaster/app/src/main/res/drawable-hdpi/list_red_up.9.png differ diff --git a/src/Notesmaster/app/src/main/res/drawable-hdpi/list_white_down.9.png b/src/Notesmaster/app/src/main/res/drawable-hdpi/list_white_down.9.png new file mode 100644 index 0000000..29f9d8c Binary files /dev/null and b/src/Notesmaster/app/src/main/res/drawable-hdpi/list_white_down.9.png differ diff --git a/src/Notesmaster/app/src/main/res/drawable-hdpi/list_white_middle.9.png b/src/Notesmaster/app/src/main/res/drawable-hdpi/list_white_middle.9.png new file mode 100644 index 0000000..77a4ab4 Binary files /dev/null and b/src/Notesmaster/app/src/main/res/drawable-hdpi/list_white_middle.9.png differ diff --git a/src/Notesmaster/app/src/main/res/drawable-hdpi/list_white_single.9.png b/src/Notesmaster/app/src/main/res/drawable-hdpi/list_white_single.9.png new file mode 100644 index 0000000..3e79189 Binary files /dev/null and b/src/Notesmaster/app/src/main/res/drawable-hdpi/list_white_single.9.png differ diff --git a/src/Notesmaster/app/src/main/res/drawable-hdpi/list_white_up.9.png b/src/Notesmaster/app/src/main/res/drawable-hdpi/list_white_up.9.png new file mode 100644 index 0000000..e23cd5c Binary files /dev/null and b/src/Notesmaster/app/src/main/res/drawable-hdpi/list_white_up.9.png differ diff --git a/src/Notesmaster/app/src/main/res/drawable-hdpi/list_yellow_down.9.png b/src/Notesmaster/app/src/main/res/drawable-hdpi/list_yellow_down.9.png new file mode 100644 index 0000000..31cfc1e Binary files /dev/null and b/src/Notesmaster/app/src/main/res/drawable-hdpi/list_yellow_down.9.png differ diff --git a/src/Notesmaster/app/src/main/res/drawable-hdpi/list_yellow_middle.9.png b/src/Notesmaster/app/src/main/res/drawable-hdpi/list_yellow_middle.9.png new file mode 100644 index 0000000..b6549b2 Binary files /dev/null and b/src/Notesmaster/app/src/main/res/drawable-hdpi/list_yellow_middle.9.png differ diff --git a/src/Notesmaster/app/src/main/res/drawable-hdpi/list_yellow_single.9.png b/src/Notesmaster/app/src/main/res/drawable-hdpi/list_yellow_single.9.png new file mode 100644 index 0000000..3faf507 Binary files /dev/null and b/src/Notesmaster/app/src/main/res/drawable-hdpi/list_yellow_single.9.png differ diff --git a/src/Notesmaster/app/src/main/res/drawable-hdpi/list_yellow_up.9.png b/src/Notesmaster/app/src/main/res/drawable-hdpi/list_yellow_up.9.png new file mode 100644 index 0000000..4ae791c Binary files /dev/null and b/src/Notesmaster/app/src/main/res/drawable-hdpi/list_yellow_up.9.png differ diff --git a/src/Notesmaster/app/src/main/res/drawable-hdpi/menu_delete.png b/src/Notesmaster/app/src/main/res/drawable-hdpi/menu_delete.png new file mode 100644 index 0000000..ccdfc4b Binary files /dev/null and b/src/Notesmaster/app/src/main/res/drawable-hdpi/menu_delete.png differ diff --git a/src/Notesmaster/app/src/main/res/drawable-hdpi/menu_move.png b/src/Notesmaster/app/src/main/res/drawable-hdpi/menu_move.png new file mode 100644 index 0000000..1140b71 Binary files /dev/null and b/src/Notesmaster/app/src/main/res/drawable-hdpi/menu_move.png differ diff --git a/src/Notesmaster/app/src/main/res/drawable-hdpi/new_note_normal.png b/src/Notesmaster/app/src/main/res/drawable-hdpi/new_note_normal.png new file mode 100644 index 0000000..e24e0d1 Binary files /dev/null and b/src/Notesmaster/app/src/main/res/drawable-hdpi/new_note_normal.png differ diff --git a/src/Notesmaster/app/src/main/res/drawable-hdpi/new_note_pressed.png b/src/Notesmaster/app/src/main/res/drawable-hdpi/new_note_pressed.png new file mode 100644 index 0000000..c748936 Binary files /dev/null and b/src/Notesmaster/app/src/main/res/drawable-hdpi/new_note_pressed.png differ diff --git a/src/Notesmaster/app/src/main/res/drawable-hdpi/note_edit_color_selector_panel.png b/src/Notesmaster/app/src/main/res/drawable-hdpi/note_edit_color_selector_panel.png new file mode 100644 index 0000000..fc49552 Binary files /dev/null and b/src/Notesmaster/app/src/main/res/drawable-hdpi/note_edit_color_selector_panel.png differ diff --git a/src/Notesmaster/app/src/main/res/drawable-hdpi/notification.png b/src/Notesmaster/app/src/main/res/drawable-hdpi/notification.png new file mode 100644 index 0000000..b13ab4a Binary files /dev/null and b/src/Notesmaster/app/src/main/res/drawable-hdpi/notification.png differ diff --git a/src/Notesmaster/app/src/main/res/drawable-hdpi/pink.png b/src/Notesmaster/app/src/main/res/drawable-hdpi/pink.png new file mode 100644 index 0000000..75ee499 Binary files /dev/null and b/src/Notesmaster/app/src/main/res/drawable-hdpi/pink.png differ diff --git a/src/Notesmaster/app/src/main/res/drawable-hdpi/search_result.png b/src/Notesmaster/app/src/main/res/drawable-hdpi/search_result.png new file mode 100644 index 0000000..ff2befd Binary files /dev/null and b/src/Notesmaster/app/src/main/res/drawable-hdpi/search_result.png differ diff --git a/src/Notesmaster/app/src/main/res/drawable-hdpi/selected.png b/src/Notesmaster/app/src/main/res/drawable-hdpi/selected.png new file mode 100644 index 0000000..b889bef Binary files /dev/null and b/src/Notesmaster/app/src/main/res/drawable-hdpi/selected.png differ diff --git a/src/Notesmaster/app/src/main/res/drawable-hdpi/title_alert.png b/src/Notesmaster/app/src/main/res/drawable-hdpi/title_alert.png new file mode 100644 index 0000000..544ee9c Binary files /dev/null and b/src/Notesmaster/app/src/main/res/drawable-hdpi/title_alert.png differ diff --git a/src/Notesmaster/app/src/main/res/drawable-hdpi/title_bar_bg.9.png b/src/Notesmaster/app/src/main/res/drawable-hdpi/title_bar_bg.9.png new file mode 100644 index 0000000..eb6bff0 Binary files /dev/null and b/src/Notesmaster/app/src/main/res/drawable-hdpi/title_bar_bg.9.png differ diff --git a/src/Notesmaster/app/src/main/res/drawable-hdpi/widget_2x_blue.png b/src/Notesmaster/app/src/main/res/drawable-hdpi/widget_2x_blue.png new file mode 100644 index 0000000..a1707f4 Binary files /dev/null and b/src/Notesmaster/app/src/main/res/drawable-hdpi/widget_2x_blue.png differ diff --git a/src/Notesmaster/app/src/main/res/drawable-hdpi/widget_2x_green.png b/src/Notesmaster/app/src/main/res/drawable-hdpi/widget_2x_green.png new file mode 100644 index 0000000..f86886c Binary files /dev/null and b/src/Notesmaster/app/src/main/res/drawable-hdpi/widget_2x_green.png differ diff --git a/src/Notesmaster/app/src/main/res/drawable-hdpi/widget_2x_red.png b/src/Notesmaster/app/src/main/res/drawable-hdpi/widget_2x_red.png new file mode 100644 index 0000000..0e66c29 Binary files /dev/null and b/src/Notesmaster/app/src/main/res/drawable-hdpi/widget_2x_red.png differ diff --git a/src/Notesmaster/app/src/main/res/drawable-hdpi/widget_2x_white.png b/src/Notesmaster/app/src/main/res/drawable-hdpi/widget_2x_white.png new file mode 100644 index 0000000..5f0619a Binary files /dev/null and b/src/Notesmaster/app/src/main/res/drawable-hdpi/widget_2x_white.png differ diff --git a/src/Notesmaster/app/src/main/res/drawable-hdpi/widget_2x_yellow.png b/src/Notesmaster/app/src/main/res/drawable-hdpi/widget_2x_yellow.png new file mode 100644 index 0000000..12d1c2b Binary files /dev/null and b/src/Notesmaster/app/src/main/res/drawable-hdpi/widget_2x_yellow.png differ diff --git a/src/Notesmaster/app/src/main/res/drawable-hdpi/widget_4x_blue.png b/src/Notesmaster/app/src/main/res/drawable-hdpi/widget_4x_blue.png new file mode 100644 index 0000000..9183738 Binary files /dev/null and b/src/Notesmaster/app/src/main/res/drawable-hdpi/widget_4x_blue.png differ diff --git a/src/Notesmaster/app/src/main/res/drawable-hdpi/widget_4x_green.png b/src/Notesmaster/app/src/main/res/drawable-hdpi/widget_4x_green.png new file mode 100644 index 0000000..fa8b452 Binary files /dev/null and b/src/Notesmaster/app/src/main/res/drawable-hdpi/widget_4x_green.png differ diff --git a/src/Notesmaster/app/src/main/res/drawable-hdpi/widget_4x_red.png b/src/Notesmaster/app/src/main/res/drawable-hdpi/widget_4x_red.png new file mode 100644 index 0000000..62de074 Binary files /dev/null and b/src/Notesmaster/app/src/main/res/drawable-hdpi/widget_4x_red.png differ diff --git a/src/Notesmaster/app/src/main/res/drawable-hdpi/widget_4x_white.png b/src/Notesmaster/app/src/main/res/drawable-hdpi/widget_4x_white.png new file mode 100644 index 0000000..a37d67c Binary files /dev/null and b/src/Notesmaster/app/src/main/res/drawable-hdpi/widget_4x_white.png differ diff --git a/src/Notesmaster/app/src/main/res/drawable-hdpi/widget_4x_yellow.png b/src/Notesmaster/app/src/main/res/drawable-hdpi/widget_4x_yellow.png new file mode 100644 index 0000000..d7c5fa4 Binary files /dev/null and b/src/Notesmaster/app/src/main/res/drawable-hdpi/widget_4x_yellow.png differ diff --git a/src/Notesmaster/app/src/main/res/drawable/button_bg.xml b/src/Notesmaster/app/src/main/res/drawable/button_bg.xml new file mode 100644 index 0000000..39d9bed --- /dev/null +++ b/src/Notesmaster/app/src/main/res/drawable/button_bg.xml @@ -0,0 +1,14 @@ + + + + + + + + + + + + + + \ No newline at end of file diff --git a/src/Notesmaster/app/src/main/res/drawable/edittext_bg.xml b/src/Notesmaster/app/src/main/res/drawable/edittext_bg.xml new file mode 100644 index 0000000..2609051 --- /dev/null +++ b/src/Notesmaster/app/src/main/res/drawable/edittext_bg.xml @@ -0,0 +1,5 @@ + + + + + \ No newline at end of file diff --git a/src/Notesmaster/app/src/main/res/drawable/ic_launcher_background.xml b/src/Notesmaster/app/src/main/res/drawable/ic_launcher_background.xml new file mode 100644 index 0000000..07d5da9 --- /dev/null +++ b/src/Notesmaster/app/src/main/res/drawable/ic_launcher_background.xml @@ -0,0 +1,170 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/src/Notesmaster/app/src/main/res/drawable/ic_launcher_foreground.xml b/src/Notesmaster/app/src/main/res/drawable/ic_launcher_foreground.xml new file mode 100644 index 0000000..2b068d1 --- /dev/null +++ b/src/Notesmaster/app/src/main/res/drawable/ic_launcher_foreground.xml @@ -0,0 +1,30 @@ + + + + + + + + + + + \ No newline at end of file diff --git a/src/Notesmaster/app/src/main/res/drawable/new_note.xml b/src/Notesmaster/app/src/main/res/drawable/new_note.xml new file mode 100644 index 0000000..2154ebc --- /dev/null +++ b/src/Notesmaster/app/src/main/res/drawable/new_note.xml @@ -0,0 +1,23 @@ + + + + + + + + diff --git a/src/Notesmaster/app/src/main/res/drawable/password_background.xml b/src/Notesmaster/app/src/main/res/drawable/password_background.xml new file mode 100644 index 0000000..ad1af2c --- /dev/null +++ b/src/Notesmaster/app/src/main/res/drawable/password_background.xml @@ -0,0 +1,14 @@ + + + + + + + + + + + \ No newline at end of file diff --git a/src/Notesmaster/app/src/main/res/layout/account_dialog_title.xml b/src/Notesmaster/app/src/main/res/layout/account_dialog_title.xml new file mode 100644 index 0000000..7717112 --- /dev/null +++ b/src/Notesmaster/app/src/main/res/layout/account_dialog_title.xml @@ -0,0 +1,43 @@ + + + + + + + + + + + \ No newline at end of file diff --git a/src/Notesmaster/app/src/main/res/layout/activity_main.xml b/src/Notesmaster/app/src/main/res/layout/activity_main.xml new file mode 100644 index 0000000..86a5d97 --- /dev/null +++ b/src/Notesmaster/app/src/main/res/layout/activity_main.xml @@ -0,0 +1,19 @@ + + + + + + \ No newline at end of file diff --git a/src/Notesmaster/app/src/main/res/layout/add_account_text.xml b/src/Notesmaster/app/src/main/res/layout/add_account_text.xml new file mode 100644 index 0000000..c799178 --- /dev/null +++ b/src/Notesmaster/app/src/main/res/layout/add_account_text.xml @@ -0,0 +1,32 @@ + + + + + + + + \ No newline at end of file diff --git a/src/Notesmaster/app/src/main/res/layout/datetime_picker.xml b/src/Notesmaster/app/src/main/res/layout/datetime_picker.xml new file mode 100644 index 0000000..f10d592 --- /dev/null +++ b/src/Notesmaster/app/src/main/res/layout/datetime_picker.xml @@ -0,0 +1,56 @@ + + + + + + + + + + + + \ No newline at end of file diff --git a/src/Notesmaster/app/src/main/res/layout/dialog_edit_text.xml b/src/Notesmaster/app/src/main/res/layout/dialog_edit_text.xml new file mode 100644 index 0000000..361b39a --- /dev/null +++ b/src/Notesmaster/app/src/main/res/layout/dialog_edit_text.xml @@ -0,0 +1,23 @@ + + + + + \ No newline at end of file diff --git a/src/Notesmaster/app/src/main/res/layout/folder_list_item.xml b/src/Notesmaster/app/src/main/res/layout/folder_list_item.xml new file mode 100644 index 0000000..77e8148 --- /dev/null +++ b/src/Notesmaster/app/src/main/res/layout/folder_list_item.xml @@ -0,0 +1,29 @@ + + + + + + + + \ No newline at end of file diff --git a/src/Notesmaster/app/src/main/res/layout/note_decryption.xml b/src/Notesmaster/app/src/main/res/layout/note_decryption.xml new file mode 100644 index 0000000..cdc89f2 --- /dev/null +++ b/src/Notesmaster/app/src/main/res/layout/note_decryption.xml @@ -0,0 +1,6 @@ + + + + \ No newline at end of file diff --git a/src/Notesmaster/app/src/main/res/layout/note_edit.xml b/src/Notesmaster/app/src/main/res/layout/note_edit.xml new file mode 100644 index 0000000..95c168f --- /dev/null +++ b/src/Notesmaster/app/src/main/res/layout/note_edit.xml @@ -0,0 +1,408 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/src/Notesmaster/app/src/main/res/layout/note_edit_list_item.xml b/src/Notesmaster/app/src/main/res/layout/note_edit_list_item.xml new file mode 100644 index 0000000..a885f9c --- /dev/null +++ b/src/Notesmaster/app/src/main/res/layout/note_edit_list_item.xml @@ -0,0 +1,39 @@ + + + + + + + + + + diff --git a/src/Notesmaster/app/src/main/res/layout/note_encryption.xml b/src/Notesmaster/app/src/main/res/layout/note_encryption.xml new file mode 100644 index 0000000..18fbe27 --- /dev/null +++ b/src/Notesmaster/app/src/main/res/layout/note_encryption.xml @@ -0,0 +1,45 @@ + + + + + + + + + + + + + + +