summaryrefslogtreecommitdiff
path: root/InCallUI/src/com/android/incallui/CallButtonFragment.java
diff options
context:
space:
mode:
authorAndrew Lee <anwlee@google.com>2014-07-18 12:04:03 -0700
committerAndrew Lee <anwlee@google.com>2014-07-18 13:09:03 -0700
commit137f67c0d87a8a28be94a07e1c7f05219aacbcb7 (patch)
treeea1d779dba57c0abf25c8b3e03933e3a56e6c56a /InCallUI/src/com/android/incallui/CallButtonFragment.java
parentaf947faa14e8c77fe4d3a90927d0f11b42eb7e3f (diff)
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
Diffstat (limited to 'InCallUI/src/com/android/incallui/CallButtonFragment.java')
-rw-r--r--InCallUI/src/com/android/incallui/CallButtonFragment.java95
1 files changed, 78 insertions, 17 deletions
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
@@ -205,17 +231,32 @@ public class CallButtonFragment
}
@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);
}
@@ -245,6 +291,21 @@ public class CallButtonFragment
}
@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());
refreshAudioModePopup();