summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBen Gilad <gilad@google.com>2013-10-02 08:28:52 -0700
committerAndroid Git Automerger <android-git-automerger@android.com>2013-10-02 08:28:52 -0700
commitfcaa2d5110c8ecfd19eb7d6ec7c219d8c91d0d9a (patch)
tree7cc91b261fcd4396fc76cda99d18d1b5c1440cd6
parentbd536d8df0bac036a739f8be0d326ee4830b2ac5 (diff)
parent0ebe68c2bd0342329c512c1c6031b477a5f12598 (diff)
am 28c55a37: Merge "Adding the (lost) buttons back upon disconnected calls, see b/11028671." into klp-dev
* commit '28c55a37424ca3e5f5250a95555210d5c885eb90': Adding the (lost) buttons back upon disconnected calls, see b/11028671.
-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);