Make phone number copyable on call detail
Now the phone number is long-pressable, which starts the CAB
for copying phone number.
Tapping the phone number again while will unselect it. (Or press back or UP.)
Also tweak the highlight area for the phone number view, per UX suggestion.
Now when you press the phone number view, the entire row will be highlighted,
including the SMS action view.
Tested:
- Regular phone number.
- SIP address.
- No-caller ID, or "private number" -> The "Call XXX" view is gone, so
nothing to long-press.
- "Voicemail". The text "Voicemail" will by copied, which is iffy, but I
don't think "fixing" it is worth introducing more complication to the code.
Bug 6354066
Change-Id: I54ee67589a2e5aaba8e4a5dd9589e8c9e46c18b8
diff --git a/res/layout/call_detail.xml b/res/layout/call_detail.xml
index 7498f5a..1d0a285 100644
--- a/res/layout/call_detail.xml
+++ b/res/layout/call_detail.xml
@@ -20,6 +20,7 @@
android:layout_width="match_parent"
android:layout_height="match_parent"
android:visibility="gone"
+ android:background="@android:color/black"
>
<!--
The list view is under everything.
@@ -32,7 +33,6 @@
android:layout_height="wrap_content"
android:layout_alignParentLeft="true"
android:layout_alignParentTop="true"
- android:background="@android:color/black"
/>
<!-- All the controls which are part of the pinned header are in this layout. -->
@@ -128,35 +128,34 @@
android:layout_height="wrap_content"
android:paddingBottom="@dimen/call_detail_button_spacing"
android:layout_below="@id/blue_separator"
- android:background="@android:color/black"
>
<!-- The voicemail fragment will be put here. -->
</LinearLayout>
- <FrameLayout android:id="@+id/call_and_sms_container"
+ <FrameLayout
+ android:id="@+id/call_and_sms"
android:layout_width="match_parent"
- android:layout_height="wrap_content"
+ android:layout_height="@dimen/call_log_list_item_height"
android:layout_marginBottom="@dimen/call_detail_button_spacing"
android:layout_below="@id/voicemail_container"
- android:background="@android:color/black"
+ android:gravity="center_vertical"
+ android:background="@drawable/dialpad_background"
>
- <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
- android:id="@+id/call_and_sms"
+ <LinearLayout
+ android:id="@+id/call_and_sms_main_action"
android:layout_width="match_parent"
- android:layout_height="@dimen/call_log_list_item_height"
+ android:layout_height="match_parent"
android:orientation="horizontal"
- android:gravity="center_vertical"
- android:background="@drawable/dialpad_background"
- >
+ android:focusable="true"
+ android:background="?android:attr/selectableItemBackground"
+ >
- <LinearLayout android:id="@+id/call_and_sms_main_action"
+ <LinearLayout
android:layout_width="0dip"
android:layout_height="match_parent"
android:layout_weight="1"
android:paddingLeft="@dimen/call_log_indent_margin"
android:orientation="vertical"
android:gravity="center_vertical"
- android:focusable="true"
- android:background="?android:attr/selectableItemBackground"
>
<TextView android:id="@+id/call_and_sms_text"
@@ -179,7 +178,6 @@
android:singleLine="true"
android:ellipsize="end"
/>
-
</LinearLayout>
<View android:id="@+id/call_and_sms_divider"
@@ -213,7 +211,7 @@
android:layout_height="match_parent"
android:layout_alignParentLeft="true"
android:layout_alignParentTop="true"
- android:background="#000000"
+ android:background="@android:color/black"
android:visibility="gone"
android:clickable="true"
/>