mirror of https://github.com/M66B/FairEmail.git
Simplification
This commit is contained in:
parent
77ab2c0450
commit
5c23de7edc
|
@ -8,7 +8,7 @@ For support you can use [the contact form](https://contact.faircode.eu/?product=
|
||||||
|
|
||||||
### Next version
|
### Next version
|
||||||
|
|
||||||
* Added barcode decoding (requires Android 7+)
|
* Added image barcode decoding (requires Android 7+)
|
||||||
* Small improvements and minor bug fixes
|
* Small improvements and minor bug fixes
|
||||||
* Updated [Public Suffix List](https://github.com/publicsuffix/list)
|
* Updated [Public Suffix List](https://github.com/publicsuffix/list)
|
||||||
* Updated [translations](https://crowdin.com/project/open-source-email)
|
* Updated [translations](https://crowdin.com/project/open-source-email)
|
||||||
|
|
|
@ -8,7 +8,7 @@ For support you can use [the contact form](https://contact.faircode.eu/?product=
|
||||||
|
|
||||||
### Next version
|
### Next version
|
||||||
|
|
||||||
* Added barcode decoding (requires Android 7+)
|
* Added image barcode decoding (requires Android 7+)
|
||||||
* Small improvements and minor bug fixes
|
* Small improvements and minor bug fixes
|
||||||
* Updated [Public Suffix List](https://github.com/publicsuffix/list)
|
* Updated [Public Suffix List](https://github.com/publicsuffix/list)
|
||||||
* Updated [translations](https://crowdin.com/project/open-source-email)
|
* Updated [translations](https://crowdin.com/project/open-source-email)
|
||||||
|
|
|
@ -5410,56 +5410,23 @@ public class FragmentMessages extends FragmentBase
|
||||||
if (canNotify)
|
if (canNotify)
|
||||||
prefs.edit().remove("notifications_reminder").apply();
|
prefs.edit().remove("notifications_reminder").apply();
|
||||||
boolean notifications_reminder = prefs.getBoolean("notifications_reminder", true);
|
boolean notifications_reminder = prefs.getBoolean("notifications_reminder", true);
|
||||||
grpNotifications.setVisibility(canNotify || !notifications_reminder ? View.GONE : View.VISIBLE);
|
grpNotifications.setVisibility(
|
||||||
|
!canNotify && notifications_reminder
|
||||||
|
? View.VISIBLE : View.GONE);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (grpDataSaver != null &&
|
if (grpDataSaver != null &&
|
||||||
("enabled".equals(key) || "datasaver_reminder".equals(key)))
|
("enabled".equals(key) || "datasaver_reminder".equals(key))) {
|
||||||
new SimpleTask<Boolean>() {
|
boolean isDataSaving = ConnectionHelper.isDataSaving(getContext());
|
||||||
@Override
|
if (!isDataSaving)
|
||||||
protected Boolean onExecute(Context context, Bundle args) {
|
prefs.edit().remove("datasaver_reminder").apply();
|
||||||
SharedPreferences prefs = PreferenceManager.getDefaultSharedPreferences(context);
|
|
||||||
|
|
||||||
boolean isDataSaving = ConnectionHelper.isDataSaving(getContext());
|
boolean enabled = prefs.getBoolean("enabled", true);
|
||||||
if (!isDataSaving) {
|
boolean datasaver_reminder = prefs.getBoolean("datasaver_reminder", true);
|
||||||
prefs.edit().putBoolean("datasaver_reminder", true).apply();
|
grpDataSaver.setVisibility(
|
||||||
return false;
|
isDataSaving && enabled && datasaver_reminder
|
||||||
}
|
? View.VISIBLE : View.GONE);
|
||||||
|
}
|
||||||
boolean enabled = prefs.getBoolean("enabled", true);
|
|
||||||
boolean reminder = prefs.getBoolean("datasaver_reminder", true);
|
|
||||||
|
|
||||||
if (!enabled || !reminder)
|
|
||||||
return false;
|
|
||||||
|
|
||||||
DB db = DB.getInstance(context);
|
|
||||||
List<EntityAccount> accounts = db.account().getSynchronizingAccounts(null);
|
|
||||||
if (accounts == null || accounts.size() == 0)
|
|
||||||
return false;
|
|
||||||
|
|
||||||
boolean ondemand = true;
|
|
||||||
for (EntityAccount account : accounts)
|
|
||||||
if (!account.ondemand) {
|
|
||||||
ondemand = false;
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (ondemand)
|
|
||||||
return false;
|
|
||||||
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
protected void onExecuted(Bundle args, Boolean show) {
|
|
||||||
grpDataSaver.setVisibility(Boolean.TRUE.equals(show) ? View.VISIBLE : View.GONE);
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
protected void onException(Bundle args, Throwable ex) {
|
|
||||||
grpDataSaver.setVisibility(View.GONE);
|
|
||||||
}
|
|
||||||
}.serial().execute(this, new Bundle(), "datasaver");
|
|
||||||
|
|
||||||
if (grpSupport != null &&
|
if (grpSupport != null &&
|
||||||
("pro".equals(key) || "banner_hidden".equals(key))) {
|
("pro".equals(key) || "banner_hidden".equals(key))) {
|
||||||
|
|
|
@ -8,7 +8,7 @@ Ypupiara
|
||||||
|
|
||||||
Next version
|
Next version
|
||||||
|
|
||||||
* Added barcode decoding (requires Android 7+)
|
* Added image barcode decoding (requires Android 7+)
|
||||||
* Small improvements and minor bug fixes
|
* Small improvements and minor bug fixes
|
||||||
* Updated Public Suffix List
|
* Updated Public Suffix List
|
||||||
* Updated translations
|
* Updated translations
|
||||||
|
|
Loading…
Reference in New Issue