summaryrefslogtreecommitdiffstats
path: root/src/com/android/camera/VideoUI.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/VideoUI.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/VideoUI.java')
-rw-r--r--src/com/android/camera/VideoUI.java22
1 files changed, 13 insertions, 9 deletions
diff --git a/src/com/android/camera/VideoUI.java b/src/com/android/camera/VideoUI.java
index 4fcc20fbf..9eecd6bd6 100644
--- a/src/com/android/camera/VideoUI.java
+++ b/src/com/android/camera/VideoUI.java
@@ -118,13 +118,10 @@ public class VideoUI implements PieRenderer.PieListener,
private int mTopMargin = 0;
private int mBottomMargin = 0;
- 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();
- }
- };
+ public enum SURFACE_STATUS {
+ HIDE,
+ SURFACE_VIEW;
+ }
public void showPreviewCover() {
mPreviewCover.setVisibility(View.VISIBLE);
@@ -165,6 +162,14 @@ public class VideoUI implements PieRenderer.PieListener,
}
}
+ public synchronized void applySurfaceChange(SURFACE_STATUS status) {
+ if(status == SURFACE_STATUS.HIDE) {
+ mSurfaceView.setVisibility(View.GONE);
+ return;
+ }
+ mSurfaceView.setVisibility(View.VISIBLE);
+ }
+
public VideoUI(CameraActivity activity, VideoController controller, View parent) {
mActivity = activity;
mController = controller;
@@ -177,9 +182,7 @@ public class VideoUI implements PieRenderer.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() {
@Override
@@ -189,6 +192,7 @@ public class VideoUI implements PieRenderer.PieListener,
int width = right - left;
int height = bottom - top;
+ tryToCloseSubList();
if (mMaxPreviewWidth == 0 && mMaxPreviewHeight == 0) {
mMaxPreviewWidth = width;
mMaxPreviewHeight = height;