mirror of
https://github.com/M66B/FairEmail.git
synced 2026-03-30 21:58:52 +02:00
Added optional widget compose button
This commit is contained in:
@@ -60,6 +60,7 @@ public class ActivityWidgetUnified extends ActivityBase {
|
||||
private ViewButtonColor btnColor;
|
||||
private Spinner spFontSize;
|
||||
private Spinner spPadding;
|
||||
private CheckBox cbCompose;
|
||||
private Button btnSave;
|
||||
private ContentLoadingProgressBar pbWait;
|
||||
private Group grpReady;
|
||||
@@ -91,6 +92,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 compose = prefs.getBoolean("widget." + appWidgetId + ".compose", false);
|
||||
|
||||
getSupportActionBar().setSubtitle(R.string.title_widget_title_list);
|
||||
setContentView(R.layout.activity_widget_unified);
|
||||
@@ -103,6 +105,7 @@ public class ActivityWidgetUnified extends ActivityBase {
|
||||
btnColor = findViewById(R.id.btnColor);
|
||||
spFontSize = findViewById(R.id.spFontSize);
|
||||
spPadding = findViewById(R.id.spPadding);
|
||||
cbCompose = findViewById(R.id.cbCompose);
|
||||
btnSave = findViewById(R.id.btnSave);
|
||||
pbWait = findViewById(R.id.pbWait);
|
||||
grpReady = findViewById(R.id.grpReady);
|
||||
@@ -170,6 +173,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 + ".compose", cbCompose.isChecked());
|
||||
editor.putInt("widget." + appWidgetId + ".version", BuildConfig.VERSION_CODE);
|
||||
|
||||
editor.apply();
|
||||
@@ -287,6 +291,7 @@ public class ActivityWidgetUnified extends ActivityBase {
|
||||
btnColor.setColor(background);
|
||||
spFontSize.setSelection(tinyIn(font));
|
||||
spPadding.setSelection(tinyIn(padding));
|
||||
cbCompose.setChecked(compose);
|
||||
|
||||
grpReady.setVisibility(View.GONE);
|
||||
pbWait.setVisibility(View.VISIBLE);
|
||||
|
||||
Reference in New Issue
Block a user