summaryrefslogtreecommitdiff
path: root/InCallUI
diff options
context:
space:
mode:
authorBen Gilad <gilad@google.com>2013-10-01 16:34:14 -0700
committerBen Gilad <gilad@google.com>2013-10-01 16:34:14 -0700
commit0e2cc4487c034998438a34f14d2d920aa6925422 (patch)
tree6a12afea176a4f4f76045e1e1a6cac7535b03903 /InCallUI
parente5e9be3603f10f53fd72372da37e02926826b49e (diff)
Adding the (lost) buttons back upon disconnected calls, see b/11028671.
Change-Id: If4f48879bb9601484e69cb66fa0eb980ece53909
Diffstat (limited to 'InCallUI')
-rw-r--r--InCallUI/res/values/colors.xml2
-rw-r--r--InCallUI/src/com/android/incallui/CallButtonFragment.java21
-rw-r--r--InCallUI/src/com/android/incallui/CallButtonPresenter.java8
3 files changed, 21 insertions, 10 deletions
diff --git a/InCallUI/res/values/colors.xml b/InCallUI/res/values/colors.xml
index 9d149a472..53d8f527f 100644
--- a/InCallUI/res/values/colors.xml
+++ b/InCallUI/res/values/colors.xml
@@ -42,5 +42,5 @@
<drawable name="end_call_pressed_state">#ff4e4e</drawable>
<!-- Used when the End Call button is disabled -->
- <drawable name="end_call_disabled_state">#00000000</drawable>
+ <drawable name="end_call_disabled_state">#303030</drawable>
</resources>
diff --git a/InCallUI/src/com/android/incallui/CallButtonFragment.java b/InCallUI/src/com/android/incallui/CallButtonFragment.java
index 209869458..b0fdda18c 100644
--- a/InCallUI/src/com/android/incallui/CallButtonFragment.java
+++ b/InCallUI/src/com/android/incallui/CallButtonFragment.java
@@ -189,12 +189,23 @@ public class CallButtonFragment
}
@Override
- public void setVisible(boolean on) {
- if (on) {
- getView().setVisibility(View.VISIBLE);
- } else {
- getView().setVisibility(View.INVISIBLE);
+ public void setEnabled(boolean isEnabled) {
+ View view = getView();
+ if (view.getVisibility() != View.VISIBLE) {
+ view.setVisibility(View.VISIBLE);
}
+
+ // The main end-call button spanning across the screen.
+ mEndCallButton.setEnabled(isEnabled);
+
+ // The smaller buttons laid out horizontally just below the end-call button.
+ mMuteButton.setEnabled(isEnabled);
+ mAudioButton.setEnabled(isEnabled);
+ mHoldButton.setEnabled(isEnabled);
+ mShowDialpadButton.setEnabled(isEnabled);
+ mMergeButton.setEnabled(isEnabled);
+ mAddCallButton.setEnabled(isEnabled);
+ mSwapButton.setEnabled(isEnabled);
}
@Override
diff --git a/InCallUI/src/com/android/incallui/CallButtonPresenter.java b/InCallUI/src/com/android/incallui/CallButtonPresenter.java
index 6840a156d..36426302f 100644
--- a/InCallUI/src/com/android/incallui/CallButtonPresenter.java
+++ b/InCallUI/src/com/android/incallui/CallButtonPresenter.java
@@ -221,14 +221,14 @@ public class CallButtonPresenter extends Presenter<CallButtonPresenter.CallButto
return;
}
- final boolean isVisible = state.isConnectingOrConnected() &&
+ final boolean isEnabled = state.isConnectingOrConnected() &&
!state.isIncoming() && call != null;
- ui.setVisible(isVisible);
+ ui.setEnabled(isEnabled);
Log.d(this, "Updating call UI for call: ", call);
- if (isVisible) {
+ if (isEnabled) {
Log.v(this, "Show hold ", call.can(Capabilities.SUPPORT_HOLD));
Log.v(this, "Enable hold", call.can(Capabilities.HOLD));
Log.v(this, "Show merge ", call.can(Capabilities.MERGE_CALLS));
@@ -335,7 +335,7 @@ public class CallButtonPresenter extends Presenter<CallButtonPresenter.CallButto
}
public interface CallButtonUi extends Ui {
- void setVisible(boolean on);
+ void setEnabled(boolean on);
void setMute(boolean on);
void enableMute(boolean enabled);
void setHold(boolean on);