summaryrefslogtreecommitdiffstats
path: root/src/com/android/camera/PhotoUI.java
diff options
context:
space:
mode:
authorJack Yoo <jyoo@codeaurora.org>2016-02-22 17:40:11 -0800
committerSteve Kondik <steve@cyngn.com>2016-08-14 00:05:32 -0700
commit1a18632c11d3f4593547e9afe309cad1f4ea7204 (patch)
treef9404217b3618c2ee987ea678e1819d6f35cfff7 /src/com/android/camera/PhotoUI.java
parent2e94604fc2fd300ce6fc14d027e6d87eca83d708 (diff)
downloadandroid_packages_apps_Snap-1a18632c11d3f4593547e9afe309cad1f4ea7204.tar.gz
android_packages_apps_Snap-1a18632c11d3f4593547e9afe309cad1f4ea7204.tar.bz2
android_packages_apps_Snap-1a18632c11d3f4593547e9afe309cad1f4ea7204.zip
SnapdragonCamera: Adjusting view initialization
Instead of removing and adding the entire root view, changing only core surface view on module change. Change-Id: I5c39cf23b2a58280f4e4e8484865bbed0b12e1cf CRs-Fixed: 979254
Diffstat (limited to 'src/com/android/camera/PhotoUI.java')
-rw-r--r--src/com/android/camera/PhotoUI.java20
1 files changed, 16 insertions, 4 deletions
diff --git a/src/com/android/camera/PhotoUI.java b/src/com/android/camera/PhotoUI.java
index a2d86313b..23ed1bad4 100644
--- a/src/com/android/camera/PhotoUI.java
+++ b/src/com/android/camera/PhotoUI.java
@@ -151,6 +151,11 @@ 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);
}
@@ -220,6 +225,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;
@@ -232,11 +245,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,
@@ -245,6 +255,8 @@ public class PhotoUI implements PieListener,
int height = bottom - top;
boolean isMaxSizeBeingValid = false;
+ tryToCloseSubList();
+
if (mMaxPreviewWidth == 0 && mMaxPreviewHeight == 0) {
mMaxPreviewWidth = width;
mMaxPreviewHeight = height;