|
|
|
@ -46,12 +46,14 @@ public class ActivityWidgetUnified extends ActivityBase {
|
|
|
|
|
private CheckBox cbUnseen;
|
|
|
|
|
private CheckBox cbFlagged;
|
|
|
|
|
private CheckBox cbSemiTransparent;
|
|
|
|
|
private Spinner spFontSize;
|
|
|
|
|
private Button btnSave;
|
|
|
|
|
private ContentLoadingProgressBar pbWait;
|
|
|
|
|
private Group grpReady;
|
|
|
|
|
|
|
|
|
|
private ArrayAdapter<EntityAccount> adapterAccount;
|
|
|
|
|
private ArrayAdapter<TupleFolderEx> adapterFolder;
|
|
|
|
|
private ArrayAdapter<String> adapterFontSize;
|
|
|
|
|
|
|
|
|
|
@Override
|
|
|
|
|
protected void onCreate(Bundle savedInstanceState) {
|
|
|
|
@ -74,6 +76,7 @@ public class ActivityWidgetUnified extends ActivityBase {
|
|
|
|
|
cbUnseen = findViewById(R.id.cbUnseen);
|
|
|
|
|
cbFlagged = findViewById(R.id.cbFlagged);
|
|
|
|
|
cbSemiTransparent = findViewById(R.id.cbSemiTransparent);
|
|
|
|
|
spFontSize = findViewById(R.id.spFontSize);
|
|
|
|
|
btnSave = findViewById(R.id.btnSave);
|
|
|
|
|
pbWait = findViewById(R.id.pbWait);
|
|
|
|
|
grpReady = findViewById(R.id.grpReady);
|
|
|
|
@ -89,6 +92,7 @@ public class ActivityWidgetUnified extends ActivityBase {
|
|
|
|
|
|
|
|
|
|
SharedPreferences prefs = PreferenceManager.getDefaultSharedPreferences(ActivityWidgetUnified.this);
|
|
|
|
|
SharedPreferences.Editor editor = prefs.edit();
|
|
|
|
|
|
|
|
|
|
if (account != null && account.id > 0)
|
|
|
|
|
if (folder != null && folder.id > 0)
|
|
|
|
|
editor.putString("widget." + appWidgetId + ".name", folder.getDisplayName(ActivityWidgetUnified.this));
|
|
|
|
@ -96,12 +100,15 @@ public class ActivityWidgetUnified extends ActivityBase {
|
|
|
|
|
editor.putString("widget." + appWidgetId + ".name", account.name);
|
|
|
|
|
else
|
|
|
|
|
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.putBoolean("widget." + appWidgetId + ".semi", cbSemiTransparent.isChecked());
|
|
|
|
|
editor.putInt("widget." + appWidgetId + ".font", spFontSize.getSelectedItemPosition());
|
|
|
|
|
|
|
|
|
|
editor.apply();
|
|
|
|
|
|
|
|
|
|
WidgetUnified.init(ActivityWidgetUnified.this, appWidgetId);
|
|
|
|
@ -171,6 +178,11 @@ public class ActivityWidgetUnified extends ActivityBase {
|
|
|
|
|
}
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
String[] sizes = getResources().getStringArray(R.array.fontSizeNames);
|
|
|
|
|
adapterFontSize = new ArrayAdapter<>(this, R.layout.spinner_item1, android.R.id.text1, sizes);
|
|
|
|
|
adapterFontSize.setDropDownViewResource(R.layout.spinner_item1_dropdown);
|
|
|
|
|
spFontSize.setAdapter(adapterFontSize);
|
|
|
|
|
|
|
|
|
|
grpReady.setVisibility(View.GONE);
|
|
|
|
|
pbWait.setVisibility(View.VISIBLE);
|
|
|
|
|
|
|
|
|
|