diff --git a/app/build.gradle.kts b/app/build.gradle.kts index 0eaccbc..fc58f3a 100644 --- a/app/build.gradle.kts +++ b/app/build.gradle.kts @@ -2,8 +2,12 @@ plugins { alias(libs.plugins.android.application) } +<<<<<<< HEAD android{ useLibrary("org.apache.http.legacy") +======= +android { +>>>>>>> master namespace = "net.micode.notes" compileSdk = 35 diff --git a/app/src/main/AndroidManifest.xml b/app/src/main/AndroidManifest.xml index d7a8acc..14801b7 100644 --- a/app/src/main/AndroidManifest.xml +++ b/app/src/main/AndroidManifest.xml @@ -1,4 +1,5 @@ +<<<<<<< HEAD @@ -157,4 +158,161 @@ android:name="android.app.default_searchable" android:value=".ui.NoteEditActivity" /> - \ No newline at end of file + +======= + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +>>>>>>> master diff --git a/app/src/main/java/net/micode/notes/gtask/remote/GTaskASyncTask.java b/app/src/main/java/net/micode/notes/gtask/remote/GTaskASyncTask.java index cb7e09d..18108cd 100644 --- a/app/src/main/java/net/micode/notes/gtask/remote/GTaskASyncTask.java +++ b/app/src/main/java/net/micode/notes/gtask/remote/GTaskASyncTask.java @@ -1,35 +1,77 @@ +<<<<<<< HEAD package net.micode.notes.gtask.remote; import android.app.NotificationChannel; +======= + +/* + * 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.gtask.remote; + +import android.app.Notification; +>>>>>>> master import android.app.NotificationManager; import android.app.PendingIntent; import android.content.Context; import android.content.Intent; import android.os.AsyncTask; +<<<<<<< HEAD import android.os.Build; import androidx.core.app.NotificationCompat; +======= +>>>>>>> master import net.micode.notes.R; import net.micode.notes.ui.NotesListActivity; import net.micode.notes.ui.NotesPreferenceActivity; +<<<<<<< HEAD public class GTaskASyncTask extends AsyncTask { private static final int GTASK_SYNC_NOTIFICATION_ID = 5234235; +======= + +public class GTaskASyncTask extends AsyncTask { + + private static int GTASK_SYNC_NOTIFICATION_ID = 5234235; +>>>>>>> master public interface OnCompleteListener { void onComplete(); } private Context mContext; +<<<<<<< HEAD private NotificationManager mNotifiManager; private GTaskManager mTaskManager; +======= + + private NotificationManager mNotifiManager; + + private GTaskManager mTaskManager; + +>>>>>>> master private OnCompleteListener mOnCompleteListener; public GTaskASyncTask(Context context, OnCompleteListener listener) { mContext = context; mOnCompleteListener = listener; +<<<<<<< HEAD mNotifiManager = (NotificationManager) mContext.getSystemService(Context.NOTIFICATION_SERVICE); mTaskManager = GTaskManager.getInstance(); @@ -42,6 +84,11 @@ public class GTaskASyncTask extends AsyncTask { ); mNotifiManager.createNotificationChannel(channel); } +======= + mNotifiManager = (NotificationManager) mContext + .getSystemService(Context.NOTIFICATION_SERVICE); + mTaskManager = GTaskManager.getInstance(); +>>>>>>> master } public void cancelSync() { @@ -49,6 +96,7 @@ public class GTaskASyncTask extends AsyncTask { } public void publishProgess(String message) { +<<<<<<< HEAD publishProgress(message); } @@ -72,12 +120,41 @@ public class GTaskASyncTask extends AsyncTask { .setPriority(NotificationCompat.PRIORITY_DEFAULT); mNotifiManager.notify(GTASK_SYNC_NOTIFICATION_ID, builder.build()); +======= + publishProgress(new String[] { + message + }); + } + + 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; + if (tickerId != R.string.ticker_success) { + pendingIntent = PendingIntent.getActivity(mContext, 0, new Intent(mContext, + NotesPreferenceActivity.class), 0); + + } 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); +>>>>>>> master } @Override protected Integer doInBackground(Void... unused) { +<<<<<<< HEAD publishProgess(mContext.getString(R.string.sync_progress_login, NotesPreferenceActivity.getSyncAccountName(mContext))); +======= + publishProgess(mContext.getString(R.string.sync_progress_login, NotesPreferenceActivity + .getSyncAccountName(mContext))); +>>>>>>> master return mTaskManager.sync(mContext, this); } @@ -92,14 +169,20 @@ public class GTaskASyncTask extends AsyncTask { @Override protected void onPostExecute(Integer result) { if (result == GTaskManager.STATE_SUCCESS) { +<<<<<<< HEAD showNotification(R.string.ticker_success, mContext.getString(R.string.success_sync_account, mTaskManager.getSyncAccount())); +======= + showNotification(R.string.ticker_success, mContext.getString( + R.string.success_sync_account, mTaskManager.getSyncAccount())); +>>>>>>> master NotesPreferenceActivity.setLastSyncTime(mContext, System.currentTimeMillis()); } else if (result == GTaskManager.STATE_NETWORK_ERROR) { showNotification(R.string.ticker_fail, mContext.getString(R.string.error_sync_network)); } else if (result == GTaskManager.STATE_INTERNAL_ERROR) { showNotification(R.string.ticker_fail, mContext.getString(R.string.error_sync_internal)); } else if (result == GTaskManager.STATE_SYNC_CANCELLED) { +<<<<<<< HEAD showNotification(R.string.ticker_cancel, mContext.getString(R.string.error_sync_cancelled)); } @@ -107,4 +190,19 @@ public class GTaskASyncTask extends AsyncTask { new Thread(() -> mOnCompleteListener.onComplete()).start(); } } -} \ No newline at end of file +} +======= + showNotification(R.string.ticker_cancel, mContext + .getString(R.string.error_sync_cancelled)); + } + if (mOnCompleteListener != null) { + new Thread(new Runnable() { + + public void run() { + mOnCompleteListener.onComplete(); + } + }).start(); + } + } +} +>>>>>>> master diff --git a/app/src/main/java/net/micode/notes/gtask/remote/GTaskClient.java b/app/src/main/java/net/micode/notes/gtask/remote/GTaskClient.java index 7b94ce4..b0e6126 100644 --- a/app/src/main/java/net/micode/notes/gtask/remote/GTaskClient.java +++ b/app/src/main/java/net/micode/notes/gtask/remote/GTaskClient.java @@ -120,7 +120,11 @@ public class GTaskClient { // need to re-login after account switch if (mLoggedin && !TextUtils.equals(getSyncAccount().name, NotesPreferenceActivity +<<<<<<< HEAD .getSyncAccountName(activity))) { +======= + .getSyncAccountName(activity))) { +>>>>>>> master mLoggedin = false; } diff --git a/app/src/main/res/values-night/themes.xml b/app/src/main/res/values-night/themes.xml index d2c68d1..5e5772c 100644 --- a/app/src/main/res/values-night/themes.xml +++ b/app/src/main/res/values-night/themes.xml @@ -1,6 +1,10 @@ +<<<<<<< HEAD diff --git a/app/src/main/res/values/strings.xml b/app/src/main/res/values/strings.xml index b473891..b323504 100644 --- a/app/src/main/res/values/strings.xml +++ b/app/src/main/res/values/strings.xml @@ -1,4 +1,5 @@ +<<<<<<< HEAD @@ -9,10 +10,77 @@ Delete Font size List Mode +======= + + + + + Notes + Notes 2x2 + Notes 4x4 + No associated note found, click to create associated note. + Privacy mode,can not see note content + ... + Add note + Delete reminder successfully + Set reminder + Expired + yyyyMMdd + MMMd kk:mm + Got it + Take a look + Call + Send email + Browse web + Open map + + /MIUI/notes/ + notes_%s.txt + + (%d) + New Folder + Export text + Sync + Cancel syncing + Settings + Search + Delete + Move to folder + %d selected + Nothing selected, the operation is invalid + Select all + Deselect all + Font size + Small + Medium + Large + Super + Enter check list + Leave check list + View folder + Delete folder + Change folder name + The folder %1$s exist, please rename +>>>>>>> master Share Send to home Remind me Delete reminder +<<<<<<< HEAD Edit Note @@ -26,4 +94,72 @@ Cancel Are you sure you want to delete? - \ No newline at end of file + +======= + Select folder + Parent folder + Note added to home + Confirm to delete folder and its notes? + Delete selected notes + Confirm to delete the selected %d notes? + Confirm to delete this note? + Have moved selected %1$d notes to %2$s folder + + SD card busy, not available now + Export failed, please check SD card + The note is not exist + Sorry, can not set clock on empty note + Sorry, can not send and empty note to home + Export successful + Export fail + Export text file (%1$s) to SD (%2$s) directory + + Syncing notes... + Sync is successful + Sync is failed + Sync is canceled + Sync is successful with account %1$s + Sync failed, please check network and account settings + Sync failed, internal error occurs + Sync is canceled + Logging into %1$s... + Getting remote note list... + Synchronize local notes with Google Task... + + Settings + Sync account + Sync notes with google task + Last sync time %1$s + yyyy-MM-dd hh:mm:ss + Add account + Change sync account + Remove sync account + Cancel + Sync immediately + Cancel syncing + Current account %1$s + All sync related information will be deleted, which may result in duplicated items sometime + Sync notes + Please select a google account. Local notes will be synced with google task. + Cannot change the account because sync is in progress + %1$s has been set as the sync account + New note background color random + + Delete + Call notes + Input name + + Searching Notes + Search notes + Text in your notes + Notes + set + cancel + + %1$s result for \"%2$s\" + + %1$s results for \"%2$s\" + + + +>>>>>>> master diff --git a/app/src/main/res/values/themes.xml b/app/src/main/res/values/themes.xml index 7c616ff..790fac7 100644 --- a/app/src/main/res/values/themes.xml +++ b/app/src/main/res/values/themes.xml @@ -1,9 +1,17 @@ +<<<<<<< HEAD +<<<<<<< HEAD