From 3ea3e316cd8ed0205bbae04f82a93653df699f75 Mon Sep 17 00:00:00 2001 From: Suphon Thanakornpakapong Date: Sun, 22 May 2022 22:40:20 +0700 Subject: [PATCH] Prevent firing icon shape change at start --- .../src/app/lawnchair/preferences2/PreferenceManager2.kt | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/lawnchair/src/app/lawnchair/preferences2/PreferenceManager2.kt b/lawnchair/src/app/lawnchair/preferences2/PreferenceManager2.kt index f8457d189a..0b545cb69a 100644 --- a/lawnchair/src/app/lawnchair/preferences2/PreferenceManager2.kt +++ b/lawnchair/src/app/lawnchair/preferences2/PreferenceManager2.kt @@ -36,6 +36,8 @@ import com.android.launcher3.util.MainThreadInitializedObject import com.patrykmichalik.preferencemanager.PreferenceManager import com.patrykmichalik.preferencemanager.firstBlocking import kotlinx.coroutines.MainScope +import kotlinx.coroutines.flow.distinctUntilChanged +import kotlinx.coroutines.flow.drop import kotlinx.coroutines.flow.launchIn import kotlinx.coroutines.flow.onEach import app.lawnchair.preferences.PreferenceManager as LawnchairPreferenceManager @@ -277,6 +279,8 @@ class PreferenceManager2(private val context: Context) : PreferenceManager { init { initializeIconShape(iconShape.firstBlocking()) iconShape.get() + .drop(1) + .distinctUntilChanged() .onEach { shape -> initializeIconShape(shape) L3IconShape.init(context)