Commit Graph

285 Commits

Author SHA1 Message Date
satok
b3fc1a5b8b Rename CorrectionSpan to SuggestionSpan
Change-Id: I004b2e012b2de4de959a31da1f55b63ca7c14199
2011-04-08 13:43:19 +09:00
Brad Fitzpatrick
bc20ac85a5 am e511fb33: am 9b1b6439: am 2ed72048: Merge "Always return a valid index from Rfc822Tokenizer.findTokenEnd()"
* commit 'e511fb33d33f0ba83ce437f615fa236f369b5ade':
  Always return a valid index from Rfc822Tokenizer.findTokenEnd()
2011-04-04 15:28:51 -07:00
Brad Fitzpatrick
e511fb33d3 am 9b1b6439: am 2ed72048: Merge "Always return a valid index from Rfc822Tokenizer.findTokenEnd()"
* commit '9b1b64399502af0a08beac3014f2294644753602':
  Always return a valid index from Rfc822Tokenizer.findTokenEnd()
2011-04-04 15:25:33 -07:00
Mattias Niklewski
114f98a753 Always return a valid index from Rfc822Tokenizer.findTokenEnd()
If an invalid input string ends with a backslash inside a comment
or quoted string, the returned index would be past the end of the
string. In one case this would lead to a runtime exception being
thrown from MultiAutoCompleteTextView.performValidation.

Change-Id: If629372b429716c25cdc25764f088e95d4812d57
2011-04-04 14:52:35 +02:00
Fabrice Di Meglio
eee49c699c Fix text redering issue where the text was sometimes truncated
- mostly was visible in Settings apps / Wi-Fi networks summary info for each network
- correctly setup the local SkPaint for advances computation
- improve test app for adding live resizing

Change-Id: Ia031fe1b115b521ba55c7e68f2a26300f02e48ca
2011-03-29 19:44:33 -07:00
Jeff Sharkey
67bcd82b40 Merge "Support Ctrl-based EditText movement." 2011-03-28 19:57:10 -07:00
satok
e3797a15fb Removed APIs for setCorrectionSpan from InputConnection
("setCorrectionSpan" was added in Id3abc9ea4d11753cd )

Also..
- Added a class java doc for CorrectionSpan
- Removed FLAG_DEFAULT
- Changed the return type of getSuggestions from Array<CharSequence> to String[]

Change-Id: If5eb091e307a7a40c5b4a70ec1fe6059ecd9fb2d
2011-03-26 07:20:34 +09:00
Jeff Sharkey
e982dfc1ba Support Ctrl-based EditText movement.
EditText now listens for Ctrl+left/right to jump through text at word
boundaries.  It also listens for Ctrl+home/end to move to start/end of
the full text.  This emulates behavior found in desktop text editors.

Bug: 4081964
Change-Id: I98bd19c0d8707357847db3466648a83fd774dbaf
2011-03-21 18:20:49 -07:00
satok
adb435835f Add CorrectionSpan and APIs to pass a secure CorrectionSpan to TextView
- CorrectionSpan is a span which has suggestions made by IME.
This has a function to change the current IME to other IME specified
in this span. For security reasons, only the current IME
is allowed to use this function through InputConnection.
(IME token is used for checking the validity of it.).

- CorrectionSpan stores following information:

flags, subtype Id, InputMethodInfo Id, suggests, locale, original string

Change-Id: Id3abc9ea4d11753cdc4f483a2bb3128f49ba198a
2011-03-16 14:44:37 +09:00
Brad Fitzpatrick
b37f7e59ee Merge changes I81fc2f90,I5e7fd759
* changes:
  Using proper key for removing from map.
  Removing wrong equals method in comparator.
2011-03-15 10:56:16 -07:00
Gilles Debunne
1e3ac18e7a Empty spans are not considered in text layout/rendering process.
Bug http://code.google.com/p/android/issues/detail?id=14786

Empty spans are affecting the text before and after them. See the
comment in TextUtils.removeEmptySpans for details.

Change-Id: I40376c32fd56a17efde6219f9b2593e4b4ab1ba1
2011-03-09 17:17:40 -08:00
Gilles Debunne
b0b225602c getTextRunCursor gets deprecated in SpannableStringBuilder
Change-Id: I2d408ebff90add7afc242bb01df9ab96c6fc7fa7
2011-03-04 11:19:40 -08:00
Gilles Debunne
616f3835a0 Removed documentation links
Broken build.

Should the Paint fields be made public or should the SpanStringBuilder
method be hidden ???

Change-Id: I8ecea19104357ea53ad53b23d02a707ec422161d
2011-03-02 19:50:20 -08:00
Gilles Debunne
5a39c95c00 Extra @Override removed in SpanStringBuilder
These were added in 99657 by using a misconfigured eclipse
save action that adds @Overirde to interfaces (Java 1.6 only).

Change-Id: I766bbde917b0bb063cb6d588ee276787e2f7db66
2011-03-02 18:06:13 -08:00
Gilles Debunne
f09d510cd1 Added documentation for SpannableStringBuilder.getTextRunCursor
Bug 3370244

Change-Id: I621a1599ff18da928044dd37a0d7cc861cc6f48f
2011-03-02 17:42:36 -08:00
Xavier Ducrohet
7719436342 am b732b7b5: am ce57a7f3: am 6504490c: am dff6b8e7: Merge "Add --non-constant-id to aapt."
* commit 'b732b7b5e8192501360edc15fb8c6399d11fb97d':
  GpsLocationProvider: Clean up HAL initialization/cleanup sequence
  Fixed GSM encoded network initiated position request
  Ensuring thread-safe usage of DateFormat.
  Fixing infinite loop for zero duration.
  Fix for an infinite loop while scrolling lists.
  WAPPushManager, WAP Push over SMS message handler
  Add --non-constant-id to aapt.
2011-02-28 10:15:48 -08:00
Xavier Ducrohet
b732b7b5e8 am ce57a7f3: am 6504490c: am dff6b8e7: Merge "Add --non-constant-id to aapt."
* commit 'ce57a7f35344e76689d30f45964d1e37b78280cb':
  GpsLocationProvider: Clean up HAL initialization/cleanup sequence
  Fixed GSM encoded network initiated position request
  Ensuring thread-safe usage of DateFormat.
  Fixing infinite loop for zero duration.
  Fix for an infinite loop while scrolling lists.
  WAPPushManager, WAP Push over SMS message handler
  Add --non-constant-id to aapt.
2011-02-28 10:10:38 -08:00
Jeff Brown
d17247164b Make SHIFT+Backspace be forward delete.
Bug: 3416383
Change-Id: I8f20a6793abd15741aff222edcfe33f7019b9095
2011-02-26 14:58:04 -08:00
Jeff Brown
8f34567c71 Add scroll wheel support to TextView.
Change-Id: I6e4258c50b0d754dccf07266ff4b2abcbccd733a
2011-02-26 13:35:35 -08:00
Jozef BABJAK
25d8b05fb7 Ensuring thread-safe usage of DateFormat.
DateFormat is inherently unsafe for multithreaded use. This patch adds
proper synchronization. The 'sLock' is re-used. To avoid two consecutive
lockings, locked version of initFormatStrings() method is created and
used where appropriate, i.e. in original method AND in added synchronized
block.

Change-Id: Id3c34613623e743e703aadb2342aa788679dda8a
2011-02-22 09:17:51 +01:00
Jozef BABJAK
b62353ad1d Removing wrong equals method in comparator.
This implementation of equals method has been likely created by
template in an IDE. It is useless, possibly leading to poor performance
and completely violating the contract of equals method as defined in
Object base class.

Change-Id: I5e7fd759b7bd9370b44d9374b57390c4e9feba02
2011-02-21 15:19:00 +01:00
Gilles Debunne
f3fa0cdbae Bugfixes in StaticLayout.
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
2011-02-18 16:05:15 -08:00
Fabrice Di Meglio
8761bfaa8d Merge "Code cleaning" 2011-02-16 10:48:12 -08:00
Fabrice Di Meglio
121c82c813 Code cleaning
- remove unused local variables
- add char constants
- some variables renaming to be more understandable

Change-Id: Id54dd671b1449cca6463bf77160dc72c8bf0c805
2011-02-15 17:41:10 -08:00
Fabrice Di Meglio
2fa160840c Merge "Small optimization when getting the spans" 2011-02-15 15:28:50 -08:00
Fabrice Di Meglio
a2a035ef47 Small optimization when getting the spans
- loop earlier if the kind is not the one we want

Change-Id: I5b020f20a144678ad2f7a4bca8fef64eb6ae491f
2011-02-15 14:31:26 -08:00
Gilles Debunne
f75c97e023 Text insertion cursor is now defined by a Drawable.
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
2011-02-14 18:29:39 -08:00
Paul Eastham
19e70cbbcb am 9a5bda87: am be46d145: Revert "Fix for StaticLayout bug with ellipsized text"
* commit '9a5bda875f86b188b501ce7cf73810dd92288251':
  Revert "Fix for StaticLayout bug with ellipsized text"
2011-02-07 13:50:42 -08:00
Kenny Root
7679365b54 am 6465889e: am c4dfa998: am d2a99617: am c94a9998: Merge "JPtextinput: Dont break emoji characters when cutting strings."
* commit '6465889ecbf4c04bb4bb6f4e8d4306727f7ca837':
  JPtextinput: Dont break emoji characters when cutting strings.
2011-02-07 13:49:08 -08:00
Gilles Debunne
de1285e7ea am 63308bd0: am a324a581: Merge "Fix for StaticLayout bug with ellipsized text" into honeycomb
* commit '63308bd092a0edcea685d9f81b3d6d6d345c663b':
  Fix for StaticLayout bug with ellipsized text
2011-02-07 13:46:21 -08:00
Paul Eastham
9a5bda875f am be46d145: Revert "Fix for StaticLayout bug with ellipsized text"
* commit 'be46d1456beb7e2f3e8b82bda2d0a5023db3debd':
  Revert "Fix for StaticLayout bug with ellipsized text"
2011-02-04 19:23:10 -08:00
Paul Eastham
be46d1456b Revert "Fix for StaticLayout bug with ellipsized text"
This reverts commit bbc910f229.
2011-02-04 19:17:54 -08:00
Kenny Root
6465889ecb am c4dfa998: am d2a99617: am c94a9998: Merge "JPtextinput: Dont break emoji characters when cutting strings."
* commit 'c4dfa998b7660b9afc4d41b0c940d798f2122fc3':
  JPtextinput: Dont break emoji characters when cutting strings.
2011-02-04 16:16:19 -08:00
Gilles Debunne
bbc910f229 Fix for StaticLayout bug with ellipsized text
This fixes the test, but I believe this class still needs a lot of fixing.

Change-Id: Ib6386196908ea8432b175d6994f9299778a322d2
2011-02-03 17:42:18 -08:00
Mike Cleron
fbcba51ab2 am b118bd1c: am ad97c1b1: Merge "Remove MeasuredText debug messages" into honeycomb
* commit 'b118bd1c2bb665eec1a78a6cf5c76a0aa6eba6af':
  Remove MeasuredText debug messages
2011-02-01 13:25:40 -08:00
Gilles Debunne
15f16e3f86 am 65383292: am 8f8aac5e: Merge "Pixel were missing on the last line of text when using MaxLines." into honeycomb
* commit '6538329258ee01b27586d8b0e46e96160d719a68':
  Pixel were missing on the last line of text when using MaxLines.
2011-02-01 10:09:29 -08:00
Mike Cleron
ad97c1b128 Merge "Remove MeasuredText debug messages" into honeycomb 2011-01-31 23:22:36 -08:00
Kenny Root
fbc8630736 Remove MeasuredText debug messages
MeasuredText debug messages were left in the tree. Remove them before
shipping.

Bug: 3408963
Change-Id: Ia220eae5835d1325bb6053de0025d8016a1edcad
2011-01-31 13:54:58 -08:00
Gilles Debunne
0a4db3c527 Pixel were missing on the last line of text when using MaxLines.
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
2011-01-30 18:23:13 -08:00
Brian Muramatsu
4f92dd2a4d am 910be3e8: am 9eaefb82: Merge "Fix TextUtils#commaEllipsize" into honeycomb
* commit '910be3e855738eab783f2e280b76dcef90a841ec':
  Fix TextUtils#commaEllipsize
2011-01-28 14:55:31 -08:00
Brian Muramatsu
4c8ad6eb62 Fix TextUtils#commaEllipsize
Bug 3400770

TextUtils#commaEllipsize creates a MeasuredText "mt" object with the
text to be ellipsized. It calls setPara which initializes mt's mPos
member to be 0. It then calls addStyleRun which moves mPos to the end
of the string. The loop back in commaEllipsize then calls mt addStyleRun
again and this causes IndexOutOfBoundsException, because the paint
object is trying to measure text past the text's length.

It seems this was a typo and that the tempMt variable should be used,
because the code is trying to measure the format string...not the
the string to be ellipsized. This makes the saner parts of CTS test
for this method pass now.

Change-Id: Ib6aa6e4bbd6afff4c95ad4c4d51a384cc1389875
2011-01-27 18:13:39 -08:00
Gilles Debunne
277ae7e3dc am 7a417821: am 47fc854a: Merge "Fix for a call to startActivity from outside of an app." into honeycomb
* commit '7a417821957bac70bfd4cb4a357b143a1a1570e3':
  Fix for a call to startActivity from outside of an app.
2011-01-25 16:18:51 -08:00
Gilles Debunne
47fc854ae9 Merge "Fix for a call to startActivity from outside of an app." into honeycomb 2011-01-25 14:20:09 -08:00
Gilles Debunne
d9ed795ca5 Fix for a call to startActivity from outside of an app.
Bug 3246715

Regression introduced by https://android-git.corp.google.com/g/#change,86174

Change-Id: Icba170746d196386bd9b0309582f724cb076d937
2011-01-25 13:40:06 -08:00
Gilles Debunne
3971b8cd52 am 2b5a62af: am 2a32a39e: Merge "Removed warnings in DynamicLayout" into honeycomb
* commit '2b5a62afdef5efc47e223057de0c867ffafef22d':
  Removed warnings in DynamicLayout
2011-01-25 11:38:33 -08:00
Gilles Debunne
2a32a39e9a Merge "Removed warnings in DynamicLayout" into honeycomb 2011-01-25 11:34:19 -08:00
Gilles Debunne
9854161e8f am 9eaa9b97: am b6b15dca: Merge "TextLine cache is used, even for long lines of text." into honeycomb
* commit '9eaa9b97d78e3efed1ac497822ca06c03db890cd':
  TextLine cache is used, even for long lines of text.
2011-01-25 10:47:33 -08:00
Gilles Debunne
d6e568c4f3 Removed warnings in DynamicLayout
Change-Id: Ied1c330795412d0bdcac1236b466951112fabc7d
2011-01-25 10:14:43 -08:00
Gilles Debunne
f902d7bc49 TextLine cache is used, even for long lines of text.
Bug 3381368

The 250 characters limit is passed for long URLs. There are only 3
TextLine objects, so their total size is not an issue. Recycle long
lines as well to make sure we fill the cache and avoid object creation.

Change-Id: I843bf623594312a0fcf0edbb13b7cd64cce0ddd1
2011-01-25 09:09:46 -08:00
Leon Scroggins
2c2aa7c4d2 am 62fd9903: am d5188657: Do a better job of lining up text with page text.
* commit '62fd9903a756eb5d8e7bcafbbc5a3a311fdbcefc':
  Do a better job of lining up text with page text.
2011-01-21 13:01:08 -08:00