mirror of
https://github.com/M66B/FairEmail.git
synced 2026-03-30 21:58:52 +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.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);
|
||||
|
||||
Reference in New Issue
Block a user