From e39b926e6d14275050261f2a86eb16416d5c0d6a Mon Sep 17 00:00:00 2001 From: Hideki Ishii Date: Tue, 25 Jul 2017 21:29:43 +0900 Subject: Fix for button flickering issue when video call screen rotates Issue: Buttons flicker when rotating video call screen and full screen mode. Because initial state of these buttons(components) are "visible". In full screen mode, these buttons should not be "visible" when video call screen is rotated. This patch modifies state of these buttons to "invisible" when video call screen rotates and isFullscreen()==True to fix the flicker issue. And, adding "enterFullscreenMode()" for getting correct view-size when changing layout by videocall-screen regenerated. Test: manual - Checked that not button flickering issue when video call screen during full screen mode rotates. Bug: 111242931 Change-Id: I271ae3fa395fa648a89c8debc5c0a76e1a0a5ecd --- .../incallui/video/impl/VideoCallFragment.java | 37 ++++++++++++++++++++++ 1 file changed, 37 insertions(+) (limited to 'java/com/android/incallui/video/impl') diff --git a/java/com/android/incallui/video/impl/VideoCallFragment.java b/java/com/android/incallui/video/impl/VideoCallFragment.java index 11b80ceb9..be78bc1ec 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 @@ -421,6 +451,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. -- cgit v1.2.3