summaryrefslogtreecommitdiffstats
path: root/src/com/android/photos
diff options
context:
space:
mode:
authorJohn Reck <jreck@google.com>2013-03-07 18:07:05 -0800
committerJohn Reck <jreck@google.com>2013-03-07 18:10:36 -0800
commitd3d2e2763bb4187a2dd3ac350d3a3c51d092890a (patch)
tree01d362853d19508a7f43fd585ec30b54254df125 /src/com/android/photos
parentf1787e59ee4a6da2604d33eae36e59c15eee7523 (diff)
downloadandroid_packages_apps_Gallery2-d3d2e2763bb4187a2dd3ac350d3a3c51d092890a.tar.gz
android_packages_apps_Gallery2-d3d2e2763bb4187a2dd3ac350d3a3c51d092890a.tar.bz2
android_packages_apps_Gallery2-d3d2e2763bb4187a2dd3ac350d3a3c51d092890a.zip
Support rotation
Change-Id: Ic93bed50851f788803124ea2453128fd0497a746
Diffstat (limited to 'src/com/android/photos')
-rw-r--r--src/com/android/photos/shims/BitmapJobDrawable.java3
1 files changed, 3 insertions, 0 deletions
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 {