summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorHyunyoung Song <hyunyoungs@google.com>2019-08-28 13:52:14 -0700
committerHyunyoung Song <hyunyoungs@google.com>2019-08-28 13:52:14 -0700
commit9ac40093460f1ae7c71a2f2e1dda5e41d70c5223 (patch)
treee274c55358f1639a00ed65526b2a117f367af6bf
parent591ff9b8e775af246baa7a91786b328ee2afec74 (diff)
parent89d0d098f09e870297047d9b8db34bd0e60e3d47 (diff)
downloadThemePicker-9ac40093460f1ae7c71a2f2e1dda5e41d70c5223.tar.gz
Merging from ub-launcher3-qt-qpr1-dev @ build 5834630
Test: manual, presubmit on the source branch http://x20/teams/android-sysui/merge/ub-launcher3-qt-qpr1-dev_5834630.html Change-Id: I259c498f915bd21efbb6e5dbda7d9a6b5e6b6ca6
-rw-r--r--src/com/android/customization/picker/theme/ThemeFragment.java6
1 files changed, 5 insertions, 1 deletions
diff --git a/src/com/android/customization/picker/theme/ThemeFragment.java b/src/com/android/customization/picker/theme/ThemeFragment.java
index f584dec9..e4682bb7 100644
--- a/src/com/android/customization/picker/theme/ThemeFragment.java
+++ b/src/com/android/customization/picker/theme/ThemeFragment.java
@@ -23,6 +23,7 @@ import android.content.res.ColorStateList;
import android.content.res.Resources;
import android.graphics.Bitmap;
import android.graphics.Bitmap.Config;
+import android.graphics.Matrix;
import android.graphics.drawable.BitmapDrawable;
import android.graphics.drawable.Drawable;
import android.graphics.drawable.LayerDrawable;
@@ -61,6 +62,7 @@ import com.android.customization.widget.OptionSelectorController;
import com.android.customization.widget.PreviewPager;
import com.android.wallpaper.R;
import com.android.wallpaper.asset.Asset;
+import com.android.wallpaper.asset.Asset.CenterCropBitmapTask;
import com.android.wallpaper.model.WallpaperInfo;
import com.android.wallpaper.module.CurrentWallpaperInfoFactory;
import com.android.wallpaper.module.InjectorProvider;
@@ -552,7 +554,9 @@ public class ThemeFragment extends ToolbarFragment {
if (wallpaperPreviewAsset != null) {
wallpaperPreviewAsset.decodeBitmap(
targetWidth, targetHeight,
- bitmap -> setWallpaperBitmap(view, bitmap));
+ bitmap -> new CenterCropBitmapTask(bitmap, view,
+ croppedBitmap -> setWallpaperBitmap(view, croppedBitmap))
+ .execute());
}
view.removeOnLayoutChangeListener(this);
}