From f6b72c4ad1d2e082441a64c4d6a5a02ee8a251ca Mon Sep 17 00:00:00 2001 From: Hilary Huo Date: Thu, 1 Oct 2020 12:26:48 -0700 Subject: [PATCH] [pixel-search] Bug fix: automatically launch screenshot + center&crop remoteaction icon Bug: b/169330678 Change-Id: Id5f8a0ce6d68f7ed9e4d1ff258ee3772229eb63b --- .../android/launcher3/views/ThumbnailSearchResultView.java | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/src/com/android/launcher3/views/ThumbnailSearchResultView.java b/src/com/android/launcher3/views/ThumbnailSearchResultView.java index bbc47739f3..81bcad97ed 100644 --- a/src/com/android/launcher3/views/ThumbnailSearchResultView.java +++ b/src/com/android/launcher3/views/ThumbnailSearchResultView.java @@ -86,9 +86,12 @@ public class ThumbnailSearchResultView extends androidx.appcompat.widget.AppComp RemoteActionItemInfo itemInfo = new RemoteActionItemInfo(target.mRemoteAction, target.bundle.getString(SearchTarget.REMOTE_ACTION_TOKEN), target.bundle.getBoolean(SearchTarget.REMOTE_ACTION_SHOULD_START)); - ItemClickHandler.onClickRemoteAction(launcher, itemInfo); bitmap = ((BitmapDrawable) target.mRemoteAction.getIcon() - .loadDrawable(getContext())).getBitmap(); + .loadDrawable(getContext())).getBitmap(); + Bitmap crop = Bitmap.createBitmap(bitmap, 0, + bitmap.getHeight() / 2 - bitmap.getWidth() / 2, + bitmap.getWidth(), bitmap.getWidth()); + bitmap = crop; setTag(itemInfo); } else { bitmap = (Bitmap) target.bundle.getParcelable("bitmap");