Fixes a regression whereby failing to explicitly set a width and height
would cause the popup window's decor view to be 0 width and height.
Also deprecates unnecessary method for setting window width and
height spec and replaces with less-confusing setters.
Cleans up javadoc for modified methods.
Bug: 19538371
Change-Id: I20da3ff02ad12e99adf14c056edd1a890b5c322a
Respect flags passed to startDrag (they used to be ignored).
Allow global drag&drop for text views.
Bug: 19548858
Change-Id: I981cfd617ebc6f5f2d59ebded798c22dc4920d38
The existing code already fires the selection action mode, which
contains all the elements from the popup.
This is the last case remaining in which the popup is used, so also
clean up all popup related code.
Change-Id: I68b8b7bc8076279371955265b0088bfa0c22760b
The Insertion handle used to show/hide the paste popup, not that we are
unifying it with the selection action mode it should start/finish the mode.
There are no other use cases of the popup with the insertion handle, so that
code is cleaned up.
Change-Id: I40703bc8316f217edaf97aff72436935de60500c
Use span properties to detect:
* Composing text - don't record undo operations
* Completing a composition - record an insert undo operation
* Canceling a composition - don't record
Save the composition state on parcel/unparcel.
Stop using begin/end batch edit to try to detect when a TextWatcher
is modifying the text. IMEs trigger multiple InputFilter passes in
a single batch edit. Use SpannableStringBuilder to determine when
we're in a TextWatcher callback because it is the authority on that
state.
Fix a bug in undo manager where it doesn't forget undos correctly if
there are more than one in the stack.
Bug: 19332904
Change-Id: Iaa9b0b2a7bf6683302cc85e7616e5d5fcc9fa202
This used to fire the "paste" popup instead. It is a tiny step towards
unifying the cut/copy/paste action mode and paste popup.
Change-Id: I03dfcc294d4453e92464fc4f714468f58c692f24
Optimize parceling of AssistData (which is now renamed to
AssistStructure) by pooling duplicated class name strings.
Change text associated with a view node to a CharSequence,
so styling information comes along.
Include global text attributes -- size, colors, etc.
Introduce a new AssistContent structure, which allows us
to propagate information about the intent and data the
activity is looking at. This further allows us to propagate
permission grants, so the assistant can dig in to that data.
The default implementation propagates the base intent of an
activity, so if for example you bring up the assistant while
doing a share the assistant itself has the same information
and access that was given to the share activity (so it could
for example share it in another way if it wanted to).
Did some optimization of loading PersistableBundle from xml,
to avoid duplicating hash maps and such.
Changed how we dispatch ACTION_ASSIST to no longer include
the more detailed AssistStructure (and new AssistContent)
data when launching; now the example code that intercepts
that needs to be sure to ask for assist data when it starts
its session. This is more like it will finally be, and allows
us to get to the UI more quickly.
Change-Id: I88420a55761bf48d34ce3013e81bd96a0e087637
Previously the offset between the touch event and the start / end of
the word could result in a negative value - we don't care or want
this value to be negative. The negative value also causes the returned
offset to be outside the bounds of the text which resulted in a crash.
Bug: 19705184
Change-Id: I4287df7778c246dd10654f1a1f1e57538e940730
As a first step in unifying the cut/copy/paste ActionMode in Editor
with the paste/replace popup, I'm moving the replace option to
the CAB ActionMode. Paste is already there, so for now all options
are together.
Missing things to address in upcoming CLs:
- Invoke the ActionMode in all cases where the popup shows up now,
ensuring only the options that are currently available show up.
- Get rid of the current popup
- Make the ActionMode a floating toolbar (pending feature completion)
- Define a keyboard shortcut for replace?
Note that since the ActionMode still shows up in the ActionBar and
replace has no icon it now appears as text and takes up lots of
space. This will improve when we can switch to using a floating
toolbar.
Change-Id: Ib6b60bae9b58e4db96b9c4cee556e19d3f1bb466
Ensures PopupMenu works correctly when multiple calls are made to show
and dismiss. Ensure PopupWindow works correctly when multiple calls are
made to showAsDropDown and dismiss (fixes multiple clicks on Spinner).
Bug: 19672907
Bug: 19671831
Change-Id: Ib92accd8fd70a1ff1f8cda27155347b007a4d25b
One of the exit conditions of the loop immediately above the code is
when a BreakIterator finishes its input and emits BreakIterator.DONE,
which we were then mistakenly then using as a parameter for setting
spans.
Bug: 12936072
Bug: 5555929
Change-Id: Ib4aba113f2e7838cd040076160c1dd0fb90adb1a
Using an activity context with AudioManager could cause that context
to be held on to longer than desired, for example if the caller
acquired audio focus but never abandoned it. Fix acquire/abandon in
VideoView, and use the application context in AudioManager to mitigate
the issue for other misbehaving code.
Bug: https://code.google.com/p/android/issues/detail?id=152173
Change-Id: I0fb8390207422c784800dda25b1f2c03d4574bcd
This fixes a rare crash in the undo system. In particular, if the
TextView did not have a cursor and the first operation was a
programmatic insert/append the "old cursor position" would be -1.
Attempting to undo would try to restore the cursor to -1 and crash.
Test will land separately in CTS.
Bug: 19332904
Change-Id: I9aa18c1e3621b99d13ac707e483154382effb81c
The previous behavior used the top-start-most view, rather than the view
with the bottom-most baseline. Which doesn't really make sense, but
that's what it did.
Bug: 19653790
Change-Id: Ia23476f1d2de5313fd82aac037e90d45b0af8972