diff --git a/app/src/main/java/org/oxycblt/auxio/image/CoverView.kt b/app/src/main/java/org/oxycblt/auxio/image/CoverView.kt index 103237d65..b783f849c 100644 --- a/app/src/main/java/org/oxycblt/auxio/image/CoverView.kt +++ b/app/src/main/java/org/oxycblt/auxio/image/CoverView.kt @@ -199,7 +199,18 @@ constructor(context: Context, attrs: AttributeSet? = null, @AttrRes defStyleAttr } private fun invalidatePlaybackIndicatorAlpha(playbackIndicator: ImageView) { - playbackIndicator.alpha = if (isSelected) 1f else 0f + // Occasionally content can bleed through the rounded corners and result in a seam + // on the playing indicator, prevent that from occurring by disabling the visibility of + // all views below the playback indicator. + for (child in children) { + child.alpha = + when (child) { + // Selection badge is above the playback indicator, do nothing + selectionBadge -> child.alpha + playbackIndicator -> if (isSelected) 1f else 0f + else -> if (isSelected) 0f else 1f + } + } } private fun invalidateSelectionIndicatorAlpha(selectionBadge: ImageView) { diff --git a/app/src/main/java/org/oxycblt/auxio/image/extractor/CoverExtractor.kt b/app/src/main/java/org/oxycblt/auxio/image/extractor/CoverExtractor.kt index be332de20..c835f5c63 100644 --- a/app/src/main/java/org/oxycblt/auxio/image/extractor/CoverExtractor.kt +++ b/app/src/main/java/org/oxycblt/auxio/image/extractor/CoverExtractor.kt @@ -43,7 +43,6 @@ import dagger.hilt.android.qualifiers.ApplicationContext import java.io.ByteArrayInputStream import java.io.InputStream import javax.inject.Inject -import kotlin.math.min import kotlinx.coroutines.Dispatchers import kotlinx.coroutines.guava.asDeferred import kotlinx.coroutines.withContext @@ -253,21 +252,4 @@ constructor( val size = pxOrElse { 512 } return if (size.mod(2) > 0) size + 1 else size } - - private fun transform(input: Bitmap, size: Size): Bitmap { - // Find the smaller dimension and then take a center portion of the image that - // has that size. - val dstSize = min(input.width, input.height) - val x = (input.width - dstSize) / 2 - val y = (input.height - dstSize) / 2 - val dst = Bitmap.createBitmap(input, x, y, dstSize, dstSize) - - val desiredWidth = size.width.pxOrElse { dstSize } - val desiredHeight = size.height.pxOrElse { dstSize } - if (dstSize != desiredWidth || dstSize != desiredHeight) { - // Image is not the desired size, upscale it. - return Bitmap.createScaledBitmap(dst, desiredWidth, desiredHeight, true) - } - return dst - } }