Merge "Adding "make personal copy" feature"
diff --git a/res/drawable-hdpi/view_bg.9.png b/res/drawable-hdpi/contact_view_bg.9.png
similarity index 100%
rename from res/drawable-hdpi/view_bg.9.png
rename to res/drawable-hdpi/contact_view_bg.9.png
Binary files differ
diff --git a/res/drawable-xlarge/contact_view_background_left.xml b/res/drawable-xlarge/contact_view_background_left.xml
new file mode 100644
index 0000000..e2fabae
--- /dev/null
+++ b/res/drawable-xlarge/contact_view_background_left.xml
@@ -0,0 +1,25 @@
+<?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.
+-->
+
+<shape
+    xmlns:android="http://schemas.android.com/apk/res/android"
+    android:shape="rectangle">
+    <gradient
+        android:angle="270"
+        android:startColor="#ff6a9cff"
+        android:endColor="#c9d7e1f5"
+        android:type="linear" />
+</shape>
diff --git a/res/drawable-xlarge/social_bubble.9.png b/res/drawable-xlarge/social_bubble.9.png
new file mode 100644
index 0000000..b3dacb5
--- /dev/null
+++ b/res/drawable-xlarge/social_bubble.9.png
Binary files differ
diff --git a/res/layout-xlarge/contact_browser.xml b/res/layout-xlarge/contact_browser.xml
index e8614d1..4643e44 100644
--- a/res/layout-xlarge/contact_browser.xml
+++ b/res/layout-xlarge/contact_browser.xml
@@ -34,6 +34,5 @@
         android:layout_width="0px"
         android:layout_height="match_parent"
         android:layout_weight="1"
-        android:background="@drawable/view_bg"
         android:layout_marginLeft="-4dip" />
 </LinearLayout>
diff --git a/res/layout-xlarge/contact_detail_fragment.xml b/res/layout-xlarge/contact_detail_fragment.xml
new file mode 100644
index 0000000..c5a7a82
--- /dev/null
+++ b/res/layout-xlarge/contact_detail_fragment.xml
@@ -0,0 +1,77 @@
+<?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.
+-->
+
+<FrameLayout
+    xmlns:android="http://schemas.android.com/apk/res/android"
+    android:layout_width="match_parent"
+    android:layout_height="match_parent">
+    <!-- Background -->
+    <LinearLayout
+        android:orientation="horizontal"
+        android:layout_width="match_parent"
+        android:layout_height="match_parent">
+        <View
+            android:layout_width="208dip"
+            android:layout_height="match_parent"
+            android:background="@drawable/contact_view_background_left" />
+        <View
+            android:layout_width="match_parent"
+            android:layout_height="match_parent"
+            android:background="#bff3f3f3" />
+    </LinearLayout>
+
+    <!-- Content -->
+    <LinearLayout
+        android:id="@+id/contact_detail"
+        android:orientation="vertical"
+        android:layout_width="match_parent"
+        android:layout_height="match_parent">
+
+        <com.android.contacts.views.detail.ContactDetailHeaderView
+            android:id="@+id/contact_header_widget"
+            android:layout_width="match_parent"
+            android:layout_height="wrap_content"
+            android:paddingLeft="128dip"
+        />
+
+        <ListView android:id="@android:id/list"
+            android:layout_width="match_parent"
+            android:layout_height="0px"
+            android:layout_weight="1"
+            android:paddingLeft="230dip"
+            android:cacheColorHint="#00000000"
+        />
+
+        <ScrollView android:id="@android:id/empty"
+            android:layout_width="match_parent"
+            android:layout_height="0px"
+            android:layout_weight="1"
+            android:visibility="gone"
+        >
+            <TextView android:id="@+id/emptyText"
+                android:layout_width="match_parent"
+                android:layout_height="wrap_content"
+                android:text="@string/no_contact_details"
+                android:textSize="20sp"
+                android:textColor="?android:attr/textColorSecondary"
+                android:paddingLeft="10dip"
+                android:paddingRight="10dip"
+                android:paddingTop="10dip"
+                android:lineSpacingMultiplier="0.92"
+            />
+        </ScrollView>
+    </LinearLayout>
+</FrameLayout>
\ No newline at end of file
diff --git a/res/layout-xlarge/contact_detail_header_view.xml b/res/layout-xlarge/contact_detail_header_view.xml
new file mode 100644
index 0000000..db85216
--- /dev/null
+++ b/res/layout-xlarge/contact_detail_header_view.xml
@@ -0,0 +1,136 @@
+<?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.
+-->
+
+<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
+    android:id="@+id/banner"
+    android:layout_width="match_parent"
+    android:layout_height="wrap_content"
+    android:orientation="horizontal"
+    android:paddingTop="40dip"
+    android:paddingRight="5dip">
+
+    <android.widget.QuickContactBadge android:id="@+id/photo"
+        android:layout_gravity="center_vertical"
+        android:layout_marginRight="8dip"
+        android:layout_marginLeft="-1dip"
+        android:layout_width="96dip"
+        android:layout_height="96dip"
+        android:src="@*android:drawable/ic_contact_picture"
+        />
+    />
+
+    <LinearLayout
+        android:layout_width="0px"
+        android:layout_height="wrap_content"
+        android:layout_weight="1"
+        android:orientation="vertical">
+
+        <LinearLayout
+            android:layout_width="match_parent"
+            android:layout_height="wrap_content"
+            android:orientation="horizontal">
+
+            <CheckBox
+                android:id="@+id/star"
+                android:layout_width="wrap_content"
+                android:layout_height="wrap_content"
+                android:layout_gravity="center_vertical"
+                android:contentDescription="@string/description_star"
+                style="?android:attr/starStyle" />
+
+            <LinearLayout
+                android:layout_width="0dip"
+                android:layout_height="wrap_content"
+                android:layout_weight="1"
+                android:orientation="vertical"
+                android:layout_gravity="center_vertical" >
+
+                <TextView android:id="@+id/name"
+                    android:layout_width="match_parent"
+                    android:layout_height="wrap_content"
+                    android:singleLine="true"
+                    android:ellipsize="end"
+                    android:textSize="26sp"
+                />
+
+                <TextView android:id="@+id/phonetic_name"
+                    android:layout_width="match_parent"
+                    android:layout_height="wrap_content"
+                    android:textAppearance="?android:attr/textAppearanceSmall"
+                    android:singleLine="true"
+                    android:ellipsize="end"
+                    android:layout_marginTop="-2dip"
+                    android:visibility="gone"
+                />
+
+                <TextView android:id="@+id/directory_name"
+                    android:layout_width="match_parent"
+                    android:layout_height="wrap_content"
+                    android:textAppearance="?android:attr/textAppearanceSmall"
+                    android:textColor="?android:attr/textColorSecondary"
+                    android:singleLine="true"
+                    android:ellipsize="end"
+                    android:layout_marginTop="-2dip"
+                    android:visibility="gone"
+                />
+            </LinearLayout>
+
+            <ImageView
+                android:id="@+id/presence"
+                android:layout_width="wrap_content"
+                android:layout_height="wrap_content"
+                android:layout_gravity="center_vertical"
+                android:paddingLeft="3dip"
+                android:paddingRight="6dip"
+                android:visibility="gone"
+            />
+        </LinearLayout>
+
+        <!-- Status info -->
+        <LinearLayout
+            android:id="@+id/status_container"
+            android:layout_width="match_parent"
+            android:layout_height="wrap_content"
+            android:orientation="vertical"
+            android:background="@drawable/social_bubble"
+            android:layout_marginTop="30dip"
+            android:paddingLeft="64dip"
+            android:paddingTop="20dip"
+            android:paddingRight="8dip"
+            android:paddingBottom="20dip"
+            android:visibility="gone">
+
+            <TextView android:id="@+id/status"
+                android:layout_width="match_parent"
+                android:layout_height="wrap_content"
+                android:textSize="14sp"
+                android:textColor="#ffffffff"
+                android:maxLines="2"
+                android:ellipsize="end"
+                android:visibility="gone"
+            />
+
+            <TextView android:id="@+id/status_date"
+                android:layout_width="match_parent"
+                android:layout_height="0dip"
+                android:layout_weight="1"
+                android:textSize="14sp"
+                android:textColor="#99999999"
+                android:visibility="gone"
+            />
+        </LinearLayout>
+    </LinearLayout>
+</LinearLayout>
diff --git a/res/layout/contact_detail_fragment.xml b/res/layout/contact_detail_fragment.xml
index 8c1bef4..180114b 100644
--- a/res/layout/contact_detail_fragment.xml
+++ b/res/layout/contact_detail_fragment.xml
@@ -4,9 +4,9 @@
      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.
@@ -31,7 +31,7 @@
         android:layout_weight="1"
         android:background="@drawable/title_bar_shadow"
     />
-    
+
     <ScrollView android:id="@android:id/empty"
         android:layout_width="match_parent"
         android:layout_height="0px"
diff --git a/res/values-xlarge/colors.xml b/res/values-xlarge/colors.xml
index b2d1444..9490fa2 100644
--- a/res/values-xlarge/colors.xml
+++ b/res/values-xlarge/colors.xml
@@ -22,7 +22,7 @@
     <color name="aizy_empty_section">#ffcccccc</color>
 
     <!-- Color used in the Aizy visual scroll control for non-empty sections -->
-    <color name="aizy_non_empty_section">#ff666666</color>
+    <color name="aizy_non_empty_section">#ff9490a0</color>
 
     <!-- Color used for the letter in the A-Z section header -->
     <color name="section_header_text_color">#ff000000</color>
diff --git a/res/values-xlarge/dimens.xml b/res/values-xlarge/dimens.xml
index e99b257..7f1edf1 100644
--- a/res/values-xlarge/dimens.xml
+++ b/res/values-xlarge/dimens.xml
@@ -16,5 +16,5 @@
 
 <resources>
     <!-- Size of the text in the aizy visual scroll control -->
-    <dimen name="aizy_text_size">17dip</dimen>
+    <dimen name="aizy_text_size">12sp</dimen>
 </resources>
diff --git a/src/com/android/contacts/list/ContactListAizyView.java b/src/com/android/contacts/list/ContactListAizyView.java
index a2fa706..a57cc9f 100644
--- a/src/com/android/contacts/list/ContactListAizyView.java
+++ b/src/com/android/contacts/list/ContactListAizyView.java
@@ -26,6 +26,7 @@
 import android.graphics.Paint.Align;
 import android.graphics.Paint.FontMetrics;
 import android.graphics.Rect;
+import android.graphics.Typeface;
 import android.util.AttributeSet;
 import android.view.Gravity;
 import android.view.LayoutInflater;
@@ -196,6 +197,7 @@
             mPaint.setTextSize(mResourceValues.textSize);
             mPaint.setAntiAlias(true);
             mPaint.setTextAlign(Align.CENTER);
+            mPaint.setTypeface(Typeface.DEFAULT_BOLD);
         }
         if (mFontMetrics == null) {
             mFontMetrics = mPaint.getFontMetrics();
diff --git a/src/com/android/contacts/views/detail/ContactDetailHeaderView.java b/src/com/android/contacts/views/detail/ContactDetailHeaderView.java
index 553637d..8ac9ce7 100644
--- a/src/com/android/contacts/views/detail/ContactDetailHeaderView.java
+++ b/src/com/android/contacts/views/detail/ContactDetailHeaderView.java
@@ -62,8 +62,9 @@
     private CheckBox mStarredView;
     private QuickContactBadge mPhotoView;
     private ImageView mPresenceView;
+    private View mStatusContainerView;
     private TextView mStatusView;
-    private TextView mStatusAttributionView;
+    private TextView mStatusDateView;
     private TextView mDirectoryNameView;
 
     private Uri mContactUri;
@@ -102,8 +103,9 @@
         mPhotoView = (QuickContactBadge) findViewById(R.id.photo);
 
         mPresenceView = (ImageView) findViewById(R.id.presence);
+        mStatusContainerView = findViewById(R.id.status_container);
         mStatusView = (TextView)findViewById(R.id.status);
-        mStatusAttributionView = (TextView)findViewById(R.id.status_date);
+        mStatusDateView = (TextView)findViewById(R.id.status_date);
 
         mDirectoryNameView = (TextView) findViewById(R.id.directory_name);
     }
@@ -216,25 +218,25 @@
     /**
      * Set the social snippet text to display in the header.
      */
-    private void setSocialSnippet(CharSequence snippet) {
+    private void setStatus(CharSequence snippet, CharSequence snippetDate) {
         if (snippet == null) {
+            // No status info. Hide everything
+            if (mStatusContainerView != null) mStatusContainerView.setVisibility(View.GONE);
             mStatusView.setVisibility(View.GONE);
-            mStatusAttributionView.setVisibility(View.GONE);
+            mStatusDateView.setVisibility(View.GONE);
         } else {
-            mStatusView.setText(snippet);
+            // We have status info. Show the bubble
+            if (mStatusContainerView != null) mStatusContainerView.setVisibility(View.VISIBLE);
             mStatusView.setVisibility(View.VISIBLE);
-        }
-    }
+            mStatusView.setText(snippet);
 
-    /**
-     * Set the status attribution text to display in the header.
-     */
-    private void setStatusAttribution(CharSequence attribution) {
-        if (attribution == null) {
-            mStatusAttributionView.setVisibility(View.GONE);
-        } else {
-            mStatusAttributionView.setText(attribution);
-            mStatusAttributionView.setVisibility(View.VISIBLE);
+            // Also show date info?
+            if (snippetDate == null) {
+                mStatusDateView.setVisibility(View.GONE);
+            } else {
+                mStatusDateView.setVisibility(View.VISIBLE);
+                mStatusDateView.setText(snippetDate);
+            }
         }
     }
 
@@ -262,12 +264,10 @@
     private void setStatus(final String status, final Long statusTimestamp,
             final Integer statusLabel, final String statusResPackage) {
         if (TextUtils.isEmpty(status)) {
-            setSocialSnippet(null);
+            setStatus(null, null);
             return;
         }
 
-        setSocialSnippet(status);
-
         final CharSequence timestampDisplayValue;
 
         if (statusTimestamp != null) {
@@ -310,21 +310,21 @@
             }
         }
 
-        final CharSequence attribution;
+        final CharSequence snippetDate;
         if (timestampDisplayValue != null && labelDisplayValue != null) {
-            attribution = getContext().getString(
+            snippetDate = getContext().getString(
                     R.string.contact_status_update_attribution_with_date,
                     timestampDisplayValue, labelDisplayValue);
         } else if (timestampDisplayValue == null && labelDisplayValue != null) {
-            attribution = getContext().getString(
+            snippetDate = getContext().getString(
                     R.string.contact_status_update_attribution,
                     labelDisplayValue);
         } else if (timestampDisplayValue != null) {
-            attribution = timestampDisplayValue;
+            snippetDate = timestampDisplayValue;
         } else {
-            attribution = null;
+            snippetDate = null;
         }
-        setStatusAttribution(attribution);
+        setStatus(status, snippetDate);
     }
 
     private void setDirectoryName(boolean isDirectoryEntry, String directoryDisplayName,