From: John Reck Date: Fri, 8 Mar 2013 02:07:05 +0000 (-0800) Subject: Support rotation X-Git-Tag: android-x86-7.1-r1~1023 X-Git-Url: http://git.osdn.net/view?a=commitdiff_plain;h=d3d2e276;p=android-x86%2Fpackages-apps-Gallery2.git Support rotation Change-Id: Ic93bed50851f788803124ea2453128fd0497a746 --- diff --git a/src/com/android/photos/shims/BitmapJobDrawable.java b/src/com/android/photos/shims/BitmapJobDrawable.java index e13e636bb..9d3c7e968 100644 --- a/src/com/android/photos/shims/BitmapJobDrawable.java +++ b/src/com/android/photos/shims/BitmapJobDrawable.java @@ -24,6 +24,7 @@ public class BitmapJobDrawable extends Drawable implements Runnable { private Bitmap mBitmap; private Paint mPaint = new Paint(); private Matrix mDrawMatrix = new Matrix(); + private int mRotation = 0; public BitmapJobDrawable() { } @@ -43,6 +44,7 @@ public class BitmapJobDrawable extends Drawable implements Runnable { // TODO: Figure out why ThumbnailLoader doesn't like to be re-used mLoader = new ThumbnailLoader(this); mLoader.startLoad(); + mRotation = mItem.getRotation(); } invalidateSelf(); } @@ -69,6 +71,7 @@ public class BitmapJobDrawable extends Drawable implements Runnable { canvas.save(); canvas.clipRect(bounds); canvas.concat(mDrawMatrix); + canvas.rotate(mRotation, bounds.centerX(), bounds.centerY()); canvas.drawBitmap(mBitmap, 0, 0, mPaint); canvas.restore(); } else {