diff options
Diffstat (limited to 'src/com/android/camera/PhotoUI.java')
-rw-r--r-- | src/com/android/camera/PhotoUI.java | 20 |
1 files changed, 14 insertions, 6 deletions
diff --git a/src/com/android/camera/PhotoUI.java b/src/com/android/camera/PhotoUI.java index 43862d376..7adb27f90 100644 --- a/src/com/android/camera/PhotoUI.java +++ b/src/com/android/camera/PhotoUI.java @@ -147,15 +147,24 @@ public class PhotoUI implements PieListener, private class DecodeTask extends AsyncTask<Integer, Void, Bitmap> { private final byte [] mData; + private int mOrientation; - public DecodeTask(byte[] data) { + public DecodeTask(byte[] data, int orientation) { mData = data; + mOrientation = orientation; } @Override protected Bitmap doInBackground(Integer... params) { // Decode image in background. - return CameraUtil.downSample(mData, DOWN_SAMPLE_FACTOR); + Bitmap bitmap = CameraUtil.downSample(mData, DOWN_SAMPLE_FACTOR); + if (mOrientation != 0) { + Matrix m = new Matrix(); + m.postRotate(mOrientation); + return Bitmap.createBitmap(bitmap, 0, 0, bitmap.getWidth(), bitmap.getHeight(), m, + false); + } + return bitmap; } @Override @@ -299,9 +308,9 @@ public class PhotoUI implements PieListener, updateOnScreenIndicators(params, prefGroup, prefs); } - public void animateCapture(final byte[] jpegData) { + public void animateCapture(final byte[] jpegData, int orientation) { // Decode jpeg byte array and then animate the jpeg - DecodeTask task = new DecodeTask(jpegData); + DecodeTask task = new DecodeTask(jpegData, orientation); task.execute(); } @@ -321,8 +330,7 @@ public class PhotoUI implements PieListener, mPreviewThumb.setOnClickListener(new OnClickListener() { @Override public void onClick(View v) { - // TODO: go to filmstrip - // mActivity.gotoGallery(); + mActivity.gotoGallery(); } }); mMenuButton = mRootView.findViewById(R.id.menu); |