Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 1c806544 authored by Brian Attwell's avatar Brian Attwell
Browse files

Clicking in the top 56dp of QC card now expands it

Bug: 17625782
Change-Id: Idb2523379be4f25ba3a9daad008874e4bec087ea
parent b44a16a8
Loading
Loading
Loading
Loading
+2 −1
Original line number Diff line number Diff line
@@ -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"/>
+4 −10
Original line number Diff line number Diff line
@@ -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)