summaryrefslogtreecommitdiff
path: root/InCallUI/src/com/android/incallui
diff options
context:
space:
mode:
authorAndrew Lee <anwlee@google.com>2014-08-22 18:11:31 -0700
committerAndrew Lee <anwlee@google.com>2014-08-22 18:43:15 -0700
commit1da81ce59cfbebd4e53fdfd2011e859069120de7 (patch)
treea0bbfdf8fa969627afc08ccfd82ce7ac88a1093a /InCallUI/src/com/android/incallui
parent5ef89ed01f89a78c28b09b4d4a218c6a47a9d03e (diff)
Move "manage conference calls" button above photo.
- Remove it from the CallButtonFragment. This meant that related logic was removed from CallButtonFragment/Presenter, and similar logic was added to the CallCardFragment/Presenter. - Delete old groups icons. (new ones added in ContactsCommon) - Delete the extra_button_row logic. + Replace extra_button_row with a dedicated "manage conference calls" button, and added to call card content layouts. + Style the new button to be similar to the secondary call info. Bug: 15862303 Change-Id: I2b4e1a3a30422c7d5e9c01479f13291a785d85f3
Diffstat (limited to 'InCallUI/src/com/android/incallui')
-rw-r--r--InCallUI/src/com/android/incallui/CallButtonFragment.java28
-rw-r--r--InCallUI/src/com/android/incallui/CallButtonPresenter.java27
-rw-r--r--InCallUI/src/com/android/incallui/CallCardFragment.java33
-rw-r--r--InCallUI/src/com/android/incallui/CallCardPresenter.java13
-rw-r--r--InCallUI/src/com/android/incallui/InCallActivity.java6
5 files changed, 42 insertions, 65 deletions
diff --git a/InCallUI/src/com/android/incallui/CallButtonFragment.java b/InCallUI/src/com/android/incallui/CallButtonFragment.java
index 5744cc5a1..14d1363ab 100644
--- a/InCallUI/src/com/android/incallui/CallButtonFragment.java
+++ b/InCallUI/src/com/android/incallui/CallButtonFragment.java
@@ -58,8 +58,6 @@ public class CallButtonFragment
private PopupMenu mAudioModePopup;
private boolean mAudioModePopupVisible;
private PopupMenu mOverflowPopup;
- private View mExtraRowButton;
- private View mManageConferenceButton;
private int mPrevAudioMode = 0;
@@ -90,11 +88,6 @@ public class CallButtonFragment
Bundle savedInstanceState) {
final View parent = inflater.inflate(R.layout.call_button_fragment, container, false);
- mExtraRowButton = parent.findViewById(R.id.extraButtonRow);
-
- mManageConferenceButton = parent.findViewById(R.id.manageConferenceButton);
- mManageConferenceButton.setOnClickListener(this);
-
mAudioButton = (ImageButton) parent.findViewById(R.id.audioButton);
mAudioButton.setOnClickListener(this);
mChangeToVoiceButton = (ImageButton) parent.findViewById(R.id.changeToVoiceButton);
@@ -191,9 +184,6 @@ public class CallButtonFragment
case R.id.overflowButton:
mOverflowPopup.show();
break;
- case R.id.manageConferenceButton:
- getPresenter().manageConferenceButtonClicked();
- break;
default:
Log.wtf(this, "onClick: unexpected");
break;
@@ -660,28 +650,10 @@ public class CallButtonFragment
}
@Override
- public void displayManageConferencePanel(boolean value) {
- if (getActivity() != null && getActivity() instanceof InCallActivity) {
- ((InCallActivity) getActivity()).displayManageConferencePanel(value);
- }
- }
-
- @Override
public Context getContext() {
return getActivity();
}
- @Override
- public void showManageConferenceCallButton() {
- mExtraRowButton.setVisibility(View.VISIBLE);
- mManageConferenceButton.setVisibility(View.VISIBLE);
- }
-
- @Override
- public void hideExtraRow() {
- mExtraRowButton.setVisibility(View.GONE);
- }
-
private void maybeSendAccessibilityEvent(View view, int stringId) {
final Context context = getActivity();
AccessibilityManager manager =
diff --git a/InCallUI/src/com/android/incallui/CallButtonPresenter.java b/InCallUI/src/com/android/incallui/CallButtonPresenter.java
index 393c0f6ac..8a5170c88 100644
--- a/InCallUI/src/com/android/incallui/CallButtonPresenter.java
+++ b/InCallUI/src/com/android/incallui/CallButtonPresenter.java
@@ -165,10 +165,6 @@ public class CallButtonPresenter extends Presenter<CallButtonPresenter.CallButto
setAudioMode(newMode);
}
- public void manageConferenceButtonClicked() {
- getUi().displayManageConferencePanel(true);
- }
-
public void muteClicked(boolean checked) {
Log.d(this, "turning on mute: " + checked);
TelecommAdapter.getInstance().mute(checked);
@@ -219,7 +215,6 @@ public class CallButtonPresenter extends Presenter<CallButtonPresenter.CallButto
public void showDialpadClicked(boolean checked) {
Log.v(this, "Show dialpad " + String.valueOf(checked));
getUi().displayDialpad(checked /* show */, true /* animate */);
- updateExtraButtonRow(checked);
}
public void changeToVideoClicked() {
@@ -409,25 +404,6 @@ public class CallButtonPresenter extends Presenter<CallButtonPresenter.CallButto
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 = mShowManageConference && !isDialpadVisible;
-
- Log.d(this, "mShowManageConference : " + mShowManageConference);
- Log.d(this, "isDialpadVisible: " + isDialpadVisible);
- if (showExtraButtonRow) {
- if (mShowManageConference) {
- getUi().showManageConferenceCallButton();
- }
- } else {
- getUi().hideExtraRow();
- }
}
public void refreshMuteState() {
@@ -468,9 +444,6 @@ public class CallButtonPresenter extends Presenter<CallButtonPresenter.CallButto
void setSupportedAudio(int mask);
void configureOverflowMenu(boolean showMergeMenuOption, boolean showAddMenuOption,
boolean showHoldMenuOption, boolean showSwapMenuOption);
- void showManageConferenceCallButton();
- void hideExtraRow();
- void displayManageConferencePanel(boolean on);
Context getContext();
}
}
diff --git a/InCallUI/src/com/android/incallui/CallCardFragment.java b/InCallUI/src/com/android/incallui/CallCardFragment.java
index bd32684d0..600689c84 100644
--- a/InCallUI/src/com/android/incallui/CallCardFragment.java
+++ b/InCallUI/src/com/android/incallui/CallCardFragment.java
@@ -90,6 +90,8 @@ public class CallCardFragment extends BaseFragment<CallCardPresenter, CallCardPr
private ImageView mSecondaryCallProviderIcon;
private View mProgressSpinner;
+ private View mManageConferenceCallButton;
+
// Dark number info bar
private TextView mInCallMessageLabel;
@@ -165,10 +167,9 @@ public class CallCardFragment extends BaseFragment<CallCardPresenter, CallCardPr
mPhoneNumber = (TextView) view.findViewById(R.id.phoneNumber);
mPrimaryName = (TextView) view.findViewById(R.id.name);
mNumberLabel = (TextView) view.findViewById(R.id.label);
- mSecondaryCallInfo = (View) view.findViewById(R.id.secondary_call_info);
- mSecondaryCallProviderInfo = (View) view.findViewById(R.id.secondary_call_provider_info);
+ mSecondaryCallInfo = view.findViewById(R.id.secondary_call_info);
+ mSecondaryCallProviderInfo = view.findViewById(R.id.secondary_call_provider_info);
mPhoto = (ImageView) view.findViewById(R.id.photo);
- mCallStateButton = view.findViewById(R.id.callStateButton);
mCallStateIcon = (ImageView) view.findViewById(R.id.callStateIcon);
mCallStateVideoCallIcon = (ImageView) view.findViewById(R.id.videoCallIcon);
mCallStateLabel = (TextView) view.findViewById(R.id.callStateLabel);
@@ -215,15 +216,25 @@ public class CallCardFragment extends BaseFragment<CallCardPresenter, CallCardPr
}
});
- mPrimaryName.setElegantTextHeight(false);
- mCallStateLabel.setElegantTextHeight(false);
-
+ mCallStateButton = view.findViewById(R.id.callStateButton);
mCallStateButton.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
getPresenter().phoneAccountClicked();
}
});
+
+ mManageConferenceCallButton = view.findViewById(R.id.manage_conference_call_button);
+ mManageConferenceCallButton.setOnClickListener(new View.OnClickListener() {
+ @Override
+ public void onClick(View v) {
+ InCallActivity activity = (InCallActivity) getActivity();
+ activity.showConferenceCallManager();
+ }
+ });
+
+ mPrimaryName.setElegantTextHeight(false);
+ mCallStateLabel.setElegantTextHeight(false);
}
@Override
@@ -840,6 +851,16 @@ public class CallCardFragment extends BaseFragment<CallCardPresenter, CallCardPr
mPhoto.setVisibility(isVisible ? View.VISIBLE : View.GONE);
}
+ /**
+ * Changes the visibility of the "manage conference call" button.
+ *
+ * @param visible Whether to set the button to be visible or not.
+ */
+ @Override
+ public void showManageConferenceCallButton(boolean visible) {
+ mManageConferenceCallButton.setVisibility(visible ? View.VISIBLE : View.GONE);
+ }
+
private void dispatchPopulateAccessibilityEvent(AccessibilityEvent event, View view) {
if (view == null) return;
final List<CharSequence> eventText = event.getText();
diff --git a/InCallUI/src/com/android/incallui/CallCardPresenter.java b/InCallUI/src/com/android/incallui/CallCardPresenter.java
index 5f98aa9df..b746267e8 100644
--- a/InCallUI/src/com/android/incallui/CallCardPresenter.java
+++ b/InCallUI/src/com/android/incallui/CallCardPresenter.java
@@ -249,6 +249,8 @@ public class CallCardPresenter extends Presenter<CallCardPresenter.CallCardUi>
callState != Call.State.ONHOLD));
}
+ maybeShowManageConferenceCallButton();
+
final boolean enableEndCallButton = Call.State.isConnectingOrConnected(callState) &&
callState != Call.State.INCOMING && mPrimary != null;
// Hide the end call button instantly if we're receiving an incoming call.
@@ -291,6 +293,16 @@ public class CallCardPresenter extends Presenter<CallCardPresenter.CallCardUi>
}
}
+ /**
+ * Only show the conference call button if we are not in a generic conference.
+ * On CDMA devices, instead of a manage conference call button, we show "add" and "merge"
+ * buttons in the {@link CallButtonFragment}.
+ */
+ private void maybeShowManageConferenceCallButton() {
+ final boolean isGenericConference = mPrimary.can(PhoneCapabilities.GENERIC_CONFERENCE);
+ getUi().showManageConferenceCallButton(mPrimary.isConferenceCall() && !isGenericConference);
+ }
+
private void setCallbackNumber() {
String callbackNumber = null;
@@ -658,6 +670,7 @@ public class CallCardPresenter extends Presenter<CallCardPresenter.CallCardUi>
void setCallbackNumber(String number, boolean isEmergencyCalls);
void setPhotoVisible(boolean isVisible);
void setProgressSpinnerVisible(boolean visible);
+ void showManageConferenceCallButton(boolean visible);
}
private TelecommManager getTelecommManager() {
diff --git a/InCallUI/src/com/android/incallui/InCallActivity.java b/InCallUI/src/com/android/incallui/InCallActivity.java
index 02635dccc..f09203369 100644
--- a/InCallUI/src/com/android/incallui/InCallActivity.java
+++ b/InCallUI/src/com/android/incallui/InCallActivity.java
@@ -586,10 +586,8 @@ public class InCallActivity extends Activity {
return mDialpadFragment != null && mDialpadFragment.isVisible();
}
- public void displayManageConferencePanel(boolean showPanel) {
- if (showPanel) {
- mConferenceManagerFragment.setVisible(true);
- }
+ public void showConferenceCallManager() {
+ mConferenceManagerFragment.setVisible(true);
}
public void showPostCharWaitDialog(String callId, String chars) {