diff --git a/res/layout-land/quickcontact_activity.xml b/res/layout-land/quickcontact_activity.xml
index 689ab9d..dd47a0b 100644
--- a/res/layout-land/quickcontact_activity.xml
+++ b/res/layout-land/quickcontact_activity.xml
@@ -30,7 +30,7 @@
         android:padding="32dip"
         android:orientation="horizontal">
         <view
-            class="com.android.contacts.widget.ProportionalLayout"
+            class="com.android.contacts.common.widget.ProportionalLayout"
             android:layout_width="wrap_content"
             android:layout_height="match_parent"
             ex:ratio="1.0"
diff --git a/res/layout-sw580dp/detail_header_contact_with_updates.xml b/res/layout-sw580dp/detail_header_contact_with_updates.xml
index c7fd25a..c515a76 100644
--- a/res/layout-sw580dp/detail_header_contact_with_updates.xml
+++ b/res/layout-sw580dp/detail_header_contact_with_updates.xml
@@ -31,7 +31,7 @@
 
     <!-- Add a first item that gives us enough space to show the carousel -->
     <view
-        class="com.android.contacts.widget.ProportionalLayout"
+        class="com.android.contacts.common.widget.ProportionalLayout"
         android:layout_width="match_parent"
         android:layout_height="wrap_content"
         ex:ratio="0.6667"
diff --git a/res/layout-sw580dp/detail_header_contact_without_updates.xml b/res/layout-sw580dp/detail_header_contact_without_updates.xml
index bc5a8e1..f8f560d 100644
--- a/res/layout-sw580dp/detail_header_contact_without_updates.xml
+++ b/res/layout-sw580dp/detail_header_contact_without_updates.xml
@@ -29,7 +29,7 @@
     <!-- Ensure that the contact photo for a contact WITHOUT social updates is the same width and
     height as a contact WITH social updates (where the photo is 2/3 of the screen width). -->
     <view
-        class="com.android.contacts.widget.ProportionalLayout"
+        class="com.android.contacts.common.widget.ProportionalLayout"
         android:layout_width="match_parent"
         android:layout_height="match_parent"
         ex:ratio="0.6667"
diff --git a/res/layout-sw580dp/updates_header_contact.xml b/res/layout-sw580dp/updates_header_contact.xml
index 6079499..10b6bd8 100644
--- a/res/layout-sw580dp/updates_header_contact.xml
+++ b/res/layout-sw580dp/updates_header_contact.xml
@@ -26,7 +26,7 @@
 
     <!-- This blank view pushes the other content down because of the tab carousel -->
     <view
-        class="com.android.contacts.widget.ProportionalLayout"
+        class="com.android.contacts.common.widget.ProportionalLayout"
         android:layout_width="match_parent"
         android:layout_height="wrap_content"
         android:layout_marginBottom="8dip"
diff --git a/res/layout/detail_header_contact_with_updates.xml b/res/layout/detail_header_contact_with_updates.xml
index 3391595..dc4cf8b 100644
--- a/res/layout/detail_header_contact_with_updates.xml
+++ b/res/layout/detail_header_contact_with_updates.xml
@@ -26,7 +26,7 @@
     android:layout_width="match_parent"
     android:layout_height="wrap_content">
     <view
-        class="com.android.contacts.widget.ProportionalLayout"
+        class="com.android.contacts.common.widget.ProportionalLayout"
         android:layout_width="match_parent"
         android:layout_height="wrap_content"
         android:layout_marginBottom="@dimen/detail_contact_photo_shadow_height"
diff --git a/res/layout/detail_header_contact_without_updates.xml b/res/layout/detail_header_contact_without_updates.xml
index b261511..27f6288 100644
--- a/res/layout/detail_header_contact_without_updates.xml
+++ b/res/layout/detail_header_contact_without_updates.xml
@@ -27,7 +27,7 @@
 
     <!-- Contact photo -->
     <view
-        class="com.android.contacts.widget.ProportionalLayout"
+        class="com.android.contacts.common.widget.ProportionalLayout"
         android:layout_width="match_parent"
         android:layout_height="wrap_content"
         ex:ratio="0.5"
diff --git a/res/layout/quickcontact_activity.xml b/res/layout/quickcontact_activity.xml
index b3351ba..66ddbc6 100644
--- a/res/layout/quickcontact_activity.xml
+++ b/res/layout/quickcontact_activity.xml
@@ -32,7 +32,7 @@
         android:paddingTop="8dip"
         android:orientation="vertical">
         <view
-            class="com.android.contacts.widget.ProportionalLayout"
+            class="com.android.contacts.common.widget.ProportionalLayout"
             android:layout_width="match_parent"
             android:layout_height="wrap_content"
             ex:ratio="0.5"
diff --git a/res/layout/stream_item_row_images.xml b/res/layout/stream_item_row_images.xml
index 7e440ab..a96e2d2 100644
--- a/res/layout/stream_item_row_images.xml
+++ b/res/layout/stream_item_row_images.xml
@@ -22,7 +22,7 @@
     android:layout_marginTop="@dimen/detail_update_section_between_items_padding">
 
     <view
-        class="com.android.contacts.widget.ProportionalLayout"
+        class="com.android.contacts.common.widget.ProportionalLayout"
         android:layout_width="0dip"
         android:layout_height="wrap_content"
         android:layout_marginRight="@dimen/detail_update_section_between_items_padding"
@@ -38,7 +38,7 @@
 
     <view
         android:id="@+id/second_image_container"
-        class="com.android.contacts.widget.ProportionalLayout"
+        class="com.android.contacts.common.widget.ProportionalLayout"
         android:layout_width="0dip"
         android:layout_height="wrap_content"
         android:layout_weight="1"
diff --git a/res/layout/updates_header_contact.xml b/res/layout/updates_header_contact.xml
index 9b59c82..33e1c02 100644
--- a/res/layout/updates_header_contact.xml
+++ b/res/layout/updates_header_contact.xml
@@ -26,7 +26,7 @@
 
     <!-- This blank view pushes the other content down because of the tab carousel -->
     <view
-        class="com.android.contacts.widget.ProportionalLayout"
+        class="com.android.contacts.common.widget.ProportionalLayout"
         android:layout_width="match_parent"
         android:layout_height="wrap_content"
         android:layout_marginBottom="@dimen/detail_contact_photo_shadow_height"
diff --git a/src/com/android/contacts/widget/ProportionalLayout.java b/src/com/android/contacts/widget/ProportionalLayout.java
deleted file mode 100644
index d069eb7..0000000
--- a/src/com/android/contacts/widget/ProportionalLayout.java
+++ /dev/null
@@ -1,146 +0,0 @@
-/*
- * 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.
- */
-
-package com.android.contacts.widget;
-
-import android.content.Context;
-import android.content.res.TypedArray;
-import android.util.AttributeSet;
-import android.view.View;
-import android.view.ViewGroup;
-
-import com.android.contacts.R;
-
-/**
- * Layout that calculates its height based on its width, or vice versa (depending on the set
- * {@link #setDirection(Direction)}. The factor is specified in {@link #setRatio(float)}.
- * <p>For {@link Direction#heightToWidth}: width := height * factor</p>
- * <p>For {@link Direction#widthToHeight}: height := width * factor</p>
- * <p>Only one child is allowed; if more are required, another ViewGroup can be used as the direct
- * child of this layout.</p>
- */
-public class ProportionalLayout extends ViewGroup {
-    /** Specifies whether the width should be calculated based on the height or vice-versa  */
-    public enum Direction {
-        widthToHeight("widthToHeight"),
-        heightToWidth("heightToWidth");
-
-        public final String XmlName;
-
-        private Direction(String xmlName) {
-            XmlName = xmlName;
-        }
-
-        /**
-         * Parses the given direction string and returns the Direction instance. This
-         * should be used when inflating from xml
-         */
-        public static Direction parse(String value) {
-            if (widthToHeight.XmlName.equals(value)) {
-                return Direction.widthToHeight;
-            } else if (heightToWidth.XmlName.equals(value)) {
-                return Direction.heightToWidth;
-            } else {
-                throw new IllegalStateException("direction must be either " +
-                        widthToHeight.XmlName + " or " + heightToWidth.XmlName);
-            }
-        }
-    }
-
-    private Direction mDirection;
-    private float mRatio;
-
-    public ProportionalLayout(Context context) {
-        super(context);
-    }
-
-    public ProportionalLayout(Context context, AttributeSet attrs) {
-        super(context, attrs);
-        initFromAttributes(context, attrs);
-    }
-
-    public ProportionalLayout(Context context, AttributeSet attrs, int defStyle) {
-        super(context, attrs, defStyle);
-        initFromAttributes(context, attrs);
-    }
-
-    private void initFromAttributes(Context context, AttributeSet attrs) {
-        TypedArray a = context.obtainStyledAttributes(attrs, R.styleable.ProportionalLayout);
-
-        mDirection = Direction.parse(a.getString(R.styleable.ProportionalLayout_direction));
-        mRatio = a.getFloat(R.styleable.ProportionalLayout_ratio, 1.0f);
-
-        a.recycle();
-    }
-
-    @Override
-    protected void onMeasure(int widthMeasureSpec, int heightMeasureSpec) {
-        if (getChildCount() != 1) {
-            throw new IllegalStateException("ProportionalLayout requires exactly one child");
-        }
-
-        final View child = getChildAt(0);
-
-        // Do a first pass to get the optimal size
-        measureChild(child, widthMeasureSpec, heightMeasureSpec);
-        final int childWidth = child.getMeasuredWidth();
-        final int childHeight = child.getMeasuredHeight();
-
-        final int width;
-        final int height;
-        if (mDirection == Direction.heightToWidth) {
-            width = Math.round(childHeight * mRatio);
-            height = childHeight;
-        } else {
-            width = childWidth;
-            height = Math.round(childWidth * mRatio);
-        }
-
-        // Do a second pass so that all children are informed of the new size
-        measureChild(child,
-                MeasureSpec.makeMeasureSpec(width, MeasureSpec.EXACTLY),
-                MeasureSpec.makeMeasureSpec(height, MeasureSpec.EXACTLY));
-
-        setMeasuredDimension(
-                resolveSize(width, widthMeasureSpec), resolveSize(height, heightMeasureSpec));
-    }
-
-    @Override
-    protected void onLayout(boolean changed, int left, int top, int right, int bottom) {
-        if (getChildCount() != 1) {
-            throw new IllegalStateException("ProportionalLayout requires exactly one child");
-        }
-
-        final View child = getChildAt(0);
-        child.layout(0, 0, right-left, bottom-top);
-    }
-
-    public Direction getDirection() {
-        return mDirection;
-    }
-
-    public void setDirection(Direction direction) {
-        mDirection = direction;
-    }
-
-    public float getRatio() {
-        return mRatio;
-    }
-
-    public void setRatio(float ratio) {
-        mRatio = ratio;
-    }
-}
