This patch adds plumbing to TextView to control the strategy used
for breaking paragraphs into lines.
The default for TextView is "quality", while the default for EditText
is "simple", largely to avoid too much re-layout when editing.
StaticLayout now has a builder which provides access to more
functionality and is also cleaner than the old mechanism of having
lots of constructors with varying numbers of arguments. This patch
changes TextView to use that builder, and also contains cleanups
of the Builder within StaticLayout.
Change-Id: Iee3cf3a05a3e51ba0834554e4a3ec606e9cabca5
This reverts commit 5a6eeb3cbe and
fixes the underlying issue (needed to @hide getHyphen() for subclasses
of Layout, not just the base class), and layoutlib changes for
checkbuild.
Change-Id: I7a2b5f20ae014ea8e224d8c4079cf9131e17e1c1
Reorder elements to place "Select All" last, as otherwise when
we use a floating toolbar the first element is "Select All" and
takes up too much space, forcing Copy and Paste to the overflow.
Change-Id: I04cdd79915bd2a3abbd10969ce298b7b0f7f8cb0
Pasted text is directly inserted into the TextView buffer, so it looks
like a programmatic insert to the undo system. This is fine, but we
need to be sure that subsequent modification by a TextWatcher (for
example, to add spaces to a credit card number) is merged into the same
undo operation -- from the user's perspective, pasting in the text and
having spaces inserted are a single operation.
Also clean up mForceMerge flag in EditOperation -- we don't need to
store it across edits, just use it when a new edit comes in.
CTS test to follow.
Bug: 19332904
Change-Id: I7b3c97c08b83faebeab9f1708b0d6eac6d151d50
This will allow any View to include foreground drawables. This is
useful for cases where a foreground drawable is a more appropriate
place to put a state list to show focus or touch highlighting.
Also add View#onDrawForeground as a public API hook for drawing
decorations after primary view content and child views such as
scrollbars, foreground drawables and EdgeEffects.
Change-Id: If1e4700af69db6876970f8f4ad5e3eab11b8034c
Before all permissions were granted at install time at once, so the user
was persented with an all or nothing choice. In the new runtime permissions
model all dangarous permissions (nomal are always granted and signature
one are granted if signatures match) are not granted at install time and
the app can request them as necessary at runtime.
Before, all granted permission to an app were identical for all users as
granting is performed at install time. However, the new runtime model
allows the same app running under two different users to have different
runtime permission grants. This change refactors the permissions book
keeping in the package manager to enable per user permission tracking.
The change also adds the app facing APIs for requesting runtime permissions.
Change-Id: Icbf2fc2ced15c42ca206c335996206bd1a4a4be5
This alters text selection so that you won't select a
whitespace line above or below your selection unless you select
a non-whitespace character past the line.
Change-Id: Ic93f77f6ccecb06be2acc83524ca9e9a627660ce
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