deps: upgrade deps
Once again Gradle -> 7.4.2 Spotless -> 6.6.1 Ktfmt -> 0.67
This commit is contained in:
@@ -62,8 +62,8 @@ class MainFragment : ViewBindingFragment<FragmentMainBinding>() {
|
||||
}
|
||||
|
||||
requireActivity()
|
||||
.onBackPressedDispatcher
|
||||
.addCallback(viewLifecycleOwner, DynamicBackPressedCallback().also { callback = it })
|
||||
.onBackPressedDispatcher.addCallback(
|
||||
viewLifecycleOwner, DynamicBackPressedCallback().also { callback = it })
|
||||
|
||||
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.N) {
|
||||
// Auxio's layout completely breaks down when it's window is resized too small,
|
||||
|
||||
@@ -349,7 +349,8 @@ constructor(context: Context, attrs: AttributeSet? = null, @AttrRes defStyleAttr
|
||||
scrollToThumbOffset(thumbOffset)
|
||||
}
|
||||
}
|
||||
MotionEvent.ACTION_UP, MotionEvent.ACTION_CANCEL -> dragging = false
|
||||
MotionEvent.ACTION_UP,
|
||||
MotionEvent.ACTION_CANCEL -> dragging = false
|
||||
}
|
||||
|
||||
lastY = eventY
|
||||
|
||||
@@ -50,11 +50,12 @@ class MusicKeyer : Keyer<Music> {
|
||||
}
|
||||
|
||||
/**
|
||||
* Fetcher that returns the album cover for a given [Album] or [Song], depending on the factory used.
|
||||
* Fetcher that returns the album cover for a given [Album] or [Song], depending on the factory
|
||||
* used.
|
||||
* @author OxygenCobalt
|
||||
*/
|
||||
class AlbumCoverFetcher private constructor(private val context: Context, private val album: Album) :
|
||||
BaseFetcher() {
|
||||
class AlbumCoverFetcher
|
||||
private constructor(private val context: Context, private val album: Album) : BaseFetcher() {
|
||||
override suspend fun fetch(): FetchResult? {
|
||||
return fetchArt(context, album)?.let { stream ->
|
||||
SourceResult(
|
||||
|
||||
@@ -170,7 +170,8 @@ object Indexer {
|
||||
// Get the compat impl to add their version-specific columns.
|
||||
compat.addSongColumns(columns)
|
||||
|
||||
context.contentResolverSafe.query(
|
||||
context.contentResolverSafe
|
||||
.query(
|
||||
MediaStore.Audio.Media.EXTERNAL_CONTENT_URI,
|
||||
columns.toTypedArray(),
|
||||
selector,
|
||||
@@ -342,7 +343,8 @@ object Indexer {
|
||||
private fun readGenres(context: Context, songs: List<Song>): List<Genre> {
|
||||
val genres = mutableListOf<Genre>()
|
||||
|
||||
context.contentResolverSafe.query(
|
||||
context.contentResolverSafe
|
||||
.query(
|
||||
MediaStore.Audio.Genres.EXTERNAL_CONTENT_URI,
|
||||
arrayOf(MediaStore.Audio.Genres._ID, MediaStore.Audio.Genres.NAME),
|
||||
null,
|
||||
@@ -385,7 +387,8 @@ object Indexer {
|
||||
val genreSongs = mutableListOf<Song>()
|
||||
|
||||
// Don't even bother blacklisting here as useless iterations are less expensive than IO
|
||||
context.contentResolverSafe.query(
|
||||
context.contentResolverSafe
|
||||
.query(
|
||||
MediaStore.Audio.Genres.Members.getContentUri("external", genreId),
|
||||
arrayOf(MediaStore.Audio.Genres.Members._ID),
|
||||
null,
|
||||
|
||||
@@ -116,8 +116,8 @@ class MusicStore private constructor() {
|
||||
* @return The corresponding [Song] for this [uri], null if there isn't one.
|
||||
*/
|
||||
fun findSongForUri(context: Context, uri: Uri): Song? {
|
||||
context.contentResolverSafe.query(
|
||||
uri, arrayOf(OpenableColumns.DISPLAY_NAME), null, null, null)
|
||||
context.contentResolverSafe
|
||||
.query(uri, arrayOf(OpenableColumns.DISPLAY_NAME), null, null, null)
|
||||
?.use { cursor ->
|
||||
cursor.moveToFirst()
|
||||
val fileName =
|
||||
|
||||
@@ -92,8 +92,7 @@ class QueueDragCallback(
|
||||
|
||||
val bg = holder.bodyView.background as MaterialShapeDrawable
|
||||
val elevation = recyclerView.context.getDimenSafe(R.dimen.elevation_small)
|
||||
holder
|
||||
.itemView
|
||||
holder.itemView
|
||||
.animate()
|
||||
.translationZ(elevation)
|
||||
.setDuration(100)
|
||||
@@ -130,8 +129,7 @@ class QueueDragCallback(
|
||||
logD("Dropping queue item")
|
||||
|
||||
val bg = holder.bodyView.background as MaterialShapeDrawable
|
||||
holder
|
||||
.itemView
|
||||
holder.itemView
|
||||
.animate()
|
||||
.translationZ(0.0f)
|
||||
.setDuration(100)
|
||||
|
||||
+24
-16
@@ -150,15 +150,19 @@ class ReplayGainAudioProcessor : BaseAudioProcessor() {
|
||||
}
|
||||
|
||||
// Case 1: Normal ReplayGain, most commonly found on MPEG files.
|
||||
tags.findLast { tag -> tag.key == RG_TRACK }?.let { tag ->
|
||||
trackGain = tag.value
|
||||
found = true
|
||||
}
|
||||
tags
|
||||
.findLast { tag -> tag.key == RG_TRACK }
|
||||
?.let { tag ->
|
||||
trackGain = tag.value
|
||||
found = true
|
||||
}
|
||||
|
||||
tags.findLast { tag -> tag.key == RG_ALBUM }?.let { tag ->
|
||||
albumGain = tag.value
|
||||
found = true
|
||||
}
|
||||
tags
|
||||
.findLast { tag -> tag.key == RG_ALBUM }
|
||||
?.let { tag ->
|
||||
albumGain = tag.value
|
||||
found = true
|
||||
}
|
||||
|
||||
// Case 2: R128 ReplayGain, most commonly found on FLAC files and other lossless
|
||||
// encodings to increase precision in volume adjustments.
|
||||
@@ -166,15 +170,19 @@ class ReplayGainAudioProcessor : BaseAudioProcessor() {
|
||||
// applied by the media framework [which ExoPlayer relies on]. The only reason we would
|
||||
// want to read it is to zero previous ReplayGain values for being invalid, however there
|
||||
// is no demand to fix that edge case right now.
|
||||
tags.findLast { tag -> tag.key == R128_TRACK }?.let { tag ->
|
||||
trackGain += tag.value / 256f
|
||||
found = true
|
||||
}
|
||||
tags
|
||||
.findLast { tag -> tag.key == R128_TRACK }
|
||||
?.let { tag ->
|
||||
trackGain += tag.value / 256f
|
||||
found = true
|
||||
}
|
||||
|
||||
tags.findLast { tag -> tag.key == R128_ALBUM }?.let { tag ->
|
||||
albumGain += tag.value / 256f
|
||||
found = true
|
||||
}
|
||||
tags
|
||||
.findLast { tag -> tag.key == R128_ALBUM }
|
||||
?.let { tag ->
|
||||
albumGain += tag.value / 256f
|
||||
found = true
|
||||
}
|
||||
return if (found) {
|
||||
Gain(trackGain, albumGain)
|
||||
} else {
|
||||
|
||||
@@ -46,9 +46,7 @@ enum class RepeatMode {
|
||||
TRACK -> R.drawable.ic_repeat_one
|
||||
}
|
||||
|
||||
/**
|
||||
* The integer code representing this particular mode.
|
||||
*/
|
||||
/** The integer code representing this particular mode. */
|
||||
val intCode: Int
|
||||
get() =
|
||||
when (this) {
|
||||
|
||||
@@ -149,7 +149,8 @@ class SettingsListFragment : PreferenceFragmentCompat() {
|
||||
true
|
||||
}
|
||||
}
|
||||
SettingsManager.KEY_SHOW_COVERS, SettingsManager.KEY_QUALITY_COVERS -> {
|
||||
SettingsManager.KEY_SHOW_COVERS,
|
||||
SettingsManager.KEY_QUALITY_COVERS -> {
|
||||
onPreferenceChangeListener =
|
||||
Preference.OnPreferenceChangeListener { _, _ ->
|
||||
Coil.imageLoader(requireContext()).apply { this.memoryCache?.clear() }
|
||||
|
||||
@@ -255,10 +255,12 @@ class SettingsManager private constructor(context: Context) :
|
||||
override fun onSharedPreferenceChanged(sharedPreferences: SharedPreferences?, key: String?) {
|
||||
when (key) {
|
||||
KEY_USE_ALT_NOTIFICATION_ACTION -> callbacks.forEach { it.onNotifSettingsChanged() }
|
||||
KEY_SHOW_COVERS, KEY_QUALITY_COVERS -> callbacks.forEach { it.onCoverSettingsChanged() }
|
||||
KEY_SHOW_COVERS,
|
||||
KEY_QUALITY_COVERS -> callbacks.forEach { it.onCoverSettingsChanged() }
|
||||
KEY_LIB_TABS -> callbacks.forEach { it.onLibrarySettingsChanged() }
|
||||
KEY_REPLAY_GAIN, KEY_PRE_AMP_WITH, KEY_PRE_AMP_WITHOUT ->
|
||||
callbacks.forEach { it.onReplayGainSettingsChanged() }
|
||||
KEY_REPLAY_GAIN,
|
||||
KEY_PRE_AMP_WITH,
|
||||
KEY_PRE_AMP_WITHOUT -> callbacks.forEach { it.onReplayGainSettingsChanged() }
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -103,7 +103,8 @@ class ActionMenu(
|
||||
return when (data) {
|
||||
is Song -> {
|
||||
when (flag) {
|
||||
FLAG_NONE, FLAG_IN_GENRE -> R.menu.menu_song_actions
|
||||
FLAG_NONE,
|
||||
FLAG_IN_GENRE -> R.menu.menu_song_actions
|
||||
FLAG_IN_ALBUM -> R.menu.menu_album_song_actions
|
||||
FLAG_IN_ARTIST -> R.menu.menu_artist_song_actions
|
||||
else -> -1
|
||||
|
||||
@@ -462,7 +462,8 @@ constructor(context: Context, attrs: AttributeSet? = null, defStyle: Int = 0) :
|
||||
return false
|
||||
}
|
||||
}
|
||||
MotionEvent.ACTION_CANCEL, MotionEvent.ACTION_UP ->
|
||||
MotionEvent.ACTION_CANCEL,
|
||||
MotionEvent.ACTION_UP ->
|
||||
if (dragHelper.isDragging) {
|
||||
// Stopped pressing while we were dragging, let the drag helper handle it
|
||||
dragHelper.processTouchEvent(ev)
|
||||
|
||||
@@ -51,8 +51,8 @@ constructor(context: Context, attrs: AttributeSet? = null, @AttrRes defStyleAttr
|
||||
|
||||
if (child != null) {
|
||||
val coordinator = parent as CoordinatorLayout
|
||||
(layoutParams as CoordinatorLayout.LayoutParams).behavior?.onNestedPreScroll(
|
||||
coordinator, this, coordinator, 0, 0, tConsumed, 0)
|
||||
(layoutParams as CoordinatorLayout.LayoutParams)
|
||||
.behavior?.onNestedPreScroll(coordinator, this, coordinator, 0, 0, tConsumed, 0)
|
||||
}
|
||||
|
||||
true
|
||||
|
||||
@@ -58,9 +58,7 @@ fun Throwable.logTraceOrThrow() {
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Automatically creates a tag that identifies the object currently logging.
|
||||
*/
|
||||
/** Automatically creates a tag that identifies the object currently logging. */
|
||||
private val Any.autoTag: String
|
||||
get() = "Auxio.${this::class.simpleName ?: "Anonymous Object"}"
|
||||
|
||||
|
||||
Reference in New Issue
Block a user