diff options
author | Raph Levien <raph@google.com> | 2015-08-12 21:00:07 +0000 |
---|---|---|
committer | Android (Google) Code Review <android-gerrit@google.com> | 2015-08-12 21:00:07 +0000 |
commit | beabcb92cbdec6f68bd712c9972e6f8377b78f46 (patch) | |
tree | 824342489a195f69bbac098b8cda3d7cfeaa2c64 /core | |
parent | 242ff8a89d851cc5c53b11dadd871fa55e00fbb5 (diff) | |
parent | f95ed10d9da55c25013200fb35af63f0dac65cb4 (diff) | |
download | frameworks_base-beabcb92cbdec6f68bd712c9972e6f8377b78f46.zip frameworks_base-beabcb92cbdec6f68bd712c9972e6f8377b78f46.tar.gz frameworks_base-beabcb92cbdec6f68bd712c9972e6f8377b78f46.tar.bz2 |
Merge "Fix Insertion ActionMode not showing on RTL languages" into mnc-dev
Diffstat (limited to 'core')
-rw-r--r-- | core/java/android/widget/Editor.java | 2 | ||||
-rw-r--r-- | core/java/com/android/internal/view/FloatingActionMode.java | 12 |
2 files changed, 11 insertions, 3 deletions
diff --git a/core/java/android/widget/Editor.java b/core/java/android/widget/Editor.java index 010cb27..5b042c6 100644 --- a/core/java/android/widget/Editor.java +++ b/core/java/android/widget/Editor.java @@ -3308,7 +3308,7 @@ public class Editor { mSelectionBounds.set( primaryHorizontal, layout.getLineTop(line), - primaryHorizontal + 1, + primaryHorizontal, layout.getLineTop(line + 1) + mHandleHeight); } // Take TextView's padding and scroll into account. diff --git a/core/java/com/android/internal/view/FloatingActionMode.java b/core/java/com/android/internal/view/FloatingActionMode.java index 41628d0..9761661 100644 --- a/core/java/com/android/internal/view/FloatingActionMode.java +++ b/core/java/com/android/internal/view/FloatingActionMode.java @@ -194,8 +194,16 @@ public class FloatingActionMode extends ActionMode { mContext.getResources().getDisplayMetrics().widthPixels, mContext.getResources().getDisplayMetrics().heightPixels); - return Rect.intersects(mContentRectOnScreen, mScreenRect) - && Rect.intersects(mContentRectOnScreen, mViewRectOnScreen); + return intersectsClosed(mContentRectOnScreen, mScreenRect) + && intersectsClosed(mContentRectOnScreen, mViewRectOnScreen); + } + + /* + * Same as Rect.intersects, but includes cases where the rectangles touch. + */ + private static boolean intersectsClosed(Rect a, Rect b) { + return a.left <= b.right && b.left <= a.right + && a.top <= b.bottom && b.top <= a.bottom; } @Override |