Make EndCallButton circular.

- Added FrameLayout around end call button.
- Reconfigured size and clipping of the end call button.
- Retyped some colors from drawables to colors.
- Removed unused styles and dimensions.

Bug: 13956531
Change-Id: I9a5bc5b0307521f4ef3d7a9ae61b586e4e32a76a
diff --git a/InCallUI/res/drawable/end_call_background.xml b/InCallUI/res/drawable/end_call_background.xml
index 53f4e54..24b4374 100644
--- a/InCallUI/res/drawable/end_call_background.xml
+++ b/InCallUI/res/drawable/end_call_background.xml
@@ -16,13 +16,7 @@
 
 <!-- Background drawable used to render the "end call" button. -->
 <selector xmlns:android="http://schemas.android.com/apk/res/android">
-
-    <item android:state_enabled="false"
-          android:drawable="@drawable/end_call_disabled_state" />
-
-    <item android:state_pressed="true"
-          android:drawable="@drawable/end_call_pressed_state" />
-
-    <item android:drawable="@drawable/end_call_active_state" />
-
+    <item android:state_enabled="false" android:drawable="@color/end_call_disabled_color" />
+    <item android:state_pressed="true" android:drawable="@color/end_call_pressed_color" />
+    <item android:drawable="@color/end_call_active_color" />
 </selector>
diff --git a/InCallUI/res/layout/call_card.xml b/InCallUI/res/layout/call_card.xml
index a8047f2..d56b740 100644
--- a/InCallUI/res/layout/call_card.xml
+++ b/InCallUI/res/layout/call_card.xml
@@ -59,15 +59,23 @@
                 android:id="@+id/callButtonFragment"
                 android:layout_width="match_parent"
                 android:layout_height="wrap_content" />
+
         </LinearLayout>
 
-        <ImageButton android:id="@+id/endButton"
-            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" />
+        <FrameLayout
+            android:layout_width="@dimen/floating_action_button_width"
+            android:layout_height="@dimen/floating_action_button_height"
+            android:layout_marginBottom="@dimen/end_call_button_margin_bottom"
+            android:layout_gravity="bottom|center">
+
+            <ImageButton android:id="@+id/endButton"
+                android:layout_width="match_parent"
+                android:layout_height="match_parent"
+                android:background="@drawable/end_call_background"
+                android:src="@drawable/ic_in_call_phone_hangup"
+                android:contentDescription="@string/onscreenEndCallText" />
+
+        </FrameLayout>
     </FrameLayout>
 
     <!-- Secondary "Call info" block, for the background ("on hold") call. -->
diff --git a/InCallUI/res/values/colors.xml b/InCallUI/res/values/colors.xml
index b187820..0cb767b 100644
--- a/InCallUI/res/values/colors.xml
+++ b/InCallUI/res/values/colors.xml
@@ -39,13 +39,13 @@
     <color name="manage_conference_secondary_text_color">#888888</color>
 
     <!-- Used when the End Call button is active -->
-    <drawable name="end_call_active_state">#f22121</drawable>
+    <color name="end_call_active_color">#f22121</color>
 
     <!-- Used when the End Call button is pressed -->
-    <drawable name="end_call_pressed_state">#ff4e4e</drawable>
+    <color name="end_call_pressed_color">#ff4e4e</color>
 
     <!-- Used when the End Call button is disabled -->
-    <drawable name="end_call_disabled_state">#303030</drawable>
+    <color name="end_call_disabled_color">#303030</color>
 
     <!-- Color of dialpad digits -->
     <color name="dialpad_digits_text_color">#000000</color>
diff --git a/InCallUI/res/values/dimens.xml b/InCallUI/res/values/dimens.xml
index 069f98d..17dc872 100644
--- a/InCallUI/res/values/dimens.xml
+++ b/InCallUI/res/values/dimens.xml
@@ -50,15 +50,15 @@
     <!-- Height of the main row of in-call buttons. -->
     <dimen name="in_call_button_height">76dp</dimen>
 
-    <!-- Height of the in-call "End" button. Match with Contact's dimens/call_button_height -->
-    <dimen name="in_call_end_button_height">60dp</dimen>
-
     <!-- Width of buttons in the extra button row. -->
     <dimen name="extra_row_button_width">56dp</dimen>
 
     <!-- Height of buttons in the extra button row. -->
     <dimen name="extra_row_button_height">@dimen/in_call_button_height</dimen>
 
+    <!-- Bottom margin for the end call button. -->
+    <dimen name="end_call_button_margin_bottom">30dp</dimen>
+
     <!-- Padding at the left and right edges of the incall_touch_ui button
          cluster.  This padding is necessary because we can't allow the
          buttons to be very close to the edges of the screen, due to the
diff --git a/InCallUI/res/values/styles.xml b/InCallUI/res/values/styles.xml
index 21b6d93..ce93c62 100644
--- a/InCallUI/res/values/styles.xml
+++ b/InCallUI/res/values/styles.xml
@@ -74,13 +74,6 @@
         <item name="android:background">@color/button_background_color</item>
     </style>
 
-    <!-- "End" button; similar to InCallButton. -->
-    <style name="InCallEndButton">
-        <item name="android:layout_width">0dip</item>
-        <item name="android:layout_height">@dimen/in_call_end_button_height</item>
-        <item name="android:layout_weight">1</item>
-    </style>
-
     <!-- Buttons in extra button row. -->
     <style name="InCallExtraRowButton">
         <item name="android:layout_width">@dimen/extra_row_button_width</item>
diff --git a/InCallUI/src/com/android/incallui/CallCardFragment.java b/InCallUI/src/com/android/incallui/CallCardFragment.java
index 809568e..9f5b052 100644
--- a/InCallUI/src/com/android/incallui/CallCardFragment.java
+++ b/InCallUI/src/com/android/incallui/CallCardFragment.java
@@ -16,13 +16,11 @@
 
 package com.android.incallui;
 
-import android.animation.LayoutTransition;
 import android.content.Context;
 import android.graphics.drawable.Drawable;
 import android.os.Bundle;
 import android.telephony.DisconnectCause;
 import android.text.TextUtils;
-import android.view.Gravity;
 import android.view.LayoutInflater;
 import android.view.View;
 import android.view.View.OnClickListener;
@@ -32,6 +30,7 @@
 import android.widget.ImageView;
 import android.widget.TextView;
 
+import com.android.contacts.common.util.ViewUtil;
 import com.android.services.telephony.common.Call;
 
 import java.util.List;
@@ -117,9 +116,7 @@
                 getPresenter().endCallClicked();
             }
         });
-        // Make the hit target smaller for the end button so that is creates a deadzone along the
-        // inside perimeter of the button.
-        mEndCallButton.setOnTouchListener(new SmallerHitTargetTouchListener());
+        ViewUtil.setupFloatingActionButton(mEndCallButton, getResources());
     }
 
     @Override