Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit e387285f authored by Hyunyoung Song's avatar Hyunyoung Song Committed by Android (Google) Code Review
Browse files

Merge "Fix NPE inside SEarchResultThumbnailView on cropping Bug: 175161949...

Merge "Fix NPE inside SEarchResultThumbnailView on cropping Bug: 175161949 Test: builds. Created screenshot of landscape portion and verified"
parents c45d4605 4b2403bb
Loading
Loading
Loading
Loading
+9 −3
Original line number Diff line number Diff line
@@ -88,9 +88,15 @@ public class ThumbnailSearchResultView extends androidx.appcompat.widget.AppComp
            bitmap = ((BitmapDrawable) target.getRemoteAction().getIcon()
                    .loadDrawable(getContext())).getBitmap();
            // crop
            if (bitmap.getWidth() < bitmap.getHeight()) {
                bitmap = Bitmap.createBitmap(bitmap, 0,
                        bitmap.getHeight() / 2 - bitmap.getWidth() / 2,
                        bitmap.getWidth(), bitmap.getWidth());
            } else {
                bitmap = Bitmap.createBitmap(bitmap, bitmap.getWidth() / 2 - bitmap.getHeight() / 2,
                        0,
                        bitmap.getHeight(), bitmap.getHeight());
            }
            setTag(itemInfo);
        } else {
            bitmap = (Bitmap) target.getExtras().getParcelable("bitmap");