diff options
author | Angus Kong <shkong@google.com> | 2012-02-18 06:04:50 +0800 |
---|---|---|
committer | Angus Kong <shkong@google.com> | 2012-02-18 07:48:05 +0800 |
commit | efa3f22e42b31bfcf916610e01efe0bdc4940080 (patch) | |
tree | 88ba8aba26c6bdfc02ce7945f5cb8aba97e32d28 /src/com | |
parent | cb9bcc4c6444cb32509caa3c80461d247e7060ae (diff) | |
download | LegacyCamera-efa3f22e42b31bfcf916610e01efe0bdc4940080.zip LegacyCamera-efa3f22e42b31bfcf916610e01efe0bdc4940080.tar.gz LegacyCamera-efa3f22e42b31bfcf916610e01efe0bdc4940080.tar.bz2 |
Fix the share popup. DO NOT MERGE
Fix the share popup to comply with the new design:
1. Black background.
2. Image is centered.
3. Share popup won't rotate automatically.
bug:6031042
Change-Id: I86b15a19bc8f7598d444cd9032960ea02e251668
Diffstat (limited to 'src/com')
-rw-r--r-- | src/com/android/camera/ui/SharePopup.java | 34 |
1 files changed, 1 insertions, 33 deletions
diff --git a/src/com/android/camera/ui/SharePopup.java b/src/com/android/camera/ui/SharePopup.java index 43f3ae8..5032651 100644 --- a/src/com/android/camera/ui/SharePopup.java +++ b/src/com/android/camera/ui/SharePopup.java @@ -31,7 +31,6 @@ import android.graphics.Bitmap; import android.graphics.drawable.ColorDrawable; import android.graphics.drawable.Drawable; import android.net.Uri; -import android.view.Gravity; import android.view.LayoutInflater; import android.view.MotionEvent; import android.view.View; @@ -39,7 +38,6 @@ import android.view.ViewGroup; import android.view.ViewGroup.LayoutParams; import android.view.WindowManager; import android.widget.AdapterView; -import android.widget.FrameLayout; import android.widget.GridView; import android.widget.ImageView; import android.widget.PopupWindow; @@ -159,38 +157,10 @@ public class SharePopup extends PopupWindow implements View.OnClickListener, setFocusable(true); setAnimationStyle(R.style.AnimationPopup); createShareMenu(); - - adjustThumbnailPosition(); - } - - private void adjustThumbnailPosition() { - FrameLayout.LayoutParams lpOld = - (FrameLayout.LayoutParams) mThumbnailRotateLayout.getLayoutParams(); - FrameLayout.LayoutParams lpNew = - new FrameLayout.LayoutParams(lpOld.width, lpOld.height); - - mRootView.setBackgroundDrawable(null); - if (mBitmapWidth > mBitmapHeight * 2 || mBitmapHeight > mBitmapWidth * 2) { - // panorama image - lpNew.gravity = Gravity.CENTER_HORIZONTAL | Gravity.CENTER_VERTICAL; - - // panorama images block the preview from showing in the background - // use a special color here for that. - mRootView.setBackgroundColor( - mContext.getResources().getColor(R.color.share_popup_blackout)); - } else { - // landscape or portrait image - if (mActivityOrientation == ActivityInfo.SCREEN_ORIENTATION_PORTRAIT) { - lpNew.gravity = Gravity.BOTTOM; - } else { - lpNew.gravity = Gravity.RIGHT; - } - } - - mThumbnailRotateLayout.setLayoutParams(lpNew); } public void setOrientation(int orientation) { + if (isShowing()) return; mOrientation = orientation; int hPaddingRootView = mRootView.getPaddingLeft() + mRootView.getPaddingRight(); @@ -236,8 +206,6 @@ public class SharePopup extends PopupWindow implements View.OnClickListener, } mGotoGalleryRotate.setOrientation(orientation); - - adjustThumbnailPosition(); } @Override |