Adjusting contact editor for portrait orientation

Change-Id: Ifed16ed951fa28507ea15e1f1a438928c6b2a448
diff --git a/res/layout-xlarge/contact_editor_activity.xml b/res/layout-xlarge/contact_editor_activity.xml
index 3b6acb9..1cf44f8 100644
--- a/res/layout-xlarge/contact_editor_activity.xml
+++ b/res/layout-xlarge/contact_editor_activity.xml
@@ -14,16 +14,25 @@
      limitations under the License.
 -->
 
-<FrameLayout xmlns:android="http://schemas.android.com/apk/res/android"
+<FrameLayout 
+    xmlns:android="http://schemas.android.com/apk/res/android"
+    xmlns:ex="http://schemas.android.com/apk/res/com.android.contacts"
     android:layout_width="match_parent"
     android:layout_height="match_parent"
-    android:paddingLeft="160dip"
-    android:paddingRight="160dip"
-    android:background="@drawable/contact_list_bg"
-    >
-
-    <fragment class="com.android.contacts.views.editor.ContactEditorFragment"
+    android:background="@drawable/contact_list_bg">
+    <com.android.contacts.widget.InterpolatingLayout
+        android:layout_width="match_parent"
+        android:layout_height="match_parent">
+        <fragment class="com.android.contacts.views.editor.ContactEditorFragment"
             android:id="@+id/contact_editor_fragment"
             android:layout_width="match_parent"
-            android:layout_height="match_parent" />
+            android:layout_height="match_parent"
+            ex:layout_wideParentWidth="1280dip"
+            ex:layout_wideLeftMargin="160dip"
+            ex:layout_wideRightMargin="160dip"
+            ex:layout_narrowParentWidth="800dip"
+            ex:layout_narrowLeftMargin="0dip"
+            ex:layout_narrowRightMargin="0dip"
+         />
+    </com.android.contacts.widget.InterpolatingLayout>
 </FrameLayout>
diff --git a/res/layout-xlarge/contact_editor_fragment.xml b/res/layout-xlarge/contact_editor_fragment.xml
index d66f8b4..59f1931 100644
--- a/res/layout-xlarge/contact_editor_fragment.xml
+++ b/res/layout-xlarge/contact_editor_fragment.xml
@@ -14,25 +14,31 @@
      limitations under the License.
 -->
 
-<FrameLayout xmlns:android="http://schemas.android.com/apk/res/android"
+<FrameLayout 
+    xmlns:android="http://schemas.android.com/apk/res/android"
+    xmlns:ex="http://schemas.android.com/apk/res/com.android.contacts"
     android:layout_width="match_parent"
     android:layout_height="match_parent"
 >
 
     <!-- Background -->
-    <LinearLayout
-        android:orientation="horizontal"
+    <com.android.contacts.widget.InterpolatingLayout
         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" />
+            android:background="@drawable/contact_view_background_left"
+            ex:layout_wideParentWidth="1280dip"
+            ex:layout_wideWidth="210dip"
+            ex:layout_narrowParentWidth="800dip"
+            ex:layout_narrowWidth="40dip"
+        />
         <View
             android:layout_width="match_parent"
             android:layout_height="match_parent"
             android:background="#bff3f3f3" />
-    </LinearLayout>
+    </com.android.contacts.widget.InterpolatingLayout>
 
     <!-- Content -->
     <ScrollView
diff --git a/res/layout-xlarge/item_contact_editor.xml b/res/layout-xlarge/item_contact_editor.xml
index f350f36..39248d6 100644
--- a/res/layout-xlarge/item_contact_editor.xml
+++ b/res/layout-xlarge/item_contact_editor.xml
@@ -16,6 +16,7 @@
 
 <com.android.contacts.ui.widget.ContactEditorView
     xmlns:android="http://schemas.android.com/apk/res/android"
+    xmlns:ex="http://schemas.android.com/apk/res/com.android.contacts"
     android:layout_width="match_parent"
     android:layout_height="wrap_content"
     android:orientation="vertical"
@@ -82,48 +83,70 @@
         android:id="@+id/body"
         android:layout_width="match_parent"
         android:layout_height="wrap_content"
-        android:orientation="vertical">
+        android:orientation="vertical"
+        android:paddingTop="10dip"
+        >
 
-        <FrameLayout
-            android:id="@+id/stub_photo"
+        <com.android.contacts.widget.InterpolatingLayout
             android:layout_width="match_parent"
-            android:layout_height="wrap_content"
-            android:paddingLeft="128dip"
-            android:paddingTop="10dip">
+            android:layout_height="wrap_content">
+            <FrameLayout
+                android:id="@+id/stub_photo"
+                android:layout_width="match_parent"
+                android:layout_height="wrap_content"
+                ex:layout_wideParentWidth="960dip"
+                ex:layout_wideLeftMargin="128dip"
+                ex:layout_narrowParentWidth="800dip"
+                ex:layout_narrowLeftMargin="15dip"
+                >
 
-            <include
-                android:id="@+id/edit_photo"
-                layout="@layout/item_photo_editor" />
+                <include
+                    android:id="@+id/edit_photo"
+                    layout="@layout/item_photo_editor" />
 
-        </FrameLayout>
+            </FrameLayout>
+        </com.android.contacts.widget.InterpolatingLayout>
 
-        <com.android.contacts.ui.widget.GenericEditorView
-            android:id="@+id/edit_name"
+        <com.android.contacts.widget.InterpolatingLayout
             android:layout_width="match_parent"
-            android:layout_height="wrap_content"
-            android:paddingRight="?android:attr/scrollbarSize"
-            android:paddingLeft="230dip"
-            android:layout_below="@id/stub_photo"
-            android:layout_marginTop="6dip"
-            android:layout_marginBottom="4dip" />
+            android:layout_height="wrap_content">
+            <LinearLayout
+                android:layout_width="match_parent"
+                android:layout_height="wrap_content"
+                android:orientation="vertical"
+                ex:layout_wideParentWidth="960dip"
+                ex:layout_wideLeftMargin="230dip"
+                ex:layout_wideRightMargin="50dip"
+                ex:layout_narrowParentWidth="800dip"
+                ex:layout_narrowLeftMargin="160dip"
+                ex:layout_narrowRightMargin="50dip"
+                >
 
-        <ViewStub android:id="@+id/aggregation_suggestion_stub"
-            android:inflatedId="@+id/aggregation_suggestion"
-            android:layout="@layout/aggregation_suggestions"
-            android:layout_width="match_parent"
-            android:layout_height="wrap_content"
-            android:paddingLeft="230dip"
-            android:visibility="visible"/>
+                <com.android.contacts.ui.widget.GenericEditorView
+                    android:id="@+id/edit_name"
+                    android:layout_width="match_parent"
+                    android:layout_height="wrap_content"
+                    android:paddingRight="?android:attr/scrollbarSize"
+                    android:layout_below="@id/stub_photo"
+                    android:layout_marginTop="6dip"
+                    android:layout_marginBottom="4dip" />
 
-        <LinearLayout
-            android:id="@+id/sect_fields"
-            android:layout_width="match_parent"
-            android:layout_height="wrap_content"
-            android:paddingLeft="230dip"
-            android:orientation="vertical"
-            android:paddingRight="?android:attr/scrollbarSize"
-        />
+                <ViewStub android:id="@+id/aggregation_suggestion_stub"
+                    android:inflatedId="@+id/aggregation_suggestion"
+                    android:layout="@layout/aggregation_suggestions"
+                    android:layout_width="match_parent"
+                    android:layout_height="wrap_content"
+                    android:visibility="visible"/>
 
+                <LinearLayout
+                    android:id="@+id/sect_fields"
+                    android:layout_width="match_parent"
+                    android:layout_height="wrap_content"
+                    android:orientation="vertical"
+                    android:paddingRight="?android:attr/scrollbarSize"
+                />
+            </LinearLayout>
+        </com.android.contacts.widget.InterpolatingLayout>
         <View
             android:layout_width="match_parent"
             android:layout_height="1px"