Skip to content

Commit

Permalink
reopen setings fragment after cancelling a nr-of-decimals-change, closes
Browse files Browse the repository at this point in the history
  • Loading branch information
Marmo committed Jan 6, 2022
1 parent 4e5aff6 commit b04cda7
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions app/src/main/java/org/ebur/debitum/ui/SettingsFragment.java
Original file line number Diff line number Diff line change
Expand Up @@ -212,6 +212,11 @@ private void showChangeDecimalsDialog(int newNrOfDecimals, int oldNrOfDecimals)
SharedPreferences pref = PreferenceManager.getDefaultSharedPreferences(requireContext());
pref.edit().putString(PREF_KEY_DECIMALS, String.valueOf(oldNrOfDecimals)).apply();
dialog.cancel();
// reopen settings fragment, as else the setting will visually remain at the new value,
// even though the change was cancelled.
// Somehow this also affects the oldValue when subsequently changing the setting again, see
// https://github.com/Marmo/debitum/issues/80, LEADING TO WRONG AMOUNTS!
NavHostFragment.findNavController(this).navigate(R.id.settings_dest);
});

builder.setMessage(getString(R.string.decrease_decimals_dialog_text))
Expand Down

0 comments on commit b04cda7

Please sign in to comment.