diff options
author | Abodunrinwa Toki <toki@google.com> | 2015-06-16 23:17:19 +0100 |
---|---|---|
committer | Abodunrinwa Toki <toki@google.com> | 2015-06-16 23:27:55 +0100 |
commit | 15a6c89f46420371115b1648bd2f3925f4bcf7ed (patch) | |
tree | 271e4f4765105a64f14e231f381fc892347d64ee | |
parent | 98f98dd19def468afc310bd879cb79cce9917ba2 (diff) | |
download | frameworks_base-15a6c89f46420371115b1648bd2f3925f4bcf7ed.zip frameworks_base-15a6c89f46420371115b1648bd2f3925f4bcf7ed.tar.gz frameworks_base-15a6c89f46420371115b1648bd2f3925f4bcf7ed.tar.bz2 |
Allow content rect to overshoot the bottom view bounds by 20dp.
Bug: 21816429
Change-Id: I84013286896d145c9501351bc6a638cbda12e8c0
-rw-r--r-- | core/java/com/android/internal/view/FloatingActionMode.java | 8 | ||||
-rw-r--r-- | core/res/res/values/dimens.xml | 1 | ||||
-rwxr-xr-x | core/res/res/values/symbols.xml | 1 |
3 files changed, 9 insertions, 1 deletions
diff --git a/core/java/com/android/internal/view/FloatingActionMode.java b/core/java/com/android/internal/view/FloatingActionMode.java index 99c1277..784b256 100644 --- a/core/java/com/android/internal/view/FloatingActionMode.java +++ b/core/java/com/android/internal/view/FloatingActionMode.java @@ -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. diff --git a/core/res/res/values/dimens.xml b/core/res/res/values/dimens.xml index e60a48d..7e74680 100644 --- a/core/res/res/values/dimens.xml +++ b/core/res/res/values/dimens.xml @@ -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> diff --git a/core/res/res/values/symbols.xml b/core/res/res/values/symbols.xml index d7b565c..17180ec 100755 --- a/core/res/res/values/symbols.xml +++ b/core/res/res/values/symbols.xml @@ -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" /> |