summaryrefslogtreecommitdiffstats
path: root/core/java/android/text/style
Commit message (Collapse)AuthorAgeFilesLines
* am 4393a7d2: am c0d84934: am 076c599f: am 1ad5c813: Fix typo in TtsSpan.John Spurlock2015-06-151-1/+1
|\ | | | | | | | | * commit '4393a7d2645cfb9097e616016c58887b9929be55': Fix typo in TtsSpan.
| * am 1ad5c813: Fix typo in TtsSpan.John Spurlock2015-06-151-1/+1
| |\ | | | | | | | | | | | | * commit '1ad5c813211d4d855a0d5396855c80653480aaa4': Fix typo in TtsSpan.
| | * Fix typo in TtsSpan.John Spurlock2015-06-151-1/+1
| | | | | | | | | | | | Change-Id: Ic32f141f0c51ee3bee8fd71464f104ef725de880
* | | Prevent poorly-extended ParcelableSpans from writing to parcelsAlan Viverette2015-06-0223-4/+233
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | If a developer extends an existing ParcelableSpan and overwrites writeToParcel, TextUtils will crash when attempting to unparcel since the span type ID is not accurate. This CL makes a separate framework-private method for writeToParcel to ensure that even if a developer extends a ParcelableSpan class, they won't modify the parceling or unparceling code that's tied to the span type ID. Bug: 21274544 Change-Id: If4c3506a55999df7a3b6d87cb8d550235d7a02c6
* | | am 46c95313: am ddb30cd3: am 7506f499: Merge "Fix to crash when clicking ↵Alan Viverette2015-03-251-1/+7
|\ \ \ | |/ / | | | | | | | | | | | | | | | text link without view activity" * commit '46c953138298285d9cb06a75030fc73081ccc121': Fix to crash when clicking text link without view activity
| * | Fix to crash when clicking text link without view activityDaniel 2 Olofsson2014-12-101-1/+7
| |/ | | | | | | | | | | | | | | | | | | | | A generated quick link to telephone number gets clicked and crashes if corresponding activity doesn't exist in device. It attempts to open up an activity to view content which will in turn generate an uncaught ActivityNotFoundException. Solved by catching exception when launching activity for the specified content. Change-Id: I47364519f1eceb5b978b29382107deae1891c7da
* | Annotate ARGB integer parameters with @ColorIntTor Norbye2015-03-052-2/+6
| | | | | | | | Change-Id: I307f72a382272cf18ddb6b07d9fcb81228568d9a
* | Add @ResourceInt annotations on APIsTor Norbye2015-02-181-2/+3
|/ | | | Change-Id: I119cc059c2f8bd98fd585fc84ac2b1b7d5892a08
* Fixed spelling of android.nominative and updated some comments.Niels Egberts2014-08-211-186/+165
| | | | | Bug: 17000831 Change-Id: I3a87635a6a894ee8ad1386cde8b59dcd9533b23f
* Make LeadingMarginSpan2 behavior more consistentAnish Athalye2014-08-141-8/+15
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This addresses b/16486549. This change updates public documentation to specify the behavior of LeadingMarginSpan2s. This change specifies what happens when a LeadingMarginSpan2 is combined with other LeadingMarginSpans. This behavior was not previously documented. LeadingMarginSpan2s specify the number of lines used for the leading margin. When laying out and rendering, for all LeadingMarginSpans, the first line margin is applied for the number of lines specified by the LeadingMarginSpan2. Previously, this behavior was slightly buggy -- the LeadingMarginSpan2 affected all LeadingMarginSpans when laying out text, but not when rendering. This change is designed to cause the least amount of breakage in existing code while achieving consistency with the way LeadingMarginSpan2 is handled in layout and drawing. For the most common use of LeadingMarginSpan2 -- getting a multi-line first margin in the first paragraph of text in a layout -- this should cause no change in behavior. For any other uses, the old (buggy) implementation most likely did not exhibit correct behavior to begin with, so developers were most likely not relying on that functionality. Change-Id: I6f69df09c0130e703458e65bf3eaac4a905df56e
* Simplify generics, and make Builder concrete.Niels Egberts2014-08-011-2/+2
| | | | Change-Id: I3e14966527c254d2c15dddefc2ef60cdde30421f
* New TtsSpan builders for money, electronic and telephone.Niels Egberts2014-07-211-3/+211
| | | | Change-Id: Idb6a66725395dbd665e17c00678901d54b4b1753
* Merge "Add money as a new TtsSpan type." into lmp-devNiels Egberts2014-07-171-9/+45
|\
| * Add money as a new TtsSpan type.Niels Egberts2014-07-181-9/+45
| | | | | | | | | | | | Added ARG_QUANTITY to decimal so money and measure can 'inherit' it. Change-Id: I0f9f464d198a9875df4a01e8a5c95a3d19ed6f7f
* | New TtsSpan builders for types measure, time, date, digits and verbatim.Niels Egberts2014-07-181-0/+315
| | | | | | | | Change-Id: I60022aa72c64f454261a0b69c21c45ce6351b9e7
* | Add builders for TtsSpans of type ordinal, decimal and fraction.Niels Egberts2014-07-181-10/+269
|/ | | | | | Also document the possibility to give phone numbers in parts. Change-Id: Ie1cdf56cc3b6c221c9410fb02dcba2568ea337b7
* TtsSpan builders for each TtsSpan type. DO NOT MERGENiels Egberts2014-07-171-4/+228
| | | | | | | | | | | | | The reason for separate classes for each type, instead of a more flat structure is to enable easy discovery of the available arguments that can be set. For L we'll have about 12 types with 30 arguments and almost all of the arguments are type specific. In future releases we'll introduce more arguments. With editors that have code completion one can construct a span without having to consult the documentation. For now it only contains Text and Cardinal types. Change-Id: I94531e600133d9f4f59a4170cceef1ee7a360ca7 (cherry picked from commit 90b095aabd8a5c43723821dda37354fd2beb38fb)
* Add more semiotic class types for TtsSpan.Niels Egberts2014-07-101-25/+333
| | | | Change-Id: I4c5f141f56d6ec679be59634693f591e3386f152
* Add TtsSpan class.Niels Egberts2014-07-071-0/+150
| | | | | | | | The TtsSpan can be used to provide addtional data for TTS engines. For now it only includes the types text and cardinals, but more will follow. Change-Id: I31392dd413c0902ba4ce702fa3307253c90c618f
* Tabs -> spaces in frameworks/base.John Spurlock2014-02-2511-101/+101
| | | | Change-Id: I5a84e8e93ac99b5ed0212b37bf66efa5e53864be
* Add APIs for obtaining themed Drawable from Theme, ContextAlan Viverette2014-02-031-1/+1
| | | | | BUG: 12611005 Change-Id: Ic0057be4e4c2d0c61ce02a019b3f7d0625e3a016
* Remove unused imports from frameworks/base.John Spurlock2013-11-205-8/+0
| | | | Change-Id: Ia1f99bd2c1105b0b0f70aa614f1f4a67b2840906
* Add View constructor that supplies a default style resourceAlan Viverette2013-09-091-6/+6
| | | | | | | Also updates the constructor of every class that extends View. BUG: 10676369 Change-Id: Ifaf27bf82028d180afa4931c0e906df88d858ac3
* Resubmitting "Enable correction/deleting notification via EasyEditSpan.""Luca Zanolin2013-02-201-3/+82
| | | | | | | | Re-run "make update-api" Original CL Ic227b8fd50066699915f69a54f225fb5330867c4 Change-Id: Ifb1a0f61801c544b01193435fbfdedd7f3888971
* Revert "Enable correction/deleting notification via EasyEditSpan."Luca Zanolin2013-02-201-82/+3
| | | | | | This reverts commit 8cd8135b95da5b471804604b06084eecbe1cc23b Change-Id: I6361cc47d58281ab37cb9ae0a67541b43f873147
* Enable correction/deleting notification via EasyEditSpan.Luca Zanolin2013-02-201-3/+82
| | | | | | | | | | | | | When the "delete" pop-up is clicked (and the wrapped text removed), the creator of the span will receive a notification of the action. Similarly, if the user modifies (i.e., add/remove a char), the creator of the span will receive a notification too. The notification will not contain any information about how the text has been modified. Bug: 6905960 Change-Id: Ic227b8fd50066699915f69a54f225fb5330867c4
* Relax suggestion notification.Luca Zanolin2012-08-291-0/+49
| | | | | | | | | | | | | Before the suggestion selection were notified only when they were added by an IME. This CL relaxes this constrain, and the suggestion are notified even if they are added by an application. If the context is null and the package name of the apk cannot be determined, the suggestion are notified using the old method via the Input Method Manager. This is required to keep the backward compatibility. Bug: 6905960 Change-Id: If225ef27cded386809fbd899e34e32aced4e0473
* LocaleSpan makes Han disambiguation easy!Victoria Lease2012-08-171-0/+84
| | | | | | | I've also provided TextView.setTextLocale() for use in single-language TextViews. Change-Id: I7f1b0d49a2ece957a7b9b5d65d48385bf2c2a668
* Revert "Fix fake bold for fallback fonts in frameworks."Victoria Lease2012-06-113-3/+0
| | | This reverts commit b26fa0ce68d3311b2fdffb930b27d897e481dd5a
* Fix fake bold for fallback fonts in frameworks.Victoria Lease2012-06-083-0/+3
| | | | | | | | | | | | | | | | | | | This change is analogous to Ic0e9f1bbd8cae9fdd3a6d1d015bb9224c8be545c in WebView, and depends upon the same Skia change that that CL makes use of. This flips the "fake bold" flag on for bold fonts in TextView.setTypeface(), with the expectation that Skia will ignore the flag if the final typeface used to render the glyphs is already bold. It also does the same for StyleSpans, TextAppearanceSpans, TypefaceSpans, and the Switch widget. With this, fake bold should work uniformly across all scripts - if fake bold works for a primary typeface, it should also work for all fallback typefaces. Bug: 6629786 Change-Id: Id3b8639ab0df83052ffd82809cb12adaacc1d46b
* Add fontFamily XML attribute to select font family by stringRaph Levien2012-05-091-18/+23
| | | | Change-Id: I0b649528d3d9888e3561a1a3907a6b6ee2e30238
* Modified algorithm to remove duplicated suggestionsGilles Debunne2012-01-251-3/+7
| | | | | | | | | | | | | | | | Bug 5916225 Duplicates were removed when received from SpellChecker, in a way that could move the top candidates lower in the list. Moved that code to the part that creates the actual suggestion list, to make it more generic. The order of the first SuggestionSpan is guaranteed to be respected. Also mentionned non null suggestions and fixed a problem in SuggestionSpan constructor. Change-Id: Iaa3b1b84ae512451e439e5c5e63448c2a19145b5
* Prevent NPE in SuggestionSpanGilles Debunne2011-12-061-6/+10
| | | | | | | | One SuggestionSpan constructor provide null as the default context. This will always create an NPE in initStyle. Prevent this. Change-Id: Ic2acffd2c8b9cda9c99b689d1b1a7f15d17b65d0
* Make FLAG_AUTO_CORRECTION publicsatok2011-10-261-1/+0
| | | | | | Bug: 5440299 Change-Id: Ia82745e793be741c1558ce15b189b63872107ddb
* Add a hidden flag for the auto correction indicator in SuggestionSpansatok2011-10-101-2/+30
| | | | | | Bug: 5245468 Change-Id: Ic111554da86fefd47dd9a26c1bd41e4ee57dc552
* Too many SpellCheckSpans are created.Gilles Debunne2011-09-271-2/+2
| | | | | | | | | | | | | | | | | | | | Removed the Runnable in SpellChecker, spell check is triggered at the end of updateSpellCheckSpans instead of when a new SpellCheckSpan is created. Cache the spans in updateSpellCheckSpans to limit the calls to getSpans. When typing, every new letter in a word will create a SpellCheckSpan (this is needed in case the user taps somewhere else on the screen) The SpellCheckSpans are pooled in SpellChecker to limit unnecessary new SpellCheckSpan creation. Minor optimization on test order in getSpans to avoid some calculation. Spell check is not started everytime the selection is changed (would be triggered when the insertion handle is moved). Explicitely do that only on tap. Change-Id: Ibacf80dd4ba098494e0b5ba0e58a362782fc8f71
* Bug 5281947: add to dictionnary option promoted in suggestions.Gilles Debunne2011-09-091-7/+21
| | | | | | | | | | | | | | | When several SuggestionSpans are available at a given position, their content are merged, in creation time order. As a result, the IME's suggestions are picked before the spell check, and no add to dictionnary option is created. This CL modifies the comparator to make easy correction spans appear first (Voice IME), then misspelled words and then regular suggestions. Also avoids the creation of a new comparator and length hash map on every display. Change-Id: I1f9f031a6fdcbbc09f248a192b83051092765f8e
* Hide method to fix the buildGilles Debunne2011-09-091-0/+2
| | | | Change-Id: I5a556454a722bf037932632fa7e6ee6a2832a68d
* Bug 5278456: text highlight color depends on the type of suggestion spans.Gilles Debunne2011-09-082-8/+23
| | | | Change-Id: I76ac02b7688a297c0e83d593f446a4cf2ee36015
* Remove the suggestion underline when the TextView loses focus.Luca Zanolin2011-09-021-23/+31
| | | | | | Only the easy correction (i.e., voice ime corrections) will lose the underline, while the misspelled span will not. Change-Id: If96c17473dd70c99b808739ddde800cc93551e2a
* Using ListView for Suggestion popup windowGilles Debunne2011-08-312-8/+13
| | | | | | | New background assets from Bug 5204807. New text selection color and associated handles, bug 5217848. Change-Id: I4eaea6be732843d8ff344400d029b4a1b80b084f
* Add EditTextShortcutSpan to provide edit short cut in the text view.Luca Zanolin2011-08-302-44/+77
| | | | | | | | | | | At the moment, EditTextShortcutSpan allows only the deletion of the text. In the future, we may decide to add extra functionality, like "retry" where all the text is removed and a specific IME is triggered. Fix the underline. The underline is not defined in thickness, and not as a multiplier of the default underline thickness. Change the behaviour of SuggestionRangeSpan to match the specification. Change-Id: I80437d9887c7a2ff8f62c38afbb0cb7add7ee9c8
* Suggestions popup window is dismissed on tap outside.Gilles Debunne2011-08-252-1/+75
| | | | | | | | | | | | But now the tap is not handled at all, as it was before. To do this, the popup window is now focusable. As a result, the TextView's window loses focus. We hide the cursor to prevent a non-blinking visible cursor. We should also fake the state of the parent TextView to keep it visually focussed. SuggestionRangeSpan and SpellCheckSpan had to made Parcelable since they are recreatedi when the TextView is re-created when the popup is dismissed. Change-Id: Ic99b2c4f02c282394f214938dd19168547af4886
* Spell checking in TextViewsGilles Debunne2011-08-232-7/+51
| | | | | | | | | | | New UX interactions (the Paste action is no longer displayed after a delay) suggestionEnabled flag replaced by existing input type flag. removeSpans fixed in SpannableStringBuilder to always send notifications SuggestionSpan handled by TextView instead of SpannableStringBuilder New span update algorithm to correctly handle edition around word boundaries. Change-Id: I52c01172f19e595fa512e285a565a3fd97c3c50e
* Change the behavior of SuggestionSpan.Luca Zanolin2011-08-161-5/+74
| | | | | | | | | | | | | | | | SuggestionSpan can be accessed in two different ways: - by tapping on the text (easy access) - by tapping on "replace" pop-up (not easy and difficult to discover) The "easy access" will be used for dictionary suggestions and voice recognition suggestions. The suggestion span can be rendered into two different way: - default, text is underlined in blue - spelling error, text is underlined in red Change-Id: I0af0fe6700d0ad588facb21c021dc6f59ef172f1
* Fix bug #5017432 NPE when mixing different spans with different font sizesFabrice Di Meglio2011-08-091-1/+1
| | | | | | - fixed typo Change-Id: I282f8bf2a72117709666e1ffc9ec8e8b5583d321
* Fleshed up SuggestionSpan documentation. Bug 4553472Gilles Debunne2011-07-081-3/+13
| | | | Change-Id: I3b5be9a6da79398b03d98eb33eb61a55fd702960
* Fix internal variables and equals in SuggestionSpansatok2011-05-261-28/+26
| | | | | | | | | 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
* Add Apis to send notifications when the suggestion was pickedsatok2011-05-261-10/+53
| | | | | | | | - Due to a strong request from VoiceIME Bug: 4443922 Change-Id: Ia539de0acf66053e0349daec459d75e36805f6bf
* SuggestionSpans are preserved when picked.Gilles Debunne2011-05-121-1/+1
| | | | | | | | | | | 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