Skip to content

Commit

Permalink
[FIX] Fixed the ANR caused by extracting colors from Bitmap
Browse files Browse the repository at this point in the history
  • Loading branch information
iZakirSheikh committed Aug 13, 2024
1 parent 436ae46 commit 80c32b2
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 2 deletions.
1 change: 1 addition & 0 deletions .github/workflows/release_workflow.yml
Original file line number Diff line number Diff line change
Expand Up @@ -112,6 +112,7 @@ jobs:
with:
tag_name: v${{ env.GIT_TAG }}
generate_release_notes: true
changesNotSentForReview: false
prerelease: true
files: |
${{steps.signed_aab.outputs.signedReleaseFile}}
Expand Down
4 changes: 2 additions & 2 deletions app/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,8 @@ android {
applicationId = "com.prime.player"
minSdk = 21
targetSdk = 34
versionCode = 124
versionName = "2.15.1"
versionCode = 125
versionName = "2.15.2"
testInstrumentationRunner = "androidx.test.runner.AndroidJUnitRunner"
vectorDrawables { useSupportLibrary = true }
//Load secrets into BuildConfig
Expand Down
5 changes: 5 additions & 0 deletions app/src/main/java/com/prime/media/Home.kt
Original file line number Diff line number Diff line change
Expand Up @@ -154,14 +154,17 @@ import com.primex.core.hsl
import com.primex.core.textResource
import com.primex.material2.Label
import com.primex.material2.OutlinedButton
import kotlinx.coroutines.Dispatchers
import kotlinx.coroutines.delay
import kotlinx.coroutines.flow.catch
import kotlinx.coroutines.flow.distinctUntilChanged
import kotlinx.coroutines.flow.flowOn
import kotlinx.coroutines.flow.launchIn
import kotlinx.coroutines.flow.map
import kotlinx.coroutines.flow.mapNotNull
import kotlinx.coroutines.flow.onEach
import kotlinx.coroutines.launch
import kotlinx.coroutines.withContext
import kotlin.math.ln

private const val TAG = "Home"
Expand Down Expand Up @@ -410,10 +413,12 @@ private fun observeAccentColor(
activity.getAlbumArt(uri)
}
.distinctUntilChanged()
.flowOn(Dispatchers.Main)
.onEach {
val accent = WallpaperAccentColor(it?.toBitmap(), isDark, default)
value = Color(accent)
}
.flowOn(Dispatchers.Default)
.launchIn(this)
}
}
Expand Down

0 comments on commit 80c32b2

Please sign in to comment.