Initial move of dialer features from contacts app.

Bug: 6993891
Change-Id: I758ce359ca7e87a1d184303822979318be171921
diff --git a/res/layout/call_detail.xml b/res/layout/call_detail.xml
new file mode 100644
index 0000000..8f38a19
--- /dev/null
+++ b/res/layout/call_detail.xml
@@ -0,0 +1,218 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!-- Copyright (C) 2009 The Android Open Source Project
+
+     Licensed under the Apache License, Version 2.0 (the "License");
+     you may not use this file except in compliance with the License.
+     You may obtain a copy of the License at
+
+          http://www.apache.org/licenses/LICENSE-2.0
+
+     Unless required by applicable law or agreed to in writing, software
+     distributed under the License is distributed on an "AS IS" BASIS,
+     WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+     See the License for the specific language governing permissions and
+     limitations under the License.
+-->
+
+<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
+    xmlns:ex="http://schemas.android.com/apk/res-auto"
+    android:id="@+id/call_detail"
+    android:layout_width="match_parent"
+    android:layout_height="match_parent"
+    android:visibility="gone"
+    android:background="@android:color/black"
+>
+    <!--
+      The list view is under everything.
+      It contains a first header element which is hidden under the controls UI.
+      When scrolling, the controls move up until the name bar hits the top.
+      -->
+    <ListView
+        android:id="@+id/history"
+        android:layout_width="match_parent"
+        android:layout_height="wrap_content"
+        android:layout_alignParentLeft="true"
+        android:layout_alignParentTop="true"
+    />
+
+    <!-- All the controls which are part of the pinned header are in this layout. -->
+    <RelativeLayout
+        android:id="@+id/controls"
+        android:layout_width="match_parent"
+        android:layout_height="match_parent"
+        android:layout_alignParentLeft="true"
+        android:layout_alignParentTop="true"
+    >
+        <FrameLayout
+            android:id="@+id/voicemail_status"
+            android:layout_width="match_parent"
+            android:layout_height="wrap_content"
+            android:layout_alignParentLeft="true"
+            android:layout_alignParentTop="true"
+            android:visibility="gone"
+        >
+            <include layout="@layout/call_log_voicemail_status"/>
+        </FrameLayout>
+
+        <view
+            class="com.android.contacts.widget.ProportionalLayout"
+            android:id="@+id/contact_background_sizer"
+            android:layout_width="match_parent"
+            android:layout_height="wrap_content"
+            android:layout_alignParentLeft="true"
+            android:layout_below="@id/voicemail_status"
+            ex:ratio="0.5"
+            ex:direction="widthToHeight"
+        >
+            <ImageView
+                android:id="@+id/contact_background"
+                android:layout_width="match_parent"
+                android:layout_height="0dip"
+                android:adjustViewBounds="true"
+                android:scaleType="centerCrop"
+            />
+        </view>
+        <LinearLayout
+            android:id="@+id/blue_separator"
+            android:layout_width="match_parent"
+            android:layout_height="1dip"
+            android:background="@android:color/holo_blue_light"
+            android:layout_below="@+id/contact_background_sizer"
+        />
+        <View
+            android:id="@+id/photo_text_bar"
+            android:layout_width="match_parent"
+            android:layout_height="42dip"
+            android:background="#7F000000"
+            android:layout_alignParentLeft="true"
+            android:layout_alignBottom="@id/contact_background_sizer"
+        />
+        <ImageView
+            android:id="@+id/main_action"
+            android:layout_width="wrap_content"
+            android:layout_height="0dip"
+            android:scaleType="center"
+            android:layout_alignRight="@id/photo_text_bar"
+            android:layout_alignBottom="@id/photo_text_bar"
+            android:layout_alignTop="@id/photo_text_bar"
+            android:layout_marginRight="@dimen/call_log_outer_margin"
+        />
+        <TextView
+            android:id="@+id/header_text"
+            android:layout_width="wrap_content"
+            android:layout_height="0dip"
+            android:layout_alignLeft="@id/photo_text_bar"
+            android:layout_toLeftOf="@id/main_action"
+            android:layout_alignTop="@id/photo_text_bar"
+            android:layout_alignBottom="@id/photo_text_bar"
+            android:layout_marginRight="@dimen/call_log_inner_margin"
+            android:layout_marginLeft="@dimen/call_detail_contact_name_margin"
+            android:gravity="center_vertical"
+            android:textColor="?attr/call_log_primary_text_color"
+            android:textAppearance="?android:attr/textAppearanceMedium"
+            android:singleLine="true"
+        />
+        <ImageButton
+            android:id="@+id/main_action_push_layer"
+            android:layout_width="match_parent"
+            android:layout_height="match_parent"
+            android:layout_alignLeft="@id/contact_background_sizer"
+            android:layout_alignTop="@id/contact_background_sizer"
+            android:layout_alignRight="@id/contact_background_sizer"
+            android:layout_alignBottom="@id/contact_background_sizer"
+            android:background="?android:attr/selectableItemBackground"
+        />
+        <LinearLayout
+            android:id="@+id/voicemail_container"
+            android:layout_width="match_parent"
+            android:layout_height="wrap_content"
+            android:paddingBottom="@dimen/call_detail_button_spacing"
+            android:layout_below="@id/blue_separator"
+        >
+            <!-- The voicemail fragment will be put here. -->
+        </LinearLayout>
+        <FrameLayout
+            android:id="@+id/call_and_sms"
+            android:layout_width="match_parent"
+            android:layout_height="@dimen/call_log_list_item_height"
+            android:layout_marginBottom="@dimen/call_detail_button_spacing"
+            android:layout_below="@id/voicemail_container"
+            android:gravity="center_vertical"
+            android:background="@drawable/dialpad_background"
+        >
+            <LinearLayout
+                android:id="@+id/call_and_sms_main_action"
+                android:layout_width="match_parent"
+                android:layout_height="match_parent"
+                android:orientation="horizontal"
+                android:focusable="true"
+                android:background="?android:attr/selectableItemBackground"
+                >
+
+                <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"
+                >
+
+                    <TextView android:id="@+id/call_and_sms_text"
+                        android:layout_width="wrap_content"
+                        android:layout_height="wrap_content"
+                        android:paddingRight="@dimen/call_log_icon_margin"
+                        android:textAppearance="?android:attr/textAppearanceMedium"
+                        android:textColor="?attr/call_log_primary_text_color"
+                        android:singleLine="true"
+                        android:ellipsize="end"
+                    />
+
+                    <TextView android:id="@+id/call_and_sms_label"
+                        android:layout_width="wrap_content"
+                        android:layout_height="wrap_content"
+                        android:paddingRight="@dimen/call_log_icon_margin"
+                        android:textAppearance="?android:attr/textAppearanceSmall"
+                        android:textColor="?attr/call_log_primary_text_color"
+                        android:textAllCaps="true"
+                        android:singleLine="true"
+                        android:ellipsize="end"
+                    />
+                </LinearLayout>
+
+                <View android:id="@+id/call_and_sms_divider"
+                    android:layout_width="1px"
+                    android:layout_height="32dip"
+                    android:background="@drawable/ic_divider_dashed_holo_dark"
+                    android:layout_gravity="center_vertical"
+                />
+
+                <ImageView android:id="@+id/call_and_sms_icon"
+                    android:layout_width="@color/call_log_voicemail_highlight_color"
+                    android:layout_height="match_parent"
+                    android:paddingLeft="@dimen/call_log_inner_margin"
+                    android:paddingRight="@dimen/call_log_outer_margin"
+                    android:gravity="center"
+                    android:scaleType="centerInside"
+                    android:focusable="true"
+                    android:background="?android:attr/selectableItemBackground"
+                />
+            </LinearLayout>
+        </FrameLayout>
+    </RelativeLayout>
+
+    <!--
+         Used to hide the UI when playing a voicemail and the proximity sensor
+         is detecting something near the screen.
+      -->
+    <View
+        android:id="@+id/blank"
+        android:layout_width="match_parent"
+        android:layout_height="match_parent"
+        android:layout_alignParentLeft="true"
+        android:layout_alignParentTop="true"
+        android:background="@android:color/black"
+        android:visibility="gone"
+        android:clickable="true"
+    />
+</RelativeLayout>
diff --git a/res/layout/call_detail_history_header.xml b/res/layout/call_detail_history_header.xml
new file mode 100644
index 0000000..09047c5
--- /dev/null
+++ b/res/layout/call_detail_history_header.xml
@@ -0,0 +1,61 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!-- Copyright (C) 2009 The Android Open Source Project
+
+     Licensed under the Apache License, Version 2.0 (the "License");
+     you may not use this file except in compliance with the License.
+     You may obtain a copy of the License at
+
+          http://www.apache.org/licenses/LICENSE-2.0
+
+     Unless required by applicable law or agreed to in writing, software
+     distributed under the License is distributed on an "AS IS" BASIS,
+     WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+     See the License for the specific language governing permissions and
+     limitations under the License.
+-->
+
+<!-- This layout is supposed to match the content of the controls in call_detail.xml  -->
+<LinearLayout
+    xmlns:android="http://schemas.android.com/apk/res/android"
+    xmlns:ex="http://schemas.android.com/apk/res-auto"
+    android:orientation="vertical"
+    android:layout_width="match_parent"
+    android:layout_height="wrap_content">
+
+    <!-- Contact photo. -->
+    <view
+        class="com.android.contacts.widget.ProportionalLayout"
+        android:layout_width="match_parent"
+        android:layout_height="wrap_content"
+        android:layout_alignParentLeft="true"
+        android:layout_below="@id/voicemail_status"
+        ex:ratio="0.5"
+        ex:direction="widthToHeight"
+    >
+        <!-- Proportional layout requires a view in it. -->
+        <View
+            android:layout_width="wrap_content"
+            android:layout_height="wrap_content"
+        />
+    </view>
+    <!-- Separator line -->
+    <View
+        android:layout_width="match_parent"
+        android:layout_height="1dip"
+    />
+    <!-- Voicemail controls -->
+    <!-- TODO: Make the height be based on a constant. -->
+    <View
+        android:id="@+id/header_voicemail_container"
+        android:layout_width="match_parent"
+        android:layout_height="140dip"
+        android:layout_marginBottom="@dimen/call_detail_button_spacing"
+    />
+    <!-- Call and SMS -->
+    <View
+        android:id="@+id/header_call_and_sms_container"
+        android:layout_width="match_parent"
+        android:layout_height="@dimen/call_log_list_item_height"
+    />
+
+</LinearLayout>
diff --git a/res/layout/call_detail_history_item.xml b/res/layout/call_detail_history_item.xml
new file mode 100644
index 0000000..01b9517
--- /dev/null
+++ b/res/layout/call_detail_history_item.xml
@@ -0,0 +1,63 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!-- Copyright (C) 2011 The Android Open Source Project
+
+     Licensed under the Apache License, Version 2.0 (the "License");
+     you may not use this file except in compliance with the License.
+     You may obtain a copy of the License at
+
+          http://www.apache.org/licenses/LICENSE-2.0
+
+     Unless required by applicable law or agreed to in writing, software
+     distributed under the License is distributed on an "AS IS" BASIS,
+     WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+     See the License for the specific language governing permissions and
+     limitations under the License.
+-->
+
+<LinearLayout
+    xmlns:android="http://schemas.android.com/apk/res/android"
+    android:layout_width="match_parent"
+    android:layout_height="wrap_content"
+    android:minHeight="@dimen/call_log_list_item_height"
+    android:paddingTop="@dimen/call_log_inner_margin"
+    android:paddingBottom="@dimen/call_log_inner_margin"
+    android:paddingLeft="@dimen/call_log_indent_margin"
+    android:paddingRight="@dimen/call_log_outer_margin"
+    android:orientation="vertical"
+>
+    <LinearLayout
+        android:layout_width="wrap_content"
+        android:layout_height="wrap_content"
+        android:orientation="horizontal"
+    >
+        <view
+            class="com.android.dialer.calllog.CallTypeIconsView"
+            android:id="@+id/call_type_icon"
+            android:layout_width="wrap_content"
+            android:layout_height="wrap_content"
+            android:layout_gravity="center_vertical"
+        />
+        <TextView
+            android:id="@+id/call_type_text"
+            android:layout_width="wrap_content"
+            android:layout_height="wrap_content"
+            android:layout_marginLeft="@dimen/call_log_icon_margin"
+            android:textAppearance="?android:attr/textAppearanceSmall"
+            android:textColor="@color/secondary_text_color"
+        />
+    </LinearLayout>
+    <TextView
+        android:id="@+id/date"
+        android:layout_width="wrap_content"
+        android:layout_height="wrap_content"
+        android:textAppearance="?android:attr/textAppearanceSmall"
+        android:textColor="@color/secondary_text_color"
+    />
+    <TextView
+        android:id="@+id/duration"
+        android:layout_width="wrap_content"
+        android:layout_height="wrap_content"
+        android:textAppearance="?android:attr/textAppearanceSmall"
+        android:textColor="@color/secondary_text_color"
+    />
+</LinearLayout>
diff --git a/res/layout/call_log_fragment.xml b/res/layout/call_log_fragment.xml
new file mode 100644
index 0000000..34b4b7f
--- /dev/null
+++ b/res/layout/call_log_fragment.xml
@@ -0,0 +1,78 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!-- Copyright (C) 2011 The Android Open Source Project
+
+     Licensed under the Apache License, Version 2.0 (the "License");
+     you may not use this file except in compliance with the License.
+     You may obtain a copy of the License at
+
+          http://www.apache.org/licenses/LICENSE-2.0
+
+     Unless required by applicable law or agreed to in writing, software
+     distributed under the License is distributed on an "AS IS" BASIS,
+     WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+     See the License for the specific language governing permissions and
+     limitations under the License.
+-->
+
+<!-- Layout parameters are set programmatically. -->
+<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
+    style="@style/FragmentActionBarPadding"
+    android:layout_width="match_parent"
+    android:layout_height="match_parent"
+    android:orientation="vertical"
+    android:divider="?android:attr/dividerHorizontal"
+    android:showDividers="end">
+
+    <FrameLayout
+        android:id="@+id/voicemail_status"
+        android:layout_width="match_parent"
+        android:layout_height="wrap_content"
+        android:visibility="gone">
+        <include layout="@layout/call_log_voicemail_status"
+    />
+    </FrameLayout>
+
+    <FrameLayout>
+        <TextView
+            android:id="@+id/filter_status"
+            android:layout_width="match_parent"
+            android:layout_height="wrap_content"
+            android:paddingLeft="@dimen/call_log_outer_margin"
+            android:paddingRight="@dimen/call_log_outer_margin"
+            android:paddingTop="@dimen/call_log_inner_margin"
+            android:paddingBottom="@dimen/call_log_inner_margin"
+            android:layout_alignParentLeft="true"
+            android:layout_alignParentBottom="true"
+            android:visibility="gone"
+            />
+        <View
+            android:id="@+id/call_log_divider"
+            android:layout_width="match_parent"
+            android:layout_height="1px"
+            android:layout_marginLeft="@dimen/call_log_outer_margin"
+            android:layout_marginRight="@dimen/call_log_outer_margin"
+            android:layout_gravity="bottom"
+            android:background="#55ffffff"
+            />
+    </FrameLayout>
+    <FrameLayout
+        android:layout_width="match_parent"
+        android:layout_height="match_parent">
+        <ListView android:id="@android:id/list"
+            android:layout_width="match_parent"
+            android:layout_height="match_parent"
+            android:fadingEdge="none"
+            android:scrollbarStyle="outsideOverlay"
+            android:divider="@null"
+        />
+        <TextView android:id="@android:id/empty"
+            android:layout_width="match_parent"
+            android:layout_height="match_parent"
+            android:text="@string/recentCalls_empty"
+            android:gravity="center"
+            android:layout_marginTop="@dimen/empty_message_top_margin"
+            android:textColor="?android:attr/textColorSecondary"
+            android:textAppearance="?android:attr/textAppearanceLarge"
+        />
+    </FrameLayout>
+</LinearLayout>
diff --git a/res/layout/call_log_list_item.xml b/res/layout/call_log_list_item.xml
new file mode 100644
index 0000000..8564c0d
--- /dev/null
+++ b/res/layout/call_log_list_item.xml
@@ -0,0 +1,167 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!-- Copyright (C) 2007 The Android Open Source Project
+
+     Licensed under the Apache License, Version 2.0 (the "License");
+     you may not use this file except in compliance with the License.
+     You may obtain a copy of the License at
+
+          http://www.apache.org/licenses/LICENSE-2.0
+
+     Unless required by applicable law or agreed to in writing, software
+     distributed under the License is distributed on an "AS IS" BASIS,
+     WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+     See the License for the specific language governing permissions and
+     limitations under the License.
+-->
+
+<view
+    xmlns:android="http://schemas.android.com/apk/res/android"
+    class="com.android.dialer.calllog.CallLogListItemView"
+    android:layout_width="match_parent"
+    android:layout_height="wrap_content"
+    android:orientation="vertical"
+>
+    <!--
+        This layout may represent either a call log item or one of the
+        headers in the call log.
+
+        The former will make the @id/call_log_item visible and the
+        @id/call_log_header gone.
+
+        The latter will make the @id/call_log_header visible and the
+        @id/call_log_item gone
+    -->
+
+        <LinearLayout
+            android:id="@+id/primary_action_view"
+            android:layout_width="match_parent"
+            android:layout_height="wrap_content"
+            android:layout_centerVertical="true"
+            android:layout_marginLeft="@dimen/call_log_outer_margin"
+            android:layout_marginRight="@dimen/call_log_outer_margin"
+            android:orientation="horizontal"
+            android:gravity="center_vertical"
+            android:background="?android:attr/selectableItemBackground"
+            android:focusable="true"
+            android:nextFocusRight="@+id/secondary_action_icon"
+            android:nextFocusLeft="@+id/quick_contact_photo"
+        >
+            <QuickContactBadge
+                android:id="@+id/quick_contact_photo"
+                android:layout_width="@dimen/call_log_list_contact_photo_size"
+                android:layout_height="@dimen/call_log_list_contact_photo_size"
+                android:nextFocusRight="@id/primary_action_view"
+                android:layout_alignParentLeft="true"
+                android:layout_centerVertical="true"
+                android:focusable="true"
+            />
+            <LinearLayout
+                android:layout_width="wrap_content"
+                android:layout_height="wrap_content"
+                android:layout_weight="1"
+                android:paddingTop="@dimen/call_log_inner_margin"
+                android:paddingBottom="@dimen/call_log_inner_margin"
+                android:orientation="vertical"
+                android:gravity="center_vertical"
+                android:layout_marginLeft="@dimen/call_log_inner_margin"
+            >
+                <TextView
+                    android:id="@+id/name"
+                    android:layout_width="wrap_content"
+                    android:layout_height="wrap_content"
+                    android:layout_marginRight="@dimen/call_log_icon_margin"
+                    android:textColor="?attr/call_log_primary_text_color"
+                    android:textSize="18sp"
+                    android:singleLine="true"
+                />
+                <LinearLayout
+                    android:layout_width="wrap_content"
+                    android:layout_height="wrap_content"
+                    android:orientation="horizontal"
+                >
+                    <TextView
+                        android:id="@+id/number"
+                        android:layout_width="wrap_content"
+                        android:layout_height="wrap_content"
+                        android:layout_marginRight="@dimen/call_log_icon_margin"
+                        android:textColor="?attr/call_log_secondary_text_color"
+                        android:textSize="14sp"
+                        android:singleLine="true"
+                        android:ellipsize="marquee"
+                        />
+                    <TextView
+                        android:id="@+id/label"
+                        android:layout_width="wrap_content"
+                        android:layout_height="wrap_content"
+                        android:layout_marginRight="@dimen/call_log_icon_margin"
+                        android:textColor="?attr/call_log_secondary_text_color"
+                        android:textStyle="bold"
+                        android:textSize="14sp"
+                        android:singleLine="true"
+                        android:ellipsize="marquee"
+                        />
+                    </LinearLayout>
+                <LinearLayout
+                    android:id="@+id/call_type"
+                    android:layout_width="wrap_content"
+                    android:layout_height="wrap_content"
+                    android:orientation="horizontal"
+                >
+                    <view
+                        class="com.android.dialer.calllog.CallTypeIconsView"
+                        android:id="@+id/call_type_icons"
+                        android:layout_width="wrap_content"
+                        android:layout_height="wrap_content"
+                        android:layout_marginRight="@dimen/call_log_icon_margin"
+                        android:layout_gravity="center_vertical"
+                    />
+                    <TextView
+                        android:id="@+id/call_count_and_date"
+                        android:layout_width="wrap_content"
+                        android:layout_height="wrap_content"
+                        android:layout_marginRight="@dimen/call_log_icon_margin"
+                        android:layout_gravity="center_vertical"
+                        android:textColor="?attr/call_log_secondary_text_color"
+                        android:textSize="14sp"
+                        android:singleLine="true"
+                    />
+                </LinearLayout>
+            </LinearLayout>
+            <View
+                android:id="@+id/divider"
+                android:layout_width="1px"
+                android:layout_height="@dimen/call_log_call_action_size"
+                android:background="@drawable/ic_divider_dashed_holo_dark"
+                android:layout_gravity="center_vertical"
+            />
+            <ImageButton
+                android:id="@+id/secondary_action_icon"
+                android:layout_width="@dimen/call_log_call_action_width"
+                android:layout_height="match_parent"
+                android:paddingLeft="@dimen/call_log_inner_margin"
+                android:paddingTop="@dimen/call_log_inner_margin"
+                android:paddingBottom="@dimen/call_log_inner_margin"
+                android:paddingRight="@dimen/call_log_inner_margin"
+                android:scaleType="center"
+                android:background="?android:attr/selectableItemBackground"
+                android:nextFocusLeft="@id/primary_action_view"
+            />
+        </LinearLayout>
+
+    <TextView
+        android:id="@+id/call_log_header"
+        style="@style/ContactListSeparatorTextViewStyle"
+        android:layout_marginLeft="@dimen/call_log_outer_margin"
+        android:layout_marginRight="@dimen/call_log_outer_margin"
+        android:paddingTop="@dimen/call_log_inner_margin"
+        android:paddingBottom="@dimen/call_log_inner_margin" />
+
+    <View
+        android:id="@+id/call_log_divider"
+        android:layout_width="match_parent"
+        android:layout_height="1px"
+        android:layout_marginLeft="@dimen/call_log_outer_margin"
+        android:layout_marginRight="@dimen/call_log_outer_margin"
+        android:background="#55ffffff"
+    />
+</view>
diff --git a/res/layout/call_log_voicemail_status.xml b/res/layout/call_log_voicemail_status.xml
new file mode 100644
index 0000000..191c821
--- /dev/null
+++ b/res/layout/call_log_voicemail_status.xml
@@ -0,0 +1,46 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!-- Copyright (C) 2011 The Android Open Source Project
+
+     Licensed under the Apache License, Version 2.0 (the "License");
+     you may not use this file except in compliance with the License.
+     You may obtain a copy of the License at
+
+          http://www.apache.org/licenses/LICENSE-2.0
+
+     Unless required by applicable law or agreed to in writing, software
+     distributed under the License is distributed on an "AS IS" BASIS,
+     WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+     See the License for the specific language governing permissions and
+     limitations under the License.
+-->
+<merge xmlns:android="http://schemas.android.com/apk/res/android">
+    <LinearLayout
+        android:layout_width="match_parent"
+        android:layout_height="?attr/call_log_voicemail_status_height"
+        android:background="?attr/call_log_voicemail_status_background_color"
+    >
+        <TextView
+            android:id="@+id/voicemail_status_message"
+            android:layout_width="wrap_content"
+            android:layout_height="wrap_content"
+            android:layout_gravity="center_vertical"
+            android:layout_weight="1"
+            android:paddingLeft="@dimen/call_log_outer_margin"
+            android:paddingRight="@dimen/call_log_inner_margin"
+            android:textAppearance="?android:attr/textAppearanceMedium"
+            android:textColor="?attr/call_log_voicemail_status_text_color"
+        />
+        <TextView
+            android:id="@+id/voicemail_status_action"
+            android:layout_width="wrap_content"
+            android:layout_height="match_parent"
+            android:gravity="center_vertical"
+            android:paddingLeft="@dimen/call_log_inner_margin"
+            android:paddingRight="@dimen/call_log_outer_margin"
+            android:textAppearance="?android:attr/textAppearanceMedium"
+            android:textColor="?attr/call_log_voicemail_status_action_text_color"
+            android:background="?android:attr/selectableItemBackground"
+            android:clickable="true"
+        />
+    </LinearLayout>
+</merge>
diff --git a/res/layout/dialpad.xml b/res/layout/dialpad.xml
new file mode 100644
index 0000000..3ccb42d
--- /dev/null
+++ b/res/layout/dialpad.xml
@@ -0,0 +1,98 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!-- Copyright (C) 2006 The Android Open Source Project
+
+     Licensed under the Apache License, Version 2.0 (the "License");
+     you may not use this file except in compliance with the License.
+     You may obtain a copy of the License at
+
+          http://www.apache.org/licenses/LICENSE-2.0
+
+     Unless required by applicable law or agreed to in writing, software
+     distributed under the License is distributed on an "AS IS" BASIS,
+     WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+     See the License for the specific language governing permissions and
+     limitations under the License.
+-->
+
+<!-- Dialpad in the Phone app. -->
+<TableLayout
+    xmlns:android="http://schemas.android.com/apk/res/android"
+    android:id="@+id/dialpad"
+    android:layout_width="match_parent"
+    android:layout_height="0px"
+    android:layout_weight="@integer/dialpad_layout_weight_dialpad"
+    android:layout_gravity="center_horizontal"
+    android:layout_marginTop="@dimen/dialpad_vertical_margin"
+    android:paddingLeft="5dip"
+    android:paddingRight="5dip"
+    android:paddingBottom="10dip"
+    android:background="@drawable/dialpad_background">
+
+    <TableRow
+         android:layout_height="0px"
+         android:layout_weight="1">
+        <com.android.dialer.dialpad.DialpadImageButton
+            android:id="@+id/one" style="@style/DialtactsDialpadButtonStyle"
+            android:src="@drawable/dial_num_1_wht"
+            android:contentDescription="@string/description_image_button_one" />
+        <com.android.dialer.dialpad.DialpadImageButton
+            android:id="@+id/two" style="@style/DialtactsDialpadButtonStyle"
+            android:src="@drawable/dial_num_2_wht"
+            android:contentDescription="@string/description_image_button_two" />
+        <com.android.dialer.dialpad.DialpadImageButton
+            android:id="@+id/three" style="@style/DialtactsDialpadButtonStyle"
+            android:src="@drawable/dial_num_3_wht"
+            android:contentDescription="@string/description_image_button_three" />
+    </TableRow>
+
+    <TableRow
+         android:layout_height="0px"
+         android:layout_weight="1">
+        <com.android.dialer.dialpad.DialpadImageButton
+            android:id="@+id/four" style="@style/DialtactsDialpadButtonStyle"
+            android:src="@drawable/dial_num_4_wht"
+            android:contentDescription="@string/description_image_button_four" />
+        <com.android.dialer.dialpad.DialpadImageButton
+            android:id="@+id/five" style="@style/DialtactsDialpadButtonStyle"
+            android:src="@drawable/dial_num_5_wht"
+            android:contentDescription="@string/description_image_button_five" />
+        <com.android.dialer.dialpad.DialpadImageButton
+            android:id="@+id/six" style="@style/DialtactsDialpadButtonStyle"
+            android:src="@drawable/dial_num_6_wht"
+            android:contentDescription="@string/description_image_button_six" />
+    </TableRow>
+
+    <TableRow
+         android:layout_height="0px"
+         android:layout_weight="1">
+        <com.android.dialer.dialpad.DialpadImageButton
+            android:id="@+id/seven" style="@style/DialtactsDialpadButtonStyle"
+            android:src="@drawable/dial_num_7_wht"
+            android:contentDescription="@string/description_image_button_seven" />
+        <com.android.dialer.dialpad.DialpadImageButton
+            android:id="@+id/eight" style="@style/DialtactsDialpadButtonStyle"
+            android:src="@drawable/dial_num_8_wht"
+            android:contentDescription="@string/description_image_button_eight" />
+        <com.android.dialer.dialpad.DialpadImageButton
+            android:id="@+id/nine" style="@style/DialtactsDialpadButtonStyle"
+            android:src="@drawable/dial_num_9_wht"
+            android:contentDescription="@string/description_image_button_nine" />
+    </TableRow>
+
+    <TableRow
+         android:layout_height="0px"
+         android:layout_weight="1">
+        <com.android.dialer.dialpad.DialpadImageButton
+            android:id="@+id/star" style="@style/DialtactsDialpadButtonStyle"
+            android:src="@drawable/dial_num_star_wht"
+            android:contentDescription="@string/description_image_button_star" />
+        <com.android.dialer.dialpad.DialpadImageButton
+            android:id="@+id/zero" style="@style/DialtactsDialpadButtonStyle"
+            android:src="@drawable/dial_num_0_wht"
+            android:contentDescription="@string/description_image_button_zero" />
+        <com.android.dialer.dialpad.DialpadImageButton
+            android:id="@+id/pound" style="@style/DialtactsDialpadButtonStyle"
+            android:src="@drawable/dial_num_pound_wht"
+            android:contentDescription="@string/description_image_button_pound" />
+    </TableRow>
+</TableLayout>
diff --git a/res/layout/dialpad_chooser_list_item.xml b/res/layout/dialpad_chooser_list_item.xml
new file mode 100644
index 0000000..853ca47
--- /dev/null
+++ b/res/layout/dialpad_chooser_list_item.xml
@@ -0,0 +1,35 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!-- Copyright (C) 2008 The Android Open Source Project
+
+     Licensed under the Apache License, Version 2.0 (the "License");
+     you may not use this file except in compliance with the License.
+     You may obtain a copy of the License at
+  
+          http://www.apache.org/licenses/LICENSE-2.0
+  
+     Unless required by applicable law or agreed to in writing, software
+     distributed under the License is distributed on an "AS IS" BASIS,
+     WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+     See the License for the specific language governing permissions and
+     limitations under the License.
+-->
+
+<!-- Layout of a single item in the Dialer's "Dialpad chooser" UI. -->
+<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
+    android:orientation="horizontal"
+    android:layout_width="match_parent"
+    android:layout_height="match_parent">
+
+    <ImageView android:id="@+id/icon"
+        android:layout_width="64dp"
+        android:layout_height="64dp"
+        android:scaleType="center" />
+
+    <TextView android:id="@+id/text"
+        android:textAppearance="?android:attr/textAppearanceMedium"
+        android:layout_gravity="center_vertical"
+        android:layout_width="0dip"
+        android:layout_weight="1"
+        android:layout_height="wrap_content" />
+
+</LinearLayout>
diff --git a/res/layout/dialpad_fragment.xml b/res/layout/dialpad_fragment.xml
new file mode 100644
index 0000000..6423638
--- /dev/null
+++ b/res/layout/dialpad_fragment.xml
@@ -0,0 +1,98 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!-- Copyright (C) 2011 The Android Open Source Project
+
+     Licensed under the Apache License, Version 2.0 (the "License");
+     you may not use this file except in compliance with the License.
+     You may obtain a copy of the License at
+
+          http://www.apache.org/licenses/LICENSE-2.0
+
+     Unless required by applicable law or agreed to in writing, software
+     distributed under the License is distributed on an "AS IS" BASIS,
+     WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+     See the License for the specific language governing permissions and
+     limitations under the License.
+-->
+
+<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
+    android:id="@+id/top"
+    android:layout_width="match_parent"
+    android:layout_height="match_parent"
+    android:orientation="vertical"
+    android:paddingLeft="@dimen/dialpad_horizontal_margin"
+    android:paddingRight="@dimen/dialpad_horizontal_margin">
+
+    <!-- Text field and possibly soft menu button above the keypad where
+         the digits are displayed. -->
+    <LinearLayout
+        android:id="@+id/digits_container"
+        android:layout_width="match_parent"
+        android:layout_height="0px"
+        android:layout_weight="@integer/dialpad_layout_weight_digits"
+        android:layout_marginTop="@dimen/dialpad_vertical_margin"
+        android:gravity="center"
+        android:background="@drawable/dialpad_background" >
+
+        <com.android.dialer.dialpad.DigitsEditText
+            android:id="@+id/digits"
+            android:layout_width="0dip"
+            android:layout_weight="1"
+            android:layout_height="match_parent"
+            android:gravity="center"
+            android:textAppearance="@style/DialtactsDigitsTextAppearance"
+            android:textColor="?android:attr/textColorPrimary"
+            android:nextFocusRight="@+id/overflow_menu"
+            android:background="@android:color/transparent" />
+
+        <ImageButton
+            android:id="@+id/deleteButton"
+            android:layout_width="56dip"
+            android:layout_height="match_parent"
+            android:layout_gravity="center_vertical"
+            android:gravity="center"
+            android:state_enabled="false"
+            android:background="?android:attr/selectableItemBackground"
+            android:contentDescription="@string/description_delete_button"
+            android:src="@drawable/ic_dial_action_delete" />
+    </LinearLayout>
+
+    <!-- Keypad section -->
+    <include layout="@layout/dialpad" />
+
+    <View
+       android:layout_width="match_parent"
+       android:layout_height="@dimen/dialpad_vertical_margin"
+       android:background="#66000000"/>
+
+    <!-- left and right paddings will be modified by the code. See DialpadFragment. -->
+    <FrameLayout
+        android:id="@+id/dialButtonContainer"
+        android:layout_width="match_parent"
+        android:layout_height="0px"
+        android:layout_weight="@integer/dialpad_layout_weight_additional_buttons"
+        android:layout_gravity="center_horizontal"
+        android:background="@drawable/dialpad_background">
+
+        <ImageButton
+            android:id="@+id/dialButton"
+            android:layout_width="match_parent"
+            android:layout_height="match_parent"
+            android:layout_gravity="center"
+            android:state_enabled="false"
+            android:background="@drawable/btn_call"
+            android:contentDescription="@string/description_dial_button"
+            android:src="@drawable/ic_dial_action_call" />
+
+    </FrameLayout>
+
+    <!-- "Dialpad chooser" UI, shown only when the user brings up the
+         Dialer while a call is already in progress.
+         When this UI is visible, the other Dialer elements
+         (the textfield/button and the dialpad) are hidden. -->
+    <ListView android:id="@+id/dialpadChooser"
+        android:layout_width="match_parent"
+        android:layout_height="1dip"
+        android:layout_weight="1"
+    />
+
+</LinearLayout>
diff --git a/res/layout/dialtacts_activity.xml b/res/layout/dialtacts_activity.xml
new file mode 100644
index 0000000..35fa00f
--- /dev/null
+++ b/res/layout/dialtacts_activity.xml
@@ -0,0 +1,47 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!-- Copyright (C) 2006 The Android Open Source Project
+
+     Licensed under the Apache License, Version 2.0 (the "License");
+     you may not use this file except in compliance with the License.
+     You may obtain a copy of the License at
+
+          http://www.apache.org/licenses/LICENSE-2.0
+
+     Unless required by applicable law or agreed to in writing, software
+     distributed under the License is distributed on an "AS IS" BASIS,
+     WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+     See the License for the specific language governing permissions and
+     limitations under the License.
+-->
+
+<FrameLayout xmlns:android="http://schemas.android.com/apk/res/android"
+    android:layout_width="match_parent"
+    android:layout_height="match_parent"
+    android:layout_marginTop="?android:attr/actionBarSize"
+    android:id="@+id/dialtacts_frame"
+    >
+    <android.support.v4.view.ViewPager
+        android:id="@+id/pager"
+        android:layout_width="match_parent"
+        android:layout_height="match_parent" />
+
+    <ImageButton
+         android:id="@+id/searchButton"
+         android:layout_width="wrap_content"
+         android:layout_height="?android:attr/actionBarSize"
+         android:layout_gravity="bottom|left"
+         android:state_enabled="false"
+         android:background="?android:attr/selectableItemBackground"
+         android:contentDescription="@string/description_search_button"
+         android:src="@drawable/ic_dial_action_search"/>
+
+    <ImageButton
+         android:id="@+id/overflow_menu"
+         android:layout_width="wrap_content"
+         android:layout_height="?android:attr/actionBarSize"
+         android:layout_gravity="bottom|right"
+         android:src="@drawable/ic_menu_overflow"
+         android:contentDescription="@string/action_menu_overflow_description"
+         android:nextFocusLeft="@id/digits"
+         android:background="?android:attr/selectableItemBackground"/>
+</FrameLayout>
diff --git a/res/layout/dialtacts_custom_action_bar.xml b/res/layout/dialtacts_custom_action_bar.xml
new file mode 100644
index 0000000..0af8eaa
--- /dev/null
+++ b/res/layout/dialtacts_custom_action_bar.xml
@@ -0,0 +1,43 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!-- Copyright (C) 2011 The Android Open Source Project
+
+     Licensed under the Apache License, Version 2.0 (the "License");
+     you may not use this file except in compliance with the License.
+     You may obtain a copy of the License at
+
+          http://www.apache.org/licenses/LICENSE-2.0
+
+     Unless required by applicable law or agreed to in writing, software
+     distributed under the License is distributed on an "AS IS" BASIS,
+     WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+     See the License for the specific language governing permissions and
+     limitations under the License.
+-->
+
+<!-- Dimensions are set at runtime in ActionBarAdapter -->
+<LinearLayout
+    xmlns:android="http://schemas.android.com/apk/res/android"
+    android:layout_width="0dip"
+    android:layout_height="0dip"
+    android:orientation="horizontal">
+
+    <SearchView
+        android:id="@+id/search_view"
+        android:layout_width="0px"
+        android:layout_height="match_parent"
+        android:layout_weight="1"
+        android:iconifiedByDefault="false"
+        android:inputType="textFilter" />
+
+    <ImageButton
+        android:id="@+id/search_option"
+        android:layout_width="wrap_content"
+        android:paddingLeft="4dip"
+        android:paddingRight="4dip"
+        android:layout_height="match_parent"
+        android:layout_alignParentRight="true"
+        android:src="@drawable/ic_menu_overflow"
+        android:background="?android:attr/selectableItemBackground"
+        android:visibility="gone" />
+
+</LinearLayout>