diff options
author | Brian Attwell <brianattwell@google.com> | 2014-10-24 17:54:14 +0000 |
---|---|---|
committer | Android (Google) Code Review <android-gerrit@google.com> | 2014-10-24 17:54:15 +0000 |
commit | f187d2eb252d77277ce20f527128619b227d4933 (patch) | |
tree | 42b82bb0e77f7e3e6959ee06f61fe58a7d3e16a5 | |
parent | 954e744f20ee4598151c10c83787792f7da62964 (diff) | |
parent | 1c8065448ec1fcbb0906ffdaa9678bce9cc98fbd (diff) | |
download | packages_apps_Contacts-f187d2eb252d77277ce20f527128619b227d4933.tar.gz packages_apps_Contacts-f187d2eb252d77277ce20f527128619b227d4933.tar.bz2 packages_apps_Contacts-f187d2eb252d77277ce20f527128619b227d4933.zip |
Merge "Clicking in the top 56dp of QC card now expands it" into lmp-mr1-dev
-rw-r--r-- | res/layout/quickcontact_header.xml | 3 | ||||
-rw-r--r-- | src/com/android/contacts/widget/MultiShrinkScroller.java | 14 |
2 files changed, 6 insertions, 11 deletions
diff --git a/res/layout/quickcontact_header.xml b/res/layout/quickcontact_header.xml index 37672c7cf..010146b11 100644 --- a/res/layout/quickcontact_header.xml +++ b/res/layout/quickcontact_header.xml @@ -47,7 +47,8 @@ this view, instead of another. This will *not* cause an additional draw since the background is transparent.--> <Toolbar - android:layout_width="match_parent" + android:layout_width="wrap_content" + android:layout_gravity="end|top" android:layout_height="?android:attr/actionBarSize" android:background="#00000000" android:id="@+id/toolbar"/> diff --git a/src/com/android/contacts/widget/MultiShrinkScroller.java b/src/com/android/contacts/widget/MultiShrinkScroller.java index dcc3b6117..ce654e901 100644 --- a/src/com/android/contacts/widget/MultiShrinkScroller.java +++ b/src/com/android/contacts/widget/MultiShrinkScroller.java @@ -41,6 +41,7 @@ import android.widget.LinearLayout; import android.widget.Scroller; import android.widget.ScrollView; import android.widget.TextView; +import android.widget.Toolbar; /** * A custom {@link ViewGroup} that operates similarly to a {@link ScrollView}, except with multiple @@ -103,7 +104,7 @@ public class MultiShrinkScroller extends FrameLayout { private MultiShrinkScrollerListener mListener; private TextView mLargeTextView; private View mPhotoTouchInterceptOverlay; - /** Contains desired location/size of the title, once the header is fully compressed */ + /** Contains desired size & vertical offset of the title, once the header is fully compressed */ private TextView mInvisiblePlaceholderTextView; private View mTitleGradientView; private View mActionBarGradientView; @@ -297,6 +298,7 @@ public class MultiShrinkScroller extends FrameLayout { mTitleGradientView.setBackground(mTitleGradientDrawable); mActionBarGradientView = findViewById(R.id.action_bar_gradient); mActionBarGradientView.setBackground(mActionBarGradientDrawable); + mCollapsedTitleStartMargin = ((Toolbar) findViewById(R.id.toolbar)).getContentInsetStart(); mPhotoTouchInterceptOverlay = findViewById(R.id.photo_touch_intercept_overlay); if (!mIsTwoPanel) { @@ -1006,17 +1008,9 @@ public class MultiShrinkScroller extends FrameLayout { */ private void calculateCollapsedLargeTitlePadding() { final Rect largeTextViewRect = new Rect(); - final Rect invisiblePlaceholderTextViewRect = new Rect(); mToolbar.getBoundsOnScreen(largeTextViewRect); + final Rect invisiblePlaceholderTextViewRect = new Rect(); mInvisiblePlaceholderTextView.getBoundsOnScreen(invisiblePlaceholderTextViewRect); - if (isLayoutRtl()) { - mCollapsedTitleStartMargin = largeTextViewRect.right - - invisiblePlaceholderTextViewRect.right; - } else { - mCollapsedTitleStartMargin = invisiblePlaceholderTextViewRect.left - - largeTextViewRect.left; - } - // Distance between top of toolbar to the center of the target rectangle. final int desiredTopToCenter = ( invisiblePlaceholderTextViewRect.top + invisiblePlaceholderTextViewRect.bottom) |