Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/stefan-niedermann/nextcloud-notes.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMasterWanna <MasterWanna@users.noreply.github.com>2021-05-04 16:23:16 +0300
committerMasterWanna <MasterWanna@users.noreply.github.com>2021-05-04 16:23:16 +0300
commit2b51c719434068b060ce2b44ce34924cc85d0a38 (patch)
tree59690ba3fa6eaf9c530a37ed662d82016c649f64 /app/src/main/java/it
parent864e89637dfef6efe143adcd20f32bdece6bd1ec (diff)
Bug fixed
Diffstat (limited to 'app/src/main/java/it')
-rw-r--r--app/src/main/java/it/niedermann/owncloud/notes/importaccount/ImportAccountActivity.java2
-rw-r--r--app/src/main/java/it/niedermann/owncloud/notes/persistence/migration/Migration_21_22.java4
-rw-r--r--app/src/main/java/it/niedermann/owncloud/notes/preferences/PreferencesFragment.java5
3 files changed, 2 insertions, 9 deletions
diff --git a/app/src/main/java/it/niedermann/owncloud/notes/importaccount/ImportAccountActivity.java b/app/src/main/java/it/niedermann/owncloud/notes/importaccount/ImportAccountActivity.java
index a8fc1823..22bc401b 100644
--- a/app/src/main/java/it/niedermann/owncloud/notes/importaccount/ImportAccountActivity.java
+++ b/app/src/main/java/it/niedermann/owncloud/notes/importaccount/ImportAccountActivity.java
@@ -104,7 +104,7 @@ public class ImportAccountActivity extends AppCompatActivity {
public void onSuccess(Account account) {
Context context = getApplicationContext();
SharedPreferences sharedPreferences = PreferenceManager.getDefaultSharedPreferences(context);
- SyncWorker.update(context, !sharedPreferences.getString("backgroundSync", "on").equals("off"));
+ 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());
diff --git a/app/src/main/java/it/niedermann/owncloud/notes/persistence/migration/Migration_21_22.java b/app/src/main/java/it/niedermann/owncloud/notes/persistence/migration/Migration_21_22.java
index 18e9eba0..5a210261 100644
--- a/app/src/main/java/it/niedermann/owncloud/notes/persistence/migration/Migration_21_22.java
+++ b/app/src/main/java/it/niedermann/owncloud/notes/persistence/migration/Migration_21_22.java
@@ -14,7 +14,6 @@ import it.niedermann.owncloud.notes.persistence.SyncWorker;
* Enabling backgroundSync, set from {@link String} values to {@link Boolean} values
* https://github.com/stefan-niedermann/nextcloud-notes/issues/1168
*/
-
public class Migration_21_22 extends Migration {
@NonNull
private final Context context;
@@ -29,10 +28,9 @@ public class Migration_21_22 extends Migration {
SharedPreferences sharedPreferences = PreferenceManager.getDefaultSharedPreferences(context);
SharedPreferences.Editor editor = sharedPreferences.edit();
if (sharedPreferences.contains("backgroundSync")) {
- if (sharedPreferences.getString("backgroundSync", "on").equals("off")) {
+ if (sharedPreferences.getString("backgroundSync", "").equals("off")) {
editor.remove("backgroundSync");
editor.putBoolean("backgroundSync", false);
- SyncWorker.update(context, false);
} else {
editor.remove("backgroundSync");
editor.putBoolean("backgroundSync", true);
diff --git a/app/src/main/java/it/niedermann/owncloud/notes/preferences/PreferencesFragment.java b/app/src/main/java/it/niedermann/owncloud/notes/preferences/PreferencesFragment.java
index 91b5cc7b..e67aab4e 100644
--- a/app/src/main/java/it/niedermann/owncloud/notes/preferences/PreferencesFragment.java
+++ b/app/src/main/java/it/niedermann/owncloud/notes/preferences/PreferencesFragment.java
@@ -36,11 +36,6 @@ public class PreferencesFragment extends PreferenceFragmentCompat implements Bra
super.onCreate(savedInstanceState);
}
- /**
- * Turn background sync from from {@link String} values to {@link Boolean} values
- * https://github.com/stefan-niedermann/nextcloud-notes/issues/1168
- */
-
@Override
public void onCreatePreferences(Bundle savedInstanceState, String rootKey) {
addPreferencesFromResource(R.xml.preferences);