Don't take the app widget host padding into account when trying to
calculate the widget sizing.
Doing such produces bad results, at least on my devices. At least, it
does now for some reason.
Fix an issue on some devices where the delayed actions system would
not work on startup.
Apparently onStart can be called several times with the same intent.
No, I am not joking. What the actual hell. This would cause any
delayed action other than Restore to be overwritten. The only hard
rule about android is that there are no rules. I hate this platform
so much.
Move the switch from IO to Main to within Indexer itself, through
withContext.
This is much easier to work with than the previous system of a separate
"update" coroutine, which isn't really needed anymore given that I no
longer need to do IO work when sanitizing the playback state.
Remove WindowInsetsCompat from the project, as it is a pile of garbage.
WindowInsetsCompat refuses to actually update the correct fields when
you transform it back into a WindowInsets. This makes it impossible to
use in Auxio. The fact that Google decided to make such an
overengineered wrapper to some version-specific methods is an absolute
joke. All you needed were some extension functions, but no, let's make
an entire wrapper class filled with so many gotchas as to be unusable.
Force LTR on timeline controls, as per the Material Design guidelines.
The guidelines state that while "directional" UIs should be LTR/RTL
depending on locale, "timeline" UIs should always by LTR, as the
direction of time is universal. Auxio did not do this, and so the
timeline controls would be RTL on other elements. Fix this by forcing
LTR on the UI elements that correspond to timelines.
Now, this is not the best system. To ensure that the rest of the layout
remains sane, much of the directional views have to be wrapped in a
redundant layout, which is somewhat in-efficient. However, the impact
seems to be at least negligable.
Add a utility to easily work with lifecycle-dependent fragment objects.
This reduces the code duplication required to maintain objects that
would leak after the destruction of a fragment. We normally would not
do this as a delegate, as that usually entails some lifecycle wizardry
that can easily break and crash the app in esoteric situations.
However, this this just extends the normal lifecycle without watching
any state, it seems to be pretty safe to use.
Revamp the shared object SettingsManager into a standalone utility
called Settings.
This makes many things easier in Auxio. It completely unifies the key
format that we use (Android Strings instead of Java consts), eliminates
the pretty dumb initialization method that we use, and eliminates the
dubiousness of holding a Context-related utility in a global field.
The only cost was having to migrate even more ViewModels to Android
ViewModels. Whatever.
Add a shortcut to shuffle all songs.
This is likely the only static shortcut Auxio will have. Top tracks
and recently added are completely useless for me, so I will never
add them. I may add more dynamic shortcuts for recently played items,
however.
Note that we use a basic black shuffle icon here. I will not add icon
customization to these shortcuts.
Introduce MenuFragment in order to replace ActionMenu.
ActionMenu was a terrible class filled with hacks. Introduce a new
fragment called MenuFragment that enables the same features, plus:
1. Requiring consumers the specify the menu, which prevents issues
from one-size-fits-all menus (unless absolutely necessary)
2. Fixing an issue where multiple menus appear at once
Fix an API 21-specific bug that could result in covers not loading when
quality covers was enabled.
This stemmed from a use of `use` on MediaMetadataRetriever, which
relied on an interface not present on the class on API 21.
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.
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.
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.
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.
Re-add accent customization on Android 12 and above.
Previously, I disabled accent customization since I thought they were
more or less useless with the new Material You dynamic colors system.
Turns out I severely underestimated how horribly OEMs would botch the
dynamic colors system. Guess I was blinded by my adherence to the pixel
line. Re-add the accent customization for those who do not have a good
dynamic color palette at all.
Resolves#131.
Rework the tiny widget to cram even more information into it.
The tiny widget is nominally meant for edge cases like exceptionally
small screens or landscape mode, but apparently it's triggered on some
devices in normal use because of platform fragmentation and OEM insanity.
Update the tiny widget layout with some new buttons in order to make it
more usable in mnormal use. This is still nowehre near ideal. For
example, when triggering the layout on my device, it ends up squishing
the buttons. But it should probably work better outside of those edge
cases.
Hack around more insane lollipop bugs, such as:
- The angular auxio icon crashing the system UI
- Optimized icons being corrupted
- Setting image alpha not working properly
I really wish I could drop support for this horrible version, but I
either have to wait for a major library to drop support or for the
usage numbers to reach 1%.
Replace the hodge-podge framework of state restoration and URI playing
with a single "delayed action" system.
Auxio's initialization routine is a total cluster----. This is mostly
because it involves multiple asynchronous operations such as music
loading, state restore, and service starting which tend to make it
highly prone to race conditions and other insanity.
In particular, the way Auxio would attempt to restore playback and
handle file opening was a spaghetti pile of bad API boundaries and
dubious UI code. This has not changed. I want to move this routine
to the service, but it's lifecycle is also sh------ed to such an
extent where that would be nearly impossible. Instead, this commit
introduces a new "delayed action" system that bites the bullet and
allowes PlaybackViewModel to accept a context and an action in
return for initializing playback...eventually.
I tried my best to eliminate as much memory leaks as I physically
could here, but could only go so far. Still though, even this insane
system is better than the UI-level LiveData shenanigans I did
previously, and actually works compared to the broken android
components that google keeps wanting you to use.
Add sorting modes for duration and song count.
This was requested previously in the now-closed UI/UX changes
megathread, however I have only gotten to it now.
Do some miscellanious formatting reworks.
1. Remove all instances of m in favor of _. _ is only used when names
collide or if something should be internal.
2. Make fragments apply their own click listeners.
3. Remove instances of inc/dec and replace them with the more
straightfoward + 1 or - 1.
Migrate all esoteric adapters to the new RecyclerView framework.
One of the shortcomings with the previous RecyclerView utilities was
how more esoteric adapters with data that does not implement Item
could not use the utlities. The new system, by comparison, is capable
of taking any type of data, so we can no migrate all of the esoteric
adapters to the new system.
Remove databinding entirely.
Databinding was a terrible idea for Auxio. I rarely leveraged it, and
when I did, it produced messy code and bloated build times. Dumpster it
for just viewbinding, which is good. This reduces building times by
nearly 2/3, and generally makes the codebase more coherent and usable.
Make resolvedName the standard name to use across all music items.
Previously, the way Auxio differentiated between names in UIs was to
use name for normal items and resolvedName for parents. This was odd
and disjointed, as it muddled the meanings of the two fields and lead
to a lot of bugs. Fix this by making resolvedName *the* standard name
to use across all music items, even in ones that don't have to resolve
their name.
Switch to the spotless linter with ktfmt used as a backend instead of
ktlint.
This switch was done for two reasons:
1. ktfmt is more thorough than ktlint
2. License headers can be added more effectively with spotless than
the default Android Studio behavior.
Dump all of the changes now so I don't have to deal with it over a long
period of time. I don't care.
Fix an issue where headset focus would result in unexpected playback
whenever the service started.
AudioManager.ACTION_HEADSET_PLUG seems to always fire when the initial
BroadcastReceiver is set up, which results in a weird bug where if a
wired headset is connected while PlaybackService is started, playback
will start immediately, which was not user friendly.
I fear that this may result in an edge case that results in headset
focus not firing in an unrelated situation, which in that case I would
be forced to remove headset autoplay entirely (or at least relegate it
to a quirk option).
Add even more checks and guards to the music loading process to ensure
proper metadata loading.
Auxio has always had issues handling track numbers and years, mostly
with ensuring their validity. This change resolves them by more or less
surrounding them with gobs of null-checks and fallible parsing
routines, which should help avoid frustrating bugs and crashes with
metadata in the future.
Resolves#88.
Resolves#84.
Revert the removal of the song/artist values from list items for now.
The current plan of removing extraneous values from songs and albums
only works if I add multi-select and a dedicated menu button, but that
is still in the air, and in general I want feedback before I go ahead.
Aside from reverting the previous changes, this actually standardizes
all item descriptions under a single bullet point formatting system,
instead of the mix of commas and bullet points that existed beforehand.
Change createMosaic to use SquareFrameTransform.
This should help fix a theoretical bug where non-1:1 album covers will
be oddly stretched in a generated mosaic, as all album covers will be
forcefully cropped to a 1:1 ratio.
Rework logging to be clearer and more standardized.
Rework all usages of lossing to follow a single unified style,
introducing a new "warn" option alongside this.
Actually migrate to API 32 [Android 12L], co-inciding with the upgrade
of my studio install and the android gradle plugin. Alongside this, add
a bunch of fixes for lints that the new studio picked up.
When using gesture navigation, swipe up events might conflict with the
slide up behavior of the playback layout. To fix this, inset the
playback bar based on the gesture insets instead of the system bar
insets.
Extend edge-to-edge to versions below Android Oreo. This is done
through tinting the navigation bar colors on those versions,
circumventing the coloring issue.
Split screen layouts in android are completely borked. You can
resize Auxio down to the point where the UI is completely
unusable, and there is NO WAY TO SET A MINIMUM HEIGHT. This is
also not to mention that smallestScreenWidthDp is completely
busted too and still uses the size of the whole screen! Just
band-aid the first issue so that when the layout becomes so
small as to result in a messed up UI, just show a splash that
says that the app can't work at the specific window size.