busky/app
Levi Bard 10a6b1616a
Editing profile: No change warning on leave. (#3972)
### 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
2023-08-28 14:13:24 +02:00
..
schemas/com.keylesspalace.tusky.db.AppDatabase Rename "Trending" to "TrendingTags" or similar where necessary (#3906) 2023-08-19 12:54:35 +02:00
src Editing profile: No change warning on leave. (#3972) 2023-08-28 14:13:24 +02:00
build.gradle Add newLintBaseline task (#3925) 2023-08-07 19:30:21 +02:00
getGitSha.gradle Previous attempt to fix git sha on non-git build broke git build. (#3322) 2023-02-16 20:20:52 +01:00
lint-baseline.xml Rename "Trending" to "TrendingTags" or similar where necessary (#3906) 2023-08-19 12:54:35 +02:00
lint.xml Use lint version 8.1.0 to fix erroneous warning about forEach (#3903) 2023-07-30 21:45:43 +02:00
proguard-rules.pro Remove shrinker rules for okhttp (#3560) 2023-04-24 12:08:03 +02:00