all: fix misc issues

Fix miscellanious issues that I've encountered.
This commit is contained in:
Alexander Capehart 2022-09-26 12:06:51 -06:00
parent f3c14b81cb
commit 7a055680bd
No known key found for this signature in database
GPG key ID: 37DBE3621FE9AD47
20 changed files with 65 additions and 59 deletions

View file

@ -9,8 +9,8 @@
- Added support for multiple genres
- Artists and album artists are now both given UI entires
- Upgraded music ID management:
- Use MD5 for default UUIDS
- Added support for MusicBrainz IDs (MBIDs
- Added support for MusicBrainz IDs (MBIDs)
- Use the more unique MD5 hash of metadata when MBIDs can't be used
- Added toggle to load non-music (Such as podcasts)
- Music loader now caches parsed metadata for faster load times

View file

@ -18,7 +18,6 @@
package org.oxycblt.auxio
import android.content.Intent
import android.os.Build
import android.os.Bundle
import android.view.View
import androidx.appcompat.app.AppCompatActivity
@ -108,11 +107,7 @@ class MainActivity : AppCompatActivity() {
private fun setupTheme() {
val settings = Settings(this)
// Disable theme customization above Android 12, as it's far enough in as a version to
// the point where most phones should have an option for light/dark theming.
if (Build.VERSION.SDK_INT < Build.VERSION_CODES.S) {
AppCompatDelegate.setDefaultNightMode(settings.theme)
}
AppCompatDelegate.setDefaultNightMode(settings.theme)
// The black theme has a completely separate set of styles since style attributes cannot
// be modified at runtime.

View file

@ -34,9 +34,9 @@ import com.google.android.material.transition.MaterialFadeThrough
import org.oxycblt.auxio.databinding.FragmentMainBinding
import org.oxycblt.auxio.music.Music
import org.oxycblt.auxio.music.Song
import org.oxycblt.auxio.playback.PlaybackSheetBehavior
import org.oxycblt.auxio.playback.PlaybackViewModel
import org.oxycblt.auxio.playback.queue.QueueSheetBehavior
import org.oxycblt.auxio.playback.PlaybackSheetBehavior
import org.oxycblt.auxio.ui.MainNavigationAction
import org.oxycblt.auxio.ui.NavigationViewModel
import org.oxycblt.auxio.ui.fragment.ViewBindingFragment

View file

@ -121,15 +121,16 @@ private class ArtistDetailViewHolder private constructor(private val binding: It
binding.context.getPlural(R.plurals.fmt_song_count, item.songs.size)
)
binding.detailPlayButton.isEnabled = true
binding.detailShuffleButton.isEnabled = true
binding.detailPlayButton.isVisible = true
binding.detailShuffleButton.isVisible = true
} else {
// The artist is a
// The artist does not have any songs, so playback, genre info, and song counts
// make no sense.
binding.detailSubhead.isVisible = false
binding.detailInfo.text =
binding.context.getPlural(R.plurals.fmt_album_count, item.albums.size)
binding.detailPlayButton.isEnabled = false
binding.detailShuffleButton.isEnabled = false
binding.detailPlayButton.isVisible = false
binding.detailShuffleButton.isVisible = false
}
binding.detailPlayButton.setOnClickListener { listener.onPlayParent() }

View file

@ -41,9 +41,9 @@ import java.io.File
/*
* This file acts as the base for most the black magic required to get a remotely sensible music
* indexing system while still optimizing for time. I would recommend you leave this file now
* before you lose your sanity trying to understand the hoops I had to jump through for this system,
* but if you really want to stay, here's a debrief on why this code is so awful.
* indexing system from MediaStore while still optimizing for time. I would recommend you leave
* this file now before you lose your sanity trying to understand the hoops I had to jump through
* for this system, but if you really want to stay, here's a debrief on why this code is so awful.
*
* MediaStore is not a good API. It is not even a bad API. Calling it a bad API is an insult to
* other bad android APIs, like CoordinatorLayout or InputMethodManager. No. MediaStore is a crime
@ -51,7 +51,7 @@ import java.io.File
*
* You think that if you wanted to query a song's genre from a media database, you could just put
* "genre" in the query and it would return it, right? But not with MediaStore! No, that's too
* straightforward for this contract that was dropped on it's head as a baby. So instead, you have
* straightforward for this database that was dropped on it's head as a baby. So instead, you have
* to query for each genre, query all the songs in each genre, and then iterate through those songs
* to link every song with their genre. This is not documented anywhere, and the O(mom im scared)
* algorithm you have to run to get it working single-handedly DOUBLES Auxio's query times. At no
@ -281,13 +281,13 @@ abstract class MediaStoreExtractor(private val context: Context, private val cac
arrayOf(
// These columns are guaranteed to work on all versions of android
MediaStore.Audio.AudioColumns._ID,
MediaStore.Audio.AudioColumns.TITLE,
MediaStore.Audio.AudioColumns.DISPLAY_NAME,
MediaStore.Audio.AudioColumns.MIME_TYPE,
MediaStore.Audio.AudioColumns.SIZE,
MediaStore.Audio.AudioColumns.DATE_ADDED,
MediaStore.Audio.AudioColumns.DATE_MODIFIED,
MediaStore.Audio.AudioColumns.DISPLAY_NAME,
MediaStore.Audio.AudioColumns.SIZE,
MediaStore.Audio.AudioColumns.DURATION,
MediaStore.Audio.AudioColumns.MIME_TYPE,
MediaStore.Audio.AudioColumns.TITLE,
MediaStore.Audio.AudioColumns.YEAR,
MediaStore.Audio.AudioColumns.ALBUM,
MediaStore.Audio.AudioColumns.ALBUM_ID,

View file

@ -83,7 +83,7 @@ class Settings(private val context: Context, private val callback: Callback? = n
fun Int.migratePlaybackMode() =
when (this) {
// Genre playback mode was retried in 3.0.0
IntegerTable.PLAYBACK_MODE_ALL_SONGS, IntegerTable.PLAYBACK_MODE_IN_GENRE -> MusicMode.SONGS
IntegerTable.PLAYBACK_MODE_ALL_SONGS -> MusicMode.SONGS
IntegerTable.PLAYBACK_MODE_IN_ARTIST -> MusicMode.ARTISTS
IntegerTable.PLAYBACK_MODE_IN_ALBUM -> MusicMode.ALBUMS
else -> null
@ -147,7 +147,7 @@ class Settings(private val context: Context, private val callback: Callback? = n
/** The current accent. */
var accent: Accent
get() = Accent.from(inner.getInt(context.getString(R.string.set_accent), Accent.DEFAULT))
get() = Accent.from(inner.getInt(context.getString(R.string.set_key_accent), Accent.DEFAULT))
set(value) {
inner.edit {
putInt(context.getString(R.string.set_key_accent), value.index)

View file

@ -34,6 +34,7 @@ import org.oxycblt.auxio.R
import org.oxycblt.auxio.music.MusicViewModel
import org.oxycblt.auxio.playback.PlaybackViewModel
import org.oxycblt.auxio.settings.Settings
import org.oxycblt.auxio.settings.SettingsFragmentDirections
import org.oxycblt.auxio.ui.NavigationViewModel
import org.oxycblt.auxio.util.androidActivityViewModels
import org.oxycblt.auxio.util.isNight

View file

@ -5,6 +5,10 @@
android:viewportWidth="24"
android:viewportHeight="24">
<path
android:fillColor="@android:color/white"
android:pathData="m 13.000272,2.9999381 a 1.0000939,1.000025 0 0 0 -0.01964,0.00155 1.0000689,1 0 0 0 -0.136953,0.012402 1.0000939,1.000025 0 0 0 -0.04651,0.0093 1.0000689,1 0 0 0 -0.107494,0.028939 1.0000939,1.000025 0 0 0 -0.04858,0.016536 1.0000689,1 0 0 0 -0.141087,0.065629 1.0000689,1 0 0 0 -0.128683,0.089917 1.0000939,1.000025 0 0 0 -0.03308,0.028939 1.0000689,1 0 0 0 -0.04548,0.039791 1.0000689,1 0 0 0 -0.03979,0.045475 1.0000939,1.000025 0 0 0 -0.02894,0.033073 1.0000689,1 0 0 0 -0.08992,0.1286744 1.0000689,1 0 0 0 -0.06563,0.1410766 1.0000939,1.000025 0 0 0 -0.01705,0.049093 1.0000689,1 0 0 0 -0.02791,0.1049032 1.0000939,1.000025 0 0 0 -0.0098,0.049093 1.0000689,1 0 0 0 -0.0124,0.1353923 1.0000939,1.000025 0 0 0 -0.0016,0.020154 V 16.586189 l -2.0000145,1.999878 -1.586059,-1.58595 2.2930405,-2.292883 a 1.0000689,1 0 0 0 0,-1.414384 1.0000689,1 0 0 0 -0.7069815,-0.292489 1.0000689,1 0 0 0 -0.7069824,0.292489 l -3.0000235,3.000333 a 1.0001689,1.0001 0 0 0 0,1.413868 l 3.0000235,3.000333 a 1.0001689,1.0001 0 0 0 1.4139639,0 l 3.000541,-3.000333 a 1.0000689,1 0 0 0 0.05478,-0.05994 1.0000939,1.000025 0 0 0 0.0067,-0.0078 1.0000689,1 0 0 0 0.09664,-0.138492 1.0000689,1 0 0 0 10e-4,-0.0016 1.0000689,1 0 0 0 0.07028,-0.150378 1.0000939,1.000025 0 0 0 0.0047,-0.01344 1.0000689,1 0 0 0 0.04289,-0.159163 1.0000689,1 0 0 0 5.17e-4,-0.0041 1.0000689,1 0 0 0 0.01499,-0.166398 1.0000939,1.000025 0 0 0 5.17e-4,-0.0057 V 6.4147167 l 2.293041,2.2923666 a 1.0000689,1 0 0 0 1.413966,0 1.0000689,1 0 0 0 0,-1.4138672 L 13.707255,3.2929435 a 1.0000689,1 0 0 0 -0.04548,-0.039791 1.0000939,1.000025 0 0 0 -0.03308,-0.028939 1.0000689,1 0 0 0 -0.128683,-0.089917 1.0000689,1 0 0 0 -0.141086,-0.065629 1.0000939,1.000025 0 0 0 -0.0491,-0.017053 1.0000689,1 0 0 0 -0.104911,-0.027905 1.0000939,1.000025 0 0 0 -0.0491,-0.00982 1.0000689,1 0 0 0 -0.135401,-0.012402 1.0000939,1.000025 0 0 0 -0.02016,-0.00155 z" />
android:fillColor="@android:color/transparent"
android:pathData="M 13,4.0000207 17,8 M 12.999969,4.0004121 V 17.000315 m 0,-0.0002940 -3.0000004,3 -2.9999997,-3 2.9999997,-3 M 7.021336,16.939069"
android:strokeWidth="2"
android:strokeColor="@android:color/white"
android:strokeLineCap="round"
android:strokeLineJoin="round" />
</vector>

View file

@ -1,15 +1,20 @@
<vector xmlns:android="http://schemas.android.com/apk/res/android"
android:width="108dp"
android:height="108dp"
android:tint="@android:color/white"
android:viewportWidth="108"
android:viewportHeight="108"
android:tint="@android:color/white">
<group android:scaleX="2.835"
android:scaleY="2.835"
android:translateX="19.98"
android:translateY="19.98">
<path
android:fillColor="@android:color/white"
android:pathData="m 13.000272,2.9999381 a 1.0000939,1.000025 0 0 0 -0.01964,0.00155 1.0000689,1 0 0 0 -0.136953,0.012402 1.0000939,1.000025 0 0 0 -0.04651,0.0093 1.0000689,1 0 0 0 -0.107494,0.028939 1.0000939,1.000025 0 0 0 -0.04858,0.016536 1.0000689,1 0 0 0 -0.141087,0.065629 1.0000689,1 0 0 0 -0.128683,0.089917 1.0000939,1.000025 0 0 0 -0.03308,0.028939 1.0000689,1 0 0 0 -0.04548,0.039791 1.0000689,1 0 0 0 -0.03979,0.045475 1.0000939,1.000025 0 0 0 -0.02894,0.033073 1.0000689,1 0 0 0 -0.08992,0.1286744 1.0000689,1 0 0 0 -0.06563,0.1410766 1.0000939,1.000025 0 0 0 -0.01705,0.049093 1.0000689,1 0 0 0 -0.02791,0.1049032 1.0000939,1.000025 0 0 0 -0.0098,0.049093 1.0000689,1 0 0 0 -0.0124,0.1353923 1.0000939,1.000025 0 0 0 -0.0016,0.020154 V 16.586189 l -2.0000145,1.999878 -1.586059,-1.58595 2.2930405,-2.292883 a 1.0000689,1 0 0 0 0,-1.414384 1.0000689,1 0 0 0 -0.7069815,-0.292489 1.0000689,1 0 0 0 -0.7069824,0.292489 l -3.0000235,3.000333 a 1.0001689,1.0001 0 0 0 0,1.413868 l 3.0000235,3.000333 a 1.0001689,1.0001 0 0 0 1.4139639,0 l 3.000541,-3.000333 a 1.0000689,1 0 0 0 0.05478,-0.05994 1.0000939,1.000025 0 0 0 0.0067,-0.0078 1.0000689,1 0 0 0 0.09664,-0.138492 1.0000689,1 0 0 0 10e-4,-0.0016 1.0000689,1 0 0 0 0.07028,-0.150378 1.0000939,1.000025 0 0 0 0.0047,-0.01344 1.0000689,1 0 0 0 0.04289,-0.159163 1.0000689,1 0 0 0 5.17e-4,-0.0041 1.0000689,1 0 0 0 0.01499,-0.166398 1.0000939,1.000025 0 0 0 5.17e-4,-0.0057 V 6.4147167 l 2.293041,2.2923666 a 1.0000689,1 0 0 0 1.413966,0 1.0000689,1 0 0 0 0,-1.4138672 L 13.707255,3.2929435 a 1.0000689,1 0 0 0 -0.04548,-0.039791 1.0000939,1.000025 0 0 0 -0.03308,-0.028939 1.0000689,1 0 0 0 -0.128683,-0.089917 1.0000689,1 0 0 0 -0.141086,-0.065629 1.0000939,1.000025 0 0 0 -0.0491,-0.017053 1.0000689,1 0 0 0 -0.104911,-0.027905 1.0000939,1.000025 0 0 0 -0.0491,-0.00982 1.0000689,1 0 0 0 -0.135401,-0.012402 1.0000939,1.000025 0 0 0 -0.02016,-0.00155 z" />
</group>
android:viewportHeight="108">
<group
android:scaleX="2.835"
android:scaleY="2.835"
android:translateX="19.98"
android:translateY="19.98">
<path
android:fillColor="@android:color/transparent"
android:pathData="M 13,4.0000207 17,8 M 12.999969,4.0004121 V 17.000315 m 0,-2.94e-4 -3.0000004,3 -2.9999997,-3 2.9999997,-3 M 7.021336,16.939069"
android:strokeWidth="2"
android:strokeColor="@android:color/white"
android:strokeLineCap="round"
android:strokeLineJoin="round" />
</group>
</vector>

View file

@ -41,7 +41,7 @@
android:layout_marginEnd="@dimen/spacing_large"
android:gravity="center"
android:minWidth="@dimen/size_pre_amp_ticker"
android:textAppearance="@style/TextAppearance.Auxio.LabelMedium"
android:textAppearance="@style/TextAppearance.Auxio.BodySmall"
app:layout_constraintBottom_toBottomOf="@+id/with_tags_slider"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintTop_toTopOf="@+id/with_tags_slider"
@ -78,7 +78,7 @@
android:layout_marginEnd="@dimen/spacing_large"
android:gravity="center"
android:minWidth="@dimen/size_pre_amp_ticker"
android:textAppearance="@style/TextAppearance.Auxio.LabelMedium"
android:textAppearance="@style/TextAppearance.Auxio.BodySmall"
app:layout_constraintBottom_toBottomOf="@+id/without_tags_slider"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintTop_toTopOf="@+id/without_tags_slider"

View file

@ -1,10 +1,10 @@
<?xml version="1.0" encoding="utf-8"?>
<androidx.core.widget.NestedScrollView xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
style="@style/Widget.Auxio.Dialog.NestedScrollView"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="vertical"
style="@style/Widget.Auxio.Dialog.NestedScrollView"
xmlns:tools="http://schemas.android.com/tools">
android:orientation="vertical">
<LinearLayout
android:id="@+id/separator_group"
@ -19,8 +19,8 @@
android:layout_marginStart="@dimen/spacing_medium"
android:layout_marginEnd="@dimen/spacing_medium"
android:paddingStart="@dimen/spacing_medium"
android:textAlignment="viewStart"
android:text="@string/set_separators_comma"
android:textAlignment="viewStart"
android:textAppearance="@style/TextAppearance.Auxio.BodyLarge"
tools:ignore="RtlSymmetry" />
@ -31,8 +31,8 @@
android:layout_marginStart="@dimen/spacing_medium"
android:layout_marginEnd="@dimen/spacing_medium"
android:paddingStart="@dimen/spacing_medium"
android:textAlignment="viewStart"
android:text="@string/set_separators_and"
android:textAlignment="viewStart"
android:textAppearance="@style/TextAppearance.Auxio.BodyLarge"
tools:ignore="RtlSymmetry" />
@ -43,8 +43,8 @@
android:layout_marginStart="@dimen/spacing_medium"
android:layout_marginEnd="@dimen/spacing_medium"
android:paddingStart="@dimen/spacing_medium"
android:textAlignment="viewStart"
android:text="@string/set_separators_slash"
android:textAlignment="viewStart"
android:textAppearance="@style/TextAppearance.Auxio.BodyLarge"
tools:ignore="RtlSymmetry" />
@ -55,8 +55,8 @@
android:layout_marginStart="@dimen/spacing_medium"
android:layout_marginEnd="@dimen/spacing_medium"
android:paddingStart="@dimen/spacing_medium"
android:textAlignment="viewStart"
android:text="@string/set_separators_plus"
android:textAlignment="viewStart"
android:textAppearance="@style/TextAppearance.Auxio.BodyLarge"
tools:ignore="RtlSymmetry" />
@ -67,19 +67,19 @@
android:layout_marginStart="@dimen/spacing_medium"
android:layout_marginEnd="@dimen/spacing_medium"
android:paddingStart="@dimen/spacing_medium"
android:textAlignment="viewStart"
android:text="@string/set_separators_and"
android:textAlignment="viewStart"
android:textAppearance="@style/TextAppearance.Auxio.BodyLarge"
tools:ignore="RtlSymmetry" />
<TextView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:textAppearance="@style/TextAppearance.Auxio.BodySmall"
android:layout_marginTop="@dimen/spacing_mid_large"
android:layout_marginStart="@dimen/spacing_mid_large"
android:layout_marginTop="@dimen/spacing_mid_large"
android:layout_marginEnd="@dimen/spacing_mid_large"
android:text="@string/set_separators_warning"/>
android:text="@string/set_separators_warning"
android:textAppearance="@style/TextAppearance.Auxio.BodySmall" />
</LinearLayout>

View file

@ -1,6 +1,6 @@
<?xml version="1.0" encoding="utf-8"?>
<adaptive-icon xmlns:android="http://schemas.android.com/apk/res/android">
<background android:drawable="@drawable/ic_launcher_background"/>
<foreground android:drawable="@drawable/ic_launcher_foreground"/>
<monochrome android:drawable="@drawable/ic_launcher_foreground"/>
<background android:drawable="@drawable/ic_launcher_background" />
<foreground android:drawable="@drawable/ic_launcher_foreground" />
<monochrome android:drawable="@drawable/ic_launcher_foreground" />
</adaptive-icon>

Binary file not shown.

Before

Width:  |  Height:  |  Size: 4.7 KiB

After

Width:  |  Height:  |  Size: 4.7 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 3 KiB

After

Width:  |  Height:  |  Size: 3 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 6.7 KiB

After

Width:  |  Height:  |  Size: 6.7 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 10 KiB

After

Width:  |  Height:  |  Size: 10 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 15 KiB

After

Width:  |  Height:  |  Size: 15 KiB

View file

@ -50,7 +50,7 @@
android:id="@+id/settings_fragment"
android:name="org.oxycblt.auxio.settings.SettingsFragment"
android:label="fragment_settings"
tools:layout="@layout/fragment_settings" >
tools:layout="@layout/fragment_settings">
<action
android:id="@+id/go_to_accent_dialog"
app:destination="@id/accent_dialog" />

View file

@ -237,7 +237,7 @@
<string name="set_exclude_non_music_desc">Ignore audio files that are not music, such as podcasts</string>
<string name="set_separators">Multi-value separators</string>
<string name="set_separators_desc">Configure characters that denote multiple tag values</string>
<string name="set_separators_warning">Warning: Using this setting may result in some tags being incorrectly interpreted as having multiple values. You can resolve this by escaping unwanted separator characters with a backslash (\\).</string>
<string name="set_separators_warning">Warning: Using this setting may result in some tags being incorrectly interpreted as having multiple values. You can resolve this by prefixing unwanted separator characters with a backslash (\\).</string>
<string name="set_separators_comma">Comma (,)</string>
<string name="set_separators_semicolon">Semicolon (;)</string>
<string name="set_separators_slash">Slash (/)</string>

View file

@ -153,17 +153,17 @@
app:summary="@string/set_observing_desc"
app:title="@string/set_observing" />
<org.oxycblt.auxio.settings.prefs.WrappedDialogPreference
app:key="@string/set_key_music_dirs"
app:summary="@string/set_dirs_desc"
app:title="@string/set_dirs" />
<SwitchPreferenceCompat
app:defaultValue="true"
app:key="@string/set_key_exclude_non_music"
app:summary="@string/set_exclude_non_music_desc"
app:title="@string/set_exclude_non_music" />
<org.oxycblt.auxio.settings.prefs.WrappedDialogPreference
app:key="@string/set_key_music_dirs"
app:summary="@string/set_dirs_desc"
app:title="@string/set_dirs" />
<org.oxycblt.auxio.settings.prefs.WrappedDialogPreference
app:key="@string/set_key_separators"
app:summary="@string/set_separators_desc"