all: switch to stateflow

Switch from LiveData to StateFlow.

While LiveData is a pretty good data storage/observer mechanism, it has
a few flaws:
- Values are always nullable in LiveData, even if you make them
non-null.
- LiveData can only be mutated on Dispatchers.Main, which frustrates
possible additions like a more fine-grained music status system.
- LiveData's perks are exclusive to ViewModels, which made coupling
with shared objects somewhat cumbersome.

StateFlow solves all of these by being a native coroutine solution with
proper android bindings. Use it instead.
This commit is contained in:
OxygenCobalt
2022-06-01 11:46:00 -06:00
parent 402a290db7
commit a65d37c421
32 changed files with 268 additions and 232 deletions
+3
View File
@@ -2,6 +2,9 @@
## dev [v2.3.1, v2.4.0, or v3.0.0]
#### What's Improved
- Loading UI is now more clear and easy-to-use
#### What's Fixed
- Fixed crash when seeking to the end of a track as the track changed to a track with a lower duration