diff options
author | Jay Wang <jaywang@codeaurora.org> | 2014-12-26 18:10:22 -0800 |
---|---|---|
committer | Byunghun Jeon <bjeon@codeaurora.org> | 2015-02-09 20:00:21 -0800 |
commit | 30b2309e7c40a46ea9506344c25b58c9e8ce8dde (patch) | |
tree | fde7703eb9feb2d676b522dfb2bf8c3d0b78b144 /src/com/android/camera/WideAnglePanoramaUI.java | |
parent | 5e266938aac08975bbe198915adda22cc59ffebe (diff) | |
download | android_packages_apps_Snap-30b2309e7c40a46ea9506344c25b58c9e8ce8dde.tar.gz android_packages_apps_Snap-30b2309e7c40a46ea9506344c25b58c9e8ce8dde.tar.bz2 android_packages_apps_Snap-30b2309e7c40a46ea9506344c25b58c9e8ce8dde.zip |
SnapdragonCamera: Add FullScreen Preview when in Panoramic shoot
Changed the Panoramic preview to full screen
Resized the warped preview image to smaller Size
and render on top of the full screen preview image
Warped preview image can be turned on/off
Change-Id: I859839542ce94c5f70d7fe7983e93b5e9534b415
Diffstat (limited to 'src/com/android/camera/WideAnglePanoramaUI.java')
-rw-r--r-- | src/com/android/camera/WideAnglePanoramaUI.java | 54 |
1 files changed, 41 insertions, 13 deletions
diff --git a/src/com/android/camera/WideAnglePanoramaUI.java b/src/com/android/camera/WideAnglePanoramaUI.java index 53b1630b1..7941ea88c 100644 --- a/src/com/android/camera/WideAnglePanoramaUI.java +++ b/src/com/android/camera/WideAnglePanoramaUI.java @@ -35,6 +35,7 @@ import android.graphics.drawable.Drawable; import android.os.Build; import android.util.Log; import android.view.Gravity; +import android.view.Display; import android.view.LayoutInflater; import android.view.TextureView; import android.view.View; @@ -100,6 +101,7 @@ public class WideAnglePanoramaUI implements private View mPreviewCover; private int mOrientation; + private int mPreviewYOffset; /** Constructor. */ public WideAnglePanoramaUI( @@ -353,6 +355,39 @@ public class WideAnglePanoramaUI implements } } + private void setPanoramaPreviewView() { + int rotation = mActivity.getWindowManager().getDefaultDisplay().getRotation(); + Display display = mActivity.getWindowManager().getDefaultDisplay(); + Point size = new Point(); + display.getSize(size); + + int width = size.x; + int height = size.y; + int xOffset = 0; + int yOffset = 0; + int w = width; + int h = height; + + h = w * 4 / 3; + yOffset = (height - h) / 2; + + FrameLayout.LayoutParams param = new FrameLayout.LayoutParams(w, h); + mTextureView.setLayoutParams(param); + mTextureView.setX(xOffset); + mTextureView.setY(yOffset); + mPreviewBorder.setLayoutParams(param); + mPreviewBorder.setX(xOffset); + mPreviewBorder.setY(yOffset); + mPreviewYOffset = yOffset; + + int t = mPreviewYOffset; + int b1 = mTextureView.getBottom() - mPreviewYOffset; + int r = mTextureView.getRight(); + int b2 = mTextureView.getBottom(); + + mCameraControls.setPreviewRatio(1.0f, true); + } + public void resetSavingProgress() { mSavingProgressBar.reset(); mSavingProgressBar.setRightIncreasing(true); @@ -441,6 +476,7 @@ public class WideAnglePanoramaUI implements mTextureView.setSurfaceTextureListener(this); mTextureView.addOnLayoutChangeListener(this); mCameraControls = (CameraControls) mRootView.findViewById(R.id.camera_controls); + setPanoramaPreviewView(); mDialogHelper = new DialogHelper(); setViews(appRes); @@ -449,14 +485,6 @@ public class WideAnglePanoramaUI implements private void setViews(Resources appRes) { int weight = appRes.getInteger(R.integer.SRI_pano_layout_weight); - LinearLayout.LayoutParams lp = (LinearLayout.LayoutParams) mPreviewLayout.getLayoutParams(); - lp.weight = weight; - mPreviewLayout.setLayoutParams(lp); - - lp = (LinearLayout.LayoutParams) mReview.getLayoutParams(); - lp.weight = weight; - mPreviewLayout.setLayoutParams(lp); - mSavingProgressBar = (PanoProgressBar) mRootView.findViewById(R.id.pano_saving_progress_bar); mSavingProgressBar.setIndicatorWidth(0); mSavingProgressBar.setMaxProgress(100); @@ -603,11 +631,11 @@ public class WideAnglePanoramaUI implements // | 3 | // `---------' =b2 // =r - int t = mPreviewLayout.getTop(); - int b1 = mPreviewLayout.getBottom(); - int r = mPreviewLayout.getRight(); - int b2 = mCaptureLayout.getBottom(); - + final View dummy = mRootView.findViewById(R.id.pano_dummy_layout); + int t = dummy.getTop(); + int b1 = dummy.getBottom(); + int r = dummy.getRight(); + int b2 = dummy.getBottom(); final FrameLayout progressLayout = (FrameLayout) mRootView.findViewById(R.id.pano_progress_layout); int pivotY = ((ViewGroup) progressLayout).getPaddingTop() |