Merge "Update assets for Phone UI's ActionBar"
diff --git a/res/layout-sw580dp-w1000dp/contact_detail_updates_fragment.xml b/res/layout-sw580dp-w1000dp/contact_detail_updates_fragment.xml
new file mode 100644
index 0000000..9b63ccf
--- /dev/null
+++ b/res/layout-sw580dp-w1000dp/contact_detail_updates_fragment.xml
@@ -0,0 +1,64 @@
+<?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.
+-->
+
+<FrameLayout xmlns:android="http://schemas.android.com/apk/res/android"
+ xmlns:ex="http://schemas.android.com/apk/res/com.android.contacts"
+ android:id="@+id/contact_detail_updates_fragment"
+ android:layout_width="match_parent"
+ android:layout_height="match_parent">
+
+ <ScrollView
+ android:layout_width="match_parent"
+ android:layout_height="match_parent"
+ android:background="@color/background_social_updates">
+
+ <LinearLayout
+ android:orientation="vertical"
+ android:layout_width="match_parent"
+ android:layout_height="wrap_content"
+ android:paddingTop="@dimen/detail_update_section_top_padding">
+
+ <include
+ android:id="@+id/title"
+ layout="@layout/contact_detail_kind_title_entry_view" />
+
+ <LinearLayout
+ android:id="@+id/update_list"
+ android:orientation="vertical"
+ android:layout_width="match_parent"
+ android:layout_height="wrap_content"
+ android:paddingLeft="@dimen/detail_update_section_side_padding"
+ android:paddingRight="@dimen/detail_update_section_side_padding" />
+ </LinearLayout>
+
+ </ScrollView>
+
+ <View
+ android:id="@+id/alpha_overlay"
+ android:layout_width="match_parent"
+ android:layout_height="match_parent"
+ android:background="@android:color/black"
+ android:alpha=".50"
+ android:visibility="gone"/>
+
+ <View
+ android:id="@+id/touch_intercept_overlay"
+ android:layout_width="match_parent"
+ android:layout_height="match_parent"
+ android:background="@android:color/transparent"
+ android:visibility="gone"/>
+
+</FrameLayout>
diff --git a/res/layout-sw580dp/contact_detail_updates_fragment.xml b/res/layout-sw580dp/contact_detail_updates_fragment.xml
new file mode 100644
index 0000000..8677737
--- /dev/null
+++ b/res/layout-sw580dp/contact_detail_updates_fragment.xml
@@ -0,0 +1,79 @@
+<?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.
+-->
+
+<FrameLayout xmlns:android="http://schemas.android.com/apk/res/android"
+ xmlns:ex="http://schemas.android.com/apk/res/com.android.contacts"
+ android:id="@+id/contact_detail_updates_fragment"
+ android:layout_width="match_parent"
+ android:layout_height="match_parent">
+
+ <ScrollView
+ android:layout_width="match_parent"
+ android:layout_height="match_parent"
+ android:background="@color/background_social_updates">
+
+ <LinearLayout
+ android:orientation="vertical"
+ android:layout_width="match_parent"
+ android:layout_height="wrap_content"
+ android:paddingTop="@dimen/detail_update_section_top_padding">
+
+ <!-- Add a first item that gives us enough space to show the carousel -->
+ <view
+ class="com.android.contacts.widget.ProportionalLayout"
+ android:layout_width="match_parent"
+ android:layout_height="wrap_content"
+ ex:ratio="0.5"
+ ex:direction="widthToHeight">
+
+ <!-- Put a dummy view here because the ProportionalLayout requires one -->
+ <View
+ android:layout_width="match_parent"
+ android:layout_height="match_parent" />
+
+ </view>
+
+ <include
+ android:id="@+id/title"
+ layout="@layout/contact_detail_kind_title_entry_view" />
+
+ <LinearLayout
+ android:id="@+id/update_list"
+ android:orientation="vertical"
+ android:layout_width="match_parent"
+ android:layout_height="wrap_content"
+ android:paddingLeft="@dimen/detail_update_section_side_padding"
+ android:paddingRight="@dimen/detail_update_section_side_padding" />
+ </LinearLayout>
+
+ </ScrollView>
+
+ <View
+ android:id="@+id/alpha_overlay"
+ android:layout_width="match_parent"
+ android:layout_height="match_parent"
+ android:background="@android:color/black"
+ android:alpha=".50"
+ android:visibility="gone"/>
+
+ <View
+ android:id="@+id/touch_intercept_overlay"
+ android:layout_width="match_parent"
+ android:layout_height="match_parent"
+ android:background="@android:color/transparent"
+ android:visibility="gone"/>
+
+</FrameLayout>
diff --git a/res/layout-sw580dp/detail_header_contact_with_updates.xml b/res/layout-sw580dp/detail_header_contact_with_updates.xml
index e909434..01e4c7e 100644
--- a/res/layout-sw580dp/detail_header_contact_with_updates.xml
+++ b/res/layout-sw580dp/detail_header_contact_with_updates.xml
@@ -22,12 +22,27 @@
-->
<LinearLayout
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"
- android:paddingTop="@dimen/detail_tab_carousel_height"
android:layout_marginTop="20dip">
+ <!-- Add a first item that gives us enough space to show the carousel -->
+ <view
+ class="com.android.contacts.widget.ProportionalLayout"
+ android:layout_width="match_parent"
+ android:layout_height="wrap_content"
+ ex:ratio="0.5"
+ ex:direction="widthToHeight">
+
+ <!-- Put a dummy view here because the ProportionalLayout requires one -->
+ <View
+ android:layout_width="match_parent"
+ android:layout_height="match_parent" />
+
+ </view>
+
<TextView
android:id="@+id/name"
android:layout_width="match_parent"
diff --git a/res/layout-sw580dp/quickcontact_activity.xml b/res/layout-sw580dp/quickcontact_activity.xml
index 6b381a9..21b5ad2 100644
--- a/res/layout-sw580dp/quickcontact_activity.xml
+++ b/res/layout-sw580dp/quickcontact_activity.xml
@@ -27,7 +27,11 @@
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:orientation="vertical">
- <include layout="@layout/quickcontact_photo_container" />
+ <FrameLayout
+ android:layout_width="400dip"
+ android:layout_height="200dip">
+ <include layout="@layout/quickcontact_photo_container" />
+ </FrameLayout>
<View
android:id="@+id/line_before_track"
android:layout_width="match_parent"
diff --git a/res/layout-w470dp/contact_detail_updates_fragment.xml b/res/layout-w470dp/contact_detail_updates_fragment.xml
new file mode 100644
index 0000000..9b63ccf
--- /dev/null
+++ b/res/layout-w470dp/contact_detail_updates_fragment.xml
@@ -0,0 +1,64 @@
+<?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.
+-->
+
+<FrameLayout xmlns:android="http://schemas.android.com/apk/res/android"
+ xmlns:ex="http://schemas.android.com/apk/res/com.android.contacts"
+ android:id="@+id/contact_detail_updates_fragment"
+ android:layout_width="match_parent"
+ android:layout_height="match_parent">
+
+ <ScrollView
+ android:layout_width="match_parent"
+ android:layout_height="match_parent"
+ android:background="@color/background_social_updates">
+
+ <LinearLayout
+ android:orientation="vertical"
+ android:layout_width="match_parent"
+ android:layout_height="wrap_content"
+ android:paddingTop="@dimen/detail_update_section_top_padding">
+
+ <include
+ android:id="@+id/title"
+ layout="@layout/contact_detail_kind_title_entry_view" />
+
+ <LinearLayout
+ android:id="@+id/update_list"
+ android:orientation="vertical"
+ android:layout_width="match_parent"
+ android:layout_height="wrap_content"
+ android:paddingLeft="@dimen/detail_update_section_side_padding"
+ android:paddingRight="@dimen/detail_update_section_side_padding" />
+ </LinearLayout>
+
+ </ScrollView>
+
+ <View
+ android:id="@+id/alpha_overlay"
+ android:layout_width="match_parent"
+ android:layout_height="match_parent"
+ android:background="@android:color/black"
+ android:alpha=".50"
+ android:visibility="gone"/>
+
+ <View
+ android:id="@+id/touch_intercept_overlay"
+ android:layout_width="match_parent"
+ android:layout_height="match_parent"
+ android:background="@android:color/transparent"
+ android:visibility="gone"/>
+
+</FrameLayout>
diff --git a/res/layout-w470dp/quickcontact_activity.xml b/res/layout-w470dp/quickcontact_activity.xml
index df68761..36d499d 100644
--- a/res/layout-w470dp/quickcontact_activity.xml
+++ b/res/layout-w470dp/quickcontact_activity.xml
@@ -15,6 +15,7 @@
-->
<view
xmlns:android="http://schemas.android.com/apk/res/android"
+ xmlns:ex="http://schemas.android.com/apk/res/com.android.contacts"
class="com.android.contacts.quickcontact.FloatingChildLayout"
android:id="@+id/floating_layout"
android:layout_width="match_parent"
@@ -25,13 +26,20 @@
<LinearLayout
android:id="@android:id/content"
android:layout_width="match_parent"
- android:layout_height="@dimen/quick_contact_picture_height"
+ android:layout_height="match_parent"
android:padding="32dip"
android:orientation="horizontal">
- <include layout="@layout/quickcontact_photo_container" />
+ <view
+ class="com.android.contacts.widget.ProportionalLayout"
+ android:layout_width="wrap_content"
+ android:layout_height="match_parent"
+ ex:ratio="1.0"
+ ex:direction="heightToWidth">
+ <include layout="@layout/quickcontact_photo_container" />
+ </view>
<LinearLayout
android:layout_width="match_parent"
- android:layout_height="@dimen/quick_contact_picture_height"
+ android:layout_height="match_parent"
android:orientation="vertical">
<include layout="@layout/quickcontact_track" />
<android.support.v4.view.ViewPager
diff --git a/res/layout/call_detail.xml b/res/layout/call_detail.xml
index 02dd098..83d3e20 100644
--- a/res/layout/call_detail.xml
+++ b/res/layout/call_detail.xml
@@ -15,6 +15,7 @@
-->
<RelativeLayout 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:orientation="horizontal"
@@ -31,21 +32,30 @@
<include layout="@layout/call_log_voicemail_status"/>
</FrameLayout>
- <ImageView
- android:id="@+id/contact_background"
+ <view
+ class="com.android.contacts.widget.ProportionalLayout"
+ android:id="@+id/contact_background_sizer"
android:layout_width="match_parent"
- android:layout_height="@dimen/call_detail_contact_background_height"
+ android:layout_height="wrap_content"
android:layout_alignParentLeft="true"
android:layout_below="@id/voicemail_status"
- android:adjustViewBounds="true"
- android:scaleType="centerCrop"
- android:background="@drawable/ic_contact_picture"
- />
+ 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"
+ android:background="@drawable/ic_contact_picture"
+ />
+ </view>
<LinearLayout
android:id="@+id/voicemail_container"
android:layout_width="match_parent"
android:layout_height="wrap_content"
- android:layout_below="@id/contact_background"
+ android:layout_below="@id/contact_background_sizer"
>
<fragment
class="com.android.contacts.voicemail.VoicemailPlaybackFragment"
@@ -59,14 +69,14 @@
android:layout_height="@dimen/call_detail_contact_background_overlay_height"
android:background="#3F000000"
android:layout_alignParentLeft="true"
- android:layout_alignBottom="@id/contact_background"
+ android:layout_alignBottom="@id/contact_background_sizer"
/>
<RelativeLayout
android:id="@+id/contact_text"
android:layout_width="match_parent"
android:layout_height="@dimen/call_detail_contact_background_overlay_height"
android:layout_alignParentLeft="true"
- android:layout_alignBottom="@id/contact_background"
+ android:layout_alignBottom="@id/contact_background_sizer"
android:paddingLeft="@dimen/call_detail_contact_name_margin"
>
<ImageView
diff --git a/res/layout/contact_detail_tab_carousel.xml b/res/layout/contact_detail_tab_carousel.xml
index 175194c..fe167d1 100644
--- a/res/layout/contact_detail_tab_carousel.xml
+++ b/res/layout/contact_detail_tab_carousel.xml
@@ -18,14 +18,14 @@
xmlns:android="http://schemas.android.com/apk/res/android"
class="com.android.contacts.detail.ContactDetailTabCarousel"
android:layout_width="match_parent"
- android:layout_height="@dimen/detail_tab_carousel_height"
+ android:layout_height="wrap_content"
android:scrollbars="none"
android:fadingEdge="none">
<LinearLayout
android:id="@+id/tab_container"
android:layout_width="match_parent"
- android:layout_height="@dimen/detail_tab_carousel_height"
+ android:layout_height="match_parent"
android:orientation="horizontal">
<include
@@ -38,4 +38,4 @@
</LinearLayout>
-</view>
\ No newline at end of file
+</view>
diff --git a/res/layout/contact_detail_updates_fragment.xml b/res/layout/contact_detail_updates_fragment.xml
index 92f3575..8677737 100644
--- a/res/layout/contact_detail_updates_fragment.xml
+++ b/res/layout/contact_detail_updates_fragment.xml
@@ -15,6 +15,7 @@
-->
<FrameLayout xmlns:android="http://schemas.android.com/apk/res/android"
+ xmlns:ex="http://schemas.android.com/apk/res/com.android.contacts"
android:id="@+id/contact_detail_updates_fragment"
android:layout_width="match_parent"
android:layout_height="match_parent">
@@ -22,7 +23,6 @@
<ScrollView
android:layout_width="match_parent"
android:layout_height="match_parent"
- android:paddingTop="@dimen/detail_tab_carousel_height"
android:background="@color/background_social_updates">
<LinearLayout
@@ -31,6 +31,21 @@
android:layout_height="wrap_content"
android:paddingTop="@dimen/detail_update_section_top_padding">
+ <!-- Add a first item that gives us enough space to show the carousel -->
+ <view
+ class="com.android.contacts.widget.ProportionalLayout"
+ android:layout_width="match_parent"
+ android:layout_height="wrap_content"
+ ex:ratio="0.5"
+ ex:direction="widthToHeight">
+
+ <!-- Put a dummy view here because the ProportionalLayout requires one -->
+ <View
+ android:layout_width="match_parent"
+ android:layout_height="match_parent" />
+
+ </view>
+
<include
android:id="@+id/title"
layout="@layout/contact_detail_kind_title_entry_view" />
@@ -43,6 +58,7 @@
android:paddingLeft="@dimen/detail_update_section_side_padding"
android:paddingRight="@dimen/detail_update_section_side_padding" />
</LinearLayout>
+
</ScrollView>
<View
@@ -59,5 +75,5 @@
android:layout_height="match_parent"
android:background="@android:color/transparent"
android:visibility="gone"/>
-</FrameLayout>
+</FrameLayout>
diff --git a/res/layout/detail_header_contact_with_updates.xml b/res/layout/detail_header_contact_with_updates.xml
index 00d1b76..8d18963 100644
--- a/res/layout/detail_header_contact_with_updates.xml
+++ b/res/layout/detail_header_contact_with_updates.xml
@@ -19,7 +19,15 @@
entry maintains vertical padding to ensure that the first contact detail is visible (and below
the tab carousel). No information has to be displayed in this header.
-->
-<FrameLayout
+<view
xmlns:android="http://schemas.android.com/apk/res/android"
+ xmlns:ex="http://schemas.android.com/apk/res/com.android.contacts"
+ class="com.android.contacts.widget.ProportionalLayout"
android:layout_width="match_parent"
- android:layout_height="@dimen/detail_tab_carousel_height"/>
\ No newline at end of file
+ android:layout_height="wrap_content"
+ ex:ratio="0.5"
+ ex:direction="widthToHeight">
+ <FrameLayout
+ android:layout_width="match_parent"
+ android:layout_height="match_parent"/>
+</view>
\ No newline at end of file
diff --git a/res/layout/detail_header_contact_without_updates.xml b/res/layout/detail_header_contact_without_updates.xml
index a5d4687..2de7711 100644
--- a/res/layout/detail_header_contact_without_updates.xml
+++ b/res/layout/detail_header_contact_without_updates.xml
@@ -18,15 +18,17 @@
This is a header entry in the contact details list for when the contact does not have social
updates, which means that the contact's photo will scroll with the list of details.
-->
-<FrameLayout
+<view
xmlns:android="http://schemas.android.com/apk/res/android"
+ xmlns:ex="http://schemas.android.com/apk/res/com.android.contacts"
+ class="com.android.contacts.widget.ProportionalLayout"
android:layout_width="match_parent"
- android:layout_height="wrap_content">
-
+ android:layout_height="wrap_content"
+ ex:ratio="0.5"
+ ex:direction="widthToHeight">
<ImageView
android:id="@+id/photo"
android:scaleType="centerCrop"
android:layout_width="match_parent"
- android:layout_height="@dimen/detail_tab_carousel_height" />
-
-</FrameLayout>
\ No newline at end of file
+ android:layout_height="match_parent" />
+</view>
\ No newline at end of file
diff --git a/res/layout/quickcontact_activity.xml b/res/layout/quickcontact_activity.xml
index 7aa2aa4..2f5a357 100644
--- a/res/layout/quickcontact_activity.xml
+++ b/res/layout/quickcontact_activity.xml
@@ -15,6 +15,7 @@
-->
<view
xmlns:android="http://schemas.android.com/apk/res/android"
+ xmlns:ex="http://schemas.android.com/apk/res/com.android.contacts"
class="com.android.contacts.quickcontact.FloatingChildLayout"
android:id="@+id/floating_layout"
android:layout_width="match_parent"
@@ -29,7 +30,14 @@
android:paddingLeft="15dip"
android:paddingRight="15dip"
android:orientation="vertical">
- <include layout="@layout/quickcontact_photo_container" />
+ <view
+ class="com.android.contacts.widget.ProportionalLayout"
+ android:layout_width="match_parent"
+ android:layout_height="wrap_content"
+ ex:ratio="0.5"
+ ex:direction="widthToHeight">
+ <include layout="@layout/quickcontact_photo_container" />
+ </view>
<View
android:id="@+id/line_before_track"
android:layout_width="match_parent"
diff --git a/res/layout/quickcontact_photo_container.xml b/res/layout/quickcontact_photo_container.xml
index 3e0c935..b18fddc 100644
--- a/res/layout/quickcontact_photo_container.xml
+++ b/res/layout/quickcontact_photo_container.xml
@@ -17,13 +17,13 @@
xmlns:android="http://schemas.android.com/apk/res/android">
<RelativeLayout
android:id="@+id/photo_container"
- android:layout_width="@dimen/quick_contact_picture_width"
- android:layout_height="@dimen/quick_contact_picture_height"
+ android:layout_width="match_parent"
+ android:layout_height="match_parent"
android:gravity="center_vertical">
<ImageView
android:id="@+id/photo"
- android:layout_width="fill_parent"
- android:layout_height="fill_parent"
+ android:layout_width="match_parent"
+ android:layout_height="match_parent"
android:scaleType="centerCrop" />
<View
android:id="@+id/photo_text_bar"
@@ -68,7 +68,7 @@
android:layout_marginTop="-3dip" />
<TextView
android:id="@+id/timestamp"
- android:layout_width="fill_parent"
+ android:layout_width="match_parent"
android:layout_height="wrap_content"
android:singleLine="true"
android:ellipsize="end"
diff --git a/res/values-sw580dp-w1000dp/dimens.xml b/res/values-sw580dp-w1000dp/dimens.xml
index 7ff9026..d8503d9 100644
--- a/res/values-sw580dp-w1000dp/dimens.xml
+++ b/res/values-sw580dp-w1000dp/dimens.xml
@@ -20,7 +20,6 @@
<dimen name="action_bar_search_spacing">32dip</dimen>
<dimen name="detail_header_view_margin">16dip</dimen>
<dimen name="detail_header_attribution_height">56dip</dimen>
- <dimen name="detail_tab_carousel_height">0dip</dimen>
<dimen name="detail_update_section_top_padding">48dip</dimen>
<dimen name="contact_browser_list_left_margin">0dip</dimen>
<dimen name="contacts_count_right_margin">24dip</dimen>
diff --git a/res/values-sw580dp/dimens.xml b/res/values-sw580dp/dimens.xml
index 60da57a..4de6bb7 100644
--- a/res/values-sw580dp/dimens.xml
+++ b/res/values-sw580dp/dimens.xml
@@ -31,12 +31,10 @@
<dimen name="shortcut_icon_size">64dip</dimen>
<dimen name="list_section_height">37dip</dimen>
<dimen name="directory_header_height">56dip</dimen>
- <dimen name="detail_tab_carousel_height">256dip</dimen>
<dimen name="detail_update_section_item_vertical_padding">32dip</dimen>
<dimen name="search_view_width">400dip</dimen>
<dimen name="contact_browser_list_left_margin">0dip</dimen>
<dimen name="contacts_count_right_margin">24dip</dimen>
+ <!-- Center vertically -->
<dimen name="quick_contact_top_position">-1px</dimen>
- <dimen name="quick_contact_picture_width">400dip</dimen>
- <dimen name="quick_contact_picture_height">200dip</dimen>
</resources>
diff --git a/res/values-w470dp/dimens.xml b/res/values-w470dp/dimens.xml
index c77d8c2..7da25d7 100644
--- a/res/values-w470dp/dimens.xml
+++ b/res/values-w470dp/dimens.xml
@@ -14,8 +14,6 @@
limitations under the License.
-->
<resources>
- <dimen name="detail_tab_carousel_height">0dip</dimen>
+ <!-- Center vertically -->
<dimen name="quick_contact_top_position">-1px</dimen>
- <dimen name="quick_contact_picture_width">174dip</dimen>
- <dimen name="quick_contact_picture_height">-1px</dimen>
</resources>
diff --git a/res/values/attrs.xml b/res/values/attrs.xml
index 0b263a4..2ca8512 100644
--- a/res/values/attrs.xml
+++ b/res/values/attrs.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.
@@ -36,4 +36,87 @@
</attr>
</declare-styleable>
+ <declare-styleable name="InterpolatingLayout_Layout">
+ <attr name="layout_narrowParentWidth" format="dimension"/>
+ <attr name="layout_narrowWidth" format="dimension"/>
+ <attr name="layout_narrowMarginLeft" format="dimension"/>
+ <attr name="layout_narrowMarginRight" format="dimension"/>
+ <attr name="layout_narrowPaddingLeft" format="dimension"/>
+ <attr name="layout_narrowPaddingRight" format="dimension"/>
+ <attr name="layout_wideParentWidth" format="dimension"/>
+ <attr name="layout_wideWidth" format="dimension"/>
+ <attr name="layout_wideMarginLeft" format="dimension"/>
+ <attr name="layout_wideMarginRight" format="dimension"/>
+ <attr name="layout_widePaddingLeft" format="dimension"/>
+ <attr name="layout_widePaddingRight" format="dimension"/>
+ </declare-styleable>
+
+ <declare-styleable name="ProportionalLayout">
+ <attr name="direction" format="string"/>
+ <attr name="ratio" format="float"/>
+ </declare-styleable>
+
+ <declare-styleable name="TransitionAnimationView">
+ <attr name="clipMarginLeft" format="dimension"/>
+ <attr name="clipMarginRight" format="dimension"/>
+ <attr name="clipMarginTop" format="dimension"/>
+ <attr name="clipMarginBottom" format="dimension"/>
+ <attr name="enterAnimation" format="reference"/>
+ <attr name="exitAnimation" format="reference"/>
+ <attr name="animationDuration" format="integer"/>
+ </declare-styleable>
+
+ <declare-styleable name="ContactBrowser">
+ <attr name="contact_filter_popup_width" format="dimension"/>
+ </declare-styleable>
+
+ <declare-styleable name="ContactListItemView">
+ <attr name="list_item_height" format="dimension"/>
+ <attr name="list_section_header_height" format="dimension"/>
+ <attr name="activated_background" format="reference"/>
+ <attr name="section_header_background" format="reference"/>
+ <attr name="list_item_divider" format="reference"/>
+ <attr name="list_item_padding_top" format="dimension"/>
+ <attr name="list_item_padding_right" format="dimension"/>
+ <attr name="list_item_padding_bottom" format="dimension"/>
+ <attr name="list_item_padding_left" format="dimension"/>
+ <attr name="list_item_gap_between_image_and_text" format="dimension"/>
+ <attr name="list_item_gap_between_label_and_data" format="dimension"/>
+ <attr name="list_item_call_button_padding" format="dimension"/>
+ <attr name="list_item_vertical_divider_margin" format="dimension"/>
+ <attr name="list_item_presence_icon_margin" format="dimension"/>
+ <attr name="list_item_presence_icon_size" format="dimension"/>
+ <attr name="list_item_photo_size" format="dimension"/>
+ <attr name="list_item_profile_photo_size" format="dimension"/>
+ <attr name="list_item_prefix_highlight_color" format="color"/>
+ <attr name="list_item_header_text_indent" format="dimension" />
+ <attr name="list_item_header_text_color" format="color" />
+ <attr name="list_item_header_text_size" format="dimension" />
+ <attr name="list_item_header_height" format="dimension" />
+ <attr name="list_item_header_underline_height" format="dimension" />
+ <attr name="list_item_header_underline_color" format="color" />
+ </declare-styleable>
+
+ <declare-styleable name="CallDetailActivity">
+ <attr name="call_detail_transparent_background" format="color" />
+ <attr name="call_detail_contact_background_overlay_alpha" format="float" />
+ </declare-styleable>
+
+ <declare-styleable name="CallLog">
+ <attr name="call_log_primary_text_color" format="color" />
+ <attr name="call_log_primary_background_color" format="color" />
+ <attr name="call_log_secondary_text_color" format="color" />
+ <attr name="call_log_secondary_background_color" format="color" />
+ <attr name="call_log_header_color" format="color" />
+ </declare-styleable>
+
+ <declare-styleable name="VoicemailStatus">
+ <attr name="call_log_voicemail_status_height" format="dimension" />
+ <attr name="call_log_voicemail_status_background_color" format="color" />
+ <attr name="call_log_voicemail_status_text_color" format="color" />
+ </declare-styleable>
+
+ <declare-styleable name="Favorites">
+ <attr name="favorites_padding_bottom" format="dimension" />
+ </declare-styleable>
</resources>
diff --git a/res/values/dimens.xml b/res/values/dimens.xml
index 45aa75e..604ea31 100644
--- a/res/values/dimens.xml
+++ b/res/values/dimens.xml
@@ -34,14 +34,6 @@
based on the source of the request -->
<dimen name="quick_contact_top_position">48dip</dimen>
- <!-- Width of the picture in the QuickContact popup. This can be -1 for the full width
- of the parent -->
- <dimen name="quick_contact_picture_width">-1px</dimen>
-
- <!-- Height of the picture in the QuickContact popup. This can be -1 for the full height
- of the parent -->
- <dimen name="quick_contact_picture_height">174dip</dimen>
-
<!-- Padding of the rounded plus/minus/expand/collapse buttons in the editor -->
<dimen name="editor_round_button_padding_left">2dip</dimen>
<dimen name="editor_round_button_padding_right">2dip</dimen>
@@ -93,9 +85,6 @@
<!-- Margin between the photo, the star, and text in the contact detail header view -->
<dimen name="detail_header_view_margin">8dip</dimen>
- <!-- Height of the tab carousel on the contact detail page -->
- <dimen name="detail_tab_carousel_height">150dip</dimen>
-
<!-- Height of the tab text label in the tab carousel on the contact detail page -->
<dimen name="detail_tab_carousel_tab_label_height">48dip</dimen>
diff --git a/res/values/styles.xml b/res/values/styles.xml
index ebf6b91..6bc5582 100644
--- a/res/values/styles.xml
+++ b/res/values/styles.xml
@@ -59,6 +59,7 @@
</style>
<style name="CallDetailActivityTheme" parent="android:Theme.Holo.SplitActionBarWhenNarrow">
+ <item name="android:windowBackground">@android:color/black</item>
<item name="android:gravity">top</item>
<item name="call_detail_transparent_background">#CC000000</item>
<item name="call_detail_contact_background_overlay_alpha">0.25</item>
@@ -116,60 +117,6 @@
<item name="android:windowExitAnimation">@anim/dummy_animation</item>
</style>
- <declare-styleable name="ContactBrowser">
- <attr name="contact_filter_popup_width" format="dimension"/>
- </declare-styleable>
-
- <declare-styleable name="ContactListItemView">
- <attr name="list_item_height" format="dimension"/>
- <attr name="list_section_header_height" format="dimension"/>
- <attr name="activated_background" format="reference"/>
- <attr name="section_header_background" format="reference"/>
- <attr name="list_item_divider" format="reference"/>
- <attr name="list_item_padding_top" format="dimension"/>
- <attr name="list_item_padding_right" format="dimension"/>
- <attr name="list_item_padding_bottom" format="dimension"/>
- <attr name="list_item_padding_left" format="dimension"/>
- <attr name="list_item_gap_between_image_and_text" format="dimension"/>
- <attr name="list_item_gap_between_label_and_data" format="dimension"/>
- <attr name="list_item_call_button_padding" format="dimension"/>
- <attr name="list_item_vertical_divider_margin" format="dimension"/>
- <attr name="list_item_presence_icon_margin" format="dimension"/>
- <attr name="list_item_presence_icon_size" format="dimension"/>
- <attr name="list_item_photo_size" format="dimension"/>
- <attr name="list_item_profile_photo_size" format="dimension"/>
- <attr name="list_item_prefix_highlight_color" format="color"/>
- <attr name="list_item_header_text_indent" format="dimension" />
- <attr name="list_item_header_text_color" format="color" />
- <attr name="list_item_header_text_size" format="dimension" />
- <attr name="list_item_header_height" format="dimension" />
- <attr name="list_item_header_underline_height" format="dimension" />
- <attr name="list_item_header_underline_color" format="color" />
- </declare-styleable>
-
- <declare-styleable name="CallDetailActivity">
- <attr name="call_detail_transparent_background" format="color" />
- <attr name="call_detail_contact_background_overlay_alpha" format="float" />
- </declare-styleable>
-
- <declare-styleable name="CallLog">
- <attr name="call_log_primary_text_color" format="color" />
- <attr name="call_log_primary_background_color" format="color" />
- <attr name="call_log_secondary_text_color" format="color" />
- <attr name="call_log_secondary_background_color" format="color" />
- <attr name="call_log_header_color" format="color" />
- </declare-styleable>
-
- <declare-styleable name="VoicemailStatus">
- <attr name="call_log_voicemail_status_height" format="dimension" />
- <attr name="call_log_voicemail_status_background_color" format="color" />
- <attr name="call_log_voicemail_status_text_color" format="color" />
- </declare-styleable>
-
- <declare-styleable name="Favorites">
- <attr name="favorites_padding_bottom" format="dimension" />
- </declare-styleable>
-
<style name="PeopleTheme" parent="@android:style/Theme.Holo.Light.SolidActionBar.Inverse.SplitActionBarWhenNarrow">
<item name="android:actionBarStyle">@style/ContactsActionBarStyle</item>
<item name="list_item_height">?android:attr/listPreferredItemHeight</item>
@@ -271,31 +218,6 @@
<item name="android:layout_height">match_parent</item>
</style>
- <declare-styleable name="InterpolatingLayout_Layout">
- <attr name="layout_narrowParentWidth" format="dimension"/>
- <attr name="layout_narrowWidth" format="dimension"/>
- <attr name="layout_narrowMarginLeft" format="dimension"/>
- <attr name="layout_narrowMarginRight" format="dimension"/>
- <attr name="layout_narrowPaddingLeft" format="dimension"/>
- <attr name="layout_narrowPaddingRight" format="dimension"/>
- <attr name="layout_wideParentWidth" format="dimension"/>
- <attr name="layout_wideWidth" format="dimension"/>
- <attr name="layout_wideMarginLeft" format="dimension"/>
- <attr name="layout_wideMarginRight" format="dimension"/>
- <attr name="layout_widePaddingLeft" format="dimension"/>
- <attr name="layout_widePaddingRight" format="dimension"/>
- </declare-styleable>
-
- <declare-styleable name="TransitionAnimationView">
- <attr name="clipMarginLeft" format="dimension"/>
- <attr name="clipMarginRight" format="dimension"/>
- <attr name="clipMarginTop" format="dimension"/>
- <attr name="clipMarginBottom" format="dimension"/>
- <attr name="enterAnimation" format="reference"/>
- <attr name="exitAnimation" format="reference"/>
- <attr name="animationDuration" format="integer"/>
- </declare-styleable>
-
<style name="DirectoryHeader" parent="PeopleTheme">
<item name="android:background">@drawable/directory_bg</item>
</style>
diff --git a/src/com/android/contacts/detail/ContactDetailTabCarousel.java b/src/com/android/contacts/detail/ContactDetailTabCarousel.java
index 79ac5fb..4ef4b1c 100644
--- a/src/com/android/contacts/detail/ContactDetailTabCarousel.java
+++ b/src/com/android/contacts/detail/ContactDetailTabCarousel.java
@@ -55,8 +55,6 @@
private CarouselTab mAboutTab;
private CarouselTab mUpdatesTab;
- private int mTabWidth;
- private int mTabHeight;
private int mTabDisplayLabelHeight;
private int mLastScrollPosition;
@@ -82,10 +80,8 @@
setOnTouchListener(this);
Resources resources = mContext.getResources();
- mTabHeight = resources.getDimensionPixelSize(R.dimen.detail_tab_carousel_height);
mTabDisplayLabelHeight = resources.getDimensionPixelSize(
R.dimen.detail_tab_carousel_tab_label_height);
- mAllowedVerticalScrollLength = mTabHeight - mTabDisplayLabelHeight;
}
@Override
@@ -117,26 +113,27 @@
@Override
protected void onMeasure(int widthMeasureSpec, int heightMeasureSpec) {
- super.onMeasure(widthMeasureSpec, heightMeasureSpec);
- measureChildren(widthMeasureSpec);
- }
-
- private void measureChildren(int widthMeasureSpec) {
int screenWidth = MeasureSpec.getSize(widthMeasureSpec);
// Compute the width of a tab as a fraction of the screen width
- mTabWidth = (int) (TAB_WIDTH_SCREEN_PERCENTAGE * screenWidth);
+ int tabWidth = (int) (TAB_WIDTH_SCREEN_PERCENTAGE * screenWidth);
// Find the allowed scrolling length by subtracting the current visible screen width
// from the total length of the tabs.
- mAllowedHorizontalScrollLength = mTabWidth * TAB_COUNT - screenWidth;
+ mAllowedHorizontalScrollLength = tabWidth * TAB_COUNT - screenWidth;
+ int tabHeight = screenWidth / 2;
// Set the child {@link LinearLayout} to be TAB_COUNT * the computed tab width so that the
// {@link LinearLayout}'s children (which are the tabs) will evenly split that width.
if (getChildCount() > 0) {
View child = getChildAt(0);
- child.measure(MeasureSpec.makeMeasureSpec(TAB_COUNT * mTabWidth, MeasureSpec.EXACTLY),
- MeasureSpec.makeMeasureSpec(mTabHeight, MeasureSpec.EXACTLY));
+ child.measure(MeasureSpec.makeMeasureSpec(TAB_COUNT * tabWidth, MeasureSpec.EXACTLY),
+ MeasureSpec.makeMeasureSpec(tabHeight, MeasureSpec.EXACTLY));
}
+
+ mAllowedVerticalScrollLength = tabHeight - mTabDisplayLabelHeight;
+ setMeasuredDimension(
+ resolveSize(screenWidth, widthMeasureSpec),
+ resolveSize(tabHeight, heightMeasureSpec));
}
private final OnClickListener mAboutTabTouchInterceptListener = new OnClickListener() {
diff --git a/src/com/android/contacts/quickcontact/FloatingChildLayout.java b/src/com/android/contacts/quickcontact/FloatingChildLayout.java
index 11d3176..62b4f1a 100644
--- a/src/com/android/contacts/quickcontact/FloatingChildLayout.java
+++ b/src/com/android/contacts/quickcontact/FloatingChildLayout.java
@@ -114,8 +114,8 @@
} else {
// default is centered horizontally around target...
final int childLeft = target.centerX() - (childWidth / 2);
- // ... and vertically aligned at the top
- final int childTop = target.top;
+ // ... and vertically aligned a bit below centered
+ final int childTop = target.centerY() - Math.round(childHeight * 0.35f);
// when child is outside bounds, nudge back inside
final int clampedChildLeft = clampDimension(childLeft, childWidth, getWidth());
diff --git a/src/com/android/contacts/widget/ProportionalLayout.java b/src/com/android/contacts/widget/ProportionalLayout.java
new file mode 100644
index 0000000..52a67d4
--- /dev/null
+++ b/src/com/android/contacts/widget/ProportionalLayout.java
@@ -0,0 +1,146 @@
+/*
+ * 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 com.android.contacts.R;
+
+import android.content.Context;
+import android.content.res.TypedArray;
+import android.util.AttributeSet;
+import android.view.View;
+import android.view.ViewGroup;
+
+/**
+ * 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;
+ }
+}
diff --git a/tests/res/values/donottranslate_strings.xml b/tests/res/values/donottranslate_strings.xml
index 528b129..194b6ca 100644
--- a/tests/res/values/donottranslate_strings.xml
+++ b/tests/res/values/donottranslate_strings.xml
@@ -107,4 +107,9 @@
<item>Two short sections with headers</item>
<item>Five short sections with headers</item>
</string-array>
+
+ <string name="attribution_google_plus">Google+</string>
+ <string name="attribution_google_talk">Google Talk</string>
+ <string name="attribution_flicker">Flicker</string>
+ <string name="attribution_twitter">Twitter</string>
</resources>
diff --git a/tests/src/com/android/contacts/tests/streamitems/StreamItemPopulatorActivity.java b/tests/src/com/android/contacts/tests/streamitems/StreamItemPopulatorActivity.java
index c984418..e27c767 100644
--- a/tests/src/com/android/contacts/tests/streamitems/StreamItemPopulatorActivity.java
+++ b/tests/src/com/android/contacts/tests/streamitems/StreamItemPopulatorActivity.java
@@ -83,6 +83,17 @@
"<i>24567</i> <font color='blue' size='+1'><b>likes</b></font>"
};
+ private Integer[] labelIds = new Integer[] {
+ R.string.attribution_google_plus,
+ R.string.attribution_google_talk,
+ R.string.attribution_flicker,
+ R.string.attribution_twitter
+ };
+
+ public Integer[] iconIds = new Integer[] {
+ R.drawable.default_icon,
+ };
+
// Photos to randomly select from.
private Integer[] imageIds = new Integer[]{
R.drawable.android,
@@ -242,6 +253,7 @@
}
private ContentValues buildStreamItemValues(String accountType, String accountName) {
+ boolean includeAttribution = randInt(100) < 70;
boolean includeComments = randInt(100) < 30;
boolean includeAction = randInt(100) < 30;
ContentValues values = new ContentValues();
@@ -250,6 +262,14 @@
String.format(pickRandom(snippetStrings) , place)
+ (includeComments ? " [c]" : "")
+ (includeAction ? " [a]" : ""));
+ if (includeAttribution) {
+ values.put(StreamItems.RES_PACKAGE, "com.android.contacts.tests");
+ int sourceIndex = randInt(labelIds.length);
+ values.put(StreamItems.RES_LABEL, labelIds[sourceIndex]);
+ if (sourceIndex < iconIds.length) {
+ values.put(StreamItems.RES_ICON, iconIds[sourceIndex]);
+ }
+ }
if (includeComments) {
values.put(StreamItems.COMMENTS, pickRandom(commentStrings));
} else {