diff options
| author | Abodunrinwa Toki <toki@google.com> | 2015-06-18 01:05:03 +0000 |
|---|---|---|
| committer | Android (Google) Code Review <android-gerrit@google.com> | 2015-06-18 01:05:07 +0000 |
| commit | e8378476b52b215536f0b7c52d2eb611a893685f (patch) | |
| tree | d77a687dc2422047583aad22f386d341dde5999c | |
| parent | 41ce003934c228f68e82645062665e0d2c443781 (diff) | |
| parent | 15a6c89f46420371115b1648bd2f3925f4bcf7ed (diff) | |
| download | frameworks_base-e8378476b52b215536f0b7c52d2eb611a893685f.zip frameworks_base-e8378476b52b215536f0b7c52d2eb611a893685f.tar.gz frameworks_base-e8378476b52b215536f0b7c52d2eb611a893685f.tar.bz2 | |
Merge "Allow content rect to overshoot the bottom view bounds by 20dp." into mnc-dev
| -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 5ba57c4..4160e0e 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" /> |
