mirror of
https://github.com/M66B/FairEmail.git
synced 2025-12-26 07:32:08 +01:00
Decouple notifications and widget/badge
This commit is contained in:
@@ -46,13 +46,13 @@ public class Widget extends AppWidgetProvider {
|
||||
});
|
||||
}
|
||||
|
||||
static void update(Context context, int count) {
|
||||
static void update(Context context, Integer count) {
|
||||
AppWidgetManager appWidgetManager = AppWidgetManager.getInstance(context);
|
||||
int[] appWidgetIds = AppWidgetManager.getInstance(context).getAppWidgetIds(new ComponentName(context, Widget.class));
|
||||
update(context, appWidgetManager, appWidgetIds, count);
|
||||
}
|
||||
|
||||
private static void update(Context context, AppWidgetManager appWidgetManager, int[] appWidgetIds, int count) {
|
||||
private static void update(Context context, AppWidgetManager appWidgetManager, int[] appWidgetIds, Integer count) {
|
||||
NumberFormat nf = NumberFormat.getIntegerInstance();
|
||||
|
||||
Intent view = new Intent(context, ActivityView.class);
|
||||
@@ -66,7 +66,7 @@ public class Widget extends AppWidgetProvider {
|
||||
|
||||
views.setOnClickPendingIntent(R.id.widget, pi);
|
||||
|
||||
if (count < 0)
|
||||
if (count == null)
|
||||
views.setTextViewText(R.id.tvCount, "?");
|
||||
else if (count > 99)
|
||||
views.setTextViewText(R.id.tvCount, "∞");
|
||||
|
||||
Reference in New Issue
Block a user