Fixed wallpaper setting with the wrong dimensions
This commit is contained in:
1 parent
f9b6a96fc5
commit
b03e860dee
3 files changed
+57
-49
No files matched your search
+1
-2
@@ -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)
|
||||
|
||||
+1
-1
@@ -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 {
|
||||
|
||||
Reference in new issue
Block a user