1
0
Fork 0
mirror of https://github.com/M66B/FairEmail.git synced 2024-12-25 09:17:58 +00:00

Added widget folder type

This commit is contained in:
M66B 2019-11-17 19:18:21 +01:00
parent b5f517b91c
commit 77fc85faed
2 changed files with 3 additions and 0 deletions

View file

@ -96,6 +96,7 @@ public class ActivityWidgetUnified extends ActivityBase {
editor.remove("widget." + appWidgetId + ".name");
editor.putLong("widget." + appWidgetId + ".account", account == null ? -1L : account.id);
editor.putLong("widget." + appWidgetId + ".folder", folder == null ? -1L : folder.id);
editor.putString("widget." + appWidgetId + ".type", folder == null ? null : folder.type);
editor.putBoolean("widget." + appWidgetId + ".unseen", cbUnseen.isChecked());
editor.putBoolean("widget." + appWidgetId + ".flagged", cbFlagged.isChecked());
editor.apply();

View file

@ -71,10 +71,12 @@ public class WidgetUnified extends AppWidgetProvider {
for (int appWidgetId : appWidgetIds) {
long account = prefs.getLong("widget." + appWidgetId + ".account", -1L);
long folder = prefs.getLong("widget." + appWidgetId + ".folder", -1L);
String type = prefs.getString("widget." + appWidgetId + ".type", null);
Intent view = new Intent(context, ActivityView.class);
view.setAction("folder:" + folder);
view.putExtra("account", account);
view.putExtra("type", type);
view.putExtra("refresh", true);
view.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
PendingIntent pi = PendingIntent.getActivity(context, ActivityView.REQUEST_FOLDER, view, PendingIntent.FLAG_UPDATE_CURRENT);