summaryrefslogtreecommitdiffstats
path: root/src/com
diff options
context:
space:
mode:
Diffstat (limited to 'src/com')
-rwxr-xr-xsrc/com/android/camera/panorama/PanoramaActivity.java13
-rw-r--r--src/com/android/camera/ui/SharePopup.java5
2 files changed, 10 insertions, 8 deletions
diff --git a/src/com/android/camera/panorama/PanoramaActivity.java b/src/com/android/camera/panorama/PanoramaActivity.java
index ab4f0af..82d2f3d 100755
--- a/src/com/android/camera/panorama/PanoramaActivity.java
+++ b/src/com/android/camera/panorama/PanoramaActivity.java
@@ -778,11 +778,14 @@ public class PanoramaActivity extends ActivityBase implements
int orientation = Exif.getOrientation(jpeg.data);
Uri uri = savePanorama(jpeg.data, jpeg.width, jpeg.height, orientation);
if (uri != null) {
- // Create a thumbnail whose width is equal or bigger
- // than the entire screen.
- int ratio = (int) Math.ceil((double) jpeg.width /
- mPanoLayout.getWidth());
- int inSampleSize = Integer.highestOneBit(ratio);
+ // Create a thumbnail whose width or height is equal or bigger
+ // than the screen's width or height.
+ int widthRatio = (int) Math.ceil((double) jpeg.width
+ / mPanoLayout.getWidth());
+ int heightRatio = (int) Math.ceil((double) jpeg.height
+ / mPanoLayout.getHeight());
+ int inSampleSize = Integer.highestOneBit(
+ Math.max(widthRatio, heightRatio));
mThumbnail = Thumbnail.createThumbnail(
jpeg.data, orientation, inSampleSize, uri);
}
diff --git a/src/com/android/camera/ui/SharePopup.java b/src/com/android/camera/ui/SharePopup.java
index 92abb8a..d83ad11 100644
--- a/src/com/android/camera/ui/SharePopup.java
+++ b/src/com/android/camera/ui/SharePopup.java
@@ -198,10 +198,9 @@ public class SharePopup extends PopupWindow implements View.OnClickListener,
new RelativeLayout.LayoutParams(lpOld.width, lpOld.height);
mRootView.setBackgroundDrawable(null);
- if (mBitmapWidth > mBitmapHeight*2) {
+ if (mBitmapWidth > mBitmapHeight * 2 || mBitmapHeight > mBitmapWidth * 2) {
// panorama image
- lpNew.addRule(RelativeLayout.ALIGN_PARENT_LEFT);
- lpNew.addRule(RelativeLayout.ALIGN_PARENT_RIGHT);
+ lpNew.addRule(RelativeLayout.CENTER_HORIZONTAL);
lpNew.addRule(RelativeLayout.CENTER_VERTICAL);
// panorama images block the preview from showing in the background