When ReplayGain is not needed, use ByteBuffer.put in favor of a for
loop when doing a simple copy.
ByteBuffer.put is highly optimized and far more efficient than a for
loop.
Redo the paths and remove scientific notation from the indicator to
make it work below API 22.
The fact that studio does not have a built-in vector editor of any
kind that properly handles the edge-cases is shameful.
Add a new view called ImageGroup that will handle all advanced image
hacks from now on.
This includes the indicator (which is now animated), any selection
indicators, and the weirdness of the album song image. All of that
is now handled by ImageGroup. This is the culmination of probably
a day and a half of wrangling with android insanity and having to
remove a lot of what I liked about the indicator in order to make
this work on a basic level.
The only major bug I am currently aware of with this is that the
indicator is bugged out on Lollipop devices due to bad vectors.
Again.
I never want to do this again. I cannot believe that adding a basic
indicator took this long and required so much stupid hacks and
inefficient code. And then google wonders why android apps are so
visually unappealing and janky and laggy. Hm. Must be that devs aren't
using the brand new FooBarBlasterFlow library!
Add a playing indicator to cover art.
This is simply to improve the general aestethics of this view. Of
course, the current way I implement this is incredibly stupid and I
plan to replace it.
Completely rework the way Auxio handles icons.
This is mostly two changes:
1. Removing ImageButton/StyledImageButton for MaterialButton. This is
done by abusing MaterialButton's theming options to make it only show
an icon.
2. Standardizing icon sizes into small, medium, and large categories.
Small is the default, Medium and Large are for edge-cases like the
playback icons which look horrible at 24dp.
3. Abusing the Toolbar to make it follow Material 3 guidelines. This
mostly involved removing the strange icon sizing and correctly padding
the view.
4. Reworking the playback bar to use more, smaller icons, making it
more like a Toolbar in the process (which I like).
Supply a view to WindowInsetsCompat.toWindowInsetsCompat through all
calls in the app.
This does nothing, but it would resolve future bugs if I were to use
the most exotic window inset types.
On the playback par, pick the larger inset out of the system bar
insets or system gesture insets.
This is to fix an issue where android just does not provide correct
gesture insets on Android 12L, and [maybe???] fix what is going on
in #149.
Make the home toolbar collapse on scroll.
I was planning to implement this back in 2.0.0, but visual bugs stopped
me. Now, knowing how much space the the Toolbar + Tab combination takes
up on smaller devices, I think it would be better to have this in
general.
Rework PrimitiveBackingData into SyncBackingData.
Google says that you should not use DiffUtil on the main thread, as it
is far too slow. In practice, the time it takes to diff is negligable,
even more so when costly diffs are filled in with a replace call
instead. Not only that, but switching to a synced list differ fixees
the horrible nightmare that is the queue adapter. Generally a win-win
for most use-cases in Auxio.
Rework the submitList animation to be less resource intensive and nicer
looking (at the cost of scroll positioning)
notifyDatasetChanged is slow and has no animation, but list diffing is
chaotic and basically useless outside of search. However, clearing the
adapter and then populating it with new items seems to work quite well,
albeit with the scroll position being lost sadly. Switch to that.
Extend the range of tags Auxio is capable of recognizing, removing some
edge-cases in the process.
This is mostly three changes:
1. Auxio no longer tolerates tracks/discs/years that are 0. These are
usually never valid.
2. Auxio now has support for original date/year values. This are niche
tags, but I was inspired to implement it by this HN discussion at
https://news.ycombinator.com/item?id=31659799 simply because it
differentiates Auxio.
3. Auxio can handle the more esoteric tag variations in vorbis, such
as "YEAR" or "ALBUM ARTIST".
Add a toggle for edge-to-edge mode.
Normally we would want to enable edge-to-edge by default (in fact, we
still do). However, some phones (once again, samsung) don't provide
Auxio with actual window insets. As a result, we need to add a toggle
so that it can be disabled on busted devices.
Did you know that even when Auxio has it's edge-to-edge functionality
busted, Samsung Music works just fine? Very interesting.
Resolves#149.
Use androidx compat tools when setting up edge-to-edge and applying
window insets.
This is mostly a readability tweak ahead of making edge-to-edge a
setting.
Remove the version-specific display name hacks added previously.
Turns out RELATIVE_PATH only includes the directory structure. Oh.
Since this invalidates the purpose of version-specific display name
hacks, we just remove it.
Do not add a callback to a MetadataRetriever call in ExoPlayerBackend.
This fixes an issue where if an error occurs while a future completes,
the app will crash entirely. This is because Futures run on a different
Executor and thus exceptions will not bubble up to Indexer.
Make the detail UIs respond to automatic rescanning events.
This currently has no effect, but is instead a preparation step for the
seamless addition of automatic rescanning.
Make IndexerService only auto-index music when there is no library AND
no loading has occured.
This resolves an issue where if IndexerService dies after a failed
index, IndexerService would try to index music regardless, as there was
no library present.
Add support for excluding directories on other volumes, at least from
Android Q onwards.
Previously, Auxio only supported excluding the primary volume. This was
mostly out of laziness, as the excluded directory implementation was
shamelessly copied from Phonograph. This commit completely refactors
the excluded directory system, dumpstering the old database (which was
overkill anyway) for a new system based on SharedPreferences that is
actually capable of handling external volumes.
Now, limitations regarding external volumes still apply below Android
Q, as the VOLUME_NAME field does not exist on those versions. However,
this should resolve at least one major complaint regarding the
excluded directory system. Now theres just all of the other complaints.
Resolves#134.
Fix an issue with highlighting in the detail UIs taht stemmed from the
ViewHolder position being cached.
Resorting could have changed the ViewHolder position, so caching it
will result in ViewHolders being incorrectly updated.
Rework genre parsing to properly align with the ID3v2 standard.
The ID3v2 genre specification is weirdly complex. Auxio ignored most
of that and just parsed out the most common cases for genres (digits
and (digits)). For the sake of completeness, rework Auxio's genre
parser to handle the weirder cases like RX/CR, multiple values,
and escaping, with an implementation roughly based on Mutagen's
genre parser.
Improve Indexer's state management by splitting up the current loading
state and the last response.
This is intended to resolve a bug where if the UI task and
IndexerService are both killed, the Indexer state would become
indeterminate and the library would not show. Resolve this by keeping
track of whatever the last completed state was and falling back to it
whenever the loading process is canceled.
Add a dedicated service towards the loading of the music library.
This new service was created for two reasons:
1. Music loading is slow and resource-intensive, so putting it on the
ViewModel layer just didn't seem right and made it vulnerable to the
OS simply stopping the loading process.
2. For automatic rescanning [#72], there must be something watching
the music library and waiting for a change in the background. This
would require a service as that is probably the least insane way to
do that kind of background work.
I have no garuntees how viable the service might be. If anything, it
might be halted by some insane android restriction or issue that
makes it more or less impossible to use for most apps, and I will have
to largely drop truly automatic rescanning.
Rework loading management into a new object, Indexer, which should act
as the base for all future loading changes.
Indexer tries to solve a two issues with music loading:
1. The issue of what occurs when tasks must be restarted or cancelled,
which is common with music loading.
2. Trying to find a good strategy to mediate between service and
ViewModel components in a sensible manner.
Indexer also rolls in a lot of the universal music loading code
alongside this, as much of MusicStore's loading state went unused
by app components and only raised technical challenges when reworking
it.
Rework genre ordering to be alphabetical based on album, but without
all of the mosaic being taken up by one artist.
With the ordering changes that were done previously, genre images
greatly differed compared to previously. May as well use this breakage
as an oppertunity to improve genre ordering. In this case, we want to
order albums alphabetically, as usual, but we also want to prevent
one artist from taking up the whole mosaic. Fix that by deduplicating
artists in the set of grouped albums.
Add an indicator to gague the current music loading progress.
This is actually a lot harder to implement than it might seem, not only
due to UI state issues, but also due to the fact that MusicStore needs
to keep it's state sane across a myriad of possible events that could
occur while loading music. This system seems like a good stopgap until
a full service-backed implementation can be created.
Apply the notifyItemChanged fix everywhere by making it an explicit
part of the RecyclerView framework.
This way, implementing future selection and rewrite behavior will be
much easier, as the payload argument is available in every adapter
implementation.
Fix two major highlighting bugs based around the janky and stupid way
I would handle highlighting previously.
Previously, I would index the views of a RecyclerView in order to
highlight viewholders. In retrospect this was a pretty bad idea,
as viewholders could be in a weird limbo state where they are bound,
but not accessible. I mean, it's in the name. It's a Recycling View.
Fortunately, google actually knew what they were doing and provided
a way to mutate viewholders at runtime using notifyItemChanged.
And the API actually makes sense! Wow! Migrate all detail adapters
to a system that uses notifyItemChanged instead of the terrible
pre-existing system.
Fix a state restore issue that would cause the parent to restore
incorrectly.
At some point, I accidentally used the index for the PlaybackMode field
when restoring the playbackState. This resulted in the playback mode
effectively reverting to ALL_SONGS and causing a number of subtle
issues.
Further refine the Indexer and ExoPlayerBackend implementations.
These fixes were primarily focused on ensuring stable grouping through
stable sorting order, and more graceful handling of edge cases in
ExoPlayerBackend.
Fix a regression where media button controls would no longer work
with GadgetBridge.
In 4a79de4, I assumed that my code was redundant, as there should be
some kind of reciever handling media button events already. I was
completely wrong. Re-add the reciever code (with extra checks) to
make controls work again.
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.