diff --git a/app/build.gradle b/app/build.gradle index 450b2ca2a..9a9567a89 100644 --- a/app/build.gradle +++ b/app/build.gradle @@ -122,7 +122,6 @@ dependencies { implementation 'com.github.penfeizhou.android.animation:apng:1.1.0' implementation 'com.github.penfeizhou.android.animation:gif:1.1.0' implementation 'com.github.PhilJay:MPAndroidChart:v3.1.0' - implementation "me.leolin:ShortcutBadger:1.1.22@aar" implementation 'com.github.smarteist:autoimageslider:1.3.2' //debugImplementation 'com.squareup.leakcanary:leakcanary-android:2.0-beta-2' diff --git a/app/src/main/java/app/fedilab/android/activities/BaseMainActivity.java b/app/src/main/java/app/fedilab/android/activities/BaseMainActivity.java index 398584f6f..fa530a142 100644 --- a/app/src/main/java/app/fedilab/android/activities/BaseMainActivity.java +++ b/app/src/main/java/app/fedilab/android/activities/BaseMainActivity.java @@ -143,7 +143,6 @@ import app.fedilab.android.interfaces.OnRetrieveMetaDataInterface; import app.fedilab.android.interfaces.OnRetrieveRemoteAccountInterface; import app.fedilab.android.interfaces.OnSyncTimelineInterface; import app.fedilab.android.interfaces.OnUpdateAccountInfoInterface; -import me.leolin.shortcutbadger.ShortcutBadger; import static app.fedilab.android.asynctasks.ManageFiltersAsyncTask.action.GET_ALL_FILTER; import static app.fedilab.android.helper.Helper.changeDrawableColor; @@ -1722,9 +1721,7 @@ public abstract class BaseMainActivity extends BaseActivity public void onResume() { super.onResume(); PreferenceManager.getDefaultSharedPreferences(this).edit().putBoolean("isMainActivityRunning", true).apply(); - - LiveNotificationService.liveNotifBadge = 0; - ShortcutBadger.removeCount(getApplicationContext()); + //Proceeds to update of the authenticated account /*if (Helper.isLoggedIn(getApplicationContext())) { new UpdateAccountInfoByIDAsyncTask(getApplicationContext(), social, BaseMainActivity.this).executeOnExecutor(AsyncTask.THREAD_POOL_EXECUTOR); diff --git a/app/src/main/java/app/fedilab/android/activities/LoginActivity.java b/app/src/main/java/app/fedilab/android/activities/LoginActivity.java index 6a8e794e9..9dbc85a11 100644 --- a/app/src/main/java/app/fedilab/android/activities/LoginActivity.java +++ b/app/src/main/java/app/fedilab/android/activities/LoginActivity.java @@ -283,6 +283,7 @@ public class LoginActivity extends BaseActivity { client_id_for_webview = true; retrievesClientId(); } else { + client_id_for_webview = false; if (instanceNodeInfo.getName().equals("PEERTUBE")) { step_login_credential.setVisibility(View.VISIBLE); step_instance.setVisibility(View.GONE); diff --git a/app/src/main/java/app/fedilab/android/services/LiveNotificationDelayedService.java b/app/src/main/java/app/fedilab/android/services/LiveNotificationDelayedService.java index 4d51c0105..166f95cd2 100644 --- a/app/src/main/java/app/fedilab/android/services/LiveNotificationDelayedService.java +++ b/app/src/main/java/app/fedilab/android/services/LiveNotificationDelayedService.java @@ -14,7 +14,6 @@ package app.fedilab.android.services; * You should have received a copy of the GNU General Public License along with Fedilab; if not, * see . */ -import android.app.AlarmManager; import android.app.NotificationChannel; import android.app.NotificationManager; import android.app.PendingIntent; @@ -294,6 +293,7 @@ public class LiveNotificationDelayedService extends Service { boolean notif_share = sharedpreferences.getBoolean(Helper.SET_NOTIF_SHARE, true); boolean notif_poll = sharedpreferences.getBoolean(Helper.SET_NOTIF_POLL, true); boolean somethingToPush = (notif_follow || notif_add || notif_mention || notif_share || notif_poll); + String message = null; if (somethingToPush) { switch (notification.getType()) { @@ -368,6 +368,7 @@ public class LiveNotificationDelayedService extends Service { break; default: } + //Some others notification final Intent intent = new Intent(getApplicationContext(), MainActivity.class); intent.addFlags(Intent.FLAG_ACTIVITY_SINGLE_TOP | Intent.FLAG_ACTIVITY_NEW_TASK); diff --git a/app/src/main/java/app/fedilab/android/services/LiveNotificationService.java b/app/src/main/java/app/fedilab/android/services/LiveNotificationService.java index 63e3ded84..b2d5e26d7 100644 --- a/app/src/main/java/app/fedilab/android/services/LiveNotificationService.java +++ b/app/src/main/java/app/fedilab/android/services/LiveNotificationService.java @@ -14,7 +14,6 @@ package app.fedilab.android.services; * You should have received a copy of the GNU General Public License along with Fedilab; if not, * see . */ -import android.app.AlarmManager; import android.app.NotificationChannel; import android.app.NotificationManager; import android.app.PendingIntent; @@ -32,7 +31,6 @@ import android.os.Bundle; import android.os.Handler; import android.os.IBinder; import android.os.Looper; -import android.os.SystemClock; import android.preference.PreferenceManager; import android.text.Html; import android.text.SpannableString; @@ -69,7 +67,6 @@ import java.util.List; import java.util.Map; import java.util.Objects; -import app.fedilab.android.activities.BaseMainActivity; import app.fedilab.android.client.API; import app.fedilab.android.client.Entities.Account; import app.fedilab.android.client.Entities.Notification; @@ -79,7 +76,6 @@ import app.fedilab.android.sqlite.AccountDAO; import app.fedilab.android.sqlite.Sqlite; import app.fedilab.android.R; import app.fedilab.android.activities.MainActivity; -import me.leolin.shortcutbadger.ShortcutBadger; import static androidx.core.text.HtmlCompat.FROM_HTML_MODE_LEGACY; import static app.fedilab.android.helper.Helper.getMainLogo; @@ -106,7 +102,6 @@ public class LiveNotificationService extends Service implements NetworkStateRece private NotificationChannel channel; public static int totalAccount = 0; public static int eventsCount = 0; - public static int liveNotifBadge = 0; public void onCreate() { super.onCreate(); @@ -426,8 +421,6 @@ public class LiveNotificationService extends Service implements NetworkStateRece final String finalMessage = message; Handler mainHandler = new Handler(Looper.getMainLooper()); Helper.NotifType finalNotifType = notifType; - liveNotifBadge++; - ShortcutBadger.applyCount(getApplicationContext(), liveNotifBadge); Runnable myRunnable = new Runnable() { @Override public void run() {