Commit graph

1416 commits

Author SHA1 Message Date
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
a408cc629d
strings: remove redundant spanish translation
Remove the strings.xml.old file in the spanish translations.

This was generated from vim when #87 was created. It's redundant, so
remove it.
2022-02-28 19:01:12 -07:00
OxygenCobalt
4588a3cd3c
Merge branch 'n-berenice-dev' into dev
Fixed spanish translation and added spanish fastlane metadata.
2022-02-28 18:59:51 -07:00
n-berenice
33b7732169 Added F-Droid desc, changelog folder
Speaks for itself.
2022-02-28 22:26:47 -03:00
n-berenice
88f815ed9f Redone from scratch
Previous file was too incomplete and had too many mistakes in order to be fixed, fully redone.
2022-02-28 22:12:56 -03: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
fc4c7714a2
deps: upgrade
Wheeeeeee
ExoPlayer -> 2.17.0
Coil -> 2.0.0-alpha09
Ktlint -> 0.44.0
2022-02-24 15:17:31 -07:00
OxygenCobalt
9171f9a3b4
coil: make mosaics use squareframetransform
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.
2022-02-24 14:58:59 -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
280b582efa
home: rework fab adaptiveness
Rework how the fab's adaptive functionality works.

Handle fab adaptiveness by using a style instead of a fully custom
view. This helps eliminate a usage of private resources.
2022-02-23 16:13:59 -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
3aaa2ab0e0
all: rework logging
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.
2022-02-22 17:24:51 -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
9304e58190
playback: rework playback icon visibility
Add a circular indicator to playback icons.

Sometimes it can be too difficult to tell apart the active and inactive
states of the shuffle/loop icons. However, there is really no good way
to improve the contrast on these icons without some kind of muddled UX
fragmentation, or god-awful design. Try to settle on the okay-est
version, which is to use colorPrimary with a dot indicator on views we
control, and use a more muddled semi-transparent icon on views we don't
control, like notifications and widgets.
2022-02-21 16:36:08 -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
f5478018c5
deps: upgrade deps
Round and round
Lifecycle -> 2.4.1
Media -> 1.5.0
Navigation -> 2.4.1// TODO: Downgrade back to 2.4.1 when it is out
2022-02-19 10:13:26 -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
d4513293a7
all: cleanup
General app cleanup.
2022-02-18 19:03:25 -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
f377e144dd
style: remove elevation from toolbars
Remove the elevation component from all toolbars and the bottom bar.

Material3 states that top and bottom app bars should not cast a drop
shadow. Auxio ignored this and used one anyway. This largely stemmed
from incorrect use of the AppBarLayout styles, which were mostly just
incorrect M2 styles with a new background plastered over. Fix this
by creating a new style that inherits the proper M3 styles and then
using that on all AppBarLayout instances in the app.
2022-02-10 17:34:03 -07:00
OxygenCobalt
04bec3161f
music: modify model configuration
Do a couple things to the music models:
1. Make the genre field non-nullable. This is because I beleive I've
largely eliminated the genre bugs in previous versions and future ones
can be caught with a crash screen I plan to add.
2. Make the initial album grouping process use hashCode instead of a
pair of names. This just helps with loading speed in general, albeit I
am slightly worried that it may result in improper grouping if some
edge case appears.
2022-02-08 06:56:49 -07:00
OxygenCobalt
f4217a337a
style: tweak body typography
Apply body typography in new places in the app.

For awhile, Body and Title typography were used interchangeably, as
they occupy the same text size range. This commit defines the Body
text as to be used for one-line widgets or tertiary widgets, while
the Title text is defined to be used for multi-line or heading widgets.
2022-02-08 06:23:43 -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
Clyde
245e0f5dc1
Update strings.xml
Update zh-rCN translations accordingly with the latest `strings.xml`.
2022-02-07 06:22:29 -07:00
Clyde
0a9c7124db
Update strings.xml
Update zh-rCN translations accordingly with the latest `strings.xml`.
2022-02-07 12:26:22 +08:00
OxygenCobalt
4d384f4cbd
Version 2.2.0
Ready for version 2.2.0 of Auxio.
2022-02-06 19:23:54 -07:00
OxygenCobalt
a51f1aa5b9
pref: fix application of m3 switches
Fix an issue with M3SwitchPreference where the switch would not update
properly.

When reacing M3SwitchPreference, I wanted to make an optimization
regarding updating the switch to M3, so I decided to make the
preference check if they have already applied the switch, and then
ignore it if that's the case. However, I ended up forgetting that
ViewHolders tend to need to be re-bound, which resulted in this
optimization leading to inconsistent application of the M3 switches.
Fix this by removing that optimization.
2022-02-06 19:20:29 -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
OxygenCobalt
8e0d27696d
detail: improve track number handling
Improve the way track numbers are handled in the album detail view.

Previously, Auxio would show track numbers by simplying stringifying
the integer and then showing it in a TextView. This was problematic for
two reasons:
- Numerics from other languages like Arabic would not be respected
- Invalid track numbers [e.g 0] would be shown regardless of the
situation.

This commit fixes that by placing all track numbers through a format
string first, and showing a generic song icon instead of a number
whenever the track number is 0.
2022-02-06 11:19:50 -07:00
OxygenCobalt
4b919b121a
util: rework context utilities
Completely rework the Context extensions for resources.

Previously, Auxio has used a strange hodge-podge of context extensions
and verbose code to get resources. Fix this by unifying most of the
resource accesses under a single, unified set of extensions. The only
ones excluded for now is the getString call, as that is used in far too
many places to effectively replace.
2022-02-06 10:45:40 -07:00
OxygenCobalt
bd099aee7b
deps: upgrade
Like a while loop with no escape
Navigation -> 2.5.0-alpha01 [workaround for AGP 7.1]
Preference -> 1.2.0
Fragment -> 1.4.1
2022-02-06 09:08:10 -07:00
OxygenCobalt
0209e526e1
all: general cleanup
Do some general code cleanup.
2022-02-06 09:01:51 -07:00
OxygenCobalt
4d22b99577
playback: re-add index correction
Re-add index correction, albeit with a new system that accomodates the
single queue mechanism.

The issue with using the previous queue mechanism for the single queue
was that it risked using the index of an incorrect duplicate song, as
the search would always start at index 0. Fix this by implementing a
sort of "wobbly" search that starts at the current index and moves back
and forth, checking the closest items first and the furthest items
last.
2022-02-05 11:40:45 -07:00
OxygenCobalt
685d3af12f
settings: remove 1.4.0 compatibility
Remove 1.4.0 setting migrations.

It's been nearly a year. Everyone should have migrated by now.
2022-02-05 11:01:03 -07:00
OxygenCobalt
b047b50411
settings: add option to force-reload the app
Add an option to force-reload the app.

Currently, Auxio will load music once and then never re-load it. This
is a really decision I made early on and now regret completely. The
only way to remedy this properly is to create an automatic rescanning
system, but that is a major technical undertaking that I want to save
for later.

Resolves #71.
2022-02-05 10:30:03 -07:00
OxygenCobalt
0a216def1b
strings: tweak arabic translations
Fix the plurals and audit RTL usages in the arabic translations.
2022-02-05 10:06:13 -07:00
OxygenCobalt
a7c6d3c97f
Merge branch 'arabic-dev' into dev
Add arabic translations
2022-02-05 09:50:42 -07:00
OxygenCobalt
4774fbaa4e
Merge branch 'dev' of https://github.com/hasanpasha/Auxio into arabic-dev 2022-02-05 09:49:52 -07:00
OxygenCobalt
92ac7d9a9d
strings: rework russian translations
Improve the russian translations for this app.

These translations were proposed by lisiczka43 with the following
rationale:

"[use] less literal translations, [use] shorter wording to fit into UI
elements,  [correct] mistranslations, [improve] consistency of
terminolgy, [enforce] strict ё, [add] missing new strings"

Apparently the previous russian translations were quite Amateurish.
This should make them better.
2022-02-05 09:45:18 -07:00