diff options
author | Linux Build Service Account <lnxbuild@localhost> | 2016-04-17 21:56:47 -0700 |
---|---|---|
committer | Gerrit - the friendly Code Review server <code-review@localhost> | 2016-04-17 21:56:47 -0700 |
commit | a136064e151b0aade3e06356b3b32991a1ea7201 (patch) | |
tree | 6e8d3c3d40a6ceee97c05ce7804528d5d132b290 /src/com/android/camera/PhotoUI.java | |
parent | b725102767aedd58057392053a8d7930626b329b (diff) | |
parent | cef16d76d423dbdb426046ad5a339c32b9ac6f75 (diff) | |
download | android_packages_apps_Snap-a136064e151b0aade3e06356b3b32991a1ea7201.tar.gz android_packages_apps_Snap-a136064e151b0aade3e06356b3b32991a1ea7201.tar.bz2 android_packages_apps_Snap-a136064e151b0aade3e06356b3b32991a1ea7201.zip |
Merge "SnapdragonCamera: Adjusting view initialization" into camera.lnx.1.0-dev.1.0
Diffstat (limited to 'src/com/android/camera/PhotoUI.java')
-rw-r--r-- | src/com/android/camera/PhotoUI.java | 36 |
1 files changed, 16 insertions, 20 deletions
diff --git a/src/com/android/camera/PhotoUI.java b/src/com/android/camera/PhotoUI.java index 5d428e432..d4503af77 100644 --- a/src/com/android/camera/PhotoUI.java +++ b/src/com/android/camera/PhotoUI.java @@ -160,26 +160,15 @@ public class PhotoUI implements PieListener, private int mOrientation; private float mScreenBrightness = 0.0f; + public enum SURFACE_STATUS { + HIDE, + SURFACE_VIEW; + } + public interface SurfaceTextureSizeChangedListener { public void onSurfaceTextureSizeChanged(int uncroppedWidth, int uncroppedHeight); } - private OnLayoutChangeListener mLayoutListener = new OnLayoutChangeListener() { - @Override - public void onLayoutChange(View v, int left, int top, int right, - int bottom, int oldLeft, int oldTop, int oldRight, int oldBottom) { - tryToCloseSubList(); - - Camera.Parameters parameters = ((PhotoModule)mController).getParameters(); - if(parameters != null) { - Camera.Size size = parameters.getPreviewSize(); - if (size != null) { - setAspectRatio((float) size.width / size.height); - } - } - } - }; - public CameraControls getCameraControls() { return mCameraControls; } @@ -233,6 +222,14 @@ public class PhotoUI implements PieListener, } } + public synchronized void applySurfaceChange(SURFACE_STATUS status) { + if(status == SURFACE_STATUS.HIDE) { + mSurfaceView.setVisibility(View.GONE); + return; + } + mSurfaceView.setVisibility(View.VISIBLE); + } + public PhotoUI(CameraActivity activity, PhotoController controller, View parent) { mActivity = activity; mController = controller; @@ -246,11 +243,8 @@ public class PhotoUI implements PieListener, mSurfaceHolder = mSurfaceView.getHolder(); mSurfaceHolder.addCallback(this); mSurfaceHolder.setType(SurfaceHolder.SURFACE_TYPE_PUSH_BUFFERS); - mSurfaceView.addOnLayoutChangeListener(mLayoutListener); Log.v(TAG, "Using mdp_preview_content (MDP path)"); - - View surfaceContainer = mRootView.findViewById(R.id.preview_container); - surfaceContainer.addOnLayoutChangeListener(new OnLayoutChangeListener() { + mSurfaceView.addOnLayoutChangeListener(new OnLayoutChangeListener() { @Override public void onLayoutChange(View v, int left, int top, int right, int bottom, int oldLeft, int oldTop, int oldRight, @@ -258,6 +252,8 @@ public class PhotoUI implements PieListener, int width = right - left; int height = bottom - top; + tryToCloseSubList(); + if (mMaxPreviewWidth == 0 && mMaxPreviewHeight == 0) { mMaxPreviewWidth = width; mMaxPreviewHeight = height; |