Commit Graph

728 Commits

Author SHA1 Message Date
Niels Egberts
36e08484ab TtsSpan builders for each TtsSpan type. DO NOT MERGE
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)
2014-07-17 17:17:07 +00:00
Niels Egberts
ca7b0277d7 New convenience method that takes a CharSequence and an Object as the
span that is applied to the appended text.

Change-Id: Ibdc4a71346e5691bcfe6af23f34beff69d642908
2014-07-11 09:55:44 +00:00
Niels Egberts
2e3f2c6727 Add more semiotic class types for TtsSpan.
Change-Id: I4c5f141f56d6ec679be59634693f591e3386f152
2014-07-10 15:29:56 +00:00
Niels Egberts
4f4ead4812 Add TtsSpan class.
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
2014-07-07 20:25:44 +00:00
Anish Athalye
677490eac4 Merge "Fix line breaking for clusters in narrow views" 2014-07-01 19:15:58 +00:00
Anish Athalye
9cd3bccdb2 Fix line breaking for clusters in narrow views
Clusters were broken incorrectly when in narrow views (when the width of
the cluster was greater than the width of a view). Also, out() calls
were modifying fm, so clusters that were too wide were not positioned
correctly.

Change-Id: I521f8dc6338f5f1de6858af3f0c0bd320aa46bc0
2014-07-01 16:39:39 +00:00
Sujith Ramakrishnan
cc32bd83e4 Add support for mouse-based text selection.
Incorporate patch from Logitech (donated under AOSP license) to the
framework to add mouse-based text selection to ArrowKeyMovementMethod.

Bug: 14652753

Change-Id: Iab264bb954b72ccedfada763eba8f13ef37a4578
2014-07-01 15:57:45 -07:00
Anish Athalye
88b5b0be88 Implement line breaking using ICU break iterator
Change-Id: I4ad98757aa2eab5dbc2ae44c0391e900ef20c4d0
2014-06-30 22:14:05 +00:00
Raph Levien
051910b9f9 Clean up dirFlags / bidiFlags confusion
The dirFlags and bidiFlags enums are distinct, and have different
meanings. The former is a determined direction for a run of text, while
the latter is a request for the bidi algorithm. They have been used
interchangeably, and this has caused some problems, notably running the
bidi algorithm needlessly when the direction for a run is already
determined.

This patch cleans up the confusion, by always naming each occurrence
explicitly "boolean isRtl" or "int bidiFlags" (the previous code often
just used "int flags", which added to the confusion), and converts
between the meanings when a function takes an isRtl argument but passes
it to another function expecting bidiFlags.

Fixes b/15089607 Clean up bidi flag mess

Change-Id: I410b6604376e853dd12c255e7f5a9d2b9a310dd9
2014-06-16 14:36:08 -07:00
Narayan Kamath
97df96d8eb am 2ecc4dc8: am f36fe3f8: am 1083573c: Merge "Track changes to libcore ICU apis."
* commit '2ecc4dc88fc209f75f5dfe815d6a1fbb5fd49ef2':
  Track changes to libcore ICU apis.
2014-06-16 11:10:00 +00:00
Narayan Kamath
2ecc4dc88f am f36fe3f8: am 1083573c: Merge "Track changes to libcore ICU apis."
* commit 'f36fe3f85daaf9e3b3270143d6648394768bb324':
  Track changes to libcore ICU apis.
2014-06-16 11:01:29 +00:00
Narayan Kamath
2c9d2005ec Track changes to libcore ICU apis.
All private APIs that earlier accepted Locale.toString
now accept Locale instances.

Change-Id: I80df88d0c928e921320b6545b1267adecefe64af
2014-06-12 13:42:05 +01:00
Jean Chalard
11abbdcb78 am 7d8b87f0: Merge "Fix a CTS test" into lmp-preview-dev
* commit '7d8b87f0d9b35694099d5f57777d27f577496960':
  Fix a CTS test
2014-06-12 19:58:08 +00:00
Jean Chalard
0a993100f9 Fix a CTS test
SpannableStringBuilder should throw an exception when the
parameters to #insert and related methods are in the wrong
order.
We'll have to reopen b/9570771 and deal with it separately.

Bug: 14965397
Change-Id: I01847e0010d23f98ad3def8ba030d36570528900
2014-06-11 18:03:05 +09:00
Justin Koh
41a2c47e65 am 44195b4f: am 42c53fd6: Merge "Catch OperationUnsupportedException when linkifying using WebView" into klp-modular-dev
* commit '44195b4f90d035533c879672891e7e169972d95d':
  Catch OperationUnsupportedException when linkifying using WebView
2014-06-11 19:33:46 +00:00
Justin Koh
44195b4f90 am 42c53fd6: Merge "Catch OperationUnsupportedException when linkifying using WebView" into klp-modular-dev
* commit '42c53fd64641d3c2974b3b8f25a2c600f4c4dd7d':
  Catch OperationUnsupportedException when linkifying using WebView
2014-06-10 18:35:20 +00:00
Aaron Whyte
83955cb260 Catch OperationUnsupportedException when linkifying using WebView
This fixes a CTS test for Wearable. We cannot check for FEATURE_WEBVIEW, because
there's no way to get a PackageManager from within these static methods.
Bug: 15131296

Change-Id: I7bf7564b6209f330a413ed54a94be1e07fedb30d
2014-06-09 17:59:03 -07:00
Raph Levien
df8427c324 Merge "Fix android.text.cts.TextUtilsTest#testRegionMatches" 2014-06-06 20:15:27 +00:00
Jeff Brown
b86b1027a3 am 9777fdb7: am b0a7f84b: am 63bf04d8: Merge "Fix NullException in QwertyKeyListener.KeyDown"
* commit '9777fdb7af696ca15906d03ad8aa7a3d8d51e4b3':
  Fix NullException in QwertyKeyListener.KeyDown
2014-05-20 20:47:29 +00:00
Jeff Brown
9777fdb7af am b0a7f84b: am 63bf04d8: Merge "Fix NullException in QwertyKeyListener.KeyDown"
* commit 'b0a7f84b6de20edc6337163a4a07e3c524991ddb':
  Fix NullException in QwertyKeyListener.KeyDown
2014-05-20 20:44:21 +00:00
Jeff Brown
b0a7f84b6d am 63bf04d8: Merge "Fix NullException in QwertyKeyListener.KeyDown"
* commit '63bf04d88bcc00876c30c9f2848da8c44b42185b':
  Fix NullException in QwertyKeyListener.KeyDown
2014-05-20 20:40:20 +00:00
Jeff Brown
63bf04d88b Merge "Fix NullException in QwertyKeyListener.KeyDown" 2014-05-20 20:37:44 +00:00
Raph Levien
8d2aa19977 Fix android.text.cts.TextUtilsTest#testRegionMatches
The CTS test expects an ArrayIndexOutOfBounds exception when passing in
an unreasonably large value for len. Since the actual implementation was
causing an integer overflow, we were getting a different exception.
Since integer overflow is potentially dangerous, this patch tests for it
and throws an exception explicitly.

Change-Id: I0420c06185d33d130853861d25d4f65b06fe0dfa
2014-05-14 15:46:47 -07:00
Dianne Hackborn
1de6b101e5 Merge "Implement better computing of battery drain time, actual charge time." 2014-04-29 18:30:08 +00:00
Dianne Hackborn
260c5020ae Implement better computing of battery drain time, actual charge time.
Also move time formatter in to framework for use elsewhere.

Change-Id: I42b6a44414b68754af65c522bef5591da5643909
2014-04-29 11:23:16 -07:00
Yuling Liang
54dacbe7ca am 3914a33c: am 26a5c2dd: Merge "Followon fix for 14276128 Clipping at bottom of TextView" into klp-modular-dev
* commit '3914a33c01102f5de51e33d006c0aeedf2693af0':
  Followon fix for 14276128 Clipping at bottom of TextView
2014-04-28 23:22:54 +00:00
Raph Levien
d97b097a5b Followon fix for 14276128 Clipping at bottom of TextView
The previous fix did not work when the text was ellipsized, because the
test for whether the line was the last line was incorrect. The new test
handles both the end of the buffer and the case where it is the last
line because of ellipsizing.

So this should be the proper fix for bug 14276128 Clipping at bottom of
TextView when lineSpacingMultiplier < 1

This version of the patch also handles the single-line case (which is
computed in BoringLayout rather than StaticLayout).

Change-Id: I88791acc2aa493cc8c599b374f4d213571260b4b
2014-04-28 18:02:27 +00:00
Yuling Liang
2be1f8c3f4 am 69a9d925: am eea94f06: Merge "Revert "Followon fix for 14276128 Clipping at bottom of TextView"" into klp-modular-dev
* commit '69a9d92502428a4cf6eb6b5bf6577d9e525796a2':
  Revert "Followon fix for 14276128 Clipping at bottom of TextView"
2014-04-25 17:38:00 +00:00
Yuling Liang
10973c7776 Revert "Followon fix for 14276128 Clipping at bottom of TextView"
This reverts commit a10e19845c.

Change-Id: I6d40451c9eb6285859e16d251b55947663a3553a
2014-04-25 17:32:08 +00:00
Yuling Liang
ec2b7d6dd7 am 60f8349b: am 243e551a: Merge "Followon fix for 14276128 Clipping at bottom of TextView" into klp-modular-dev
* commit '60f8349b9819130e81e28106a35bf3362d337045':
  Followon fix for 14276128 Clipping at bottom of TextView
2014-04-25 16:41:07 +00:00
Raph Levien
a10e19845c Followon fix for 14276128 Clipping at bottom of TextView
The previous fix did not work when the text was ellipsized, because the
test for whether the line was the last line was incorrect. The new test
handles both the end of the buffer and the case where it is the last
line because of ellipsizing.

So this should be the proper fix for bug 14276128 Clipping at bottom of
TextView when lineSpacingMultiplier < 1

Change-Id: Iac5c96f2273142031c18a27f504f7d6d5fcf823e
2014-04-24 20:00:05 +00:00
Raph Levien
79cb5505a9 am 07bed492: am e4ee0e31: Merge "Fix bug 14276128 Clipping at bottom of TextView" into klp-modular-dev
* commit '07bed4921a05e717a4b7f10a25e3830e346426b7':
  Fix bug 14276128 Clipping at bottom of TextView
2014-04-24 16:25:21 +00:00
Raph Levien
936df68016 Fix bug 14276128 Clipping at bottom of TextView
Avoid applying "extra" linespacing to the last line of a layout, because
when that is negative, it causes clipping.

Change-Id: I4cc8792fd3444e4118604cc3d0f816d59dfc1e74
2014-04-23 23:17:12 +00:00
Raph Levien
63b3d8c62e Fix extra text appearing after ellipsis
This is a fix for bug 7615701 TextView: calling setText with long
strings causes ellipsize to not work correctly. The problem is that the
"break" when the last line was ellipsized did not fully break out of
both loops of the processing logic, but only the inner loop. This
caused the outer loop to restart at the next span, causing the next span
boundary to overwrite the line end of the last visible line.

The fix simply returns from the function in that case, as there is no
further processing needing to be done.

Change-Id: I5b34233ffba6f0f6f1c12b9565b4fc53e83a4892
2014-04-03 15:52:08 -07:00
Adam Lesinski
776abc24cd Uses VMRuntime.newUnpaddedArray for ideal array sizes
Bug:13028925

Change-Id: I0a9301248b10a339afbdc5e4ffe3310ac4fa1fb7
2014-03-27 11:42:10 -07:00
John Spurlock
8a985d24ce Tabs -> spaces in frameworks/base.
Change-Id: I5a84e8e93ac99b5ed0212b37bf66efa5e53864be
2014-02-25 09:49:29 -05:00
Jean Chalard
84a3320507 Fix a crash where user data was not validated.
ExtractedText#partialStartOffset and #partialEndOffset are
from the app, that sets it as it sees fit. We need to
validate them so that we don't crash.
Still emit a warning if this is the case, as this is
not expected.

Bug: 9570771
Change-Id: Id9d6babd1620da39bf0e454b14d7ce716bd9d9d3
2014-02-13 19:14:24 +09:00
Alan Viverette
8eea3ea559 Add APIs for obtaining themed Drawable from Theme, Context
BUG: 12611005
Change-Id: Ic0057be4e4c2d0c61ce02a019b3f7d0625e3a016
2014-02-03 18:42:24 -08:00
Scott Main
418312f44c am 991ba3b7: am 74e9e698: am 7d1f8e65: am efe10233: am 5dcb75e6: Merge "fix typos bug: 11693951 bug: 12118617" into klp-docs
* commit '991ba3b7f2d7164fab956b54c711d5ea523b2ba5':
  fix typos bug: 11693951 bug: 12118617
2013-12-18 00:53:57 +00:00
Scott Main
7d1f8e6570 am efe10233: am 5dcb75e6: Merge "fix typos bug: 11693951 bug: 12118617" into klp-docs
* commit 'efe102332861bd05f0cba60e729661607546de34':
  fix typos bug: 11693951 bug: 12118617
2013-12-17 16:44:31 -08:00
Scott Main
efe1023328 am 5dcb75e6: Merge "fix typos bug: 11693951 bug: 12118617" into klp-docs
* commit '5dcb75e67b7a3401aa501126bc8401f78c181a68':
  fix typos bug: 11693951 bug: 12118617
2013-12-18 00:41:23 +00:00
Scott Main
688342f98c fix typos
bug: 11693951
bug: 12118617

Change-Id: I7a3ab4c6d7bc124ff9ed8779700e77c87409569d
2013-12-17 13:55:02 -08:00
John Spurlock
6090995951 Remove unused imports from frameworks/base.
Change-Id: Ia1f99bd2c1105b0b0f70aa614f1f4a67b2840906
2013-11-20 11:31:47 -05:00
Jean Chalard
e1ce53209a am 9ea18d49: am d952ac4c: am 218ecd43: Fix the docs build
* commit '9ea18d495c4c3d47d279f3f63cb4a24641544f89':
  Fix the docs build
2013-11-12 22:35:28 -08:00
Jean Chalard
9ea18d495c am d952ac4c: am 218ecd43: Fix the docs build
* commit 'd952ac4c171780da78a157de73702d60d4737916':
  Fix the docs build
2013-11-12 22:31:34 -08:00
Jean Chalard
f86e81c4ff [DO NOT MERGE] Improve documentation for InputType and EditorInfo.
Bug: 11245912
Change-Id: If00bb540f25b176da803af0e02fc1ce1b46537e1
2013-11-13 15:29:16 +09:00
Jean Chalard
218ecd4394 Fix the docs build
Change-Id: I05f1f39aaa9d72201a7fd06377799246039cd505
2013-11-13 15:20:58 +09:00
Jean Chalard
cfafb5059d am 45637283: am 383ef79d: am 7d57b7a3: Merge "Improve documentation for InputType and EditorInfo." into klp-dev
* commit '4563728371520de38445d5758edd3da7538a1934':
  Improve documentation for InputType and EditorInfo.
2013-11-12 21:27:34 -08:00
Jean Chalard
4563728371 am 383ef79d: am 7d57b7a3: Merge "Improve documentation for InputType and EditorInfo." into klp-dev
* commit '383ef79d14a64b335d94353e87e824ea2f37ee65':
  Improve documentation for InputType and EditorInfo.
2013-11-12 21:25:26 -08:00
Jean Chalard
c1a11f17a2 Improve documentation for InputType and EditorInfo.
Bug: 11245912
Change-Id: Ie92ba20079461f7f0e30d969ba3692fec3a3b97f
2013-11-12 14:13:55 +09:00