| Commit message (Collapse) | Author | Age | Files | Lines |
|
|
|
|
|
| |
Bug:13028925
Change-Id: I0a9301248b10a339afbdc5e4ffe3310ac4fa1fb7
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
This patch fixes behavior where attempting to place the cursor at
the end of a string where the last character is a combining accent
actually placed it before that accent. This was especially annoying
for editing Thai text, because it made it difficult to delete a
trailing tone mark.
Fixes bug 8947569 "Can't place cursor after combining accent" and bug
10398332 "[Thailand] Thai Language(IME) -- Can't delete Thai tone mark
while writing message"
Change-Id: Ida1933c8f0ab6cdb0200db39891e9389e4bdba86
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
The existing behavior of EditText is that trailing blanks can cause a
line to exceed the layout width, causing the cursor to extend past the
line, which in turn causes horizontal scrolling. This patch clamps the
cursor to the layout width in the non-scrolling case, which makes the
spaces effectively invisible when they're at the end of the line, but at
least suppresses the scrolling.
The clamping only works reliably in left-to-right alignments, so this
patch checks for than and only enables the clamping in those cases.
Fix for bug 7699295.
Change-Id: I22bc4e6c9ded3d7716edfcf10dd2b5c31a5da9de
|
|
|
|
|
|
|
|
| |
text and if gravity is set to LEFT
- fold LEFT/RIGHT into NORMAL/OPPOSITE cases
Change-Id: Idf14342ffed4840e7b4ea53cc42f1cde8f196a4c
|
|\ |
|
| |
| |
| |
| |
| |
| | |
- use the correct ellipsis char in both measurement and rendered string
Change-Id: Ia00285fc16da528f18702719026503b5d0610642
|
|/
|
|
|
|
|
|
|
|
|
|
| |
Bug 6642222
Using setMaxLines(0) and setMinHeight(30) causes a crash
because Layout#getLineRangeForDraw() returns a [0,0] interval
in that case.
Accessing the Direction in draw causes a NPE.
Change-Id: If50f9b554e3cdc598a721b623992e9196982838c
|
|
|
|
| |
Change-Id: I79f5444a097f1e2b2a81ececf1f0a14b6d7d5179
|
|
|
|
|
|
|
|
|
| |
The main performance improvement should come from the fact
that we entirely skip the loop (which calls getLineStart, getLineTop
and getLineDescent on each line) in the frequent case where there
are no LineBackgroundSpans.
Change-Id: Ie2d3168521e88d43f1a4236da2b3e8447606df1e
|
|
|
|
|
|
|
|
|
|
| |
Decorelate background and text in layout display. This allows
to only store the text in the editable TextView's display list.
Selection and cursor changes no longer need to invalidate the
display list, leading to faster rendering.
Change-Id: I3af3a98846e1bfe2d9ec6c42590e71bf3704595e
|
|
|
|
|
|
|
|
|
|
| |
some RTL run into it
Part 2
- make selection handles aware of the run direction
Change-Id: Idf41036de53d8968e7ae27eb87aea09e86bcd652
|
|
|
|
|
|
|
|
| |
some RTL run into it
- make the selection green highlight work
Change-Id: I4e3b88e3720288f973b1b9e68afa8f800ad13779
|
|
|
|
|
|
|
|
|
|
| |
- force ellipsising when there are more lines found than maxLines
- do not care about lines when we have reached maxLines
- also fix relayouting when changing maxLines thru setMaxLines()
- do not allow START / MIDDLE ellipsis when there are multiple lines
(and print a log accordingly)
Change-Id: I90f5a7f5200a220aceee01fb7300bec2c4c3a075
|
|
|
|
| |
Change-Id: I2fcf18de573f2d66494fa5ed61e4273c3c6078c7
|
|
|
|
| |
Change-Id: Id6f3682f67ba2e6811e3014cd34a281e6dd0a469
|
|\
| |
| |
| |
| | |
* commit '8b22ef66ef1a67333e2f1d4250d2c134b50ef91a':
Using robust equality check.
|
| |
| |
| |
| | |
Change-Id: Ie30684c472bfa38d0432f855f7075c34709958d5
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
The current framework does not consider surrogate pairs
when getting the index of the character. This bug becomes
visible when creating the text including Emojis. For
example cursor breaks up when it moves around the Emojis.
Our proposed solution will consider the surrogate pairs
when calculating the index. It will fix not only the Emoji
case, but also the letters that use surrogate pairs.
Change-Id: I4983f2e4df933c8af9d5f0cc27df871e8e10fed4
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
Bug 3422121
With ellipsize, lines starting with a very long word that does not
fit inside the width were simply ignored. Cut the long word instead.
start - widthStart index offset shift in BiDi.
The original ellipsize-end patch that added '...' after the last
word on end-ellipsized lines has been punted in favor of a true
ellipsize support in I.
I believe the StaticLayout calculateEllipsise is a no-op since textwidth <= avail
by construction: fitWidth and okwidth are < outerWidth. The only exception is the
paraEnd != here case in generate (when not a single character fits in width).
This case is exercised by StaticLayoutTest in cts (width of 8 pixels) and revealed
an offset error in widstart.
All in all, it looks like this code was probably never really tested. I tried some
typical text configuration to make sure these changes improved the situation.
Change-Id: Ibee410bd7db453abf93e10e8beb844eae998922c
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
Bug 3261766
If defined, the drawable is used instead of directly drawing a 1 pixel
line. This makes the cursor more fancy and more visible.
The drawable is currently clipped by the TextView's limits, which is
currently visible on the left when the cursor is at the first position.
To solve this issue properly, we would need to propagate a do-not-clip
up in the hierarchy.
Change-Id: I99f6001048eed14104994acf6bab942dda8eb38e
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
Bug 3295544
Only the last line of text includes the bottomPadding (extra line
spacing below the characters' descent. When The text is clipped using
maxLines, the desired height correctly added this value, but getLineTop
and getLineDescent are also used when the layout is drawn.
The fix is to make the layout aware of its clipping so that these
values are correctly updated.
Change-Id: I703656cf45022d34a90f55f0ed8fc5e4b30f80b1
|
| |
| |
| |
| |
| |
| | |
Bug 3182953
Change-Id: Idc7faa86b8250bf325e2547d7d4c094300a06686
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
Added new key maps for external keyboards. These maps are intended to
be shared across devices by inheriting the "keyboards.mk" product
makefile as part of the device's product definition.
One of the trickier changes here was to unwind some code in
MetaKeyKeyListener that assumed that only the low 8 bits of the meta key
state were actually used. The new code abandons bitshifts in favor
of simple conditionals that are probably easier to read anyways.
The special meta key state constants used by MetaKeyKeyListener
are now (@hide) defined in KeyEvent now so as to make it clearer that they
share the same code space even if those codes are not valid for KeyEvents.
The EventHub now takes care of detecting the appropriate key layout
map and key character map when the device is added and sets system
properties accordingly. This avoids having duplicate code in
KeyCharacterMap to probe for the appropriate key character map
although the current probing mechanism has been preserved for legacy
reasons just in case.
Added support for tracking caps lock, num lock and scroll lock and
turning their corresponding LEDs on and off as needed.
The key character map format will need to be updated to correctly support
PC style external keyboard semantics related to modifier keys.
That will come in a later change so caps lock doesn't actually do
anything right now except turn the shiny LEDs on and off...
Added a list of symbolic key names to KeyEvent and improved the toString()
output for debug diagnosis. Having this list in a central place in the
framework also allows us to remove it from Monkey so there is one less
thing to maintain when we add new keycodes.
Bug: 2912307
Change-Id: If8c25e8d50a7c29bbf5d663c94284f5f86de5da4
|
| |
| |
| |
| |
| |
| |
| | |
Also fixes a crash in the drop shadows cache and improves
drop shadows caching.
Change-Id: I9c0208a49467f9201d786ae0c129194b8d423923
|
| |
| |
| |
| |
| |
| |
| |
| | |
When the text ends with an empty line, the getSpans() call to retrieve
styles for it would also retrieve the styles of the preceding line.
Add a special case to detect and prevent this.
Change-Id: I888131cacce6bf45e68c53c931ebe8d58db0b7a9
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
Add internal API (getTextRunAdvances) to Paint, use when measuring.
Add internal API (getTextRunCursor) to Paint, use when determining
valid cursor positions.
Remove java-level shaping code. Remove 'prep' code in TextLine
(except for replacement text) since shaping now is done on the fly as
needed in native.
Provide explicit shaping context bounds to internal text measuring,
cursor movement, and rendering APIs.
Update for to changes in external API in ushape.h.
Change-Id: I146958b624802ce8553125e5c3c6c03031bc9608
|
| |
| |
| |
| |
| |
| |
| | |
Also remove unused debugging code that depends on junit.
Remove trailing whitespace in changed code.
Change-Id: Ie02d1b8220c599a672ee6e91af0fba634e0f620c
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
This takes utility functions from Styled and a few other classes and
incorporates them into two new utility classes, TextLine and
MeasuredText. The main point of this is to support shaping by skia,
to experiment with how this will look, this also introduces
character-based Arabic shaping.
MeasuredText is used by code that determines line breaks by generating
and examining character widths in logical order. Factoring the code
in this way makes it usable by the ellipsize functions in TextUtils as
well as by StaticLayout. This class takes over the caching of widths
and chars arrays that was previously performed by StyledText. A small
number of MeasuredText objects are themselves cached by the class and
accesed using static obtain and recycle methods. Generally only these
few cached instances are ever created.
TextLine is used by code that draws or measures text on a line. This
unifies the line measuring and rendering code, and pushes assumptions
about how rtl text is treated closer to the points where skia code is
invoked. TextLine implements the functions that were previously
provided by Styled, working on member arrays rather than
explicitly-passed arguments. It implements the same kind of static
cache as MeasuredText.
TextLine and MeasureText simulate arabic glyph generation and shaping
by using ArabicShaping, ported with very minor changes from ICU4J's
ArabicShaping. This class generates shaped Arabic glyphs and Lam-Alef
ligatures using Unicode presentation forms. ArabicShaping is not
intended to be permanent, but to be replaced by real shaping from the
skia layer. It is introduced in order to emulate the behavior of real
shaping so that higher level code dealing with rendering shaped text
and cursor movement over ligatures can be developed and tested; it
also provides basic-level support for Arabic.
Since cursor movement depends on conjuncts whose formation is
font-dependent, cursor movement code that was formerly in Layout and
StaticLayout was moved into TextLine so that it can work on the shaped
text.
Other than these changes, the other major change is a rework of the
ellipsize utility functions to combine multiple branches into fewer
branches with additional state.
Updated copyright notices on new files.
Change-Id: I492cb58b51f5aaf6f14cb1419bdbed49eac5ba29
|
| |
| |
| |
| |
| |
| | |
Also, clean up imports and trailing whitespace.
Change-Id: I5ebaaceb756600a1ca7370ab3ef078ce200545ef
|
|/
|
|
|
|
|
|
|
|
|
|
| |
Changes the internal representation of direction information in the Directions object to be a visually-ordered list of start/length+direction pairs instead of a list of directionality inversion offsets.
Rewrite Layout.getOffsetToLeft/RightOf to use run information instead of width metrics.
Remove java Bidi, use native. Switch bidi tests to test native, expect levels instead of dirs.
Add test of directionality. Leave in switch to turn new code off and restore previous behavior for now.
Change-Id: Iea8bb46c678a18820e237c90f76007a084c83051
|
|
|
|
|
| |
Add rudimentary support for overriding default base line direction heuristic.
Add some simple tests of the bidi implementation.
|
|
|
|
| |
for further investigation.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
This change is likely incomplete and perhaps not right in other ways.
The gist of the change is that the span can return the number of lines
to which to apply the "leading margin".
Some specific things that should be looked at:
1) if the user has nested multiple
LeadingMarginSpans then they will inherit the "line count" feature.
This is wrong but I didn't want to spend time fixing it until it
was clear that this overall approach was acceptible.
2) The units for how many lines should indented is "lines" rather than
something like dips.
3) I wasn't sure what our strategy was for binary compatibility so
I didn't want to modify the methods in LeadingMarginSpan. Instead I
made another interface with extends LeadingMarginSpan that has the
extra method to return the line count.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
It was measuring the text to try to determine the size that it needed to
scale the emoji character to. Unfortunately it was accidentally trying
to measure the character under the cursor instead of the emoji character
itself, which is wrong, but more seriously doesn't work at all when the
cursor is at the end of the line.
This was already fixed before in change 144474, but that change never got
merged over to donut. So this merges it now.
Bug 2087915
Change-Id: Ib4804d330a029a966207b3b07271f84e6b2652c0
|
|
|
|
|
|
|
| |
The semantics of Config.DEBUG will be changing soon, and all other
Config.* fields will become deprecated/hidden.
BUG=1780938
|
|
|
|
|
|
|
|
|
| |
text.
Original author: enf
Merged from: //branches/cupcake/...
Automated import of CL 143165
|
| |
|
| |
|
| |
|
| |
|
|
|