Skip to content

Commit

Permalink
feat: crop notif album art
Browse files Browse the repository at this point in the history
  • Loading branch information
Ubuntu committed Jun 26, 2023
1 parent f95982e commit c514071
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 0 deletions.
1 change: 1 addition & 0 deletions kotlin-audio/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,7 @@ dependencies {
api 'com.jakewharton.timber:timber:5.0.1'

implementation 'androidx.test:rules:1.4.0'
implementation 'jp.wasabeef.transformers:coil:1.0.6'

// Asynchronous Testing
androidTestImplementation('org.awaitility:awaitility:4.2.0') {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ import androidx.annotation.DrawableRes
import androidx.core.app.NotificationCompat
import coil.imageLoader
import coil.request.ImageRequest
import jp.wasabeef.transformers.coil.CropSquareTransformation
import com.doublesymmetry.kotlinaudio.R
import com.doublesymmetry.kotlinaudio.event.NotificationEventHolder
import com.doublesymmetry.kotlinaudio.event.PlayerEventHolder
Expand Down Expand Up @@ -387,6 +388,7 @@ class NotificationManager internal constructor(
context.imageLoader.enqueue(
ImageRequest.Builder(context)
.data(source)
.transformations(CropSquareTransformation())
.target { result ->
val bitmap = (result as BitmapDrawable).bitmap
holder.artworkBitmap = bitmap
Expand Down

0 comments on commit c514071

Please sign in to comment.