From a860052619d1c3d13a33629e97a8e05509fa0e1b 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: I44ae0e94e214892776487bff4cc09be8c5640db1 --- .../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(-) diff --git a/InCallUI/src/com/android/incallui/CallCardFragment.java b/InCallUI/src/com/android/incallui/CallCardFragment.java index 3efdb7570..e7d4f4836 100644 --- a/InCallUI/src/com/android/incallui/CallCardFragment.java +++ b/InCallUI/src/com/android/incallui/CallCardFragment.java @@ -183,6 +183,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); } } @@ -955,11 +958,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() { @@ -1061,7 +1071,9 @@ public class CallCardPresenter extends Presenter void setPrimary(String number, String name, boolean nameIsNumber, String label, Drawable photo, boolean isSipCall, boolean isContactPhotoShown); 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 33e4e5ace..d4d95bc54 100644 --- a/InCallUI/src/com/android/incallui/InCallPresenter.java +++ b/InCallUI/src/com/android/incallui/InCallPresenter.java @@ -1174,6 +1174,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. @@ -1796,6 +1811,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 ce14e48f9..eca9ab883 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; /** @@ -105,6 +106,8 @@ public class VideoCallFragment extends BaseFragment