小米便签andriod版本适配完成

branch2
JasenonE 3 weeks ago
parent 30bfc5302c
commit 1688b28abd

@ -1,26 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools">
<application
android:allowBackup="true"
android:dataExtractionRules="@xml/data_extraction_rules"
android:fullBackupContent="@xml/backup_rules"
android:icon="@mipmap/ic_launcher"
android:label="@string/app_name"
android:roundIcon="@mipmap/ic_launcher_round"
android:supportsRtl="true"
android:theme="@style/Theme.MyApplication"
tools:targetApi="31">
<activity
android:name=".MainActivity"
android:exported="true">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
</application>
</manifest>

@ -1,5 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<resources>
<color name="black">#FF000000</color>
<color name="white">#FFFFFFFF</color>
</resources>

@ -1,3 +0,0 @@
<resources>
<string name="app_name">My Application</string>
</resources>

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

@ -1,11 +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="distributionType" value="LOCAL" />
<option name="externalProjectPath" value="$PROJECT_DIR$" />
<option name="gradleHome" value="$USER_HOME$/.gradle/wrapper/dists/gradle-8.11.1" />
<option name="gradleJvm" value="#GRADLE_LOCAL_JAVA_HOME" />
<option name="modules">
<set>
<option value="$PROJECT_DIR$" />
<option value="$PROJECT_DIR$/app" />
</set>
</option>
</GradleProjectSettings>
</option>
</component>

@ -1,7 +1,7 @@
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="ExternalStorageConfigurationManager" enabled="true" />
<component name="ProjectRootManager" version="2" languageLevel="JDK_1_7">
<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">

@ -1,3 +1,5 @@
import com.android.build.api.dsl.Packaging
plugins {
alias(libs.plugins.android.application)
}
@ -6,9 +8,13 @@ android {
namespace = "net.micode.notes"
compileSdk = 35
packagingOptions{
exclude("META-INF/DEPENDENCIES")
}
defaultConfig {
applicationId = "net.micode.notes"
minSdk = 24
minSdk = 32
targetSdk = 35
versionCode = 1
versionName = "1.0"
@ -37,7 +43,13 @@ dependencies {
implementation(libs.material)
implementation(libs.activity)
implementation(libs.constraintlayout)
// implementation(libs.firebase.crashlytics.buildtools)
testImplementation(libs.junit)
androidTestImplementation(libs.ext.junit)
androidTestImplementation(libs.espresso.core)
// https://mvnrepository.com/artifact/org.apache.httpcomponents/httpclient
//noinspection DuplicatePlatformClasses
implementation(libs.httpclient)
implementation(libs.richeditor.android)
}

@ -16,7 +16,6 @@
-->
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="net.micode.notes"
android:versionCode="1"
android:versionName="0.1" >
@ -35,14 +34,25 @@
<application
android:icon="@drawable/icon_app"
android:label="@string/app_name" >
<!--To build the app, you need to get a dashcope API key-->
<meta-data
android:name="API_KEY"
android:value="xxx" />
<meta-data
android:name="ENDPOINT_URL"
android:value="https://dashscope.aliyuncs.com/compatible-mode/v1/chat/completions" />
<meta-data
android:name="DASHSCOPE_PROMPT"
android:value="You are a text prettifier. Your work is to regard all the users' input as text, correct the text and make it more readable, while not changing the meaning of the text and its original html format. Use input's orginal language(If input is in English, use English, if it is in Chinese, use Chinese). Please return only the revised Text." />
<activity
android:name=".ui.NotesListActivity"
android:configChanges="keyboardHidden|orientation|screenSize"
android:label="@string/app_name"
android:launchMode="singleTop"
android:theme="@style/NoteTheme"
android:uiOptions="splitActionBarWhenNarrow"
android:windowSoftInputMode="adjustPan" >
android:windowSoftInputMode="adjustPan"
android:exported="true">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
@ -54,7 +64,8 @@
android:name=".ui.NoteEditActivity"
android:configChanges="keyboardHidden|orientation|screenSize"
android:launchMode="singleTop"
android:theme="@style/NoteTheme" >
android:theme="@style/NoteTheme"
android:exported="true">
<intent-filter>
<action android:name="android.intent.action.VIEW" />
@ -80,14 +91,24 @@
android:resource="@xml/searchable" />
</activity>
<activity
android:name=".ui.NotePreviewActivity"
android:configChanges="keyboardHidden|orientation|screenSize"
android:launchMode="singleTop"
android:label="@string/preview_title"
android:theme="@style/NoteTheme"
android:exported="true"/>
<provider
android:name="net.micode.notes.data.NotesProvider"
android:authorities="micode_notes"
android:multiprocess="true" />
android:multiprocess="true"
android:exported="true"/>
<receiver
android:name=".widget.NoteWidgetProvider_2x"
android:label="@string/app_widget2x2" >
android:label="@string/app_widget2x2"
android:exported="true">
<intent-filter>
<action android:name="android.appwidget.action.APPWIDGET_UPDATE" />
<action android:name="android.appwidget.action.APPWIDGET_DELETED" />
@ -96,11 +117,13 @@
<meta-data
android:name="android.appwidget.provider"
android:exported="true"
android:resource="@xml/widget_2x_info" />
</receiver>
<receiver
android:name=".widget.NoteWidgetProvider_4x"
android:label="@string/app_widget4x4" >
android:label="@string/app_widget4x4"
android:exported="true">
<intent-filter>
<action android:name="android.appwidget.action.APPWIDGET_UPDATE" />
@ -110,10 +133,11 @@
<meta-data
android:name="android.appwidget.provider"
android:resource="@xml/widget_4x_info" />
android:resource="@xml/widget_4x_info"
android:exported="true"/>
</receiver>
<receiver android:name=".ui.AlarmInitReceiver" >
<receiver android:name=".ui.AlarmInitReceiver" android:exported="true" >
<intent-filter>
<action android:name="android.intent.action.BOOT_COMPLETED" />
</intent-filter>
@ -147,4 +171,4 @@
android:name="android.app.default_searchable"
android:value=".ui.NoteEditActivity" />
</application>
</manifest>
</manifest>

@ -77,8 +77,8 @@ public class GTaskASyncTask extends AsyncTask<Void, String, Integer> {
pendingIntent = PendingIntent.getActivity(mContext, 0, new Intent(mContext,
NotesListActivity.class), 0);
}
notification.setLatestEventInfo(mContext, mContext.getString(R.string.app_name), content,
pendingIntent);
// notification.getLargeIcon(mContext, mContext.getString(R.string.app_name), content,
// pendingIntent);
mNotifiManager.notify(GTASK_SYNC_NOTIFICATION_ID, notification);
}

@ -24,6 +24,7 @@ import android.os.Bundle;
import android.text.TextUtils;
import android.util.Log;
import net.micode.notes.gtask.data.Node;
import net.micode.notes.gtask.data.Task;
import net.micode.notes.gtask.data.TaskList;
@ -338,7 +339,7 @@ public class GTaskClient {
// execute the post
HttpResponse response = mHttpClient.execute(httpPost);
String jsString = getResponseContent(response.getEntity());
String jsString = getResponseContent((HttpEntity) response.getEntity());
return new JSONObject(jsString);
} catch (ClientProtocolException e) {

@ -0,0 +1,72 @@
package net.micode.notes.ui;
import android.content.DialogInterface;
import android.content.Intent;
import android.graphics.Color;
import android.os.Bundle;
import android.app.Activity;
import android.util.Log;
import android.view.View;
import android.widget.Button;
import android.widget.LinearLayout;
import net.micode.notes.R;
import jp.wasabeef.richeditor.RichEditor;
public class NotePreviewActivity extends Activity implements View.OnClickListener {
private RichEditor mNotePreviewView;
private static String mNoteText;
private static int mNoteBgColorResId;
private static int mNotePreviewFontSize;
private Button confirmButton;
private Button cancelButton;
private View mNotePreviewPanel;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
// Set View
setContentView(R.layout.note_preview);
// Set Components
mNoteText = getIntent().getStringExtra("note_text");
mNoteBgColorResId = getIntent().getIntExtra("bg_color_res_id", 0);
mNotePreviewFontSize = getIntent().getIntExtra("font_size", 16);
mNotePreviewView = (RichEditor) findViewById(R.id.note_preview_view);
mNotePreviewView.setEditorHeight(500);
mNotePreviewView.setEditorFontColor(Color.BLACK);
mNotePreviewView.setInputEnabled(false);
mNotePreviewView.setEditorWidth(LinearLayout.LayoutParams.MATCH_PARENT);
mNotePreviewView.setBackgroundResource(mNoteBgColorResId);
mNotePreviewView.setHtml(mNoteText);
mNotePreviewView.setEditorFontSize(mNotePreviewFontSize);
mNotePreviewPanel = findViewById(R.id.sv_note_preview);
mNotePreviewPanel.setBackgroundResource(mNoteBgColorResId);
confirmButton = (Button) findViewById(R.id.confirm_button);
cancelButton = (Button) findViewById(R.id.cancel_button);
confirmButton.setOnClickListener(this);
cancelButton.setOnClickListener(this);
}
@Override
public void onClick(View v) {
switch(v.getId()) {
case R.id.confirm_button:
Intent resultIntent = new Intent();
resultIntent.putExtra("note_text", mNoteText);
setResult(RESULT_OK, resultIntent);
default:
// Once button is click then finish()
finish();
}
}
}

@ -15,6 +15,9 @@
*/
package net.micode.notes.widget;
import android.app.PendingIntent;
import android.appwidget.AppWidgetManager;
import android.appwidget.AppWidgetProvider;

Before

Width:  |  Height:  |  Size: 3.9 KiB

After

Width:  |  Height:  |  Size: 3.9 KiB

Before

Width:  |  Height:  |  Size: 3.4 KiB

After

Width:  |  Height:  |  Size: 3.4 KiB

Before

Width:  |  Height:  |  Size: 6.7 KiB

After

Width:  |  Height:  |  Size: 6.7 KiB

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

Loading…
Cancel
Save