History log of /frameworks/base/core/java/com/android/internal/view/FloatingActionMode.java
Revision Date Author Comments (<<< Hide modified files) (Show modified files >>>)
4e7a1208eaa81f684485ee23ba681dab6419973f 03-May-2016 Abodunrinwa Toki <toki@google.com> Implement alternative ViewGroup.getChildVisibleRect.

This CL allows getChildVisibleRect to optionally always call the
view's parent. The previous version attempted to optimize the call
by not calling further up the view heirarchy when the rect isn't
visible in the current view.

The call is hidden and the previous behaviour is preserved to limit
the bits of code that this change affects.

Bug: 28514727
Change-Id: I49550ed4082bcbdcfe4643b962b50f3308092525
/frameworks/base/core/java/com/android/internal/view/FloatingActionMode.java
6183b722de89d69ce16890db809a14ac03ab89fe 27-Apr-2016 Justin Klaassen <justinklaassen@google.com> Support view transformations when positioning floating CAB

Bug: 24088745

Use ViewGroup#getChildVisibleRect to transform the reported content
rect into the coordinate system of the root view. This allows the
floating CAB to be positioned correctly for views that may have a
scale (or other transforms) applied.

Change-Id: Ia6733a461b44070e7f6bab42f0b6fe2aed6870e5
/frameworks/base/core/java/com/android/internal/view/FloatingActionMode.java
b9acbe40d298612a2ab6bfb15842e63ff8f09af5 16-Sep-2015 Abodunrinwa Toki <toki@google.com> Reduce delay of floating toolbar appearance.

Bug: 21956394
Change-Id: Ide7ee2daffbf618b0a483c377032bf25b20d5b8e
/frameworks/base/core/java/com/android/internal/view/FloatingActionMode.java
ea2d64492399f336c996a1af511c7acd2ad0192c 01-Sep-2015 Clara Bayarri <clarabayarri@google.com> Fix Custom action mode menu item onclick is not working

BUG: 23575152
Change-Id: I7c07a769bd03c2d756e04f16296f418e965a993f
/frameworks/base/core/java/com/android/internal/view/FloatingActionMode.java
f95ed10d9da55c25013200fb35af63f0dac65cb4 12-Aug-2015 Clara Bayarri <clarabayarri@google.com> Fix Insertion ActionMode not showing on RTL languages

When long pressing on an empty Text field with the system language set
to RTL, the "paste" popup was not showing up.

The Floating Toolbar requires a content rect to determine where the
text is and place itself close to it. In the case of an empty field,
we create a "fake" content rect by taking the placement of the cursor
+1 pixel to the right. In RTL languages, this +1 causes the content
rect to be considered off the bounds of the view, as the cursor is
aligned to the right, and hence the Floating Toolbar is hidden.

After making the rect a 0 width rect, we ran into the issue that
it was considered out of bounds due to the calculation ignoring rects
that simply touch the edge of the view's bounds.

BUG: 22540083
Change-Id: I29c79b701f586970b2611178233eff082b802ec1
/frameworks/base/core/java/com/android/internal/view/FloatingActionMode.java
bafc908304d49e8f7f7c5e52772c75da66e4daa3 14-Jul-2015 Yohei Yukawa <yukawa@google.com> Allow FloatingToolbar to be outside of the attached window.

Currently PopupWindow used for the floating toolbar specifies
neither FLAG_LAYOUT_NO_LIMITS nor FLAG_LAYOUT_IN_SCREEN.
As a result, the floating toolbar can overlap the selected
text when the attached window does not have enough height.

Here is the repro code.

final TextView textView = new TextView(this);
textView.setLayoutParams(
new ViewGroup.LayoutParams(
ViewGroup.LayoutParams.MATCH_PARENT,
ViewGroup.LayoutParams.WRAP_CONTENT));
textView.setText("A test sentence.");
textView.setTextIsSelectable(true);
final AlertDialog dialog = new AlertDialog.Builder(this)
.setView(textView)
.create();
dialog.getWindow().setGravity(Gravity.BOTTOM)
dialog.show();

If you tap a word in the dialog, the floating toolbar
unintentionally overlaps the selected text due to the limited
height of the AlertDialog.

It also turns out that just calling
PopupWindow.setClippingEnabled(false)
to specify FLAG_LAYOUT_NO_LIMITS is not sufficient and ends up
showing the toolbar on the NavBar because we have mistakenly
compared bounds in window-local coordinates
(e.g. FloatingActionModemContentRectOnWindow) with bounds in
screen coordinates (e.g. FloatingActionMode#mScreenRect).
Hence the confusion of window-local coordinates and screen
coordinates in FloatingToolbar and FloatingToolbar also needs
to be addresses.

To summarize here are the notable changes in this CL:
- Specify FLAG_LAYOUT_NO_LIMITS so that the floating
toolbar can be placed outside of the attached window.
(We do this with PopupWindow#setClippingEnabled)
- Switch to use screen coordinates from window-local
coordiantes in FloatingToolbar and FloatingActionMode
because some system components such as WindowManager
prefer screen coordinates.
- Put -OnScreen suffix for Rect and Point variables
as long as they are in screen coordinates.

Bug: 22335001
Change-Id: I71a8d356e868dc7715b030ca1078da4ec39368c3
/frameworks/base/core/java/com/android/internal/view/FloatingActionMode.java
5e2310030b538d934606e29dbd11bc5736c3c1c5 01-Jul-2015 Abodunrinwa Toki <toki@google.com> FloatingToolbar: Offset visible rect by the rootview's offset

windowSoftInputMode="adjustPan" config causes the root view to be
offset if necessary when the soft keyboard is shown to keep the text
selection visible. Account for this offset when calculating the
global visible rect of the textview in relation to the screen.

Bug: 21687644
Change-Id: Id44cad387d0a3f1f063880497c234052924717ea
/frameworks/base/core/java/com/android/internal/view/FloatingActionMode.java
1b57653b50892f143241ae0f0beb2246ca4b2aa7 30-Jun-2015 Abodunrinwa Toki <toki@google.com> Fix floating toolbar flicker in ExtractEditText mode.

Fixed by making sure to update visibility immediately after setting a
hide flag on the FloatingToolbarVisibilityHelper.

Bug: 22101632
Change-Id: Iea2d9786c14f6451da836e55f0d880025aa00ed2
/frameworks/base/core/java/com/android/internal/view/FloatingActionMode.java
c107b0ecdcd4e2f89ae4bec818c3a94f45c3c15e 26-Jun-2015 Abodunrinwa Toki <toki@google.com> Fix FloatingToolbar flicker in reaction to text cursor blink.

1. Reposition the toolbar on predraw only when positioning has changed.
2. Update the toolbar popup's position only if the content rect changed.
3. Fix FloatingToolbarPopup.cancelOverflowAnimations().
The previous implementation wasn't actually cancelling the animation.

(1) is enough to fix the bug. But (2) and (3) fix issues in the
toolbar directly related to this bug.

Bug: 22039189
Change-Id: I84ec793d788f9402a1f8635e68e3344746f6af07
/frameworks/base/core/java/com/android/internal/view/FloatingActionMode.java
972ab4f8588c365cf9c06e1f22b30a96fb0a06fc 17-Jun-2015 Abodunrinwa Toki <toki@google.com> Fix FloatingToolbar flickers.

This is fixed by avoiding calling toolbar.show() in PhoneWindow.
FloatingActionMode coordinates whether or not the toolbar should be
visible. PhoneWindow differs to it.

This CL also adds a new API:
ActionMode#onWindowFocusChanged(boolean)

Bug: 21617792
Change-Id: Ic49ce1000ce9c782d0f9e17e3d024d462c7b758b
/frameworks/base/core/java/com/android/internal/view/FloatingActionMode.java
15a6c89f46420371115b1648bd2f3925f4bcf7ed 17-Jun-2015 Abodunrinwa Toki <toki@google.com> Allow content rect to overshoot the bottom view bounds by 20dp.

Bug: 21816429
Change-Id: I84013286896d145c9501351bc6a638cbda12e8c0
/frameworks/base/core/java/com/android/internal/view/FloatingActionMode.java
f444b5c3ae46f8790c8f2a8481fb688b00a42d3b 16-Jun-2015 Abodunrinwa Toki <toki@google.com> Fix floating toolbar flickers.

-Flicker was a side effect the delay in hiding the toolbar when
there is a down press on a TextView handle. The timing clashed
with the time it takes for the FloatingActionMode to release a
hide lock on a changing content rect. Extra flickers also happened
if the ActionMode happened to be invalidated at about the same time.
Since there was no longer a hide lock, the toolbar refreshed, getting
rid of the "Select all" menu item.
FIX. I believe we don't need the delayed hide on down press on a
TextView handle. I've removed this.

-I've also updated FloatingActionMode to ensure that hide locks
overlap one another if necessary. The toolbar can only be visible if
all locks are off.

Bug: 21793687
Change-Id: I290ea45ab17d5862b453cb319afb4c8ffe084cd0
/frameworks/base/core/java/com/android/internal/view/FloatingActionMode.java
7d3b8833df5857f5cc70d6c101abe7501fa22b49 08-Jun-2015 Abodunrinwa Toki <toki@google.com> Merge "Fix ActionMode.snooze API" into mnc-dev
9e211282d3ee54c9840947951593554c3bd5a77c 05-Jun-2015 Abodunrinwa Toki <toki@google.com> Fix ActionMode.snooze API

Bug: 21572677
Change-Id: If9fdb8ace3773b983418b0148082712644fd1fa5
/frameworks/base/core/java/com/android/internal/view/FloatingActionMode.java
601523ad007923779d156aaa8dc229468773e48c 04-Jun-2015 Abodunrinwa Toki <toki@google.com> TextView: Make sure the contentRect is within visibile bounds.

Bug: 21620604
Change-Id: Idd0d891e423316b2ebacf883fd3cbfff9ef69743
/frameworks/base/core/java/com/android/internal/view/FloatingActionMode.java
6a0b277c7c5759cae8151e87cbc11c5a2c7332a2 26-May-2015 Abodunrinwa Toki <toki@google.com> Hide the floatingtoolbar when content rect is invisible.

Hide the floating toolbar when the content rect is outside the
source view's visible area.

Bug: 21304845
Change-Id: I0dd10ad2cda7a8d9b05c81334cdfbd68c22dbc6a
/frameworks/base/core/java/com/android/internal/view/FloatingActionMode.java
a8151e4ef7987faa7d0ee31bc3013a05e5b76a05 06-May-2015 Abodunrinwa Toki <toki@google.com> Hide floating toolbar when selection is out of bounds.

Bug: 20212141
Change-Id: I7844308e339ba9a5027c629da8090053011e019d
/frameworks/base/core/java/com/android/internal/view/FloatingActionMode.java
fd3a3a1163c5096821cef351309fcdd9a4f48002 05-May-2015 Abodunrinwa Toki <toki@google.com> Hide floating toolbar when user interacts with screen.

- Adds an ActionMode.snooze(int) API.
- Clients call this to hide the floating toolbar on DOWN touch event.
- This is called repeatedly as a snooze timeout will re-show the
toolbar.
- ActionMode.snooze(0) will "wake" the toolbar, reshowing it.
- Clients call this to re-show the toolbar on UP touch event.
- This CL also adds code to hide the toolbar when the "content rect"
is changing.

Bug: 20148125
Change-Id: If5a9a15f72c73cad8ca01a4328a58570b3e29f66
/frameworks/base/core/java/com/android/internal/view/FloatingActionMode.java
0d7d4ef56083543d58ef5835ec594865a547347c 13-May-2015 Clara Bayarri <clarabayarri@google.com> Fix Floating Toolbar appearing after ActionMode was cancelled

The Views created for the Toolbar were not cleaned up properly when the
mode was cancelled by the client in onCreateActionMode, leading to the
toolbar appearing over other views when it shouldn't due to
onWindowFocusChanged showing the Toolbar if it exists.

We don't actually need the views if we don't know whether they are
going to be shown yet, so moved view creation to after onCreateActionMode

Bug: 20713912
Change-Id: Ic0c31d1634e1e96d9981a77b2c769306a8bf1a8d
/frameworks/base/core/java/com/android/internal/view/FloatingActionMode.java
838e36cda7af884233c06c5b2b5e43ffbed4715b 18-Mar-2015 Clara Bayarri <clarabayarri@google.com> Floating toolbar: Create the FloatingActionMode and use it in DecorView.

This CL
- Creates a new FloatingActionMode
- Uses it for action mode requests of type floating
- Plumbs in the positioning invalidation logic

Change-Id: I379de5b0a87b256946d0a6d8014299cfb78e6734
/frameworks/base/core/java/com/android/internal/view/FloatingActionMode.java