mirror of
https://github.com/accelforce/Yuito
synced 2024-12-22 05:19:05 +01:00
10a6b1616a
### Objective * Prevent data loss when the user inadvertently hits back or wants to leave the profile edition with unsaved changes. ### Description * To limit the number of changes to the existing codebase, I merely re-used the same method used by `save()` in the ViewModel to decide whether to make a network request or simply return the profile as-is. * ~A bit of code juggling around in the ViewModel and I was able to use the logic for all the encoding of each profile field (Which is what the ViewModel caches in memory).~ Thanks @Lakoja for improving this in the VM. * A couple of internal data classes used as helpers to move all the fields around (now that they are no longer used in one single place) were introduced. ### Potential Optimizations * ~The profile encoding is done twice (once for checking, and then again if the user has to actually save it). I'd say this is a negligible price to pay, since the alternative would be to create a different set of comparisons and/or keeping another profile in memory for the purpose of comparison.~ ### Visual Improvement * I believe the Dialog is difficult to see, but it's being displayed with Tusky's theme. Perhaps there's a better style to apply in this case? (or maybe the edit profile activity shouldn't have the same background color as dialogs?!) ### Issue * #3486 |
||
---|---|---|
.. | ||
schemas/com.keylesspalace.tusky.db.AppDatabase | ||
src | ||
build.gradle | ||
getGitSha.gradle | ||
lint-baseline.xml | ||
lint.xml | ||
proguard-rules.pro |