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.net.Uri;
import android.view.View;
import android.widget.RemoteViews;
@@ -42,6 +43,7 @@ public class WidgetUnified extends AppWidgetProvider {
long account = prefs.getLong("widget." + appWidgetId + ".account", -1L);
long folder = prefs.getLong("widget." + appWidgetId + ".folder", -1L);
String type = prefs.getString("widget." + appWidgetId + ".type", null);
boolean semi = prefs.getBoolean("widget." + appWidgetId + ".semi", true);
Intent view = new Intent(context, ActivityView.class);
view.setAction("folder:" + folder);
@@ -53,6 +55,9 @@ public class WidgetUnified extends AppWidgetProvider {
RemoteViews views = new RemoteViews(context.getPackageName(), R.layout.widget_unified);
if (!semi)
views.setInt(R.id.widget, "setBackgroundColor", Color.TRANSPARENT);
views.setViewVisibility(R.id.pro, pro ? View.GONE : View.VISIBLE);
if (pro) {
String name = prefs.getString("widget." + appWidgetId + ".name", null);