Compare commits

...

7 Commits

Author SHA1 Message Date
Xiaonidaba 8a1197d22d 文档提交
2 months ago
范鑫源 103e3ed27c 新增功能:更换背景图片
3 months ago
范鑫源 c5e7f9b340 版本更新:基础功能已完善
3 months ago
范鑫源 d26d32c872 删除test1文件
3 months ago
fxy1070059060 6e6f27160c readme文件修改
3 months ago
fxy1070059060 167eca197e 个人代码提交
3 months ago
fxy1070059060 d0f9bc2dd9 第一次提交
3 months ago

@ -1 +1,3 @@
# Notes-master # 小米便签个人分支------范鑫源
### 此分支为个人测试分支

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

@ -0,0 +1,3 @@
# 默认忽略的文件
/shelf/
/workspace.xml

@ -0,0 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="CompilerConfiguration">
<bytecodeTargetLevel target="21" />
</component>
</project>

@ -0,0 +1,10 @@
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="deploymentTargetSelector">
<selectionStates>
<SelectionState runConfigName="app">
<option name="selectionMode" value="DROPDOWN" />
</SelectionState>
</selectionStates>
</component>
</project>

@ -0,0 +1,20 @@
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="GradleMigrationSettings" migrationVersion="1" />
<component name="GradleSettings">
<option name="linkedExternalProjectsSettings">
<GradleProjectSettings>
<option name="testRunner" value="CHOOSE_PER_TEST" />
<option name="externalProjectPath" value="$PROJECT_DIR$" />
<option name="gradleJvm" value="#GRADLE_LOCAL_JAVA_HOME" />
<option name="modules">
<set>
<option value="$PROJECT_DIR$" />
<option value="$PROJECT_DIR$/app" />
</set>
</option>
<option name="resolveExternalAnnotations" value="false" />
</GradleProjectSettings>
</option>
</component>
</project>

@ -0,0 +1,10 @@
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="ProjectMigrations">
<option name="MigrateToGradleLocalJavaHome">
<set>
<option value="$PROJECT_DIR$" />
</set>
</option>
</component>
</project>

@ -0,0 +1,9 @@
<project version="4">
<component name="ExternalStorageConfigurationManager" enabled="true" />
<component name="ProjectRootManager" version="2" languageLevel="JDK_21" default="true" project-jdk-name="jbr-21" project-jdk-type="JavaSDK">
<output url="file://$PROJECT_DIR$/build/classes" />
</component>
<component name="ProjectType">
<option name="id" value="Android" />
</component>
</project>

@ -1,13 +1,13 @@
<?xml version="1.0" encoding="UTF-8"?> <?xml version="1.0" encoding="UTF-8"?>
<project version="4"> <project version="4">
<component name="RunConfigurationProducerService"> <component name="RunConfigurationProducerService">
<option name="ignoredProducers"> <option name="ignoredProducers">
<set> <set>
<option value="com.intellij.execution.junit.AbstractAllInDirectoryConfigurationProducer" /> <option value="com.intellij.execution.junit.AbstractAllInDirectoryConfigurationProducer" />
<option value="com.intellij.execution.junit.AllInPackageConfigurationProducer" /> <option value="com.intellij.execution.junit.AllInPackageConfigurationProducer" />
<option value="com.intellij.execution.junit.TestInClassConfigurationProducer" /> <option value="com.intellij.execution.junit.TestInClassConfigurationProducer" />
<option value="com.intellij.execution.junit.UniqueIdConfigurationProducer" /> <option value="com.intellij.execution.junit.UniqueIdConfigurationProducer" />
</set> </set>
</option> </option>
</component> </component>
</project> </project>

@ -0,0 +1,4 @@
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="VcsDirectoryMappings" defaultProject="true" />
</project>

@ -0,0 +1,54 @@
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"
}
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.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(files("F:\\MyApplication\\httpcomponents-client-4.5.14-bin\\lib\\httpclient-osgi-4.5.14.jar"))
implementation(files("F:\\MyApplication\\httpcomponents-client-4.5.14-bin\\lib\\httpclient-win-4.5.14.jar"))
implementation(files("F:\\MyApplication\\httpcomponents-client-4.5.14-bin\\lib\\httpcore-4.4.16.jar"))
testImplementation(libs.junit)
androidTestImplementation(libs.ext.junit)
androidTestImplementation(libs.espresso.core)
}

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

@ -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 <a href="http://d.android.com/tools/testing">Testing documentation</a>
*/
@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());
}
}

@ -1,150 +1,156 @@
<?xml version="1.0" encoding="utf-8"?> <?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
<!-- Copyright (c) 2010-2011, The MiCode Open Source Community (www.micode.net) xmlns:tools="http://schemas.android.com/tools">
Licensed under the Apache License, Version 2.0 (the "License"); <uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />
you may not use this file except in compliance with the License. <uses-permission android:name="com.android.launcher.permission.INSTALL_SHORTCUT" />
You may obtain a copy of the License at <uses-permission android:name="android.permission.INTERNET" />
<uses-permission android:name="android.permission.READ_CONTACTS" />
http://www.apache.org/licenses/LICENSE-2.0 <uses-permission android:name="android.permission.MANAGE_ACCOUNTS" />
<uses-permission android:name="android.permission.AUTHENTICATE_ACCOUNTS" />
Unless required by applicable law or agreed to in writing, software <uses-permission android:name="android.permission.GET_ACCOUNTS" />
distributed under the License is distributed on an "AS IS" BASIS, <uses-permission android:name="android.permission.USE_CREDENTIALS" />
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. <uses-permission android:name="android.permission.RECEIVE_BOOT_COMPLETED" />
See the License for the specific language governing permissions and
limitations under the License. <application
--> android:allowBackup="true"
android:dataExtractionRules="@xml/data_extraction_rules"
<manifest xmlns:android="http://schemas.android.com/apk/res/android" android:fullBackupContent="@xml/backup_rules"
package="net.micode.notes" android:icon="@mipmap/ic_launcher"
android:versionCode="1" android:label="@string/app_name"
android:versionName="0.1" > android:roundIcon="@mipmap/ic_launcher_round"
android:supportsRtl="true"
<uses-sdk android:minSdkVersion="14" /> android:theme="@style/Theme.MyApplication"
tools:targetApi="31">
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />
<uses-permission android:name="com.android.launcher.permission.INSTALL_SHORTCUT" /> <activity
<uses-permission android:name="android.permission.INTERNET" /> android:name=".ui.NotesListActivity"
<uses-permission android:name="android.permission.READ_CONTACTS" /> android:configChanges="keyboardHidden|orientation|screenSize"
<uses-permission android:name="android.permission.MANAGE_ACCOUNTS" /> android:label="@string/app_name"
<uses-permission android:name="android.permission.AUTHENTICATE_ACCOUNTS" /> android:launchMode="singleTop"
<uses-permission android:name="android.permission.GET_ACCOUNTS" /> android:theme="@style/NoteTheme"
<uses-permission android:name="android.permission.USE_CREDENTIALS" /> android:uiOptions="splitActionBarWhenNarrow"
<uses-permission android:name="android.permission.RECEIVE_BOOT_COMPLETED" /> android:windowSoftInputMode="adjustPan"
android:exported="true">
<application
android:icon="@drawable/icon_app" <intent-filter>
android:label="@string/app_name" > <action android:name="android.intent.action.MAIN" />
<activity <category android:name="android.intent.category.LAUNCHER" />
android:name=".ui.NotesListActivity" </intent-filter>
android:configChanges="keyboardHidden|orientation|screenSize" </activity>
android:label="@string/app_name"
android:launchMode="singleTop" <activity
android:theme="@style/NoteTheme" android:name=".ui.NoteEditActivity"
android:uiOptions="splitActionBarWhenNarrow" android:configChanges="keyboardHidden|orientation|screenSize"
android:windowSoftInputMode="adjustPan" > android:launchMode="singleTop"
android:theme="@style/NoteTheme"
<intent-filter> android:exported="true">
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" /> <intent-filter tools:ignore="AppLinkUrlError">
</intent-filter> <action android:name="android.intent.action.VIEW" />
</activity> <category android:name="android.intent.category.DEFAULT" />
<data android:mimeType="vnd.android.cursor.item/text_note" />
<activity <data android:mimeType="vnd.android.cursor.item/call_note" />
android:name=".ui.NoteEditActivity" </intent-filter>
android:configChanges="keyboardHidden|orientation|screenSize"
android:launchMode="singleTop" <intent-filter>
android:theme="@style/NoteTheme" > <action android:name="android.intent.action.INSERT_OR_EDIT" />
<category android:name="android.intent.category.DEFAULT" />
<intent-filter> <data android:mimeType="vnd.android.cursor.item/text_note" />
<action android:name="android.intent.action.VIEW" /> <data android:mimeType="vnd.android.cursor.item/call_note" />
<category android:name="android.intent.category.DEFAULT" /> </intent-filter>
<data android:mimeType="vnd.android.cursor.item/text_note" />
<data android:mimeType="vnd.android.cursor.item/call_note" /> <intent-filter>
</intent-filter> <action android:name="android.intent.action.SEARCH" />
<category android:name="android.intent.category.DEFAULT" />
<intent-filter> </intent-filter>
<action android:name="android.intent.action.INSERT_OR_EDIT" />
<category android:name="android.intent.category.DEFAULT" /> <meta-data
<data android:mimeType="vnd.android.cursor.item/text_note" /> android:name="android.app.searchable"
<data android:mimeType="vnd.android.cursor.item/call_note" /> android:resource="@xml/searchable" />
</intent-filter> </activity>
<intent-filter>
<action android:name="android.intent.action.SEARCH" /> <provider
<category android:name="android.intent.category.DEFAULT" /> android:name="net.micode.notes.data.NotesProvider"
</intent-filter> android:authorities="micode_notes"
android:multiprocess="true" />
<meta-data
android:name="android.app.searchable" <receiver
android:resource="@xml/searchable" /> android:name=".widget.NoteWidgetProvider_2x"
</activity> android:label="@string/app_widget2x2"
android:exported="true">
<provider <intent-filter>
android:name="net.micode.notes.data.NotesProvider" <action android:name="android.appwidget.action.APPWIDGET_UPDATE" />
android:authorities="micode_notes" <action android:name="android.appwidget.action.APPWIDGET_DELETED" />
android:multiprocess="true" /> <action android:name="android.intent.action.PRIVACY_MODE_CHANGED" />
</intent-filter>
<receiver
android:name=".widget.NoteWidgetProvider_2x" <meta-data
android:label="@string/app_widget2x2" > android:name="android.appwidget.provider"
<intent-filter> android:resource="@xml/widget_2x_info" />
<action android:name="android.appwidget.action.APPWIDGET_UPDATE" /> </receiver>
<action android:name="android.appwidget.action.APPWIDGET_DELETED" /> <receiver
<action android:name="android.intent.action.PRIVACY_MODE_CHANGED" /> android:name=".widget.NoteWidgetProvider_4x"
</intent-filter> android:label="@string/app_widget4x4"
android:exported="true">
<meta-data
android:name="android.appwidget.provider" <intent-filter>
android:resource="@xml/widget_2x_info" /> <action android:name="android.appwidget.action.APPWIDGET_UPDATE" />
</receiver> <action android:name="android.appwidget.action.APPWIDGET_DELETED" />
<receiver <action android:name="android.intent.action.PRIVACY_MODE_CHANGED" />
android:name=".widget.NoteWidgetProvider_4x" </intent-filter>
android:label="@string/app_widget4x4" >
<meta-data
<intent-filter> android:name="android.appwidget.provider"
<action android:name="android.appwidget.action.APPWIDGET_UPDATE" /> android:resource="@xml/widget_4x_info" />
<action android:name="android.appwidget.action.APPWIDGET_DELETED" /> </receiver>
<action android:name="android.intent.action.PRIVACY_MODE_CHANGED" />
</intent-filter> <receiver android:name=".ui.AlarmInitReceiver"
android:exported="true">
<meta-data <intent-filter>
android:name="android.appwidget.provider" <action android:name="android.intent.action.BOOT_COMPLETED" />
android:resource="@xml/widget_4x_info" /> </intent-filter>
</receiver> </receiver>
<receiver android:name=".ui.AlarmInitReceiver" > <receiver
<intent-filter> android:name="net.micode.notes.ui.AlarmReceiver"
<action android:name="android.intent.action.BOOT_COMPLETED" /> android:process=":remote" >
</intent-filter> </receiver>
</receiver>
<activity
<receiver android:name=".ui.AlarmAlertActivity"
android:name="net.micode.notes.ui.AlarmReceiver" android:label="@string/app_name"
android:process=":remote" > android:launchMode="singleInstance"
</receiver> android:theme="@android:style/Theme.Holo.Wallpaper.NoTitleBar" >
</activity>
<activity
android:name=".ui.AlarmAlertActivity" <activity
android:label="@string/app_name" android:name="net.micode.notes.ui.NotesPreferenceActivity"
android:launchMode="singleInstance" android:label="@string/preferences_title"
android:theme="@android:style/Theme.Holo.Wallpaper.NoTitleBar" > android:launchMode="singleTop"
</activity> android:theme="@android:style/Theme.Holo.Light" >
</activity>
<activity
android:name="net.micode.notes.ui.NotesPreferenceActivity" <service
android:label="@string/preferences_title" android:name="net.micode.notes.gtask.remote.GTaskSyncService"
android:launchMode="singleTop" android:exported="false" >
android:theme="@android:style/Theme.Holo.Light" > </service>
</activity>
<meta-data
<service android:name="android.app.default_searchable"
android:name="net.micode.notes.gtask.remote.GTaskSyncService" android:value=".ui.NoteEditActivity" />
android:exported="false" >
</service> <!-- <activity-->
<!-- android:name=".MainActivity"-->
<meta-data <!-- android:exported="true">-->
android:name="android.app.default_searchable" <!-- <intent-filter>-->
android:value=".ui.NoteEditActivity" /> <!-- <action android:name="android.intent.action.MAIN" />-->
</application>
</manifest> <!-- <category android:name="android.intent.category.LAUNCHER" />-->
<!-- </intent-filter>-->
<!-- </activity>-->
</application>
</manifest>

@ -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;
});
}
}

@ -64,21 +64,22 @@ public class GTaskASyncTask extends AsyncTask<Void, String, Integer> {
} }
private void showNotification(int tickerId, String content) { private void showNotification(int tickerId, String content) {
Notification notification = new Notification(R.drawable.notification, mContext
.getString(tickerId), System.currentTimeMillis());
notification.defaults = Notification.DEFAULT_LIGHTS;
notification.flags = Notification.FLAG_AUTO_CANCEL;
PendingIntent pendingIntent; PendingIntent pendingIntent;
if (tickerId != R.string.ticker_success) { if (tickerId != R.string.ticker_success) {
pendingIntent = PendingIntent.getActivity(mContext, 0, new Intent(mContext, pendingIntent = PendingIntent.getActivity(mContext, 0, new Intent(mContext,
NotesPreferenceActivity.class), 0); NotesPreferenceActivity.class), PendingIntent.FLAG_IMMUTABLE);
} else { } else {
pendingIntent = PendingIntent.getActivity(mContext, 0, new Intent(mContext, 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, Notification.Builder builder = new Notification.Builder(mContext)
pendingIntent); .setAutoCancel(true)
.setContentTitle(mContext.getString(R.string.app_name))
.setContentText(content)
.setContentIntent(pendingIntent)
.setWhen(System.currentTimeMillis())
.setOngoing(true);
Notification notification=builder.getNotification();
mNotifiManager.notify(GTASK_SYNC_NOTIFICATION_ID, notification); mNotifiManager.notify(GTASK_SYNC_NOTIFICATION_ID, notification);
} }

Before

Width:  |  Height:  |  Size: 3.9 KiB

After

Width:  |  Height:  |  Size: 3.9 KiB

Some files were not shown because too many files have changed in this diff Show More

Loading…
Cancel
Save