diff options
author | Andrew Lee <anwlee@google.com> | 2014-08-22 23:47:15 +0000 |
---|---|---|
committer | Android Git Automerger <android-git-automerger@android.com> | 2014-08-22 23:47:15 +0000 |
commit | 26aabaa8eebf3a29fb209f79a22fe3da08a60dce (patch) | |
tree | c65c2ff4b1fa01b3b8060a972f321cfd1e186bc4 /InCallUI | |
parent | 1daa875dc10bc49e8afe28e185b1306f80d4e7f0 (diff) | |
parent | 5ef89ed01f89a78c28b09b4d4a218c6a47a9d03e (diff) |
am a8b5c8f9: Merge "Remove generic call merge button." into lmp-dev
* commit 'a8b5c8f943c55619141cca0f82968ae575df5992':
Remove generic call merge button.
Diffstat (limited to 'InCallUI')
-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 74aeaf393..5744cc5a1 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; @@ -679,14 +675,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 6cdc657ac..393c0f6ac 100644 --- a/InCallUI/src/com/android/incallui/CallButtonPresenter.java +++ b/InCallUI/src/com/android/incallui/CallButtonPresenter.java @@ -40,7 +40,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; @@ -305,18 +304,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() { @@ -361,20 +348,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: @@ -385,8 +370,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); @@ -399,28 +390,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 { @@ -467,7 +469,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); Context getContext(); |