From 137f67c0d87a8a28be94a07e1c7f05219aacbcb7 Mon Sep 17 00:00:00 2001 From: Andrew Lee Date: Fri, 18 Jul 2014 12:04:03 -0700 Subject: Show correct call buttons depending on voice/video call. Behaviors to be implemented in separate changelist. Renamed some of the methods to reference buttons, and rearranged the order in which buttons are listed and dealt with to be more consistent with the order in the layout. Bug: 16014280 Change-Id: I40a9137d222daf6959a869c11e6ac763baa61788 --- .../com/android/incallui/CallButtonFragment.java | 95 ++++++++++++++++++---- 1 file changed, 78 insertions(+), 17 deletions(-) (limited to 'InCallUI/src/com/android/incallui/CallButtonFragment.java') diff --git a/InCallUI/src/com/android/incallui/CallButtonFragment.java b/InCallUI/src/com/android/incallui/CallButtonFragment.java index 3b06f1af1..93bb00145 100644 --- a/InCallUI/src/com/android/incallui/CallButtonFragment.java +++ b/InCallUI/src/com/android/incallui/CallButtonFragment.java @@ -40,13 +40,18 @@ public class CallButtonFragment implements CallButtonPresenter.CallButtonUi, OnMenuItemClickListener, OnDismissListener, View.OnClickListener, CompoundButton.OnCheckedChangeListener { - private ImageButton mMuteButton; private ImageButton mAudioButton; - private ImageButton mHoldButton; + private ImageButton mChangeToVoiceButton; + private ImageButton mMuteButton; private ImageButton mShowDialpadButton; - private ImageButton mMergeButton; - private ImageButton mAddCallButton; + private ImageButton mHoldButton; private ImageButton mSwapButton; + private ImageButton mChangeToVideoButton; + private ImageButton mSwitchCameraButton; + private ImageButton mAddCallButton; + private ImageButton mMergeButton; + private ImageButton mPauseVideoButton; + private ImageButton mOverflowButton; private PopupMenu mAudioModePopup; private boolean mAudioModePopupVisible; @@ -125,14 +130,24 @@ public class CallButtonFragment } }); + mChangeToVoiceButton = (ImageButton) parent.findViewById(R.id.changeToVoiceButton); + mChangeToVoiceButton. setOnClickListener(this); mShowDialpadButton = (ImageButton) parent.findViewById(R.id.dialpadButton); mShowDialpadButton.setOnClickListener(this); + mSwapButton = (ImageButton) parent.findViewById(R.id.swapButton); + mSwapButton.setOnClickListener(this); + mChangeToVideoButton = (ImageButton) parent.findViewById(R.id.changeToVideoButton); + mChangeToVideoButton.setOnClickListener(this); + mSwitchCameraButton = (ImageButton) parent.findViewById(R.id.switchCameraButton); + mSwitchCameraButton.setOnClickListener(this); mAddCallButton = (ImageButton) parent.findViewById(R.id.addButton); mAddCallButton.setOnClickListener(this); mMergeButton = (ImageButton) parent.findViewById(R.id.mergeButton); mMergeButton.setOnClickListener(this); - mSwapButton = (ImageButton) parent.findViewById(R.id.swapButton); - mSwapButton.setOnClickListener(this); + mPauseVideoButton = (ImageButton) parent.findViewById(R.id.pauseVideoButton); + mPauseVideoButton.setOnClickListener(this); + mOverflowButton = (ImageButton) parent.findViewById(R.id.overflowButton); + mOverflowButton.setOnClickListener(this); return parent; } @@ -175,6 +190,13 @@ public class CallButtonFragment case R.id.dialpadButton: getPresenter().showDialpadClicked(!mShowDialpadButton.isSelected()); break; + case R.id.changeToVoiceButton: + case R.id.changeToVideoButton: + case R.id.switchCameraButton: + case R.id.pauseVideoButton: + case R.id.overflowButton: + // TODO: Implement these button behaviors. + break; default: Log.wtf(this, "onClick: unexpected"); break; @@ -189,14 +211,18 @@ public class CallButtonFragment view.setVisibility(View.VISIBLE); } - // The smaller buttons laid out horizontally just below the end-call button. - mMuteButton.setEnabled(isEnabled); mAudioButton.setEnabled(isEnabled); - mHoldButton.setEnabled(isEnabled); + mChangeToVoiceButton.setEnabled(isEnabled); + mMuteButton.setEnabled(isEnabled); mShowDialpadButton.setEnabled(isEnabled); - mMergeButton.setEnabled(isEnabled); - mAddCallButton.setEnabled(isEnabled); + mHoldButton.setEnabled(isEnabled); mSwapButton.setEnabled(isEnabled); + mChangeToVideoButton.setEnabled(isEnabled); + mSwitchCameraButton.setEnabled(isEnabled); + mAddCallButton.setEnabled(isEnabled); + mMergeButton.setEnabled(isEnabled); + mPauseVideoButton.setEnabled(isEnabled); + mOverflowButton.setEnabled(isEnabled); } @Override @@ -204,18 +230,33 @@ public class CallButtonFragment mMuteButton.setSelected(value); } + @Override + public void showAudioButton(boolean show) { + mAudioButton.setVisibility(show ? View.VISIBLE : View.GONE); + } + + @Override + public void showChangeToVoiceButton(boolean show) { + mChangeToVoiceButton.setVisibility(show ? View.VISIBLE : View.GONE); + } + @Override public void enableMute(boolean enabled) { mMuteButton.setEnabled(enabled); } + @Override + public void showDialpadButton(boolean show) { + mShowDialpadButton.setVisibility(show ? View.VISIBLE : View.GONE); + } + @Override public void setHold(boolean value) { mHoldButton.setSelected(value); } @Override - public void showHold(boolean show) { + public void showHoldButton(boolean show) { mHoldButton.setVisibility(show ? View.VISIBLE : View.GONE); } @@ -225,17 +266,22 @@ public class CallButtonFragment } @Override - public void showMerge(boolean show) { - mMergeButton.setVisibility(show ? View.VISIBLE : View.GONE); + public void showSwapButton(boolean show) { + mSwapButton.setVisibility(show ? View.VISIBLE : View.GONE); } @Override - public void showSwap(boolean show) { - mSwapButton.setVisibility(show ? View.VISIBLE : View.GONE); + public void showChangeToVideoButton(boolean show) { + mChangeToVideoButton.setVisibility(show ? View.VISIBLE : View.GONE); } @Override - public void showAddCall(boolean show) { + public void showSwitchCameraButton(boolean show) { + mSwitchCameraButton.setVisibility(show ? View.VISIBLE : View.GONE); + } + + @Override + public void showAddCallButton(boolean show) { mAddCallButton.setVisibility(show ? View.VISIBLE : View.GONE); } @@ -244,6 +290,21 @@ public class CallButtonFragment mAddCallButton.setEnabled(enabled); } + @Override + public void showMergeButton(boolean show) { + mMergeButton.setVisibility(show ? View.VISIBLE : View.GONE); + } + + @Override + public void showPauseVideoButton(boolean show) { + mPauseVideoButton.setVisibility(show ? View.VISIBLE : View.GONE); + } + + @Override + public void showOverflowButton(boolean show) { + mOverflowButton.setVisibility(show ? View.VISIBLE : View.GONE); + } + @Override public void setAudio(int mode) { updateAudioButtons(getPresenter().getSupportedAudio()); -- cgit v1.2.3