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

Commit e8378476 authored by Abodunrinwa Toki's avatar Abodunrinwa Toki Committed by Android (Google) Code Review
Browse files

Merge "Allow content rect to overshoot the bottom view bounds by 20dp." into mnc-dev

parents 41ce0039 15a6c89f
Loading
Loading
Loading
Loading
+7 −1
Original line number Diff line number Diff line
@@ -25,6 +25,7 @@ import android.view.MenuItem;
import android.view.View;
import android.view.ViewConfiguration;

import com.android.internal.R;
import com.android.internal.util.Preconditions;
import com.android.internal.view.menu.MenuBuilder;
import com.android.internal.widget.FloatingToolbar;
@@ -44,6 +45,7 @@ public class FloatingActionMode extends ActionMode {
    private final Rect mViewRect;
    private final Rect mScreenRect;
    private final View mOriginatingView;
    private final int mBottomAllowance;

    private final Runnable mMovingOff = new Runnable() {
        public void run() {
@@ -77,6 +79,10 @@ public class FloatingActionMode extends ActionMode {
        mScreenRect = new Rect();
        mOriginatingView = Preconditions.checkNotNull(originatingView);
        mOriginatingView.getLocationInWindow(mViewPosition);
        // Allow the content rect to overshoot a little bit beyond the
        // bottom view bound if necessary.
        mBottomAllowance = context.getResources()
                .getDimensionPixelSize(R.dimen.content_rect_bottom_clip_allowance);
    }

    public void setFloatingToolbar(FloatingToolbar floatingToolbar) {
@@ -141,7 +147,7 @@ public class FloatingActionMode extends ActionMode {
                    Math.max(mContentRectOnWindow.left, mViewRect.left),
                    Math.max(mContentRectOnWindow.top, mViewRect.top),
                    Math.min(mContentRectOnWindow.right, mViewRect.right),
                    Math.min(mContentRectOnWindow.bottom, mViewRect.bottom));
                    Math.min(mContentRectOnWindow.bottom, mViewRect.bottom + mBottomAllowance));

            if (!mContentRectOnWindow.equals(mPreviousContentRectOnWindow)) {
                // Content rect is moving.
+1 −0
Original line number Diff line number Diff line
@@ -399,6 +399,7 @@
     <dimen name="floating_toolbar_maximum_overflow_height">192dp</dimen>
     <dimen name="floating_toolbar_horizontal_margin">16dp</dimen>
     <dimen name="floating_toolbar_vertical_margin">8dp</dimen>
     <dimen name="content_rect_bottom_clip_allowance">20dp</dimen>

     <dimen name="chooser_grid_padding">0dp</dimen>
</resources>
+1 −0
Original line number Diff line number Diff line
@@ -2274,6 +2274,7 @@
  <java-symbol type="dimen" name="floating_toolbar_maximum_overflow_height" />
  <java-symbol type="dimen" name="floating_toolbar_horizontal_margin" />
  <java-symbol type="dimen" name="floating_toolbar_vertical_margin" />
  <java-symbol type="dimen" name="content_rect_bottom_clip_allowance" />

  <java-symbol type="string" name="date_picker_prev_month_button" />
  <java-symbol type="string" name="date_picker_next_month_button" />