detail: update album song layout
Update the album song layout to be more alike to other songs. Recently I migrated the TextView in the album songs to use 48dp sizing, like the other song views. However, this resulted in a lot of empty space that felt off. Fix this by adding a light background to the track number, which fills the room it takes up a bit more. It also hopefully primes the track number to take an indicator once multi-select is added.
This commit is contained in:
@@ -19,6 +19,7 @@ package org.oxycblt.auxio.detail.recycler
|
||||
|
||||
import android.content.Context
|
||||
import androidx.core.view.isInvisible
|
||||
import androidx.core.view.isVisible
|
||||
import androidx.recyclerview.widget.RecyclerView
|
||||
import org.oxycblt.auxio.IntegerTable
|
||||
import org.oxycblt.auxio.R
|
||||
@@ -171,14 +172,14 @@ private class AlbumSongViewHolder private constructor(private val binding: ItemA
|
||||
isInvisible = false
|
||||
}
|
||||
|
||||
binding.songTrackPlaceholder.isInvisible = true
|
||||
binding.songTrackPlaceholder.isVisible = false
|
||||
} else {
|
||||
binding.songTrack.apply {
|
||||
textSafe = ""
|
||||
isInvisible = true
|
||||
}
|
||||
|
||||
binding.songTrackPlaceholder.isInvisible = false
|
||||
binding.songTrackPlaceholder.isVisible = true
|
||||
}
|
||||
|
||||
binding.songName.textSafe = item.resolvedName
|
||||
@@ -197,6 +198,7 @@ private class AlbumSongViewHolder private constructor(private val binding: ItemA
|
||||
binding.songName.isActivated = isHighlighted
|
||||
binding.songTrack.isActivated = isHighlighted
|
||||
binding.songTrackPlaceholder.isActivated = isHighlighted
|
||||
binding.songTrackBg.isActivated = isHighlighted
|
||||
}
|
||||
|
||||
companion object {
|
||||
|
||||
@@ -83,7 +83,7 @@ class PlaybackService :
|
||||
private lateinit var player: ExoPlayer
|
||||
private lateinit var mediaSession: MediaSessionCompat
|
||||
private lateinit var connector: PlaybackSessionConnector
|
||||
private val audioProcessor = ReplayGainAudioProcessor()
|
||||
private val replayGainProcessor = ReplayGainAudioProcessor()
|
||||
|
||||
// Notification components
|
||||
private lateinit var notification: PlaybackNotification
|
||||
@@ -247,7 +247,7 @@ class PlaybackService :
|
||||
if (info.isSelected) {
|
||||
for (i in 0 until info.trackGroup.length) {
|
||||
if (info.isTrackSelected(i)) {
|
||||
audioProcessor.applyReplayGain(info.trackGroup.getFormat(i).metadata)
|
||||
replayGainProcessor.applyReplayGain(info.trackGroup.getFormat(i).metadata)
|
||||
break
|
||||
}
|
||||
}
|
||||
@@ -359,8 +359,8 @@ class PlaybackService :
|
||||
handler,
|
||||
audioListener,
|
||||
AudioCapabilities.DEFAULT_AUDIO_CAPABILITIES,
|
||||
audioProcessor),
|
||||
LibflacAudioRenderer(handler, audioListener, audioProcessor))
|
||||
replayGainProcessor),
|
||||
LibflacAudioRenderer(handler, audioListener, replayGainProcessor))
|
||||
}
|
||||
|
||||
// Enable constant bitrate seeking so that certain MP3s/AACs are seekable
|
||||
|
||||
@@ -211,17 +211,17 @@ class ReplayGainAudioProcessor : BaseAudioProcessor() {
|
||||
}
|
||||
} else {
|
||||
for (i in position until limit step 2) {
|
||||
val sample = inputBuffer.getLeShort(i)
|
||||
var sample = inputBuffer.getLeShort(i)
|
||||
// Clamp the values to the minimum and maximum values possible for the
|
||||
// encoding. This prevents issues where samples amplified beyond 1 << 16
|
||||
// will end up becoming truncated during the conversion to a short,
|
||||
// resulting in popping.
|
||||
val targetSample =
|
||||
sample =
|
||||
(sample * volume)
|
||||
.toInt()
|
||||
.clamp(Short.MIN_VALUE.toInt(), Short.MAX_VALUE.toInt())
|
||||
.toShort()
|
||||
buffer.putLeShort(targetSample)
|
||||
buffer.putLeShort(sample)
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user