Added option to disable widget background

This commit is contained in:
M66B
2020-04-08 12:08:50 +02:00
parent cb274f1db7
commit 1e654d7765
8 changed files with 43 additions and 2 deletions

View File

@@ -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);