summaryrefslogtreecommitdiff
path: root/java
diff options
context:
space:
mode:
authorHideki Ishii <hideki.ishii@sony.com>2019-04-16 17:27:06 -0700
committerandroid-build-merger <android-build-merger@google.com>2019-04-16 17:27:06 -0700
commitefe0fce79fa597e5413d56071bfda81a275b2ec8 (patch)
tree86a392fe7b13362d53946558463e1401a6658923 /java
parent534ce67669fbc8cd7e96546ac13edf4feb7999a3 (diff)
parentfc10e63786347b2b1d92936ec94ac54dd94092ee (diff)
Merge "Fix for button flickering issue when video call screen rotates" am: 890dcce1a5
am: fc10e63786 Change-Id: I0d5a7576d0f1e6d2aee25db615a2459827127be1
Diffstat (limited to 'java')
-rw-r--r--java/com/android/incallui/VideoCallPresenter.java5
-rw-r--r--java/com/android/incallui/video/impl/VideoCallFragment.java37
-rw-r--r--java/com/android/incallui/video/protocol/VideoCallScreenDelegate.java2
3 files changed, 44 insertions, 0 deletions
diff --git a/java/com/android/incallui/VideoCallPresenter.java b/java/com/android/incallui/VideoCallPresenter.java
index 1700d530d..0d1d1a5e0 100644
--- a/java/com/android/incallui/VideoCallPresenter.java
+++ b/java/com/android/incallui/VideoCallPresenter.java
@@ -431,6 +431,11 @@ public class VideoCallPresenter
InCallPresenter.getInstance().getInCallCameraManager().onCameraPermissionGranted();
}
+ @Override
+ public boolean isFullscreen() {
+ return InCallPresenter.getInstance().isFullscreen();
+ }
+
/**
* Called when the user interacts with the UI. If a fullscreen timer is pending then we start the
* timer from scratch to avoid having the UI disappear while the user is interacting with it.
diff --git a/java/com/android/incallui/video/impl/VideoCallFragment.java b/java/com/android/incallui/video/impl/VideoCallFragment.java
index 3a355c47a..edfc17c46 100644
--- a/java/com/android/incallui/video/impl/VideoCallFragment.java
+++ b/java/com/android/incallui/video/impl/VideoCallFragment.java
@@ -306,6 +306,30 @@ public class VideoCallFragment extends Fragment
updatePreviewOffView();
}
});
+
+ controls.addOnLayoutChangeListener(
+ new OnLayoutChangeListener() {
+ @Override
+ public void onLayoutChange(
+ View v,
+ int left,
+ int top,
+ int right,
+ int bottom,
+ int oldLeft,
+ int oldTop,
+ int oldRight,
+ int oldBottom) {
+ LogUtil.i("VideoCallFragment.onLayoutChange", "controls layout changed");
+ if (getActivity() != null && getView() != null) {
+ controls.removeOnLayoutChangeListener(this);
+ if (isInFullscreenMode) {
+ enterFullscreenMode();
+ }
+ }
+ }
+ });
+
return view;
}
@@ -334,6 +358,12 @@ public class VideoCallFragment extends Fragment
inCallButtonUiDelegate.onInCallButtonUiReady(this);
view.setOnSystemUiVisibilityChangeListener(this);
+
+ if (videoCallScreenDelegate.isFullscreen()) {
+ controls.setVisibility(View.INVISIBLE);
+ contactGridManager.getContainerView().setVisibility(View.INVISIBLE);
+ endCallButton.setVisibility(View.INVISIBLE);
+ }
}
@Override
@@ -420,6 +450,13 @@ public class VideoCallFragment extends Fragment
.translationY(0)
.setInterpolator(linearOutSlowInInterpolator)
.alpha(1)
+ .withStartAction(
+ new Runnable() {
+ @Override
+ public void run() {
+ controls.setVisibility(View.VISIBLE);
+ }
+ })
.start();
// Animate onHold to the shown state.
diff --git a/java/com/android/incallui/video/protocol/VideoCallScreenDelegate.java b/java/com/android/incallui/video/protocol/VideoCallScreenDelegate.java
index 55ea23f5e..9dd545080 100644
--- a/java/com/android/incallui/video/protocol/VideoCallScreenDelegate.java
+++ b/java/com/android/incallui/video/protocol/VideoCallScreenDelegate.java
@@ -48,4 +48,6 @@ public interface VideoCallScreenDelegate {
void setSurfaceViews(SurfaceView preview, SurfaceView remote);
int getDeviceOrientation();
+
+ boolean isFullscreen();
}