Merge "TextView: Make sure the contentRect is within visibile bounds." into mnc-dev
This commit is contained in:
committed by
Android (Google) Code Review
commit
4741f6a4c7
@@ -127,11 +127,16 @@ public class FloatingActionMode extends ActionMode {
|
|||||||
|
|
||||||
private void repositionToolbar() {
|
private void repositionToolbar() {
|
||||||
checkToolbarInitialized();
|
checkToolbarInitialized();
|
||||||
|
|
||||||
|
mContentRectOnWindow.set(mContentRect);
|
||||||
|
mContentRectOnWindow.offset(mViewPosition[0], mViewPosition[1]);
|
||||||
|
// Make sure that content rect is not out of the view's visible bounds.
|
||||||
mContentRectOnWindow.set(
|
mContentRectOnWindow.set(
|
||||||
mContentRect.left + mViewPosition[0],
|
Math.max(mContentRectOnWindow.left, mViewRect.left),
|
||||||
mContentRect.top + mViewPosition[1],
|
Math.max(mContentRectOnWindow.top, mViewRect.top),
|
||||||
mContentRect.right + mViewPosition[0],
|
Math.min(mContentRectOnWindow.right, mViewRect.right),
|
||||||
mContentRect.bottom + mViewPosition[1]);
|
Math.min(mContentRectOnWindow.bottom, mViewRect.bottom));
|
||||||
|
|
||||||
if (!mContentRectOnWindow.equals(mPreviousContentRectOnWindow)) {
|
if (!mContentRectOnWindow.equals(mPreviousContentRectOnWindow)) {
|
||||||
if (!mPreviousContentRectOnWindow.isEmpty()) {
|
if (!mPreviousContentRectOnWindow.isEmpty()) {
|
||||||
notifyContentRectMoving();
|
notifyContentRectMoving();
|
||||||
|
|||||||
Reference in New Issue
Block a user