diff options
author | Stefan Niedermann <info@niedermann.it> | 2023-03-09 16:18:30 +0300 |
---|---|---|
committer | Stefan Niedermann <info@niedermann.it> | 2023-03-09 16:18:30 +0300 |
commit | 7957e3e5fd1570234788bc86f9a8ab17af5bd928 (patch) | |
tree | 3ed071c18fbe8434a3d0df80425e57e37572dfb2 /app/src/main/java/it/niedermann/nextcloud/deck/ui | |
parent | c48c06cd6155db09ce8b1bd99ef703fc6ec42ef9 (diff) |
fix: Recreate MainActivity after changing any setting to directly apply them
Signed-off-by: Stefan Niedermann <info@niedermann.it>
Diffstat (limited to 'app/src/main/java/it/niedermann/nextcloud/deck/ui')
-rw-r--r-- | app/src/main/java/it/niedermann/nextcloud/deck/ui/settings/SettingsActivity.java | 4 | ||||
-rw-r--r-- | app/src/main/java/it/niedermann/nextcloud/deck/ui/settings/SettingsFragment.java | 2 |
2 files changed, 3 insertions, 3 deletions
diff --git a/app/src/main/java/it/niedermann/nextcloud/deck/ui/settings/SettingsActivity.java b/app/src/main/java/it/niedermann/nextcloud/deck/ui/settings/SettingsActivity.java index 172b31fd1..0ca0739fe 100644 --- a/app/src/main/java/it/niedermann/nextcloud/deck/ui/settings/SettingsActivity.java +++ b/app/src/main/java/it/niedermann/nextcloud/deck/ui/settings/SettingsActivity.java @@ -35,7 +35,9 @@ public class SettingsActivity extends AppCompatActivity implements Themed { applyTheme(account.getColor()); setSupportActionBar(binding.toolbar); setContentView(binding.getRoot()); - setResult(RESULT_CANCELED); + + // TODO We should only set this if a preference has changed that influences the MainActivity + setResult(RESULT_OK); } @Override diff --git a/app/src/main/java/it/niedermann/nextcloud/deck/ui/settings/SettingsFragment.java b/app/src/main/java/it/niedermann/nextcloud/deck/ui/settings/SettingsFragment.java index 422095497..44cfe5410 100644 --- a/app/src/main/java/it/niedermann/nextcloud/deck/ui/settings/SettingsFragment.java +++ b/app/src/main/java/it/niedermann/nextcloud/deck/ui/settings/SettingsFragment.java @@ -1,6 +1,5 @@ package it.niedermann.nextcloud.deck.ui.settings; -import android.app.Activity; import android.os.Bundle; import android.view.View; @@ -66,7 +65,6 @@ public class SettingsFragment extends PreferenceFragmentCompat { if (themePref != null) { themePref.setOnPreferenceChangeListener((Preference preference, Object newValue) -> { preferencesViewModel.setAppTheme(Integer.parseInt((String) newValue)); - requireActivity().setResult(Activity.RESULT_OK); ActivityCompat.recreate(requireActivity()); return true; }); |