Yet-Zio / yetCalc

Yet another calculator designed and developed for Android
BSD 3-Clause "New" or "Revised" License
226 stars 17 forks source link

feat: save/restore selections on conversion fragments #141

Closed jj-style closed 2 months ago

jj-style commented 2 months ago

Implemented a solution to store the selections of converter spinners/dropdowns in SharedPreferences and restore them on startup to whatever you had selected last.

I have never written any Kotlin/any android app development before so sort of guessed my way through it but it seems to be working on my phone but any advice / feedback for changes are welcome!

Yet-Zio commented 2 months ago

Hi @jj-style,

I see that you have saved each of the fragment's dropdown values to SharedPreferences directly. I once tried to store it in a file format with the help of ConverterPref but that kinda didn't work. Your solution seems pretty fine in that case. I will merge the changes to the 1.1.5 branch and test it on my end as well.

Also, I'm rewriting the app in Material 3 since there are a lot of UI issues with the app. It's not finished, but your changes, I think, will be almost the same there as well.

You have understood the code well and applied it wherever necessary even if you haven't written any Kotlin code before, as you say. Guess that is due to experience with many different languages. One advice would be to avoid including the .idea folder in changes, its usually environment specific.

Thank you! :)

jj-style commented 2 months ago

Thank you for the feedback, ah sorry for committing the .idea folder and thanks for cleaning that up.

Look forward to seeing the UI change when it's out, I just swapped to a really small android phone and have noticed on the calculator the buttons at the bottom are cut off a bit, and the intermediate result at the top was blocked by the 3 dot bar.

Anyway hopefully that will be sorted with the UI changes, and thanks for merging this quickly and for the app it's super useful :)