Commit Graph

321 Commits

Author SHA1 Message Date
Doug Felt
c0ccf0c47c Support control of text alignment.
Change-Id: Id6f3682f67ba2e6811e3014cd34a281e6dd0a469
2011-06-29 16:08:42 -07:00
Gilles Debunne
da188fbe4b Merge "Fix for bug 4499752 - Detect nulled layouts in HandleViews" 2011-05-31 10:41:58 -07:00
Gilles Debunne
e8e833fbe8 Merge "Replacement spans correctly measured in TextView" 2011-05-27 16:12:19 -07:00
Gilles Debunne
d4bb0b01c6 Fix for bug 4499752 - Detect nulled layouts in HandleViews
Change-Id: I6a7289150bf461cdf4cca0aff4aa4a0400e0d553
2011-05-27 16:02:40 -07:00
Gilles Debunne
9a3a884864 Replacement spans correctly measured in TextView
Bug 4444591

Change-Id: I74c94445806d6c00b0971146cac57363c7d3f205
2011-05-27 09:34:09 -07:00
Romain Guy
bc7cdb6783 Remove extraneous log.
Change-Id: I91b248410d69836c7a3b56eb0867224ccb4a5336
2011-05-26 18:48:49 -07:00
satok
42c5a1666c Fix internal variables and equals in SuggestionSpan
Bug: 4443922

- Instantiating other package's class for the name is complicated, so we changed the internal value for the notification target class from Class to String.
- Implement equals

Change-Id: Iaf7682be777f0027d33c9a3be4609ac01b6950ad
2011-05-26 19:21:35 +09:00
satok
f9f0100862 Add Apis to send notifications when the suggestion was picked
- Due to a strong request from VoiceIME

Bug: 4443922

Change-Id: Ia539de0acf66053e0349daec459d75e36805f6bf
2011-05-26 11:02:31 +09:00
Gilles Debunne
3bca69b09f TextView uses floats for touch event positions.
This is the type returned by event.getX/Y methods. Conversion
to ints is only performed when needed. Low performance impact
since there is only a minimal amount of computations on these
values.

Change-Id: I53a56efe5e3a1a96911adc25fedaab7f40f1ba8e
2011-05-23 18:20:26 -07:00
Gilles Debunne
ee511cc529 SuggestionSpans are preserved when picked.
This is the exception case: text replacement should NOT remove SuggestionSpans
when this is the result of a Suggestion pick in the popup.

Save them and restore them after the text replacement.
Only spans that entirely englobe the replaced region make sense after the
text replacement.

Change-Id: Ib18eb6437c3a63fd0e788ebd4565c8f42e83503b
2011-05-12 15:20:30 -07:00
Conley Owens
f4c4a276e2 Merge commit 'f395e304' into m
Conflicts:
	core/tests/coretests/src/android/text/TextUtilsTest.java

Change-Id: I7439f7f80cf91ff654c0ddd79c3e6b3808ba4784
2011-05-02 10:25:55 -07:00
Conley Owens
f395e3042a am 19653c64: am 425db473: Merge "CHAR_SEQUENCE_CREATOR cannot handle null string"
* commit '19653c6440eaf7328ecbc01c3ca6d7a910906484':
  CHAR_SEQUENCE_CREATOR cannot handle null string
2011-04-29 17:15:39 -07:00
Conley Owens
a02a9e602b am 27e8f1a3: am 8b22ef66: am e41d2aed: Merge "Using robust equality check."
* commit '27e8f1a3a6b43592e3d419d7a3cfc6192a86bf5c':
  Using robust equality check.
2011-04-29 15:11:34 -07:00
Conley Owens
1b38cc3057 am 014757ee: am a9517012: am 1e29552b: Merge "We don\'t need these local references."
* commit '014757eea22fc9cceede1548c579c33c79464001':
  We don't need these local references.
2011-04-29 15:11:30 -07:00
Conley Owens
95b533911c am 49df110a: am d66a92e6: am da882181: Merge "Eliminating dead code with no other effect than consuming battery life."
* commit '49df110aeb94ada810a8eec0540e30a25c267a56':
  Eliminating dead code with no other effect than consuming battery life.
2011-04-29 15:11:26 -07:00
Conley Owens
27e8f1a3a6 am 8b22ef66: am e41d2aed: Merge "Using robust equality check."
* commit '8b22ef66ef1a67333e2f1d4250d2c134b50ef91a':
  Using robust equality check.
2011-04-29 14:56:15 -07:00
Conley Owens
014757eea2 am a9517012: am 1e29552b: Merge "We don\'t need these local references."
* commit 'a95170122619f5442d5efbdf2e37f91dbf455ab9':
  We don't need these local references.
2011-04-29 14:56:05 -07:00
Conley Owens
49df110aeb am d66a92e6: am da882181: Merge "Eliminating dead code with no other effect than consuming battery life."
* commit 'd66a92e6875bfc835adf0b100607afbf4bfc2761':
  Eliminating dead code with no other effect than consuming battery life.
2011-04-29 14:55:55 -07:00
Gilles Debunne
75beb336f4 SuggestionSpans are removed around edited text.
SuggestionSpans do not make sense anymore when the text they
refer to is modified. Removed these at the lowest possible common
level: In the SpannableStringBuilder that is used to back the Editable.

This way, IME do not have to care about removing these when they change
text. And they cannot forget to so either.

Also fixed a bug in TextView's paste with multi-item paste text (never
exercised, since we have no source for such a thing).

Change-Id: I08ed921f8c04ffb1a00936a3e554a85ee82f103c
2011-04-29 13:27:37 -07:00
Conley Owens
425db473a0 Merge "CHAR_SEQUENCE_CREATOR cannot handle null string" 2011-04-29 10:00:20 -07:00
Gilles Debunne
988ec4bdc8 Merge "TextView's baseline is correctly computed for empty text." 2011-04-28 15:48:05 -07:00
Gilles Debunne
f483e514d4 TextView's baseline is correctly computed for empty text.
Bug http://code.google.com/p/android/issues/detail?id=15598

Change-Id: I3aae29b55dc92acca3883b8d14e01dc1c79c2243
2011-04-28 15:08:57 -07:00
Conley Owens
e41d2aed9c Merge "Using robust equality check." 2011-04-28 14:57:08 -07:00
Conley Owens
1e29552bd5 Merge "We don't need these local references." 2011-04-28 14:56:59 -07:00
Conley Owens
da88218124 Merge "Eliminating dead code with no other effect than consuming battery life." 2011-04-28 14:56:55 -07:00
Gilles Debunne
0f9ae274b4 Typo in TextAppearanceSpan documentation
Dim does not exist anymore.

Change-Id: I83268657accfef15561ce313b66108adc108dfc6
2011-04-27 14:25:56 -07:00
Fabrice Di Meglio
3f92b8b188 Merge "Clean getTextRunAdvances() APIs" 2011-04-22 16:54:37 -07:00
Fabrice Di Meglio
0a1413e4bf Clean getTextRunAdvances() APIs
- remove ICU reference in API names
- use a "reserved" int parameter to pass either "0" for Harfbuzz or "1" for "ICU"

Change-Id: I88b4f76feafd203a6999cd7349402fa36a9a4b2a
2011-04-21 17:36:26 -07:00
Gilles Debunne
e193fd1434 Extracted WordIterator class.
This class will be used by TextView and the IMEs to cut the
text into words.

New getBeginning and getEnd methods that return word limits.

Added Locale to constructor.

Change-Id: Ie8ad590ebca4b48517ec7b4c3768b3e41879166e
2011-04-20 15:34:36 -07:00
Gilles Debunne
a00972ab9a Fix around suggestionSpan.
Since the kind was unknown, doing a copy/cut on text with a SuggestionSpan crashed.

Change-Id: I10c0677b3587897b82c794db57d7b07149f12e09
2011-04-13 16:07:34 -07:00
Gilles Debunne
e9f05b0079 Merge "Fix in BreakIterator." 2011-04-11 16:21:38 -07:00
Gilles Debunne
daa4a95a54 Fix in BreakIterator.
An index equal to the length of text is indeed a valid position,
representing a cursor located after the last character.

Also changed iterator to comply to the documentation.

Change-Id: I7b9e427e4e37df20ab7e66d99053a9d8a6af6eb3
2011-04-08 11:33:23 -07:00
satok
b3fc1a5b8b Rename CorrectionSpan to SuggestionSpan
Change-Id: I004b2e012b2de4de959a31da1f55b63ca7c14199
2011-04-08 13:43:19 +09:00
Martin Wallgren
cee2051ada CHAR_SEQUENCE_CREATOR cannot handle null string
TextUtils.writeToParcel can handle null as input CharSequence
but createFromParcel will throw NullPointerException. Transforming
to and from parcel should handle null in the same way.

Change-Id: I707ea9be2091d2655c5f63eaa57c5674befa5ad3
2011-04-07 14:45:43 +02: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
Jozef BABJAK
2fb503f510 Using robust equality check.
Change-Id: Ie30684c472bfa38d0432f855f7075c34709958d5
2011-03-17 09:54:51 +01:00
Jozef BABJAK
97124117e8 We don't need these local references.
Change-Id: I227c88eb4eb5d2842124e1c944cc18d5b28cccc1
2011-03-17 09:43:54 +01:00
Jozef BABJAK
b74378ab35 Eliminating dead code with no other effect than consuming battery life.
Change-Id: I4376902a4e9c301ff16f74137d86eeaff901bbb7
2011-03-17 09:15:43 +01: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