diff options
author | Ben Gilad <gilad@google.com> | 2013-10-02 15:08:45 +0000 |
---|---|---|
committer | Android (Google) Code Review <android-gerrit@google.com> | 2013-10-02 15:08:45 +0000 |
commit | 0ebe68c2bd0342329c512c1c6031b477a5f12598 (patch) | |
tree | 1d0974c122f612624d1269a903d417b402a306fb /InCallUI | |
parent | 9e21a8b3dd1eab756c3cde836c39d7a408467e5a (diff) | |
parent | 0e2cc4487c034998438a34f14d2d920aa6925422 (diff) |
Merge "Adding the (lost) buttons back upon disconnected calls, see b/11028671." into klp-dev
Diffstat (limited to 'InCallUI')
-rw-r--r-- | InCallUI/res/values/colors.xml | 2 | ||||
-rw-r--r-- | InCallUI/src/com/android/incallui/CallButtonFragment.java | 21 | ||||
-rw-r--r-- | InCallUI/src/com/android/incallui/CallButtonPresenter.java | 8 |
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); |