Commit graph

1416 commits

Author SHA1 Message Date
OxygenCobalt
ae00a308fe
all: fix version-specific issues
Fix a few version-specific issues so that I don't make a critical
blunder like I did in 2.4.0.
2022-07-12 12:13:49 -06:00
OxygenCobalt
f3aca45690
settings: remove excluded dir migration code
Remove the excluded directory migration code, as it causes far more
issues than it fixes.

Due to an unfixable logic bug that occurs when trying to read the
setting, Auxio will always try to migrate the database when there is
no music folders, causing a hang in some situations. Fix it by just
removing the migration.
2022-07-12 09:59:08 -06:00
OxygenCobalt
60b637e1ce
all: cleanup
Semi-major code cleanup.
2022-07-11 11:29:34 -06:00
OxygenCobalt
caa755c12f
ui: add service/notification abstractions
Add additional abstractions for service foreground states and their
notifications.
2022-07-09 13:16:41 -06:00
OxygenCobalt
a63b3791d2
util: add guard abstraction
Add an abstraction over the generation system called GenerationGuard.

This allows cheap cooperative threading to be implemented consistently
in many places.
2022-07-09 11:17:15 -06:00
OxygenCobalt
f9a61c8ef7
music: remove dead code
Remove dead code from a vain attempt to leverage DATE_TAKEN.
2022-07-09 10:19:55 -06:00
OxygenCobalt
201f132686
detail: fix song deletion issue
Fix an issue where the song dialog would not properly close when the
song it corresponded to was deleted.
2022-07-09 10:18:45 -06:00
OxygenCobalt
35f05ed902
ui: fix insane background issue
Fix an issue where the background will remain the system default theme
because...reasons.

I don't even know what I did wrong.
2022-07-09 09:00:36 -06:00
OxygenCobalt
6f8dc3c311
music: hide quality tags for now
Hide the new quality tags option for now.

This is not because I wanted to, but rather because of me wanting to
reduce the amount of bugs I will likely be thrown due to the release
of automatic rescanning.
2022-07-08 16:48:28 -06:00
OxygenCobalt
3a7768ad22
music: add automatic rescanning
Add automatic rescanning, for real.

This is the culmination of 6 months of work to make Auxio respond to
music updates and to research the most versatile implementation of
such. Is it the best system? No. It's actually a bit messy by necessity
in order to prevent bugs. Does it work well? Yes.

This will not be enabled by default, as it does require a battery
draining foreground service and is generally not useful for most
circumstances.

So glad to be done with this.

Resolves #72.
2022-07-08 16:42:23 -06:00
OxygenCobalt
94f2d28936
music: rework indexer thread safety
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.
2022-07-07 16:47:21 -06:00
OxygenCobalt
29cc680c34
revert playback: save state when sanitizing
Edge case I thought existed did not. PlaybackService must have saved
before dying, and thus if it did not foreground after a sanitization,
the saved state would still sanitize in a similar manner.
2022-07-07 16:14:47 -06:00
OxygenCobalt
a217bde713
playback: save state during sanitize
Save, but do not read the playback state when sanitizing.

Turns out there is an edge-case where we want to save the state. Still
keep the runtime sanitization, as that greatly reduces the time it
takes to rescan the library.
2022-07-07 15:07:23 -06:00
OxygenCobalt
41ff92a587
deps: upgrade
Update deps:
Kotlin -> 1.7.10
Navigation -> 2.5.0
Lifecycle -> 2.5.0
Activity -> 1.5.0
Fragment -> 1.5.0
2022-07-07 12:08:17 -06:00
OxygenCobalt
e0a05ef486
playback: make sanitization runtime
Do not save the playback state when sanitizing.

After some thought, there is no situation where re-saving the playback
state is desirable. A previously saved state will be consistent with
a sanitized state, and there is no need to save when the service is
active. Thus, save on speed and reduce insane race conditions by just
sanitizing the current runtime state and not saving at all.
2022-07-07 11:58:25 -06:00
OxygenCobalt
83d6c529e2
all: misc ui reworks
Miscellanious UI reworks that accumulated over the past few days.
2022-07-07 10:40:18 -06:00
OxygenCobalt
1730a73eac
settings: add option to force-restore state
Add an option to restore the previous playback state.

This allows me to avoid having to use force stop to restore a previous
state.
2022-07-04 14:22:49 -06:00
OxygenCobalt
a15bc79cc9
music: more hypothetical fixes
Fix a bunch of more hypothetical issues that could occur with runtime
rescanning. It's still global mutable concurrent state though. Sigh.
2022-07-04 11:20:02 -06:00
OxygenCobalt
b1a8544b73
ui: make toolbar fix dedicated class
Make the toolbar spacing fixes a dedicated class.

This resolves an issue on lollipop devices where the ripple would be
clipped.
2022-07-03 16:23:53 -06:00
OxygenCobalt
9647b53f78
ui: remove ripple resources
Remove the ripple resources and replace them with their system
counterparts.

This is to remove redundancy in-app and make the widget more consistent
with other android widgets.
2022-07-03 15:44:56 -06:00
OxygenCobalt
b3cac19ee4
ui: use grade instead of indicator
Finally unify all icon activation states under the new grade modifier
in Material Symbols.

This provides similar clarify to the dot/greyed state, but without
inconsistent meanings. The shuffle icon did have to be bolded a little
more though, as the grade did not seem to do much.
2022-07-03 15:29:42 -06:00
OxygenCobalt
4f8fc8008c
music: rework loading ui flow
Rework the UI flow for music loading to be more coherent with runtime
rescanning.

The loading progress is now shown as a card on the bottom of the
screen. This way, app use is not completely crippled when the app has
to rescan the music library, albeit the shuffle button still has to
be disabled during this period.
2022-07-03 14:53:21 -06:00
OxygenCobalt
e1c55d5ddc
ui: revert rounded bottom sheet
Revert the optional rounded corners on the bottom sheet.

It was causing too many bugs to be a sensible addition. I will only add
it if Google moves WindowInset application to layout time AND only on
devices with the stretch overscroll implemented.
2022-07-03 11:29:01 -06:00
Weblate (bot)
81c616a2aa
Translations update from Hosted Weblate (#169)
* Translated using Weblate (German)

Currently translated at 100.0% (187 of 187 strings)

Translation: Auxio/Strings
Translate-URL: https://hosted.weblate.org/projects/auxio/strings/de/

* Translated using Weblate (Italian)

Currently translated at 100.0% (187 of 187 strings)

Translation: Auxio/Strings
Translate-URL: https://hosted.weblate.org/projects/auxio/strings/it/

* Translated using Weblate (German)

Currently translated at 100.0% (187 of 187 strings)

Translation: Auxio/Strings
Translate-URL: https://hosted.weblate.org/projects/auxio/strings/de/

* Translated using Weblate (French)

Currently translated at 53.4% (100 of 187 strings)

Translation: Auxio/Strings
Translate-URL: https://hosted.weblate.org/projects/auxio/strings/fr/

* Translated using Weblate (German)

Currently translated at 94.7% (18 of 19 strings)

Translation: Auxio/Metadata
Translate-URL: https://hosted.weblate.org/projects/auxio/metadata/de/

* Translated using Weblate (Czech)

Currently translated at 100.0% (187 of 187 strings)

Translation: Auxio/Strings
Translate-URL: https://hosted.weblate.org/projects/auxio/strings/cs/

* Translated using Weblate (Turkish)

Currently translated at 37.4% (70 of 187 strings)

Translation: Auxio/Strings
Translate-URL: https://hosted.weblate.org/projects/auxio/strings/tr/

* Translated using Weblate (Turkish)

Currently translated at 37.4% (70 of 187 strings)

Translation: Auxio/Strings
Translate-URL: https://hosted.weblate.org/projects/auxio/strings/tr/

* Translated using Weblate (German)

Currently translated at 100.0% (19 of 19 strings)

Translation: Auxio/Metadata
Translate-URL: https://hosted.weblate.org/projects/auxio/metadata/de/

* Translated using Weblate (German)

Currently translated at 100.0% (187 of 187 strings)

Translation: Auxio/Strings
Translate-URL: https://hosted.weblate.org/projects/auxio/strings/de/

* Translated using Weblate (Turkish)

Currently translated at 97.3% (182 of 187 strings)

Translation: Auxio/Strings
Translate-URL: https://hosted.weblate.org/projects/auxio/strings/tr/

* Translated using Weblate (Turkish)

Currently translated at 97.3% (182 of 187 strings)

Translation: Auxio/Strings
Translate-URL: https://hosted.weblate.org/projects/auxio/strings/tr/

* Translated using Weblate (Czech)

Currently translated at 100.0% (19 of 19 strings)

Translation: Auxio/Metadata
Translate-URL: https://hosted.weblate.org/projects/auxio/metadata/cs/

* Translated using Weblate (Turkish)

Currently translated at 100.0% (19 of 19 strings)

Translation: Auxio/Metadata
Translate-URL: https://hosted.weblate.org/projects/auxio/metadata/tr/

* Translated using Weblate (Spanish)

Currently translated at 72.7% (136 of 187 strings)

Translation: Auxio/Strings
Translate-URL: https://hosted.weblate.org/projects/auxio/strings/es/

* Translated using Weblate (Chinese (Simplified))

Currently translated at 100.0% (187 of 187 strings)

Translation: Auxio/Strings
Translate-URL: https://hosted.weblate.org/projects/auxio/strings/zh_Hans/

* Translated using Weblate (Portuguese (Brazil))

Currently translated at 60.9% (114 of 187 strings)

Translation: Auxio/Strings
Translate-URL: https://hosted.weblate.org/projects/auxio/strings/pt_BR/

* Translated using Weblate (Portuguese (Brazil))

Currently translated at 94.7% (18 of 19 strings)

Translation: Auxio/Metadata
Translate-URL: https://hosted.weblate.org/projects/auxio/metadata/pt_BR/

* Translated using Weblate (Indonesian)

Currently translated at 45.9% (86 of 187 strings)

Translation: Auxio/Strings
Translate-URL: https://hosted.weblate.org/projects/auxio/strings/id/

* Translated using Weblate (Portuguese (Brazil))

Currently translated at 78.0% (146 of 187 strings)

Translation: Auxio/Strings
Translate-URL: https://hosted.weblate.org/projects/auxio/strings/pt_BR/

* Translated using Weblate (Portuguese (Brazil))

Currently translated at 100.0% (19 of 19 strings)

Translation: Auxio/Metadata
Translate-URL: https://hosted.weblate.org/projects/auxio/metadata/pt_BR/

* Translated using Weblate (Indonesian)

Currently translated at 100.0% (187 of 187 strings)

Translation: Auxio/Strings
Translate-URL: https://hosted.weblate.org/projects/auxio/strings/id/

* Translated using Weblate (Indonesian)

Currently translated at 94.7% (18 of 19 strings)

Translation: Auxio/Metadata
Translate-URL: https://hosted.weblate.org/projects/auxio/metadata/id/

* Update translation files

Updated by "Cleanup translation files" hook in Weblate.

Translation: Auxio/Strings
Translate-URL: https://hosted.weblate.org/projects/auxio/strings/

* Update translation files

Updated by "Cleanup translation files" hook in Weblate.

Translation: Auxio/Strings
Translate-URL: https://hosted.weblate.org/projects/auxio/strings/

* Translated using Weblate (Portuguese (Brazil))

Currently translated at 80.4% (152 of 189 strings)

Translation: Auxio/Strings
Translate-URL: https://hosted.weblate.org/projects/auxio/strings/pt_BR/

Co-authored-by: Konstantin Tutsch <konstantin.tutsch@disroot.org>
Co-authored-by: Enrico D'Ortenzio <enrico2588@gmail.com>
Co-authored-by: J. Lavoie <j.lavoie@net-c.ca>
Co-authored-by: Fjuro <fjuro@seznam.cz>
Co-authored-by: metezd <itoldyouthat@protonmail.com>
Co-authored-by: arif <others.superset@simplelogin.co>
Co-authored-by: qwerty287 <ndev@web.de>
Co-authored-by: Rodrigo Hernández <alex_werehog@hotmail.com>
Co-authored-by: Clyde Johanson <johnson.hu95@gmail.com>
Co-authored-by: Luiz-bro <luiznneto1@gmail.com>
Co-authored-by: Adam Adrian <4.adam.adrian@gmail.com>
2022-07-03 16:16:51 +00:00
OxygenCobalt
cd00950a5c
all: audit synchronized usages
Audit usages of Synchronized throughout the app to prevent deadlocks.

This is primarily composed of not making long-running work
synchronized, instead only making mutations and reads synchronized.
This does cause minor issues, such as during a sanitization event
the playback state could be feasibly saved, changed, and then restored
back to the previous state unintentionally. However, preventing
deadlocks is generally better than trying to fix those.
2022-07-03 09:12:19 -06:00
OxygenCobalt
3bdf7b136e
music: enable quality tags [#128]
Enable the ExoPlayer parser in the UI.

Now that runtime rescanning is implemented, this feature can also be
finally enabled.

Resolves #128.
2022-07-02 20:37:55 -06:00
OxygenCobalt
d6f166a3ee
all: use synchronized annotation
Use the @Synchronized annotation instead of synchronized.

Makes my ability to manage thread-safety on the shared objects much
easier. Because I don't have to think about what I should guard
and what I shouldn't.
2022-07-02 17:28:51 -06:00
OxygenCobalt
73e10c9519
music: enable runtime rescanning [#72]
Finally enable runtime rescanning, opening the door for a ton of new
features and automatic rescanning later on.

More work needs to be done on making the shared mutable state in-app
safer to use.
2022-07-02 17:15:21 -06:00
OxygenCobalt
bbf3b1778b
music: improve indexer callback impl
Improve the indexer callback system to be more coherent and efficient.

This delegates the old Callback role to a new singular Callback and
Controller roles. IndexerService also handles the loading process
more gracefully, reducing the amount of time music loads take.
2022-07-02 15:31:01 -06:00
OxygenCobalt
49a964705b
playback: sync mediasession and notif
Make notification updates entirely reliant on the MediaSession.

Android 11 and onwards automatically populate the notification with the
MediaSession state. This apparently conflicts with updating the
notification in some cases, resulting in the incorrect song being
shown. Fix this by not populating the notification from Android 11
onward and only posting it when the MediaSession state was set.

Resolves #179.
2022-07-02 14:04:21 -06:00
OxygenCobalt
3663396b97
ui: remove windowinsetscompat
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.
2022-07-02 10:19:46 -06:00
OxygenCobalt
631120dafc
search: actually commit filter mode to settings
Turns out the filter mode was also not being committed to settings.

I have no idea how this slipped into production.
2022-07-01 20:39:23 -06:00
OxygenCobalt
8b8eebdd95
search: fix mismatched filter ids
Fix an issue were (at some point) the filter ID for display modes was
swapped out for drawable IDs.
2022-07-01 20:26:20 -06:00
OxygenCobalt
217ced8ade
ui: rework rounded covers into round mode
Rework the rounded covers option into a new "Round Mode" option.

This commit extends the rounded corners configuration to now the
widget, thus making the setting apply now to covers, the bar, and
the widget configuration. This makes a naming change useful.
2022-07-01 20:06:54 -06:00
OxygenCobalt
e41645ee28
widgets: rework button appearance
Further rework the button layout to be alike to other modern widgets.

This changeset transforms the play button into a FAB-ish thing,
makes spacing coherent between the uses of each layout, and adds
spacers to make the buttons layout in a more appealing way.
2022-07-01 12:25:59 -06:00
OxygenCobalt
e883336b04
music: rework library update process [#176]
Update the library update process to be on a co-routine, updating
callbacks on the main thread.

For some insane reason, the Main dispatcher used normally when
loading music just disappears sometimes. This leads to unpleasent
crashes as callbacks expect to be called on the app thread, not
any background threads.

Fix this by forcing the Main dispatcher during the update process.
This requires the music update process to also run on a background
thread, albeit that will be useful for automatic rescanning late ron.
2022-07-01 08:54:42 -06:00
OxygenCobalt
090a1713dd
ui: rework iconography
Completely rework Auxio's iconography based on the new material symbols
icon set.

This does the following:
1. Switches the sharp + filled icon style to an outlined + round icon
style.
2. Removes 32dp icons from everywhere except the playback panel.

This does not:
1. Actually handle optical sizes right. This is going to take some more
work to make it harmonious with the current UI.
2. Update margins in some places to be harmonious with the new icons.
This is also going to take some more work to do properly.
2022-06-30 21:09:21 -06:00
OxygenCobalt
9a17806da1
ui: rework module structure
Rework the ui module structure to subdivide related groups of elements.
2022-06-29 11:41:49 -06:00
OxygenCobalt
a81b90a81f
widgets: update control layout
Rework the widget control layouts to add additional controls and to
have more consistent padding.
2022-06-29 11:35:49 -06:00
OxygenCobalt
249ddae269
ui: rework bottom sheet layout method
Rework the bottom sheet layout process to accomodate the new rounded
corners and be far more efficient.

This removes the weird content layout code and moves it into the inset
code, which not only allows content to show in the corners, but also
allows us to minimize the amount of layouts that we normally perform.
2022-06-29 11:17:50 -06:00
OxygenCobalt
c7c4473247
ui: make bottom sheet follow rounded corners
Make BottomSheetLayout apply rounded corners when rounded covers is
enabled.

Draggable elements should be rounded, not straight, so this simply
makes this consistent. It does have one visual error as it stands,
stemming from the layout code allocating space for the bar and thus
clipping certain content. I hope to fix this soon.
2022-06-29 09:10:50 -06:00
OxygenCobalt
67ef667080
home: do not collect immediately on recreate
Do not use collectImmediately when recreating tabs in the home menu.

This resulted in an issue where the ViewPager would not update to
reflect the new tab layout.
2022-06-27 14:50:33 -06:00
OxygenCobalt
5b70295330
ui: fix bottom sheet issues
Fix several issues with the bottom sheet implementation, mostly
relating to what occurs when the bar is hidden.

Previously, if the bar was hidden and then re-shown, it would not be
visible, and you could override a hidden event with another tap. These
are now both resolved by removing a stray visibility assignment and
replacing the old drag checks with a new isDraggable attribute.

In the future, I hope to abuse BottomSheetBehavior into not being a
pile of garbage and replace this system once and for all.
2022-06-27 10:28:17 -06:00
OxygenCobalt
c3721266b5
playback: use isactive in replaygain [#174]
Override isActive to control when the ReplayGain engine should
manipulate audio.

This makes the system much more efficient, as we can side-step a
useless copy when ReplayGain shouldn't be applied.
2022-06-26 19:19:28 -06:00
OxygenCobalt
efd24a4fee
detail: fix broken album menu
Fix broken menu items in the album detail view.

No idea why this happened. Probably a mistake while I was redoing the
menus previously.
2022-06-24 09:07:18 -06:00
OxygenCobalt
149da883fe
playback: make state db sync
Add synchronized calls to PlaybackStateDatabase to resolve future race
conditions.
2022-06-23 15:27:41 -06:00
OxygenCobalt
d5c0ccfce0
ui: remove titlemidlarge style
Remove the TitleMidLarge style, replacing it with more Material3
attributes.

This finally removes all of the non-standard text styles. There is
still the two TitleMedium styles, but this is considered okay.

In the playback view, TitleMidLarge has become TitleLarge, which
honestly works quite well, as the same text styles are used in the
detail views.
2022-06-23 11:22:29 -06:00
OxygenCobalt
50ba3358e1
info: expose weblate
Fully expose Auxio's Weblate project to the public.
2022-06-23 07:47:38 -06:00
OxygenCobalt
3fcd7e1a63
all: general cleanup
A bunch of changes that accumulated that I'm too lazy to split into
good commits.
2022-06-22 18:38:57 -06:00
OxygenCobalt
630950ea5d
playback: force LTR on timeline controls
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.
2022-06-22 12:38:00 -06:00