Commit graph

374 commits

Author SHA1 Message Date
OxygenCobalt
7b5c49a5b3
ui: disable default actions in drag helpers
Disable the default long-press action in the ItemTouchHelper usages.

ItemTouchHelper provides a long-press action to start an item drag by
default. However, because Auxio adds a drag handle on top of this
action, this actually results in a conflict with the default behavior
in certain cases. Replace it with a custom version of the long-press
action within the viewholders themselves.
2022-03-07 08:33:49 -07:00
OxygenCobalt
b5b8767f46
playback: fix crash with state restore [#89]
Fix an esoteric crash with queue synchronization during the playback
restore process.

Auxio will attempt to re-synchronize the queue index whenever it is
desynchronized, however during the check for if it's desynchronized,
Auxio would do a direct index of the queue, which could result in a
crash in situations where the desynchronized index is outside of the
queue bounds.

Fix this by replacing that unprotected access with a protected access,
which not only fixes the crash but also still correctly detects
desynchronization in that case.

Resolves #89.
2022-03-06 19:25:48 -07:00
OxygenCobalt
1b791074ec
playback: replace headset focus with headset autoplay
Turn the headset focus setting into the headset autoplay setting.

The way auxio handles headsets is...odd. Sometimes the MediaSession
handles it and Auxio could not care less, and sometimes Auxio actually
needs to handle it. As a result, the idea of being able to disable
headset focus is more or less moot because it will only apply to some
devices and not others.

On the other end, the way Auxio automatically begins playback once a
headset is plugged in is also quite weird. It only works on wired
headsets, and when it does, it overrides all other apps that might
also be playing audio. It's not to say that it's a bad feature, but
it's also one that I don't want to make the defualt. Auxio should
still play along within the confines of Android's expectations, after
all.

Replacing the existing "Headset focus" setting with a new "Headset
autoplay" setting solves both of these issues, as it prevents a
mis-guided disabling of the setting that doesn't actually disable
the feature and it relegates the quirky autoplay behavior to an
setting not enabled by default.
2022-03-05 20:34:12 -07:00
OxygenCobalt
6d003c308b
playback: fix headset focus autoplay issue
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).
2022-03-03 18:47:55 -07:00
OxygenCobalt
1e39ceb9fc
music: add more failsafes to loading process
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.
2022-03-01 19:52:28 -07:00
OxygenCobalt
dbe0bd1bb3
ui: revert list item changes
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.
2022-02-28 19:27:57 -07:00
OxygenCobalt
d7babcba71
ui: remove album name from song items
Remove the album name from the main song item in favor of a duration
value.

Auxio has traditionally used "Artist . Album" for song items. However,
this had some shortcomings:
1. The way the artist and album names are packed probably results in
truncation on small screens, which I doubt is very helpful.
2. All other items in Auxio have only one specific "subject" per line,
which makes the song items a bit of an outlier since it has two (the
artist and the album)
3. The empty space available could be used for another UI element,
such as a duration or maybe a menu button in the future.

For consistency, this also removes the song count from all album items
as well.
2022-02-25 08:12:26 -07:00
OxygenCobalt
c5be39774a
ui: remove memberBinding [#80]
Remove all usages of memberBinding from the app.

For some reason, certain devices running Android 10 and lower will
have a lifecycle race condition whenever the theme is mis-matched.
This ends up resulting in an invalid state whenever memberBinder was
used. Since we can't replace memberBinder with a better solution,
just dumpster the whole thing. This platform is so god damn broken,
jesus christ.

Resolves #80.
2022-02-24 19:31:48 -07:00
OxygenCobalt
61dbfe3185
coil: make rounded images more nuanced
Create a custom view for rounded images, making them more nuanced in
the process.

The previous method for applying rounded images in-app was generally
clunky and fragile. Introduce a new custom view that actually takes a
cornerRadius attribute from the ImageView itself that then applies it
whenever the user enables the setting. This also allows rounded images
to be more nuanced, as typical 8dp elevation can be used for small
views and a more fitting 16dp radius can be used for large views.
2022-02-23 17:42:34 -07:00
OxygenCobalt
87035805d2
ui: general cleanup
Clean up a bunch of UI issues that have accumulated.
2022-02-23 15:26:40 -07:00
OxygenCobalt
22258a3e6b
style: add disabled state to switches
Add a disabled state to the M3 switches.
2022-02-22 17:44:56 -07:00
OxygenCobalt
35b75b5f81
music: rename BaseModel to Item
Rename BaseModel to Item to make the meaning of it clearer.
2022-02-22 17:44:36 -07:00
OxygenCobalt
e1dbe6c40c
coil: force all images to a 1:1 aspect ratio
Crop all images to a 1:1 aspect ratio.

Sometimes cover art will not be a square. I never realized this because
all covers in my music library are square. This led to many strange bugs
that I would rather avoid, so create a new transformation that crops the
image to a 1:1 aspect ratio.

The reason why we use a transformation is that it won't be dependent on
the actual state of the ImageView, which is what would happen if we
used ScaleType.CENTER_CROP. In the case that we use a very weird hacky
ImageView like in the widgets, doing such would result in any cropping
not actually working correctly. It's better to do it in the
Transformation stage simply to ensure consistency.
2022-02-21 20:00:30 -07:00
OxygenCobalt
6fc3c9374c
style: rework dynamic colors
Allow the material library to handle dynamic colors.

Turns out I was mis-understanding how DynamicColor themes were meant to
be used by the material library. Turns out you can just inherit from it
and it will work perfectly fine. Refactor the V31 styles to remove our
insane shims and finally fix the slapdash dynamic color usage across
the main theme and widgets.
2022-02-21 17:07:06 -07:00
OxygenCobalt
2a74ff906c
style: enable drop shadows before api 28
Re-enable drop shadows on the playback bar and queue items on API 27
and lower. This is mostly to make Auxio line up with the M3 styles as
a whole.
2022-02-19 11:06:10 -07:00
OxygenCobalt
ddc6428455
Version 2.2.1
Ready for version 2.2.1 of Auxio.
2022-02-18 19:06:00 -07:00
OxygenCobalt
83dc6cd4c9
app: expose file opening intents better [#78]
Copy-paste some extra fields onto the file opening intent filter as to
[hopefully] get Auxio to be recognized by OEM skins better.

Some OEM skins don't seem to do a basic query for an app that matches
the APP_MUSIC category. Instead, they do some insane query for apps
that match this specific file intent structure that Auxio does not fit
for whatever reason. Try to graft some manifest features from the MPV
android app to make Auxio correctly expose this. I have no idea if this
will actually do anything.
2022-02-15 19:27:44 -07:00
OxygenCobalt
5b57d77d02
playback: disable audio focus setting on api 31
Disable the ability to customize audio focus on Android 12 and up.

Android 12 automatically regulates audio streams even further than it
did in previous versions, to the point where the audio focus setting
no longer makes sense on that version. I may extend the removal to all
versions in the future.
2022-02-15 06:33:21 -07:00
OxygenCobalt
30ad7f99db
playback: fix headset focus bug
Fix an issue where headset focus would restart playback unexpectedly.

At some point during the broadcast refactor, I accidentally switched
the values of CONNECTED and DISCONNECTED when handling
AudioManager.ACTION_HEADSET_PLUG. This resulted in playback starting
for no reason in some situations.
2022-02-14 19:46:04 -07:00
OxygenCobalt
ec358a13e3
style: apply body typography
Use body typography in more places, reworking the letter spacing as to
make it more pleasent to use with the inter typeface.

This should hopefully be the last time I fret over typography.
Everything should line up in the way desired by M3.
2022-02-13 15:39:34 -07:00
OxygenCobalt
4a326cc4ff
all: fix sloppy code
Fix some dumb and sloppy code that I made in the rush to complete
2.2.0.
2022-02-07 20:08:18 -07:00
OxygenCobalt
4d384f4cbd
Version 2.2.0
Ready for version 2.2.0 of Auxio.
2022-02-06 19:23:54 -07:00
OxygenCobalt
d9e2d7f07a
docs: rework contribution info
Update the contribution information and templates.

The contribution information and templates were growing a bit stale,
given that they haven't gotten a refresh since ~1.3.0. This commit
reworks them to be more thorough and straightfoward.
2022-02-06 14:33:36 -07:00
OxygenCobalt
470187422a
docs: add changelog
Add a CHANGELOG document that keeps track of the past and current
release notes.

Making all of our releases rely on GitHub to keep track of them is not
really a good idea, so this document serves as a record of past release
changelogs just as a pre-caution. It also allows a live preview of the
next version whenever something is changed.
2022-02-06 14:01:03 -07:00