Added option refresh button / messages widget

This commit is contained in:
M66B
2021-09-01 08:36:14 +02:00
parent f094ca4c41
commit 386fb3361d
6 changed files with 85 additions and 4 deletions

View File

@@ -60,6 +60,7 @@ public class ActivityWidgetUnified extends ActivityBase {
private ViewButtonColor btnColor;
private Spinner spFontSize;
private Spinner spPadding;
private CheckBox cbRefresh;
private CheckBox cbCompose;
private Button btnSave;
private ContentLoadingProgressBar pbWait;
@@ -92,6 +93,7 @@ public class ActivityWidgetUnified extends ActivityBase {
int background = prefs.getInt("widget." + appWidgetId + ".background", Color.TRANSPARENT);
int font = prefs.getInt("widget." + appWidgetId + ".font", 0);
int padding = prefs.getInt("widget." + appWidgetId + ".padding", 0);
boolean refresh = prefs.getBoolean("widget." + appWidgetId + ".refresh", false);
boolean compose = prefs.getBoolean("widget." + appWidgetId + ".compose", false);
getSupportActionBar().setSubtitle(R.string.title_widget_title_list);
@@ -105,6 +107,7 @@ public class ActivityWidgetUnified extends ActivityBase {
btnColor = findViewById(R.id.btnColor);
spFontSize = findViewById(R.id.spFontSize);
spPadding = findViewById(R.id.spPadding);
cbRefresh = findViewById(R.id.cbRefresh);
cbCompose = findViewById(R.id.cbCompose);
btnSave = findViewById(R.id.btnSave);
pbWait = findViewById(R.id.pbWait);
@@ -173,6 +176,7 @@ public class ActivityWidgetUnified extends ActivityBase {
editor.putInt("widget." + appWidgetId + ".background", btnColor.getColor());
editor.putInt("widget." + appWidgetId + ".font", tinyOut(font));
editor.putInt("widget." + appWidgetId + ".padding", tinyOut(padding));
editor.putBoolean("widget." + appWidgetId + ".refresh", cbRefresh.isChecked());
editor.putBoolean("widget." + appWidgetId + ".compose", cbCompose.isChecked());
editor.putInt("widget." + appWidgetId + ".version", BuildConfig.VERSION_CODE);
@@ -291,6 +295,7 @@ public class ActivityWidgetUnified extends ActivityBase {
btnColor.setColor(background);
spFontSize.setSelection(tinyIn(font));
spPadding.setSelection(tinyIn(padding));
cbRefresh.setChecked(refresh);
cbCompose.setChecked(compose);
grpReady.setVisibility(View.GONE);