Skip to content

Commit

Permalink
Do not notifyColorsChanged() in Material you preview
Browse files Browse the repository at this point in the history
  • Loading branch information
cvzi committed Aug 23, 2022
1 parent a0447ad commit 7e05c2d
Showing 1 changed file with 9 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -433,6 +433,15 @@ class DarkWallpaperService : WallpaperService() {
}
}

override fun notifyColorsChanged() {
if (isPreview && !isLockScreen && fixedConfig && MainActivity.originalDesiredWidth > 0) {
Log.v(TAG, "notifyColorsChanged() blocked because: In-app preview")
} else if (isPreview && (desiredMinimumWidth < width || desiredMinimumHeight < height)) {
Log.v(TAG, "notifyColorsChanged() blocked because: Material you preview")
} else {
super.notifyColorsChanged()
}
}

fun desiredDimensions(): Point {
val desiredWidth: Int
Expand Down

0 comments on commit 7e05c2d

Please sign in to comment.