deps: upgrate
Like a while loop with no escape. Platform -> API 32 Coil -> 2.0.0-alpha06
This commit is contained in:
parent
8ad44d898c
commit
dc43edd6cb
5 changed files with 13 additions and 16 deletions
|
@ -4,7 +4,7 @@ apply plugin: "kotlin-kapt"
|
|||
apply plugin: "androidx.navigation.safeargs.kotlin"
|
||||
|
||||
android {
|
||||
compileSdkVersion 31
|
||||
compileSdkVersion 32
|
||||
buildToolsVersion "31.0.0"
|
||||
|
||||
defaultConfig {
|
||||
|
@ -13,7 +13,7 @@ android {
|
|||
versionCode 10
|
||||
|
||||
minSdkVersion 21
|
||||
targetSdkVersion 31
|
||||
targetSdkVersion 32
|
||||
|
||||
buildFeatures {
|
||||
dataBinding true
|
||||
|
@ -86,7 +86,7 @@ dependencies {
|
|||
implementation "androidx.navigation:navigation-fragment-ktx:$navigation_version"
|
||||
|
||||
// Media
|
||||
// TODO: Migrate to Media3
|
||||
// TODO: Dumpster this for Media3
|
||||
implementation "androidx.media:media:1.4.3"
|
||||
|
||||
// Preferences
|
||||
|
@ -98,7 +98,7 @@ dependencies {
|
|||
implementation "com.google.android.exoplayer:exoplayer-core:2.16.1"
|
||||
|
||||
// Image loading
|
||||
implementation 'io.coil-kt:coil:2.0.0-alpha05'
|
||||
implementation 'io.coil-kt:coil:2.0.0-alpha06'
|
||||
|
||||
// Material
|
||||
implementation 'com.google.android.material:material:1.5.0-rc01'
|
||||
|
|
|
@ -39,6 +39,7 @@ import org.oxycblt.auxio.util.systemBarsCompat
|
|||
/**
|
||||
* A [Fragment] that displays more information about the song, along with more media controls.
|
||||
* Instantiation is done by the navigation component, **do not instantiate this fragment manually.**
|
||||
* TODO: Show playing from on this screen now
|
||||
* @author OxygenCobalt
|
||||
*/
|
||||
class PlaybackFragment : Fragment() {
|
||||
|
@ -103,12 +104,10 @@ class PlaybackFragment : Fragment() {
|
|||
playbackModel.song.observe(viewLifecycleOwner) { song ->
|
||||
if (song != null) {
|
||||
logD("Updating song display to ${song.name}.")
|
||||
|
||||
binding.song = song
|
||||
binding.playbackSeekBar.setDuration(song.seconds)
|
||||
} else {
|
||||
logD("No song is being played, leaving.")
|
||||
|
||||
findNavController().navigateUp()
|
||||
}
|
||||
}
|
||||
|
|
|
@ -34,8 +34,7 @@ import org.oxycblt.auxio.util.logD
|
|||
import kotlin.math.pow
|
||||
|
||||
/**
|
||||
* Object that manages the AudioFocus state.
|
||||
* Adapted from NewPipe (https://github.com/TeamNewPipe/NewPipe)
|
||||
* Manages the current volume and playback state across ReplayGain and AudioFocus events.
|
||||
* @author OxygenCobalt
|
||||
*/
|
||||
class AudioReactor(context: Context) : AudioManager.OnAudioFocusChangeListener {
|
||||
|
@ -76,8 +75,8 @@ class AudioReactor(context: Context) : AudioManager.OnAudioFocusChangeListener {
|
|||
|
||||
val gain = parseReplayGain(metadata)
|
||||
|
||||
// Currently we consider both the album and the track gain. One might want to add
|
||||
// configuration to handle more cases.
|
||||
// Currently we consider both the album and the track gain.
|
||||
// TODO: Add configuration here
|
||||
var adjust = 0f
|
||||
|
||||
if (gain != null) {
|
||||
|
@ -107,12 +106,12 @@ class AudioReactor(context: Context) : AudioManager.OnAudioFocusChangeListener {
|
|||
val entry = metadata.get(i)
|
||||
|
||||
// Sometimes the ReplayGain keys will be lowercase, so make them uppercase.
|
||||
if (entry is TextInformationFrame && entry.description?.uppercase() in replayGainTags) {
|
||||
if (entry is TextInformationFrame && entry.description?.uppercase() in REPLAY_GAIN_TAGS) {
|
||||
tags.add(GainTag(entry.description!!.uppercase(), parseReplayGainFloat(entry.value)))
|
||||
continue
|
||||
}
|
||||
|
||||
if (entry is VorbisComment && entry.key.uppercase() in replayGainTags) {
|
||||
if (entry is VorbisComment && entry.key.uppercase() in REPLAY_GAIN_TAGS) {
|
||||
tags.add(GainTag(entry.key.uppercase(), parseReplayGainFloat(entry.value)))
|
||||
}
|
||||
}
|
||||
|
@ -228,7 +227,7 @@ class AudioReactor(context: Context) : AudioManager.OnAudioFocusChangeListener {
|
|||
const val R128_TRACK = "R128_TRACK_GAIN"
|
||||
const val R128_ALBUM = "R128_ALBUM_GAIN"
|
||||
|
||||
val replayGainTags = arrayOf(
|
||||
val REPLAY_GAIN_TAGS = arrayOf(
|
||||
RG_TRACK,
|
||||
RG_ALBUM,
|
||||
R128_ALBUM,
|
||||
|
|
|
@ -27,6 +27,7 @@ import android.support.v4.media.session.MediaSessionCompat
|
|||
import androidx.annotation.DrawableRes
|
||||
import androidx.core.app.NotificationCompat
|
||||
import androidx.media.app.NotificationCompat.MediaStyle
|
||||
import org.oxycblt.auxio.BuildConfig
|
||||
import org.oxycblt.auxio.R
|
||||
import org.oxycblt.auxio.coil.loadBitmap
|
||||
import org.oxycblt.auxio.music.MusicParent
|
||||
|
@ -172,7 +173,7 @@ class PlaybackNotification private constructor(
|
|||
}
|
||||
|
||||
companion object {
|
||||
const val CHANNEL_ID = "CHANNEL_AUXIO_PLAYBACK"
|
||||
const val CHANNEL_ID = BuildConfig.APPLICATION_ID + ".channel.PLAYBACK"
|
||||
const val NOTIFICATION_ID = 0xA0A0
|
||||
|
||||
/**
|
||||
|
|
|
@ -46,7 +46,6 @@ import kotlinx.coroutines.CoroutineScope
|
|||
import kotlinx.coroutines.Dispatchers
|
||||
import kotlinx.coroutines.Job
|
||||
import kotlinx.coroutines.delay
|
||||
import kotlinx.coroutines.flow.collect
|
||||
import kotlinx.coroutines.flow.conflate
|
||||
import kotlinx.coroutines.flow.flow
|
||||
import kotlinx.coroutines.flow.takeWhile
|
||||
|
@ -412,7 +411,6 @@ class PlaybackService : Service(), Player.Listener, PlaybackStateManager.Callbac
|
|||
pollFlow.takeWhile { player.isPlaying }.collect { poll ->
|
||||
playbackManager.setPosition(poll.pos)
|
||||
player.volume = audioReactor.volume
|
||||
logD(player.volume)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue