Fixed wallpaper setting with the wrong dimensions

This commit is contained in:
Anthonyy232 committed 2024-08-10 00:56:19 -07:00
1 parent f9b6a96fc5
commit b03e860dee
3 files changed
+57 -49

No files matched your search

@@ -555,8 +555,7 @@ class HomeWallpaperService: Service() {
val aspectRatio = imageSize.height.toFloat() / imageSize.width.toFloat()
val device = context.resources.displayMetrics
val targetWidth = min(2 * device.widthPixels, imageSize.width)
val targetHeight = (targetWidth * aspectRatio).toInt()
val targetHeight = (targetWidth / aspectRatio).toInt()
val bitmap = if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.P) {
try {
val source = ImageDecoder.createSource(context.contentResolver, wallpaper)
@@ -486,7 +486,7 @@ class LockWallpaperService: Service() {
val aspectRatio = imageSize.height.toFloat() / imageSize.width.toFloat()
val device = context.resources.displayMetrics
val targetWidth = min(2 * device.widthPixels, imageSize.width)
val targetHeight = (targetWidth * aspectRatio).toInt()
val targetHeight = (targetWidth / aspectRatio).toInt()
val bitmap = if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.P) {
try {