all: fix merge regressions
This commit is contained in:
parent
d2524a0b3a
commit
190abd5588
5 changed files with 42 additions and 5 deletions
|
@ -542,13 +542,17 @@ constructor(
|
||||||
val header =
|
val header =
|
||||||
if (section is DetailSection.Songs) SortHeader(section.stringRes)
|
if (section is DetailSection.Songs) SortHeader(section.stringRes)
|
||||||
else BasicHeader(section.stringRes)
|
else BasicHeader(section.stringRes)
|
||||||
|
if (newList.isNotEmpty()) {
|
||||||
newList.add(Divider(header))
|
newList.add(Divider(header))
|
||||||
|
}
|
||||||
newList.add(header)
|
newList.add(header)
|
||||||
section.items
|
section.items
|
||||||
}
|
}
|
||||||
is DetailSection.Discs -> {
|
is DetailSection.Discs -> {
|
||||||
val header = SortHeader(section.stringRes)
|
val header = SortHeader(section.stringRes)
|
||||||
|
if (newList.isNotEmpty()) {
|
||||||
newList.add(Divider(header))
|
newList.add(Divider(header))
|
||||||
|
}
|
||||||
newList.add(header)
|
newList.add(header)
|
||||||
section.discs.flatMap { listOf(DiscHeader(it.key)) + it.value }
|
section.discs.flatMap { listOf(DiscHeader(it.key)) + it.value }
|
||||||
}
|
}
|
||||||
|
|
|
@ -73,6 +73,10 @@ constructor(
|
||||||
private var currentRequest: Request? = null
|
private var currentRequest: Request? = null
|
||||||
private var currentHandle = 0L
|
private var currentHandle = 0L
|
||||||
|
|
||||||
|
/** If this provider is currently attempting to load something. */
|
||||||
|
val isBusy: Boolean
|
||||||
|
get() = currentRequest?.run { !disposable.isDisposed } ?: false
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Load the Album cover [Bitmap] from a [Song].
|
* Load the Album cover [Bitmap] from a [Song].
|
||||||
*
|
*
|
||||||
|
|
|
@ -65,7 +65,11 @@ class RoundedRectTransformation(
|
||||||
|
|
||||||
val (outputWidth, outputHeight) = calculateOutputSize(input, size)
|
val (outputWidth, outputHeight) = calculateOutputSize(input, size)
|
||||||
|
|
||||||
val output = createBitmap(outputWidth, outputHeight, input.config)
|
val output =
|
||||||
|
createBitmap(
|
||||||
|
outputWidth,
|
||||||
|
outputHeight,
|
||||||
|
requireNotNull(input.config) { "unsupported bitmap format" })
|
||||||
output.applyCanvas {
|
output.applyCanvas {
|
||||||
drawColor(Color.TRANSPARENT, PorterDuff.Mode.CLEAR)
|
drawColor(Color.TRANSPARENT, PorterDuff.Mode.CLEAR)
|
||||||
|
|
||||||
|
|
|
@ -21,13 +21,13 @@ package org.oxycblt.auxio.music.external
|
||||||
import android.content.Context
|
import android.content.Context
|
||||||
import android.net.Uri
|
import android.net.Uri
|
||||||
import dagger.hilt.android.qualifiers.ApplicationContext
|
import dagger.hilt.android.qualifiers.ApplicationContext
|
||||||
|
import javax.inject.Inject
|
||||||
import org.oxycblt.auxio.music.Playlist
|
import org.oxycblt.auxio.music.Playlist
|
||||||
import org.oxycblt.auxio.music.fs.Components
|
import org.oxycblt.auxio.music.fs.Components
|
||||||
import org.oxycblt.auxio.music.fs.DocumentPathFactory
|
import org.oxycblt.auxio.music.fs.DocumentPathFactory
|
||||||
import org.oxycblt.auxio.music.fs.Path
|
import org.oxycblt.auxio.music.fs.Path
|
||||||
import org.oxycblt.auxio.music.fs.contentResolverSafe
|
import org.oxycblt.auxio.music.fs.contentResolverSafe
|
||||||
import org.oxycblt.auxio.util.logE
|
import org.oxycblt.auxio.util.logE
|
||||||
import javax.inject.Inject
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Generic playlist file importing abstraction.
|
* Generic playlist file importing abstraction.
|
||||||
|
|
|
@ -20,6 +20,7 @@ package org.oxycblt.auxio.playback.state
|
||||||
|
|
||||||
import android.net.Uri
|
import android.net.Uri
|
||||||
import android.os.SystemClock
|
import android.os.SystemClock
|
||||||
|
import android.support.v4.media.session.PlaybackStateCompat
|
||||||
import org.oxycblt.auxio.list.adapter.UpdateInstructions
|
import org.oxycblt.auxio.list.adapter.UpdateInstructions
|
||||||
import org.oxycblt.auxio.music.MusicParent
|
import org.oxycblt.auxio.music.MusicParent
|
||||||
import org.oxycblt.auxio.music.Song
|
import org.oxycblt.auxio.music.Song
|
||||||
|
@ -324,6 +325,30 @@ private constructor(
|
||||||
initPositionMs
|
initPositionMs
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Load this instance into a [PlaybackStateCompat].
|
||||||
|
*
|
||||||
|
* @param builder The [PlaybackStateCompat.Builder] to mutate.
|
||||||
|
* @return The same [PlaybackStateCompat.Builder] for easy chaining.
|
||||||
|
*/
|
||||||
|
fun intoPlaybackState(builder: PlaybackStateCompat.Builder): PlaybackStateCompat.Builder =
|
||||||
|
builder.setState(
|
||||||
|
// State represents the user's preference, not the actual player state.
|
||||||
|
// Doing this produces a better experience in the media control UI.
|
||||||
|
if (isPlaying) {
|
||||||
|
PlaybackStateCompat.STATE_PLAYING
|
||||||
|
} else {
|
||||||
|
PlaybackStateCompat.STATE_PAUSED
|
||||||
|
},
|
||||||
|
initPositionMs,
|
||||||
|
if (isAdvancing) {
|
||||||
|
1f
|
||||||
|
} else {
|
||||||
|
// Not advancing, so don't move the position.
|
||||||
|
0f
|
||||||
|
},
|
||||||
|
creationTime)
|
||||||
|
|
||||||
// Equality ignores the creation time to prevent functionally identical states
|
// Equality ignores the creation time to prevent functionally identical states
|
||||||
// from being non-equal.
|
// from being non-equal.
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue