Loading res/layout/quickcontact_header.xml +2 −1 Original line number Diff line number Diff line Loading @@ -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"/> Loading src/com/android/contacts/widget/MultiShrinkScroller.java +4 −10 Original line number Diff line number Diff line Loading @@ -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 Loading Loading @@ -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; Loading Loading @@ -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) { Loading Loading @@ -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) Loading Loading
res/layout/quickcontact_header.xml +2 −1 Original line number Diff line number Diff line Loading @@ -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"/> Loading
src/com/android/contacts/widget/MultiShrinkScroller.java +4 −10 Original line number Diff line number Diff line Loading @@ -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 Loading Loading @@ -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; Loading Loading @@ -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) { Loading Loading @@ -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) Loading