Increase max QC title size on 720dp+ tablets
Because of the way that View#setScaleY() works, the maximum size of the
title TextView has to be less than the minimum size of the of the TextView's
parent. As a result, increasing the title size caused unexpected behavior.
Fixing this odd behavior required me to remove the title TextView
out of the header ViewGroup and instead manually control its position
inside MultiShrinkScroller. This required me to make MultiShrinkScroller
a FrameLayout. This necessitated lots of little changes inside MultiShrinkScroller
(ie, what type of LayoutParams to cast into).
There is a reason nobody else has messed around with scaling title TextViews.
Bug: 16683381
Change-Id: Ib8fc065931a6a0c2a96b8bd5a11bb055457aa3dd
diff --git a/res/layout/quickcontact_activity.xml b/res/layout/quickcontact_activity.xml
index 008062b..577a451 100644
--- a/res/layout/quickcontact_activity.xml
+++ b/res/layout/quickcontact_activity.xml
@@ -24,14 +24,34 @@
android:focusableInTouchMode="true"
android:descendantFocusability="afterDescendants" >
- <View
+ <LinearLayout
android:layout_width="match_parent"
- android:layout_height="@dimen/quickcontact_starting_empty_height"
- android:contentDescription="@string/quickcontact_transparent_view_description"
- android:id="@+id/transparent_view" />
+ android:layout_height="match_parent"
+ android:orientation="vertical">
- <include layout="@layout/quickcontact_header" />
+ <View
+ android:layout_width="match_parent"
+ android:layout_height="@dimen/quickcontact_starting_empty_height"
+ android:contentDescription="@string/quickcontact_transparent_view_description"
+ android:id="@+id/transparent_view" />
- <include layout="@layout/quickcontact_content" />
+ <!-- Needs a non null background for elevation to work on this View. This will *not*
+ cause an additional draw since the background is transparent. -->
+ <FrameLayout
+ android:layout_width="match_parent"
+ android:layout_height="match_parent"
+ android:background="#00000000"
+ android:id="@+id/toolbar_parent">
+ <include layout="@layout/quickcontact_header" />
+ </FrameLayout>
+
+ <include layout="@layout/quickcontact_content" />
+
+ </LinearLayout>
+
+ <!-- This title's maximum height must be less than the minimum size of its
+ parent ViewGroup because of an oddity in the way View#setScaleY() works. As a result,
+ this title can not be inside @style/quickcontact_header. -->
+ <include layout="@layout/quickcontact_title" />
</com.android.contacts.widget.MultiShrinkScroller>
\ No newline at end of file