Tusky-App-Android/app/src/main/java/com/keylesspalace/tusky
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
..
adapter Composite semi-transparent avatars over a solid background (#3874) 2023-08-08 23:09:59 +02:00
appstore Remove Rx from EventHub and TimelineCases (#3446) 2023-03-18 10:11:47 +01:00
components Uses the system theme as default theme (#3813) 2023-08-23 15:04:24 +02:00
db Rename "Trending" to "TrendingTags" or similar where necessary (#3906) 2023-08-19 12:54:35 +02:00
di Rename "Trending" to "TrendingTags" or similar where necessary (#3906) 2023-08-19 12:54:35 +02:00
entity Add support for setting a list's "exclusivity" option (#3932) 2023-08-06 20:29:34 +02:00
fragment Migrate to androidx-media3 video player (#3857) 2023-08-10 19:31:55 +02:00
interfaces Support the mastodon 4 filter api (#3188) 2023-03-11 13:12:50 +01:00
json update ktlint plugin to 11.3.1, format code (#3442) 2023-03-13 13:16:39 +01:00
network Add support for setting a list's "exclusivity" option (#3932) 2023-08-06 20:29:34 +02:00
pager Keep the tabs adapter over the life of the viewpager (#3255) 2023-02-15 19:17:59 +01:00
receiver Move cache pruning to a WorkManager worker (#3649) 2023-06-11 13:17:30 +02:00
service Improve account switching intents (#3732) 2023-08-19 12:31:47 +02:00
settings Uses the system theme as default theme (#3813) 2023-08-23 15:04:24 +02:00
usecase Remove Rx from EventHub and TimelineCases (#3446) 2023-03-18 10:11:47 +01:00
util Uses the system theme as default theme (#3813) 2023-08-23 15:04:24 +02:00
view Migrate to androidx-media3 video player (#3857) 2023-08-10 19:31:55 +02:00
viewdata Fix extra clicks on media tab (#3930) 2023-08-07 19:30:56 +02:00
viewmodel Apply PR suggestions: 2023-08-24 10:06:25 +02:00
worker Show notifications from workers (#3760) 2023-06-29 18:37:27 +02:00
AboutActivity.kt Show additional bug report info in AboutActivity (#3802) 2023-08-03 12:20:35 +02:00
AccountsInListFragment.kt Simplify repeated code that shows errors (#3762) 2023-06-19 23:49:20 +02:00
BaseActivity.java Uses the system theme as default theme (#3813) 2023-08-23 15:04:24 +02:00
BottomSheetActivity.kt Use case-insensitive checks when comparing account URLs in search (#3931) 2023-08-06 13:45:48 +02:00
EditProfileActivity.kt Apply PR suggestions: 2023-08-24 10:06:25 +02:00
LicenseActivity.kt update ktlint plugin to 11.3.1, format code (#3442) 2023-03-13 13:16:39 +01:00
ListsActivity.kt Add support for setting a list's "exclusivity" option (#3932) 2023-08-06 20:29:34 +02:00
MainActivity.kt Display notification filter/clear actions as menu items (#3877) 2023-08-19 14:41:10 +02:00
SplashActivity.kt remove legacy notification channel cleanup (#2550) 2022-05-25 20:54:25 +02:00
StatusListActivity.kt update ktlint plugin to 11.3.1, format code (#3442) 2023-03-13 13:16:39 +01:00
TabData.kt Allow the user to add a "bookmarks" tab (#3983) 2023-08-24 16:21:43 +02:00
TabPreferenceActivity.kt Allow the user to add a "bookmarks" tab (#3983) 2023-08-24 16:21:43 +02:00
TuskyApplication.kt Uses the system theme as default theme (#3813) 2023-08-23 15:04:24 +02:00
ViewMediaActivity.kt Migrate to androidx-media3 video player (#3857) 2023-08-10 19:31:55 +02:00