diff options
author | Andrew Lee <anwlee@google.com> | 2014-08-22 14:53:20 -0700 |
---|---|---|
committer | Andrew Lee <anwlee@google.com> | 2014-08-22 16:01:26 -0700 |
commit | 79858d44ebdf946712a801988a827d46d7f7cbe8 (patch) | |
tree | b2ca240c839f3fb13a0fdad35a0c9f34a4376c5f | |
parent | 3e8c8b99868aa7a50b1b53eddb78f9f775ca5416 (diff) |
Remove generic call merge button.
We now use the same button component for merge. Formerly, it seems
that it was included in the "extra button row" to accomodate the
add and merge options both showing at the same time. Now, we handle
this as an additional scenario for the overflow menu button.
This is prework in order to be able to delete the extra button row,
and add a different "row" for the conferece call manager.
Bug: 15862303
Change-Id: I278ea17291d8daf3c5201116a10e3641b5deb4e1
-rw-r--r-- | InCallUI/res/layout-land/call_card_content.xml | 3 | ||||
-rw-r--r-- | InCallUI/res/layout/call_card_content.xml | 5 | ||||
-rw-r--r-- | InCallUI/res/layout/extra_button_row.xml | 24 | ||||
-rw-r--r-- | InCallUI/res/layout/secondary_call_info.xml | 2 | ||||
-rw-r--r-- | InCallUI/res/values/colors.xml | 2 | ||||
-rw-r--r-- | InCallUI/src/com/android/incallui/CallButtonFragment.java | 12 | ||||
-rw-r--r-- | InCallUI/src/com/android/incallui/CallButtonPresenter.java | 67 |
7 files changed, 40 insertions, 75 deletions
diff --git a/InCallUI/res/layout-land/call_card_content.xml b/InCallUI/res/layout-land/call_card_content.xml index b1b527505..f3173532f 100644 --- a/InCallUI/res/layout-land/call_card_content.xml +++ b/InCallUI/res/layout-land/call_card_content.xml @@ -43,12 +43,15 @@ <FrameLayout android:layout_width="match_parent" android:layout_height="match_parent" > + <!-- Secondary "Call info" block, for the background ("on hold") call. --> <include layout="@layout/secondary_call_info" android:layout_width="match_parent" android:layout_height="wrap_content" android:layout_gravity="bottom" /> + </FrameLayout> + </LinearLayout> <!-- Contact photo for primary call info --> diff --git a/InCallUI/res/layout/call_card_content.xml b/InCallUI/res/layout/call_card_content.xml index 605d6300f..c45553f6d 100644 --- a/InCallUI/res/layout/call_card_content.xml +++ b/InCallUI/res/layout/call_card_content.xml @@ -96,10 +96,7 @@ </FrameLayout> <!-- Secondary "Call info" block, for the background ("on hold") call. --> - <include layout="@layout/secondary_call_info" - android:layout_width="match_parent" - android:layout_height="wrap_content" - android:layout_alignParentBottom="true"/> + <include layout="@layout/secondary_call_info" /> <!-- Placeholder for the dialpad which is replaced with the dialpad fragment when shown. --> <FrameLayout diff --git a/InCallUI/res/layout/extra_button_row.xml b/InCallUI/res/layout/extra_button_row.xml index 1bff4c550..417c4d6b9 100644 --- a/InCallUI/res/layout/extra_button_row.xml +++ b/InCallUI/res/layout/extra_button_row.xml @@ -46,28 +46,4 @@ android:text="@string/onscreenManageConferenceText" /> </LinearLayout> - <!-- CDMA-specific "Merge" --> - <!-- This button is used only on CDMA devices, where we can't use - the Merge button in the main button row (because the "Add Call" - button might need to be enabled at the same time.) --> - <LinearLayout android:id="@+id/cdmaMergeButton" - android:orientation="horizontal" - android:layout_width="match_parent" - android:layout_height="wrap_content" - android:paddingStart="@dimen/button_cluster_horizontal_padding" - android:paddingEnd="@dimen/button_cluster_horizontal_padding" - android:background="?android:attr/selectableItemBackground" - android:visibility="gone"> - <!-- The entire LinearLayout here is clickable, so we don't - care about clicks on the ImageButton itself. --> - <ImageButton android:id="@+id/cdmaMergeButtonImage" - android:clickable="false" - style="@style/InCallExtraRowButton" - android:src="@drawable/ic_toolbar_merge" - android:contentDescription="@string/onscreenMergeCallsText" /> - <TextView android:id="@+id/cdmaMergeButtonLabel" - style="@style/InCallExtraRowButtonLabel" - android:text="@string/onscreenMergeCallsText" /> - </LinearLayout> - </FrameLayout> diff --git a/InCallUI/res/layout/secondary_call_info.xml b/InCallUI/res/layout/secondary_call_info.xml index cbe1fa2f9..237559d46 100644 --- a/InCallUI/res/layout/secondary_call_info.xml +++ b/InCallUI/res/layout/secondary_call_info.xml @@ -27,7 +27,7 @@ android:paddingTop="@dimen/call_banner_secondary_call_top_bottom_padding" android:paddingBottom="@dimen/call_banner_secondary_call_top_bottom_padding" android:background="@color/incall_banner_secondary_background_color" - android:elevation="@dimen/secondary_call_elevation" > + android:elevation="@dimen/secondary_call_elevation"> <LinearLayout android:layout_width="0dp" diff --git a/InCallUI/res/values/colors.xml b/InCallUI/res/values/colors.xml index bd2642d64..3060339a0 100644 --- a/InCallUI/res/values/colors.xml +++ b/InCallUI/res/values/colors.xml @@ -62,7 +62,7 @@ <color name="glowpad_text_widget_ring_color">#ffffff</color> <color name="glowpad_widget_active_color">#ffffff</color> <color name="glowpad_text_widget_normal_tint">#cccccc</color> - <color name="glowpad_call_widget_normal_tint">#00e5ff</color> + <color name="glowpad_call_widget_normal_tint">@color/dialtacts_theme_color</color> <color name="glowpad_end_call_widget_normal_tint">#ff1744</color> <color name="glowpad_incoming_widget_tint">#a3a3a3</color> <color name="glowpad_incoming_widget_background_tint">#ffffff</color> diff --git a/InCallUI/src/com/android/incallui/CallButtonFragment.java b/InCallUI/src/com/android/incallui/CallButtonFragment.java index 09a3bc292..b58278bd9 100644 --- a/InCallUI/src/com/android/incallui/CallButtonFragment.java +++ b/InCallUI/src/com/android/incallui/CallButtonFragment.java @@ -60,7 +60,6 @@ public class CallButtonFragment private PopupMenu mOverflowPopup; private View mExtraRowButton; private View mManageConferenceButton; - private View mGenericMergeButton; private int mPrevAudioMode = 0; @@ -95,8 +94,6 @@ public class CallButtonFragment mManageConferenceButton = parent.findViewById(R.id.manageConferenceButton); mManageConferenceButton.setOnClickListener(this); - mGenericMergeButton = parent.findViewById(R.id.cdmaMergeButton); - mGenericMergeButton.setOnClickListener(this); mAudioButton = (ImageButton) parent.findViewById(R.id.audioButton); mAudioButton.setOnClickListener(this); @@ -166,7 +163,6 @@ public class CallButtonFragment getPresenter().muteClicked(!button.isSelected()); break; } - case R.id.cdmaMergeButton: case R.id.mergeButton: getPresenter().mergeClicked(); break; @@ -674,14 +670,6 @@ public class CallButtonFragment public void showManageConferenceCallButton() { mExtraRowButton.setVisibility(View.VISIBLE); mManageConferenceButton.setVisibility(View.VISIBLE); - mGenericMergeButton.setVisibility(View.GONE); - } - - @Override - public void showGenericMergeButton() { - mExtraRowButton.setVisibility(View.VISIBLE); - mManageConferenceButton.setVisibility(View.GONE); - mGenericMergeButton.setVisibility(View.VISIBLE); } @Override diff --git a/InCallUI/src/com/android/incallui/CallButtonPresenter.java b/InCallUI/src/com/android/incallui/CallButtonPresenter.java index 93548dd7a..6a2419b35 100644 --- a/InCallUI/src/com/android/incallui/CallButtonPresenter.java +++ b/InCallUI/src/com/android/incallui/CallButtonPresenter.java @@ -39,7 +39,6 @@ public class CallButtonPresenter extends Presenter<CallButtonPresenter.CallButto private Call mCall; private boolean mAutomaticallyMuted = false; private boolean mPreviousMuteState = false; - private boolean mShowGenericMerge = false; private boolean mShowManageConference = false; private InCallCameraManager mInCallCameraManager; @@ -304,18 +303,6 @@ public class CallButtonPresenter extends Presenter<CallButtonPresenter.CallButto } ui.enableMute(call.can(PhoneCapabilities.MUTE)); - - // Finally, update the "extra button row": It's displayed above the "End" button, but only - // if necessary. It's never displayed while the dialpad is visible since it would overlap. - // - // The row contains two buttons: - // - "Manage conference" (used only on GSM devices) - // - "Merge" button (used only on CDMA devices) - final boolean canMerge = call.can(PhoneCapabilities.MERGE_CALLS); - final boolean isGenericConference = call.can(PhoneCapabilities.GENERIC_CONFERENCE); - mShowGenericMerge = isGenericConference && canMerge; - mShowManageConference = (call.isConferenceCall() && !isGenericConference); - updateExtraButtonRow(ui.isDialpadVisible()); } private void updateVideoCallButtons() { @@ -360,20 +347,18 @@ public class CallButtonPresenter extends Presenter<CallButtonPresenter.CallButto final boolean canMerge = call.can(PhoneCapabilities.MERGE_CALLS); final boolean canAdd = call.can(PhoneCapabilities.ADD_CALL); - final boolean isGenericConference = call.can(PhoneCapabilities.GENERIC_CONFERENCE); final boolean canHold = call.can(PhoneCapabilities.HOLD); final boolean canSwap = call.can(PhoneCapabilities.SWAP_CALLS); final boolean supportHold = call.can(PhoneCapabilities.SUPPORT_HOLD); + final boolean isGenericConference = call.can(PhoneCapabilities.GENERIC_CONFERENCE); + boolean canVideoCall = call.can(PhoneCapabilities.SUPPORTS_VT_LOCAL) && call.can(PhoneCapabilities.SUPPORTS_VT_REMOTE); - - final boolean showMerge = !isGenericConference && canMerge; - ui.showChangeToVideoButton(canVideoCall); - // Show either MERGE or ADD, but not both. - final boolean showMergeOption = showMerge; - final boolean showAddCallOption = !showMerge; + // Show either MERGE or ADD. Only show both if, for CDMA, we're in a generic conference. + final boolean showMergeOption = canMerge; + final boolean showAddCallOption = canAdd && (isGenericConference || !canMerge); final boolean enableAddCallOption = showAddCallOption && canAdd; // Show either HOLD or SWAP, but not both. // If neither HOLD or SWAP is available: @@ -384,8 +369,14 @@ public class CallButtonPresenter extends Presenter<CallButtonPresenter.CallButto final boolean showSwapOption = !canHold && canSwap; ui.setHold(call.getState() == Call.State.ONHOLD); - if (canVideoCall && (showAddCallOption || showMergeOption) - && (showHoldOption || showSwapOption)) { + // If we show video upgrade and add/merge and hold/swap, the overflow menu is needed. + final boolean isVideoOverflowScenario = canVideoCall + && (showAddCallOption || showMergeOption) && (showHoldOption || showSwapOption); + // If we show hold/swap, add, and merge simultaneously, the overflow menu is needed. + final boolean isCdmaConferenceOverflowScenario = + (showHoldOption || showSwapOption) && showMergeOption && showAddCallOption; + + if (isVideoOverflowScenario) { ui.showHoldButton(false); ui.showSwapButton(false); ui.showAddCallButton(false); @@ -398,28 +389,39 @@ public class CallButtonPresenter extends Presenter<CallButtonPresenter.CallButto showHoldOption && enableHoldOption /* showHoldMenuOption */, showSwapOption); } else { - ui.showMergeButton(showMergeOption); - ui.showAddCallButton(showAddCallOption); - ui.enableAddCall(enableAddCallOption); + if (isCdmaConferenceOverflowScenario) { + ui.showAddCallButton(false); + ui.showMergeButton(false); + + ui.configureOverflowMenu( + showMergeOption, + showAddCallOption && enableAddCallOption /* showAddMenuOption */, + false /* showHoldMenuOption */, + false /* showSwapMenuOption */); + } else { + ui.showMergeButton(showMergeOption); + ui.showAddCallButton(showAddCallOption); + ui.enableAddCall(enableAddCallOption); + } ui.showHoldButton(showHoldOption); ui.enableHold(enableHoldOption); ui.showSwapButton(showSwapOption); } + + // Only show the conference call button if we are not in a generic conference. + // On CDMA devices, instead of a conference call button we show "add" and "merge" buttons. + mShowManageConference = (call.isConferenceCall() && !isGenericConference); + updateExtraButtonRow(ui.isDialpadVisible()); } private void updateExtraButtonRow(boolean isDialpadVisible) { - final boolean showExtraButtonRow = (mShowGenericMerge || mShowManageConference) && - !isDialpadVisible; + final boolean showExtraButtonRow = mShowManageConference && !isDialpadVisible; - Log.d(this, "isGeneric: " + mShowGenericMerge); Log.d(this, "mShowManageConference : " + mShowManageConference); - Log.d(this, "mShowGenericMerge: " + mShowGenericMerge); Log.d(this, "isDialpadVisible: " + isDialpadVisible); if (showExtraButtonRow) { - if (mShowGenericMerge) { - getUi().showGenericMergeButton(); - } else if (mShowManageConference) { + if (mShowManageConference) { getUi().showManageConferenceCallButton(); } } else { @@ -466,7 +468,6 @@ public class CallButtonPresenter extends Presenter<CallButtonPresenter.CallButto void configureOverflowMenu(boolean showMergeMenuOption, boolean showAddMenuOption, boolean showHoldMenuOption, boolean showSwapMenuOption); void showManageConferenceCallButton(); - void showGenericMergeButton(); void hideExtraRow(); void displayManageConferencePanel(boolean on); } |