From 51d24e36b28a57d069f3b63aa7de995ed28f3d6a Mon Sep 17 00:00:00 2001 From: M66B Date: Sun, 28 Mar 2021 21:28:46 +0200 Subject: [PATCH] Upgrade widget colors --- .../main/java/eu/faircode/email/ApplicationEx.java | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/app/src/main/java/eu/faircode/email/ApplicationEx.java b/app/src/main/java/eu/faircode/email/ApplicationEx.java index 57be37d038..67c0a8c941 100644 --- a/app/src/main/java/eu/faircode/email/ApplicationEx.java +++ b/app/src/main/java/eu/faircode/email/ApplicationEx.java @@ -454,6 +454,19 @@ public class ApplicationEx extends Application } else if (version < 1539) { if (!prefs.contains("double_back")) editor.putBoolean("double_back", true); + } else if (version < 1540) { + Map all = prefs.getAll(); + for (String key : all.keySet()) + if (key.startsWith("widget.") && key.endsWith(".semi")) { + String[] k = key.split("\\."); + if (k.length == 3) + try { + int appWidgetId = Integer.parseInt(k[1]); + editor.remove("widget." + appWidgetId + ".background"); + } catch (Throwable ex) { + Log.e(ex); + } + } } if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.O && !BuildConfig.DEBUG)