summaryrefslogtreecommitdiffstats
path: root/core/java/android/text
Commit message (Collapse)AuthorAgeFilesLines
* Merge tag 'android-6.0.1_r22' of ↵Steve Kondik2016-03-112-30/+44
|\ | | | | | | | | | | | | | | https://android.googlesource.com/platform/frameworks/base into cm-13.0 Android 6.0.1 release 22 Change-Id: I0d31899b234156a91accb61e0a7fb3d8d16d5062
| * Merge changes from topic 'grapheme-dr1.5' into mnc-dr1.5-devRaph Levien2016-01-121-22/+34
| |\ | | | | | | | | | | | | | | | * changes: Respect grapheme clusters in Layout#getOffsetForHorizontal. Fix: Cursor can be at an invalid offset in EditText.
| | * Respect grapheme clusters in Layout#getOffsetForHorizontal.Keisuke Kuroyanagi2016-01-111-24/+31
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | TextUtils#getOffsetAfter was used for getting the next offset in Layout#getOffsetForHorizontal. However, this method doesn't treat grapheme clusters properly. Changed to use TextLine#getOffsetToLeftRightOf instead of TextUtils#getOffsetAfter. Bug: 25375561 Change-Id: I96c9e6e5da65adfb5266446ecab852c52628dbb5
| | * Fix: Cursor can be at an invalid offset in EditText.Keisuke Kuroyanagi2016-01-111-5/+10
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | "getLineEnd(line) - 1" is used as the return value when the "horiz" is beyond the line end for multiple line text. In this case, the returned value can point an invalid offset like the middle point of a surrogate pair. Bug: 23069901 Change-Id: I1afef7205a15079a42bb0018df73f70fe9ada862 (cherry picked from commit 00ad16d1cd24b788262ab4f62935e720a392da6d)
| * | Fix measurement to respect grapheme and span boundariesRaph Levien2016-01-111-8/+10
| |/ | | | | | | | | | | | | | | | | | | | | | | | | When measuring in TextLine (important for cursor positioning), the substring measured must neither be too short (it can't just be the substring up to the measure limit, but must include additional characters if they form a ligature) nor too long (it can't extend beyond the end of the CharacterStyle span, otherwise the measurement fails to account for the fact that the CharacterStyle span boundary breaks the ligature). This patch gets it just right. Bug: 25375561 Change-Id: I36e1c4bdc66424d3b611cf54031756cf54cf3fec
* | Merge tag 'android-6.0.1_r3' of ↵Steve Kondik2015-12-072-19/+41
|\ \ | |/ | | | | | | | | | | | | https://android.googlesource.com/platform/frameworks/base into cm-13.0 Android 6.0.1 release 3 Change-Id: I59b9e5a943e0860d43bcfb36ee0e8b8b072412ea
| * Fix line height problem with inline images in StaticLayout.Roozbeh Pournader2015-10-161-2/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Previously, paragraphs with ImageSpans in their middle would continue to carry the height of the image into the line height of next lines. This was a regression from L. The bug was due to StaticLayout's out() method almost always modifying the value of its parameter "fm", although that was only intended when there were LineHeightSpans in the text. The method generate() was assuming that it can restore fmTop etc to metrics of the current span by setting them from "fm" after out() was run, while "fm" was modified by out() and its original values was lost! The fix makes sure to set chooseHt back to null if there were no LineHeightSpans, so out() would not modify "fm" unless necessary. AOSP bug: https://code.google.com/p/android/issues/detail?id=188042 Bug: 24548073 Change-Id: I0d00af384c35a9d863377972318da9db7668118f
| * Merge "Load binary hyphen data files" into mnc-dr-devRoozbeh Pournader2015-10-152-11/+26
| |\
| | * Load binary hyphen data filesRaph Levien2015-10-142-11/+26
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Support for loading the pre-compiled binary format for hyphenation patterns. Bug: 21562869 Bug: 21826930 Bug: 24570591 Change-Id: Iaeaa9c9ac9dac236af6b0d7894c2e2396bc8447d (cherry picked from commit 091dba2de1e5fa7d4db9f8ccbf1f86e5825d0f52)
| * | Make Hyphenator#get() return an object.Roozbeh Pournader2015-10-142-6/+11
| |/ | | | | | | | | | | | | | | | | | | Previously, a native pointer was returned. After this change, callers should call getNativePtr() if they want to get the native pointer instead. Bug: 21492297 Bug: 24570591 Change-Id: I745bd88e6e8c86078fffb07f90f8d8f24215410c (cherry picked from commit e7eac6f540b09892172edd5b584605ea90f5a1ba)
* | Fix "Select correct 12 or 24 time format" breaking ChromeWilhelm Fitzpatrick2015-10-281-9/+20
| | | | | | | | | | | | | | | | | | | | | | Due to Chrome's process isolation, using a ContentResolver is forbidden. However ActivityThread already has direct access to settings and locale, so modify DateFormat's utility method to allow those values to be passed directly. CYNGNOS-495 Change-Id: I5284b94459ac03214f1712c8a1fddcbefeae3783
* | Base: Mirroring layout on RTL languages [1/2]Arthur Zamarin2015-10-261-5/+7
| | | | | | | | | | | | | | | | | | When Force RTL layout (in developer options) is sellected on RTL language (Arabic, Hebrew, etc) - mirror back to LTR. There is another commit (same name but with [2/2]) which just changes the strings to match the new meaning for RTL languages. Change-Id: Ib051b976db4e15dab9caddcd0d49276b5ada3f13
* | keyboard: re-add code to detect lid state and handle lightsMichael Gernoth2015-10-181-0/+31
|/ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Depends on libhardware patch for the light ids: http://review.cyanogenmod.org/77944 This squashes the following commits from cm-11.0 and updates them for cm-12.0: From: Dave Daynard <nardholio@gmail.com> Date: Tue, 19 Nov 2013 18:22:45 -0500 Subject: keyboard: re-add code to detect lid state keyboard: re-add code to detect lid state This was lost in the cm-11 merge. Without this, a change in lid state isn't generated to light up the keyboard backlight Change-Id: Ief35cebcb62da13afe1ae7531d69ab58e196be9e From: YuanQY <yuanqingyun@gmail.com> Date: Fri, 8 Feb 2013 10:59:22 +0800 Subject: Keyboard light: Fix the physical keyboard not light when Keyboard light: Fix the physical keyboard not light when it's visiable. Change-Id: I595afd3cb6b422a17ae0f6ec20aa51979db13810 From: tbalden <illespal@gmail.com> Date: Sun, 31 Mar 2013 18:33:53 +0200 Subject: keyboard: adding functional alt/shift lights keyboard: adding functional alt/shift lights This is useful for devices that has QWERTY keyboard and leds for the Alt/Shift (Fn/Caps) keys, like htc doubleshot. Change-Id: I66ebc2d881438f5b51db77eaa885421e65a7da0d
* Merge "Release text when finishing StaticLayout.Builder" into mnc-devRaph Levien2015-07-291-0/+4
|\
| * Release text when finishing StaticLayout.BuilderRaph Levien2015-07-291-0/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | DynamicLayout reuses a StaticLayout.Builder object to avoid having to allocate. There is a "finish" method that releases any expensive internal state of the builder object, but it didn't release a reference to the text object (which in turn may contain references to lots of other things, especially if it's a Spannable). This patch releases the text, as well as a few other arrays, at time of finish. Bug: 22822416 Change-Id: Icc8b6cd41a9a2d11689df7bd1b9f524c6524f706
* | Allow soft hyphens in languages without patternsRaph Levien2015-07-271-11/+13
|/ | | | | | | | | | This patch sets up an "empty" hyphenator, which it uses by default for locales in which there is no hyphenation pattern data. This has the effect of enabling soft hyphens (U+00AD), which were otherwise disabled, because the "no-hyphen" code path didn't consider them. Bug: 19605972 Change-Id: I4dcb95cee8edc48495f7c38736f5abf26fa04935
* Merge "Respect style boundaries when measuring text" into mnc-devRaph Levien2015-07-211-2/+2
|\
| * Respect style boundaries when measuring textRaph Levien2015-07-201-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The existing implementation of handleText() in TextLine laid out text to the end of the context. However, in cases where the text is broken into multiple style spans, it's only valid to lay out up to the end of the style span. This can lead to inconsistent measurements, especially in the presence of legitimate zero-width characters such as bidi control characters and zero width space. This patch changes the invocation of getRunAdvance to measure only within the style span. Bug: 22589743 Change-Id: I027f5e77db27ddf9596ef20adcad7e62a82b41de
* | Merge "Fix default value of stereoReset() in the documentation." into mnc-devRoozbeh Pournader2015-07-201-7/+8
|\ \
| * | Fix default value of stereoReset() in the documentation.Roozbeh Pournader2015-07-201-7/+8
| |/ | | | | | | | | | | | | | | | | | | The default has been 'true' for eternity in the code. But the documentation was mistakenly saying it was 'false'. Going with the code, since there are people out there relying on the code continuing to work the same way. Bug: 22557371 Change-Id: I6f4e7b2052d0cc30d41e8ccf2b9a5c6111fa0ab7
* | Bidi-wrap the results of format[Short]FileSize().Roozbeh Pournader2015-07-171-5/+26
|/ | | | | | | | | | | | | | | | | | | | Previously, users of the results of formatFileSize() and formatShortFileSize() needed to unicodeWrap the results themselves using BidiFormatter, which resulted in several bugs and inconsistencies across the platform when they didn't, especially in Hebrew and Urdu locales: Hebrew and Urdu use Latin abbreviations like 'MB' for file sizes which cause undesired reorderings (or incorrect detection of the string direction when the formatted file size starts the string). With this patch, the results are now bidi-wrapped before being returned if the locale of the context passed in to the formatter is a right-to-left locale. Bug: 22237132 Bug: 22273176 Change-Id: If076636d15828fc810feef6f0fa8806ef52aed5d
* Merge "Improve Html.toHtml() documentation" into mnc-devRaph Levien2015-07-111-1/+6
|\
| * Improve Html.toHtml() documentationRaph Levien2015-07-101-1/+6
| | | | | | | | | | | | | | | | | | | | | | The existing documentation is very terse and users were getting confused whether the method escapes HTML metacharacters or not. Expand the description a bit and explicitly state that metacharacters are escaped. Bug: 17456925 Change-Id: Icaae7fe1344629de5c0860674f3913781de18013
* | Merge "Reduce cost of span type checking" into mnc-devChris Craik2015-07-101-4/+5
|\ \
| * | Reduce cost of span type checkingChris Craik2015-07-101-4/+5
| | | | | | | | | | | | | | | | | | bug:22378829 Change-Id: I1da5154b2fb4f5032eaed44586d5470d28ceb45b
* | | Merge "Fix StaticLayout crash when maxLines = 0" into mnc-devRaph Levien2015-07-101-1/+2
|\ \ \ | |_|/ |/| |
| * | Fix StaticLayout crash when maxLines = 0Raph Levien2015-07-091-1/+2
| |/ | | | | | | | | | | | | | | | | An app setting maxLines = 0 is an edge case, but it can happen. We had some logic that would index an array at -1 in that case. This patch just skips the fixup of the ellipsis line break in that case. Bug: 22353342 Change-Id: I940cf0782b319010f5aedf75b9291df4ac2976d8
* | Delete dead codeJohn Reck2015-07-091-2/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | Bug: 22378829 Every time setText is called a BoringLayout is created. BoringLayout internally creates a new Paint called mWorkPaint. However, creating a Paint turns out to be somewhat substantial amount of work, and mWorkPaint is never actually used. Deleting this shaves off roughly 50ms and 1,000 object creations during a fling on a listview. Change-Id: I5d03402b9027df6ce0f3e58160752c66c69a4d2d
* | Slightly more precise RTL check in BoringLayout.isBoring()Raph Levien2015-07-091-1/+9
|/ | | | | | | | | | This patch refines the crude check for potential RTL characters, based on ranges containing RTL scripts and format characters that affect bidi. This will make it much less likely that a StaticLayout will be chosen instead of a BoringLayout. Bug: 22328919 Change-Id: I9a0ed9b3f3373069052de21c836b3372f175430f
* Merge "Fix problems with StaticLayout indentation" into mnc-devRaph Levien2015-07-062-11/+79
|\
| * Fix problems with StaticLayout indentationRaph Levien2015-07-012-11/+79
| | | | | | | | | | | | | | | | | | | | | | The implementation of indendataion had two issues. First, the indent pattern would restart on a new paragraph, which created problems when a multi-paragraph text would flow into a shape. Second, the indents didn't affect drawing position, which is ok for centered text but not most of the other alignments. This patch fixes both. Bug: 21904268 Change-Id: I53a3eb1c192fc0f8f0beace304832eed61b38497
* | Clean up Hyphenator file readingRaph Levien2015-07-061-9/+6
|/ | | | | | | | | The old code made invalid assumptions about read() behavior and failed to clean up properly in case of error. This patch changes the file reading to use IoUtils.readFileAsString, which handles that. Bug: 21020457 Change-Id: If9b54955c20a20a4ed5e8381d0c7e9c920d0639a
* Merge "Text selection: Fix word boundaries for languages without spaces" ↵Mady Mellor2015-06-261-10/+94
|\ | | | | | | into mnc-dev
| * Text selection: Fix word boundaries for languages without spacesMady Mellor2015-06-221-10/+94
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | WordIterator's getEnd/getBeginning methods does not support the needs for word boundary detection in text selection. Consider the words AABB (where AA and BB are each words). If getEnd is given the offset on the boundary between AA and BB, it would return that offset since it is the end of AA. For text selection we always want the "next end" if available. This CL adds two methods to word iterator that return the next end and previous beginning. This CL also alters the code in Start/EndHandle to use the x value and current / prev line positions to determine if the user is expanding or contracting the selection. Bug: 21305292 Change-Id: I6e7a83e53e245d71e43d78f1957f844f2ed1cdfb
* | Merge "Fix: Ellipsis is wrongly applied or not applied in TextView." into ↵Keisuke Kuroyanagi2015-06-261-0/+21
|\ \ | | | | | | | | | mnc-dev
| * | Fix: Ellipsis is wrongly applied or not applied in TextView.Keisuke Kuroyanagi2015-06-151-0/+21
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | In current implementation, ellipsis is applied after coptuting line breaks without limiting line count. As a result, ellipsis can be skipped or- wrongly applied because the breaks are computed to fit with the width. With this change, the last line and overflowed part are treated as a single line when the number of breaks exceeds the remaining line count. Bug: 6615676 Bug: 18514378 Bug: 20177499 Change-Id: I1d90e299404960cdd22746bad572411b119f7360
* | | Fix Formatter.formatBytes() crash on non-EN localesMakoto Onuki2015-06-251-14/+27
| | | | | | | | | | | | | | | | | | Bug 22012651 Change-Id: I21b1834a35647527002e01d76a7eb3a6a0354512
* | | Merge "Revive Null check for backward compatibility." into mnc-devSeigo Nonaka2015-06-231-2/+9
|\ \ \
| * | | Revive Null check for backward compatibility.Seigo Nonaka2015-06-221-2/+9
| | |/ | |/| | | | | | | | | | Bug: 21934529 Change-Id: I18e8f01be728e0400f3218a359b0dc9fd97fbbbd
* | | Forget private partition keys.Jeff Sharkey2015-06-221-0/+5
|/ / | | | | | | | | | | | | | | | | When we forget a private partition, ask vold to also forget the key for that partition GUID. This means we need to track both the filesystem UUID and the partition GUID for a private volume. Bug: 21782268 Change-Id: Icda1cbb65539d61dacc663428daf3d1a2e4c313e
* | Merge "Update file size formatting." into mnc-devJeff Sharkey2015-06-161-16/+48
|\ \
| * | Update file size formatting.Jeff Sharkey2015-06-151-16/+48
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Per UX, default strings should have space between value and units resulting in "12.3 GB". Add a formatting variant that returns the various components for callers who want to build their own strings. For now there is only one mounted emulated volume at a time, and it's always the primary storage, so give it the default rootId to keep old Uris working. Change-Id: Ifcc72a91a6b397ee65dc92642153286186eb64ac
* | | 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
* | | | Selected count string needs plurals.Jeff Sharkey2015-06-111-0/+9
| |_|/ |/| | | | | | | | | | | Bug: 21717427 Change-Id: Ie0db8ac30244b022ca5838969fb085230bfc4499
* | | Fix documentation of nextSpanTransition off by oneRaph Levien2015-06-101-6/+5
| | | | | | | | | | | | | | | | | | | | | | | | Improve wording of javadoc for nextSpanTransition() to accurately reflect the actual implementation. Bug: 19274845 Change-Id: I8f8fb6a21a8cbcc26fefb63164a6943431d16089
* | | Merge "Prevent poorly-extended ParcelableSpans from writing to parcels" into ↵Alan Viverette2015-06-0426-11/+266
|\ \ \ | | | | | | | | | | | | mnc-dev
| * | | Prevent poorly-extended ParcelableSpans from writing to parcelsAlan Viverette2015-06-0226-11/+266
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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
* | | | Rename setTextDir to setTextDirectionRaph Levien2015-06-032-3/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | StaticLayout.Builder used "setTextDir" as a shorthand, but it's not as clear as spelling it out. So, setTextDirection. Bug: 21572282 Change-Id: Ia94476562d70678f963196b87bb63511d30836b6