mirror of
https://github.com/M66B/FairEmail.git
synced 2026-03-31 14:17:03 +02:00
Batch update preferences
This commit is contained in:
@@ -285,6 +285,15 @@ public class FragmentOptionsBackup extends FragmentBase implements SharedPrefere
|
||||
"cloud_activated".equals(key) ||
|
||||
"cloud_busy".equals(key) ||
|
||||
"cloud_last_sync".equals(key)) {
|
||||
getMainHandler().removeCallbacks(update);
|
||||
getMainHandler().postDelayed(update, FragmentOptions.DELAY_SETOPTIONS);
|
||||
}
|
||||
}
|
||||
|
||||
private Runnable update = new RunnableEx("backup") {
|
||||
@Override
|
||||
protected void delegate() {
|
||||
SharedPreferences prefs = PreferenceManager.getDefaultSharedPreferences(getContext());
|
||||
String user = prefs.getString("cloud_user", null);
|
||||
String password = prefs.getString("cloud_password", null);
|
||||
boolean auth = !(TextUtils.isEmpty(user) || TextUtils.isEmpty(password));
|
||||
@@ -301,8 +310,9 @@ public class FragmentOptionsBackup extends FragmentBase implements SharedPrefere
|
||||
grpLogin.setVisibility(auth ? View.GONE : View.VISIBLE);
|
||||
grpActivate.setVisibility(auth && !activated && !busy ? View.VISIBLE : View.GONE);
|
||||
grpLogout.setVisibility(auth ? View.VISIBLE : View.GONE);
|
||||
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
@Override
|
||||
public void onActivityResult(int requestCode, int resultCode, Intent data) {
|
||||
|
||||
Reference in New Issue
Block a user