diff options
author | Hideki Ishii <hideki.ishii@sony.com> | 2017-07-25 21:29:43 +0900 |
---|---|---|
committer | Michael Bestas <mkbestas@lineageos.org> | 2020-05-24 20:09:50 +0300 |
commit | a0c5bdd1a071cc593e7d67f3a48274ab5f852c8b (patch) | |
tree | 59fc6dfdb1965f229db6fda481faff4c77457d6a | |
parent | e7523ef16127591c61943de822fb15806709fc9a (diff) | |
download | android_packages_apps_Dialer-a0c5bdd1a071cc593e7d67f3a48274ab5f852c8b.tar.gz android_packages_apps_Dialer-a0c5bdd1a071cc593e7d67f3a48274ab5f852c8b.tar.bz2 android_packages_apps_Dialer-a0c5bdd1a071cc593e7d67f3a48274ab5f852c8b.zip |
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
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 9d9f5bf3f..b65979241 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. 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(); } |