From 6e21e8acf98b6b7a82eb1b328eb1cdca365962a7 Mon Sep 17 00:00:00 2001 From: Tyler Gunn Date: Thu, 14 May 2015 13:20:24 -0700 Subject: Fix issue where secondary call info overlaps video preview. Other issues: - Secondary caller info should not be shown when in fullscreen mode. Solution: - Added onSecondaryCallerInfoVisibilityChanged to InCallEventListener ( which is documented as a place for events between fragments). - In CallCard fragment, call notify listeners of this callback of the state change. - In VideoCallPresenter/Fragment, handle changes to the visibility of the secondary caller info box to shift the preview surface up or down. - Added hide/show animation for the secondary caller info when entering and exiting fullscreen mode. Bug: 20914754 Change-Id: I32ccccd6d881c494688de6d9a965f80c43d50e79 --- .../src/com/android/incallui/CallCardFragment.java | 108 +++++++++++++++++++-- .../com/android/incallui/CallCardPresenter.java | 22 ++++- .../src/com/android/incallui/InCallPresenter.java | 16 +++ .../com/android/incallui/VideoCallFragment.java | 29 ++++++ .../com/android/incallui/VideoCallPresenter.java | 18 ++++ 5 files changed, 178 insertions(+), 15 deletions(-) (limited to 'InCallUI') diff --git a/InCallUI/src/com/android/incallui/CallCardFragment.java b/InCallUI/src/com/android/incallui/CallCardFragment.java index 43cec89de..5c49a5723 100644 --- a/InCallUI/src/com/android/incallui/CallCardFragment.java +++ b/InCallUI/src/com/android/incallui/CallCardFragment.java @@ -160,6 +160,11 @@ public class CallCardFragment extends BaseFragment mSecondaryContactInfo.label, getCallProviderLabel(mSecondary), false /* isConference */, - mSecondary.isVideoCall(mContext)); + mSecondary.isVideoCall(mContext), + mIsFullscreen); } else { // Clear the secondary display info. ui.setSecondary(false, null, false, null, null, false /* isConference */, - false /* isVideoCall */); + false /* isVideoCall */, mIsFullscreen); } } @@ -762,11 +765,18 @@ public class CallCardPresenter extends Presenter */ @Override public void onFullscreenModeChanged(boolean isFullscreenMode) { + mIsFullscreen = isFullscreenMode; final CallCardUi ui = getUi(); if (ui == null) { return; } ui.setCallCardVisible(!isFullscreenMode); + ui.setSecondaryInfoVisible(!isFullscreenMode); + } + + @Override + public void onSecondaryCallerInfoVisibilityChanged(boolean isVisible, int height) { + // No-op - the Call Card is the origin of this event. } private boolean isPrimaryCallActive() { @@ -813,7 +823,9 @@ public class CallCardPresenter extends Presenter void setPrimary(String number, String name, boolean nameIsNumber, String label, Drawable photo, boolean isSipCall); void setSecondary(boolean show, String name, boolean nameIsNumber, String label, - String providerLabel, boolean isConference, boolean isVideoCall); + String providerLabel, boolean isConference, boolean isVideoCall, + boolean isFullscreen); + void setSecondaryInfoVisible(boolean visible); void setCallState(int state, int videoState, int sessionModificationState, DisconnectCause disconnectCause, String connectionLabel, Drawable connectionIcon, String gatewayNumber, boolean isWifi, diff --git a/InCallUI/src/com/android/incallui/InCallPresenter.java b/InCallUI/src/com/android/incallui/InCallPresenter.java index 4b8b56d47..ed61d05d5 100644 --- a/InCallUI/src/com/android/incallui/InCallPresenter.java +++ b/InCallUI/src/com/android/incallui/InCallPresenter.java @@ -946,6 +946,21 @@ public class InCallPresenter implements CallList.Listener { } } + /** + * Called by the {@link CallCardPresenter} to inform of a change in visibility of the secondary + * caller info bar. + * + * @param isVisible {@code true} if the secondary caller info is visible, {@code false} + * otherwise. + * @param height the height of the secondary caller info bar. + */ + public void notifySecondaryCallerInfoVisibilityChanged(boolean isVisible, int height) { + for (InCallEventListener listener : mInCallEventListeners) { + listener.onSecondaryCallerInfoVisibilityChanged(isVisible, height); + } + } + + /** * For some disconnected causes, we show a dialog. This calls into the activity to show * the dialog if appropriate for the call. @@ -1607,6 +1622,7 @@ public class InCallPresenter implements CallList.Listener { */ public interface InCallEventListener { public void onFullscreenModeChanged(boolean isFullscreenMode); + public void onSecondaryCallerInfoVisibilityChanged(boolean isVisible, int height); } public interface InCallUiListener { diff --git a/InCallUI/src/com/android/incallui/VideoCallFragment.java b/InCallUI/src/com/android/incallui/VideoCallFragment.java index 47c19e08e..5fdec7ce7 100644 --- a/InCallUI/src/com/android/incallui/VideoCallFragment.java +++ b/InCallUI/src/com/android/incallui/VideoCallFragment.java @@ -31,6 +31,7 @@ import android.view.ViewTreeObserver; import android.widget.FrameLayout; import android.widget.ImageView; +import com.android.phone.common.animation.AnimUtils; import com.google.common.base.Objects; /** @@ -103,6 +104,8 @@ public class VideoCallFragment extends BaseFragment