mirror of
https://github.com/nextcloud/notes-android.git
synced 2024-11-21 20:35:58 +03:00
#1168 Enable background synchronization by default
This commit is contained in:
parent
ecff7bb0e7
commit
d508552b93
3 changed files with 5 additions and 6 deletions
|
@ -102,15 +102,14 @@ public class ImportAccountActivity extends AppCompatActivity {
|
|||
*/
|
||||
@Override
|
||||
public void onSuccess(Account account) {
|
||||
Context context = getApplicationContext();
|
||||
SharedPreferences sharedPreferences = PreferenceManager.getDefaultSharedPreferences(context);
|
||||
SyncWorker.update(context, sharedPreferences.getBoolean(context.getString(R.string.pref_key_background_sync), true));
|
||||
runOnUiThread(() -> {
|
||||
Log.i(TAG, capabilities.toString());
|
||||
BrandingUtil.saveBrandColors(ImportAccountActivity.this, capabilities.getColor(), capabilities.getTextColor());
|
||||
setResult(RESULT_OK);
|
||||
finish();
|
||||
});
|
||||
SyncWorker.update(ImportAccountActivity.this, PreferenceManager.getDefaultSharedPreferences(ImportAccountActivity.this)
|
||||
.getBoolean(getString(R.string.pref_key_background_sync), true));
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
|
@ -28,11 +28,10 @@ public class Migration_21_22 extends Migration {
|
|||
SharedPreferences sharedPreferences = PreferenceManager.getDefaultSharedPreferences(context);
|
||||
SharedPreferences.Editor editor = sharedPreferences.edit();
|
||||
if (sharedPreferences.contains("backgroundSync")) {
|
||||
editor.remove("backgroundSync");
|
||||
if (sharedPreferences.getString("backgroundSync", "").equals("off")) {
|
||||
editor.remove("backgroundSync");
|
||||
editor.putBoolean("backgroundSync", false);
|
||||
} else {
|
||||
editor.remove("backgroundSync");
|
||||
editor.putBoolean("backgroundSync", true);
|
||||
SyncWorker.update(context, true);
|
||||
}
|
||||
|
|
|
@ -1,3 +1,4 @@
|
|||
- 🌐 Enhanced linkifying - by @Cui-Yusong
|
||||
- ⚙️ Use Retrofit for API calls (#1167)
|
||||
- ⚙ Switched based for markdown rendering in widgets
|
||||
- ⚙ Switched based for markdown rendering in widgets
|
||||
- ⚙ Enable background synchronization by default (#1168) - by @MasterWanna
|
Loading…
Reference in a new issue