Add call button to details, increase hit area.

+ Add call back button in call details.
+ Increase touch target size of call back button.
+ Simplify tint styling and layouts.
- Delete asset which was duplicate of one in ContactsCommon.

Bug: 18331084
Bug: 21659613
Change-Id: Icbd5f66a294f1215dc2056e7f7aece2129af5630
diff --git a/src/com/android/dialer/CallDetailActivity.java b/src/com/android/dialer/CallDetailActivity.java
index 6da7c79..87ec774 100644
--- a/src/com/android/dialer/CallDetailActivity.java
+++ b/src/com/android/dialer/CallDetailActivity.java
@@ -97,11 +97,9 @@
 
         @Override
         public void onGetCallDetails(PhoneCallDetails[] details) {
-            Context context = CallDetailActivity.this;
-
             if (details == null) {
                 // Somewhere went wrong: we're going to bail out and show error to users.
-                Toast.makeText(context, R.string.toast_call_detail_error,
+                Toast.makeText(mContext, R.string.toast_call_detail_error,
                         Toast.LENGTH_SHORT).show();
                 finish();
                 return;
@@ -119,9 +117,9 @@
 
             // Cache the details about the phone number.
             final boolean canPlaceCallsTo =
-                PhoneNumberUtilsWrapper.canPlaceCallsTo(mNumber, numberPresentation);
-            final PhoneNumberUtilsWrapper phoneUtils = new PhoneNumberUtilsWrapper(context);
-            final boolean isVoicemailNumber =
+                    PhoneNumberUtilsWrapper.canPlaceCallsTo(mNumber, numberPresentation);
+            final PhoneNumberUtilsWrapper phoneUtils = new PhoneNumberUtilsWrapper(mContext);
+            mIsVoicemailNumber =
                     phoneUtils.isVoicemailNumber(accountHandle, mNumber);
             final boolean isSipNumber = PhoneNumberUtilsWrapper.isSipNumber(mNumber);
 
@@ -144,7 +142,9 @@
                 }
             }
 
-            String accountLabel = PhoneAccountUtils.getAccountLabel(context, accountHandle);
+            mCallButton.setVisibility(canPlaceCallsTo ? View.VISIBLE : View.GONE);
+
+            String accountLabel = PhoneAccountUtils.getAccountLabel(mContext, accountHandle);
             if (!TextUtils.isEmpty(accountLabel)) {
                 mAccountLabel.setText(accountLabel);
                 mAccountLabel.setVisibility(View.VISIBLE);
@@ -153,14 +153,14 @@
             }
 
             mHasEditNumberBeforeCallOption =
-                    canPlaceCallsTo && !isSipNumber && !isVoicemailNumber;
+                    canPlaceCallsTo && !isSipNumber && !mIsVoicemailNumber;
             mHasTrashOption = hasVoicemail();
             mHasRemoveFromCallLogOption = !hasVoicemail();
             invalidateOptionsMenu();
 
             ListView historyList = (ListView) findViewById(R.id.history);
             historyList.setAdapter(
-                    new CallDetailHistoryAdapter(context, mInflater, mCallTypeHelper, details));
+                    new CallDetailHistoryAdapter(mContext, mInflater, mCallTypeHelper, details));
 
             String lookupKey = contactUri == null ? null
                     : ContactInfoHelper.getLookupKeyFromUri(contactUri);
@@ -168,7 +168,7 @@
             final boolean isBusiness = mContactInfoHelper.isBusiness(firstDetails.sourceType);
 
             final int contactType =
-                    isVoicemailNumber ? ContactPhotoManager.TYPE_VOICEMAIL :
+                    mIsVoicemailNumber ? ContactPhotoManager.TYPE_VOICEMAIL :
                     isBusiness ? ContactPhotoManager.TYPE_BUSINESS :
                     ContactPhotoManager.TYPE_DEFAULT;
 
@@ -201,14 +201,17 @@
         }
     };
 
+    private Context mContext;
     private CallTypeHelper mCallTypeHelper;
     private QuickContactBadge mQuickContactBadge;
     private TextView mCallerName;
     private TextView mCallerNumber;
     private TextView mAccountLabel;
+    private View mCallButton;
     private ContactInfoHelper mContactInfoHelper;
 
-    private String mNumber = null;
+    private String mNumber;
+    private boolean mIsVoicemailNumber;
     private String mDefaultCountryIso;
 
     /* package */ LayoutInflater mInflater;
@@ -230,6 +233,8 @@
     protected void onCreate(Bundle icicle) {
         super.onCreate(icicle);
 
+        mContext = this;
+
         setContentView(R.layout.call_detail);
 
         mInflater = (LayoutInflater) getSystemService(LAYOUT_INFLATER_SERVICE);
@@ -248,6 +253,14 @@
         mDefaultCountryIso = GeoUtil.getCurrentCountryIso(this);
         mContactPhotoManager = ContactPhotoManager.getInstance(this);
 
+        mCallButton = (View) findViewById(R.id.call_back_button);
+        mCallButton.setOnClickListener(new View.OnClickListener() {
+            @Override
+            public void onClick(View view) {
+                mContext.startActivity(IntentUtil.getCallIntent(mNumber));
+            }
+        });
+
         mContactInfoHelper = new ContactInfoHelper(this, GeoUtil.getCurrentCountryIso(this));
         getActionBar().setDisplayHomeAsUpEnabled(true);