mirror of
https://github.com/M66B/FairEmail.git
synced 2026-04-01 06:38:29 +02:00
Added option to disable widget background
This commit is contained in:
@@ -26,6 +26,7 @@ import android.content.ComponentName;
|
||||
import android.content.Context;
|
||||
import android.content.Intent;
|
||||
import android.content.SharedPreferences;
|
||||
import android.graphics.Color;
|
||||
import android.text.TextUtils;
|
||||
import android.widget.RemoteViews;
|
||||
|
||||
@@ -54,6 +55,7 @@ public class Widget extends AppWidgetProvider {
|
||||
for (int appWidgetId : appWidgetIds) {
|
||||
long account = prefs.getLong("widget." + appWidgetId + ".account", -1L);
|
||||
String name = prefs.getString("widget." + appWidgetId + ".name", null);
|
||||
boolean semi = prefs.getBoolean("widget." + appWidgetId + ".semi", true);
|
||||
|
||||
List<EntityFolder> folders = db.folder().getNotifyingFolders(account);
|
||||
if (folders == null)
|
||||
@@ -93,6 +95,9 @@ public class Widget extends AppWidgetProvider {
|
||||
|
||||
views.setOnClickPendingIntent(R.id.widget, pi);
|
||||
|
||||
if (!semi)
|
||||
views.setInt(R.id.widget, "setBackgroundColor", Color.TRANSPARENT);
|
||||
|
||||
views.setImageViewResource(R.id.ivMessage, unseen == 0
|
||||
? R.drawable.baseline_mail_outline_24
|
||||
: R.drawable.baseline_mail_24);
|
||||
|
||||
Reference in New Issue
Block a user