From e26b887e90d5e9566a5054a1ccb3ed32ae2eea2d Mon Sep 17 00:00:00 2001 From: Andrew Lee Date: Wed, 23 Apr 2014 17:02:46 -0700 Subject: Properly enable/disable end call button. Also, cleaning up erroneous 8-space indents to 4-space. Bug: 14108639 Change-Id: Ic34fd9c645861533c584bfa33ab20793c509d78c --- InCallUI/res/layout/call_card.xml | 64 +++++++++---------- InCallUI/res/layout/incall_screen.xml | 72 +++++++++++----------- .../src/com/android/incallui/CallCardFragment.java | 4 ++ .../com/android/incallui/CallCardPresenter.java | 5 ++ 4 files changed, 77 insertions(+), 68 deletions(-) diff --git a/InCallUI/res/layout/call_card.xml b/InCallUI/res/layout/call_card.xml index b254592f4..a8047f237 100644 --- a/InCallUI/res/layout/call_card.xml +++ b/InCallUI/res/layout/call_card.xml @@ -17,10 +17,10 @@ --> + android:id="@+id/call_card" + android:layout_width="match_parent" + android:layout_height="match_parent" + android:orientation="vertical"> + android:layout_width="match_parent" + android:layout_height="0dp" + android:layout_weight="1"> + android:layout_alignParentStart="true" + android:layout_alignParentTop="true" + android:layout_width="match_parent" + android:layout_height="match_parent" + android:gravity="top|center_horizontal" + android:scaleType="centerCrop" + android:contentDescription="@string/contactPhoto" + android:src="@drawable/picture_unknown"/> + android:layout_width="match_parent" + android:layout_height="wrap_content" + android:orientation="vertical"> + layout="@layout/primary_call_info" /> + android:id="@+id/callButtonFragment" + android:layout_width="match_parent" + android:layout_height="wrap_content" /> + style="@style/InCallEndButton" + android:layout_width="match_parent" + android:src="@drawable/ic_in_call_phone_hangup" + android:background="@drawable/end_call_background" + android:contentDescription="@string/onscreenEndCallText" + android:layout_gravity="bottom" /> + android:layout="@layout/secondary_call_info" + android:layout_width="match_parent" + android:layout_height="0dp" + android:layout_weight="1" /> diff --git a/InCallUI/res/layout/incall_screen.xml b/InCallUI/res/layout/incall_screen.xml index 06e8dac15..d00b6bb95 100644 --- a/InCallUI/res/layout/incall_screen.xml +++ b/InCallUI/res/layout/incall_screen.xml @@ -16,58 +16,58 @@ + + + android:orientation="vertical" > - - - - + android:layout_alignParentTop="true" + android:layout_alignParentStart="true" + android:layout_weight="1"/> + android:id="@+id/dialpadFragment" + android:layout_width="match_parent" + android:layout_height="0dp" + android:layout_alignParentTop="true" + android:layout_alignParentStart="true" + android:layout_weight="1" /> + android:id="@+id/answerFragment" + android:layout_width="match_parent" + android:layout_height="wrap_content" + android:layout_alignParentBottom="true" + android:layout_centerHorizontal="true" + android:gravity="top" + android:layout_gravity="bottom|center_horizontal" + android:layout_marginBottom="@dimen/glowpadview_margin_bottom" + android:visibility="gone" /> + android:id="@+id/conferenceManagerFragment" + android:layout_width="match_parent" + android:layout_height="match_parent" + android:layout_alignParentTop="true" + android:layout_alignParentStart="true" + android:layout_alignParentBottom="true" + android:layout_alignParentEnd="true" /> diff --git a/InCallUI/src/com/android/incallui/CallCardFragment.java b/InCallUI/src/com/android/incallui/CallCardFragment.java index 2093a442c..10f3ed6c6 100644 --- a/InCallUI/src/com/android/incallui/CallCardFragment.java +++ b/InCallUI/src/com/android/incallui/CallCardFragment.java @@ -517,6 +517,10 @@ public class CallCardFragment extends BaseFragment eventText = event.getText(); diff --git a/InCallUI/src/com/android/incallui/CallCardPresenter.java b/InCallUI/src/com/android/incallui/CallCardPresenter.java index 50179c4e6..33d99b7d6 100644 --- a/InCallUI/src/com/android/incallui/CallCardPresenter.java +++ b/InCallUI/src/com/android/incallui/CallCardPresenter.java @@ -194,6 +194,10 @@ public class CallCardPresenter extends Presenter } else { ui.setCallState(Call.State.IDLE, DisconnectCause.NOT_VALID, false, null, null); } + + final boolean enableEndCallButton = state.isConnectingOrConnected() && + !state.isIncoming() && mPrimary != null; + ui.setEndCallButtonEnabled(enableEndCallButton); } @Override @@ -478,5 +482,6 @@ public class CallCardPresenter extends Presenter void setPrimaryImage(Drawable image); void setPrimaryPhoneNumber(String phoneNumber); void setPrimaryLabel(String label); + void setEndCallButtonEnabled(boolean enabled); } } -- cgit v1.2.3