diff options
Diffstat (limited to 'InCallUI/src/com/android/incallui/VideoCallFragment.java')
-rw-r--r-- | InCallUI/src/com/android/incallui/VideoCallFragment.java | 24 |
1 files changed, 22 insertions, 2 deletions
diff --git a/InCallUI/src/com/android/incallui/VideoCallFragment.java b/InCallUI/src/com/android/incallui/VideoCallFragment.java index 63a031044..cea9c4d90 100644 --- a/InCallUI/src/com/android/incallui/VideoCallFragment.java +++ b/InCallUI/src/com/android/incallui/VideoCallFragment.java @@ -21,6 +21,7 @@ import android.graphics.Point; import android.graphics.SurfaceTexture; import android.os.Bundle; import android.view.Display; +import android.view.Gravity; import android.view.LayoutInflater; import android.view.Surface; import android.view.TextureView; @@ -115,7 +116,7 @@ public class VideoCallFragment extends BaseFragment<VideoCallPresenter, * changes. */ private static class VideoCallSurface implements TextureView.SurfaceTextureListener, - View.OnClickListener, View.OnAttachStateChangeListener { + View.OnClickListener, View.OnAttachStateChangeListener, View.OnLongClickListener { private int mSurfaceId; private VideoCallPresenter mPresenter; private TextureView mTextureView; @@ -174,6 +175,7 @@ public class VideoCallFragment extends BaseFragment<VideoCallPresenter, mTextureView = view; mTextureView.setSurfaceTextureListener(this); mTextureView.setOnClickListener(this); + mTextureView.setOnLongClickListener(this); final boolean areSameSurfaces = Objects.equal(mSavedSurfaceTexture, mTextureView.getSurfaceTexture()); @@ -412,6 +414,18 @@ public class VideoCallFragment extends BaseFragment<VideoCallPresenter, } /** + * Handles a user long pressing on the surface, which is the trigger to show the + * picture mode pop up alert dialog + * + * @param View The view receiving the long press. + */ + @Override + public boolean onLongClick(View v) { + Log.d(this, "onLongClick:"); + return mPresenter.onLongClick(); + } + + /** * Returns the dimensions of the surface. * * @return The dimensions of the surface. @@ -690,9 +704,15 @@ public class VideoCallFragment extends BaseFragment<VideoCallPresenter, preview.setLayoutParams(params); if (mPreviewVideoContainer != null) { - ViewGroup.LayoutParams containerParams = mPreviewVideoContainer.getLayoutParams(); + FrameLayout.LayoutParams containerParams = (FrameLayout.LayoutParams) + mPreviewVideoContainer.getLayoutParams(); containerParams.width = width; containerParams.height = height; + if (getPresenter().isCameraPreviewMode()) { + containerParams.gravity = Gravity.CENTER; + } else { + containerParams.gravity = Gravity.BOTTOM | Gravity.RIGHT; + } mPreviewVideoContainer.setLayoutParams(containerParams); } |