mirror of
https://github.com/M66B/FairEmail.git
synced 2025-12-26 23:50:58 +01:00
Fixed widget init
This commit is contained in:
@@ -25,8 +25,11 @@ import android.appwidget.AppWidgetProvider;
|
||||
import android.content.ComponentName;
|
||||
import android.content.Context;
|
||||
import android.content.Intent;
|
||||
import android.content.SharedPreferences;
|
||||
import android.widget.RemoteViews;
|
||||
|
||||
import androidx.preference.PreferenceManager;
|
||||
|
||||
import java.text.NumberFormat;
|
||||
import java.util.concurrent.ExecutorService;
|
||||
import java.util.concurrent.Executors;
|
||||
@@ -41,7 +44,15 @@ public class Widget extends AppWidgetProvider {
|
||||
@Override
|
||||
public void run() {
|
||||
DB db = DB.getInstance(context);
|
||||
update(context, appWidgetManager, appWidgetIds, db.message().getUnseenUnified());
|
||||
TupleMessageStats stats = db.message().getUnseenWidget();
|
||||
|
||||
SharedPreferences prefs = PreferenceManager.getDefaultSharedPreferences(context);
|
||||
boolean unseen_ignored = prefs.getBoolean("unseen_ignored", false);
|
||||
Integer unseen = (unseen_ignored ? stats.notifying : stats.unseen);
|
||||
if (unseen == null)
|
||||
unseen = 0;
|
||||
|
||||
update(context, appWidgetManager, appWidgetIds, unseen);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user