Commit graph

789 commits

Author SHA1 Message Date
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
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
OxygenCobalt
20245db261
style: update inter
Update the inter font to v3.19.
2022-02-05 09:23:37 -07:00
OxygenCobalt
b121b6428d
music: refactor music grouping
Completely refactor the way music is grouped up into artists and
albums.

The issue with previous attempts at implementing better artist
management was the reliance on MediaStore IDs in many parts of the
program. Dumpster this by merging the hash and ID values into a
single field that is garunteed to be unique enough. This allows songs
to be adequately grouped into case-insensitive artists while also
deduplicating albums that may have been split my MediaStore due to
heterogeneous formats.

Resolves #66.
2022-02-04 20:55:48 -07:00
hasanpasha
bdaa0519d8 add arabic tranlation 2022-02-04 14:49:54 +03:00
OxygenCobalt
6e00fd1129
music: merge duplicate albums [#66]
Move all duplicate checking to the album creation stage, adding a new
check for duplicate albums.

Album names can be similarly duplicated as artist names, most often
when one has an album consisting of multiple differing file formats.
This commit fixes that by grouping albums up by their ID as usual,
but then merging together albums that have the same (lowercase) album
name and (lowercase) artist name.
2022-02-03 20:05:20 -07:00
OxygenCobalt
433d623f14
strings: fix improper usage of plurals
Use a proper composition of the "many" and "other" fields in the plural
fields of specific languages.

In the french/czech plural configuration, both "many" and "other" are
used for string fields. The lint does not make this obvious, so in
d7f34e6 I ended up switching the "other" field to "many". This resulted
in some devices on those languages crashing. To fix this, we define
the "many" and "other" fields with the same value to avoid a crash.

Resolves #69.
2022-02-02 07:17:28 -07:00
OxygenCobalt
3c9ffd5946
style: re-add inter
Re-add the inter typeface.

It's not good design to have two similar typefaces, so I may as well
revert back to Inter once and for all. It's too good of a typeface
compared to the mess of Roboto and other native fonts.
2022-01-30 20:31:40 -07:00
OxygenCobalt
9514f17bc7
music: group artists case-insensitively [#66]
Group up album artists case-insensitively.

Music files from the same artist may format the artist differently, such as being
in uppercase/lowercase forms. If we have already built an artist that has a
functionally identical name to another artist, then simply merge the artists
instead of keeping them separate.
2022-01-30 17:29:42 -07:00
OxygenCobalt
50a2305f63
music: respect individual artist names [#66]
Modify the music loader to use the normal artist name when using song
titles while still retaining album artist functionality.

Oftentimes music files will be tagged as to use the artist tag to
specify performers, collaborators, and others, and then use the album
artist tag to group them up into a single artist. Previously, Auxio
would only use the album artist tag, which flattened the collaborator
information out for consistency. Resolve this by implementing a sort
of "resolved artist name" for songs that is used in the UI and nowhere
else. This seems to work well, but at the same time further ruins the
API surface for handling music objects. An acceptable price to pay
for a better UX.
2022-01-30 16:46:11 -07:00
OxygenCobalt
50f6f8f348
style: migrate body type to roboto
Migrate to the native roboto typeface on body elements.

Migrating to the native typeface saves on APK size, contributes to a
more native look and feel, and create a more compact UI for smaller
devices. Inter Semibold remains as the "Flair" type that distinguishes
Auxio from other apps.
2022-01-29 10:25:35 -07:00
OxygenCobalt
44c53d96f3
Version 2.1.0
Ready for version 2.1.0 of Auxio.
2022-01-28 19:22:18 -07:00
OxygenCobalt
50b2cabf8b
meta: update descriptions
Update the README and fastlane metadata in preparation for 2.1.0.
2022-01-28 18:02:25 -07:00
OxygenCobalt
d540773664
deps: fix aar issues
Fix insane build issues with the new aar system through means that I
really don't understand.
2022-01-27 19:41:25 -07:00
OxygenCobalt
5b5aa24f5c
deps: use aar
Bundle our custom ExoPlayer components into aar instead of directly
depending on the project. This just makes things far better regarding
ease of use and reproducible builds.
2022-01-27 15:05:45 -07:00
OxygenCobalt
f2e4a3a369
deps: move exoplayer to app
Move ExoPlayer from a top-level directory to srclibs.
2022-01-26 19:56:38 -07:00
OxygenCobalt
d7f34e6b94
all: migrate to api 32
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.
2022-01-25 18:59:16 -07:00
OxygenCobalt
317b12579c
playback: expose media button receiver
Expose a custom MediaButtonReceiver that handles the media button
intent. This is not because I wanted to implement this. Some apps
like gadgetbridge just blindly query ACTION_MEDIA_BUTTON instead of
relying on the more modern MediaController API, which I expected
most apps would use instead.

Resolves #62.
2022-01-25 17:20:26 -07:00
OxygenCobalt
c9f789e388
revert "style: migrate to roboto"
I want to hold off with this migration actually. I feel like it's too
jarring of a change to be included as of right now.
This reverts commit 50170f202e.
2022-01-23 12:42:49 -07:00
OxygenCobalt
3de5fecf4a
coil: gracefully handle file handling failures
Wrap the basic fetchArt call in a try statement to prevent exceptions
from being unable to open a file from propagating outwards. This allows
us to safely degrade when creating mosaics.
2022-01-23 11:30:26 -07:00
OxygenCobalt
b04611c3be
playback: fix media intent detection [#62]
Some apps query for media apps by checking for apps that have a
BroadcastReciever that handles the ACTION_MEDIA_BUTTON intent. However,
Auxio does not have a custom media button reciever, instead relying on
the androidx media button reciever. This resulted in Auxio not showing
up in apps like GadgetBridge. Fix this by exposing the androidx media
button reciever in the manifest, which allows this app to be detected.
2022-01-23 11:04:27 -07:00
OxygenCobalt
c98d131316
style: implement m3 switches
Implement a facimile of the new Material 3/You switches in the settings
menu. There's no defined spec for this yet, so I just shamelessly ripped
the implementation from Doodle.
2022-01-23 10:56:34 -07:00
OxygenCobalt
50170f202e
style: migrate to roboto
Dumpster Inter in favor of Roboto. This is mostly for three reasons:
1. Reduces the insane typography setup that Auxio uses
2. Reduces total app size since .ttf files are pretty large and the
dynamic fonts feature was proprietary.
3. Creates a more cohesive look and feel given that nearly every
android app also uses Roboto.
2022-01-23 10:17:47 -07:00
OxygenCobalt
eadf4cc86d
detail: extend smart queue disabling to detail
Add the queue disabling functionality from 47fca78 to the album detail
fragment as well.
2022-01-21 19:59:00 -07:00
OxygenCobalt
6e6252b033
Merge branch 'cccClyde-cccClyde-patch-1' into dev
Implement improved Chinese translations [courtesy of cccClyde].
2022-01-21 19:02:14 -07:00
Clyde
c8f1fd1094
Update strings.xml
Complicated Simplified Chinese localization accroding to the latest strings from `/app/src/main/res/values/strings.xml`.
2022-01-21 15:00:22 +08:00
OxygenCobalt
47fca7819f
ui: disable queue adding if no playback
If theres no playback going on, disable the play next/add to queue
options, as they will have no effect. This mostly for QoL purposes.
2022-01-19 06:52:05 -07:00
OxygenCobalt
e5901fa9e2
playback: use gesture insets in playback layout
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.
2022-01-18 19:51:06 -07:00
OxygenCobalt
e4f2906767
deps: upgrade deps
Material -> 1.5.0 [Finally]
ConstraintLayout -> 2.1.3
2022-01-17 16:49:20 -07:00