diff options
-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); |