-
-
Notifications
You must be signed in to change notification settings - Fork 226
Adds default currency feature #2972
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
TheLastProject
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Didn't do a full depth review but I see multiple severe bugs. Please make sure to test your implementation well.
| private void formatBalanceCurrencyField(Currency balanceType) { | ||
| if (balanceType == null) { | ||
| balanceCurrencyField.setText(getString(R.string.points)); | ||
| Currency defaultCurrency = new Settings(getApplicationContext()).getCurrency(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Won't this keep changing Points to the "Default currency" every time someone opens the edit view, thus changing it away from Points? Making it impossible to keep using points unless you keep setting it back?
Seems to me the only sensible moment is to only ever set it once for a new card.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Completly agree. I refactored the code to identify new cards creation, removing the ambiguity related to "currency == null", separating new cards from points option.
| } | ||
|
|
||
| public Currency getCurrency() { | ||
| String value = getString(R.string.settings_key_default_currency, "Points"); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You cannot use the string "Points" as this is translatable, will break for anything but English by default.
- Correctly assigned symbols to currency codes for respectively entries and entrieValues - Removed hardcoded string "Points" - Only select default currency at the creation of a new card (when its required field is empty)
implements #2886