Fix issue where clicking home button caused search icon blip
Also, tweak size of icons in landscape mode
Bug: 7221345
Change-Id: Ib0d1445e165f291c09021f7dad08ad4d248e47ca
diff --git a/src/com/android/launcher2/HolographicViewHelper.java b/src/com/android/launcher2/HolographicViewHelper.java
index 0e798da..93d7853 100644
--- a/src/com/android/launcher2/HolographicViewHelper.java
+++ b/src/com/android/launcher2/HolographicViewHelper.java
@@ -21,6 +21,7 @@
import android.graphics.Bitmap;
import android.graphics.Canvas;
import android.graphics.PorterDuff;
+import android.graphics.drawable.Drawable;
import android.graphics.drawable.StateListDrawable;
import android.widget.ImageView;
@@ -69,12 +70,13 @@
* Creates a copy of the original image.
*/
private Bitmap createOriginalImage(ImageView v, Canvas canvas) {
+ final Drawable d = v.getDrawable();
final Bitmap b = Bitmap.createBitmap(
- v.getWidth(), v.getHeight(), Bitmap.Config.ARGB_8888);
+ d.getIntrinsicWidth(), d.getIntrinsicHeight(), Bitmap.Config.ARGB_8888);
canvas.setBitmap(b);
canvas.save();
- v.draw(canvas);
+ d.draw(canvas);
canvas.restore();
canvas.setBitmap(null);
@@ -86,12 +88,13 @@
* Responsibility for the bitmap is transferred to the caller.
*/
private Bitmap createPressImage(ImageView v, Canvas canvas) {
+ final Drawable d = v.getDrawable();
final Bitmap b = Bitmap.createBitmap(
- v.getWidth(), v.getHeight(), Bitmap.Config.ARGB_8888);
+ d.getIntrinsicWidth(), d.getIntrinsicHeight(), Bitmap.Config.ARGB_8888);
canvas.setBitmap(b);
canvas.save();
- v.draw(canvas);
+ d.draw(canvas);
canvas.restore();
canvas.drawColor(mHighlightColor, PorterDuff.Mode.SRC_IN);
canvas.setBitmap(null);