Commit Graph

512 Commits

Author SHA1 Message Date
Luca Zanolin
f252f1dcaf Merge "Relax suggestion notification." 2012-09-04 14:08:24 -07:00
Luca Zanolin
0c96b81f8e Relax suggestion notification.
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
2012-08-29 11:33:12 +01:00
Elliott Hughes
989e14bee1 Merge "Use icu4c for CLDR "yesterday", "today", and "tomorrow" strings." 2012-08-28 16:54:14 -07:00
Elliott Hughes
47a0539eca Use icu4c for CLDR "yesterday", "today", and "tomorrow" strings.
Change-Id: Id9e3b678a98751c4ca85f63b130cc7781d2a6cfe
2012-08-28 16:41:37 -07:00
Dianne Hackborn
1ce05ed2de am 737e99d8: am e45ca31a: am aae49432: am 4763989d: am 32d1fec5: Merge "Fixes relative time formatting issue for dates in future"
* commit '737e99d8d621bfdde810c8f9ce23b25c67ad4de4':
  Fixes relative time formatting issue for dates in future
2012-08-27 13:16:13 -07:00
Dianne Hackborn
e45ca31a61 am aae49432: am 4763989d: am 32d1fec5: Merge "Fixes relative time formatting issue for dates in future"
* commit 'aae4943297a08a659add964a3fef96bdfa0b2c14':
  Fixes relative time formatting issue for dates in future
2012-08-27 13:10:58 -07:00
Dianne Hackborn
aae4943297 am 4763989d: am 32d1fec5: Merge "Fixes relative time formatting issue for dates in future"
* commit '4763989d95342c25e9b857dc9ee21eb5ebac31d6':
  Fixes relative time formatting issue for dates in future
2012-08-27 12:33:57 -07:00
Steve Pomeroy
ca3363775e Fixes relative time formatting issue for dates in future
All variations of getRelativeTimeSpanString() now properly handle dates
that are in the future. Prior, the version used by
getRelativeDateTimeString() would occasionally show the time instead of
a date when the future date was the same weekday as the current weekday.
This resulted in the time output being duplicated, eg.: "11:23, 11:23"

Change-Id: If20972a6942cce792fa233437f94dedfb71379f3
Signed-off-by: Steve Pomeroy <steve@staticfree.info>
2012-08-27 02:20:13 -04:00
Raph Levien
0704064cbe am 8dc2d8d2: am 236d0520: Merge "Fix bug 7054190 line breaks at inappropriate places" into jb-mr1-dev
* commit '8dc2d8d287066e6c13e50aec167c496044689a53':
  Fix bug 7054190 line breaks at inappropriate places
2012-08-24 16:25:06 -07:00
Raph Levien
7c3255f14f Fix bug 7054190 line breaks at inappropriate places
We were doing line breaks after punctuation as long as they weren't
surrounded by digits. This is a misinterpretation of the Unicode line
breaking algorithm. Punctuation (class IS) is not hugely different than
the default classes (NU and AL) - there are breaks after punctuation
that are allowed (for example, followed by an open parenthesis), but
we're not implementing the algorithm with anything near that level of
fidelity.

The long term fix is to really implement the algorithm. In the shorter
term, the easiest thing to do is to remove the special case altogether.

Change-Id: Ic4dc3216c2a4191fbb7cfa06e9dc038d1a56398c
2012-08-24 13:48:37 -07:00
Victoria Lease
df8ef4b139 DO NOT MERGE LocaleSpan makes Han disambiguation easy!
Cherry-pick of I7f1b0d49a2ece957a7b9b5d65d48385bf2c2a668 from master.

I've also provided TextView.setTextLocale() for use in single-language
TextViews.

Change-Id: I5692859bfd2aafc284172454d943afc250b22535
2012-08-20 13:17:58 -07:00
Victoria Lease
ec97b4ddb4 LocaleSpan makes Han disambiguation easy!
I've also provided TextView.setTextLocale() for use in single-language
TextViews.

Change-Id: I7f1b0d49a2ece957a7b9b5d65d48385bf2c2a668
2012-08-17 16:12:46 -07:00
Fabrice Di Meglio
a5f93f74df am e89ad6c2: am d63b9922: Merge "Fix bug #6908329 TextUtils.ellipsize does not work properly when Locale is changed" into jb-mr1-dev
* commit 'e89ad6c20fda6f2d5bf983dc32debfb7a177346e':
  Fix bug #6908329 TextUtils.ellipsize does not work properly when Locale is changed
2012-08-14 14:08:20 -07:00
Fabrice Di Meglio
f3e64101bb Fix bug #6908329 TextUtils.ellipsize does not work properly when Locale is changed
- load the ellipis resources on the fly to get the correct ones depending on the Locale

Change-Id: I42d591e3f5ed715c983f736f94a80143a3897f47
2012-08-14 14:01:53 -07:00
Elliott Hughes
99c406e42b Switch DateUtils and Time over to using the CLDR for all week and month names.
Change-Id: I92c73c269c6f90125cf834d434883595ba4b42d4
2012-08-06 19:41:22 -07:00
Elliott Hughes
db9d339d4b Merge "Use ICU's CLDR data for "AM" and "PM" strings." 2012-08-06 09:40:32 -07:00
Elliott Hughes
68dcd1750e Fix Time.parse and Time.parse3339 crashing bugs.
Two reported by users, the other spotted by inspection.

Bug: http://code.google.com/p/android/issues/detail?id=16002
Bug: http://code.google.com/p/android/issues/detail?id=22225
Change-Id: I86fe022fda4af68e5a6fb9dc5dd2abdb75e9d966
2012-07-25 19:47:45 -07:00
Elliott Hughes
b12b61a88a Use ICU's CLDR data for "AM" and "PM" strings.
This brings DateUtils and Time in sync with bionic, icu, WebKit,
DateFormatSymbols, Formatter, and SimpleDateFormat. And specifically
means that DateUtils now knows how to say "AM" and "PM" in Japanese.

Bug: 6719054
Change-Id: Icdd75c0865505fde4115d71025eeb7515b73da4c
2012-07-25 17:37:12 -07:00
Fabrice Di Meglio
8e136f85f7 Fix for bug 6716343. Use correct offset for mPos reset. DO NOT MERGE
The mPos field in the MeasuredText object is relative to the start of
the text (mTextStart), but the pos passed in by the caller of the
setPos() method is relative to the character sequence. When spans
overlap break boundaries and the paragraph doesn't start at 0, the
result is an out of bounds error. This fix uses the correct offset.

Change-Id: I64ef06df0eb06f75aedd25de97e9f347eeb52979
2012-07-10 14:30:45 -07:00
Raph Levien
1341ab6f38 Fix for bug 6716343. Use correct offset for mPos reset.
The mPos field in the MeasuredText object is relative to the start of
the text (mTextStart), but the pos passed in by the caller of the
setPos() method is relative to the character sequence. When spans
overlap break boundaries and the paragraph doesn't start at 0, the
result is an out of bounds error. This fix uses the correct offset.

Change-Id: I12c7a2311a9bdbbea7ab21554a922b7f665a17bf
2012-07-09 16:57:35 -07:00
Gilles Debunne
884eb4b884 Merge "Better handling of spaces at ends of lines in StaticLayout." 2012-07-02 14:41:57 -07:00
Gilles Debunne
8154149194 Better handling of spaces at ends of lines in StaticLayout.
Skipping spaces at ends of line used to be done only when ok != here
(a potential line break was found).

Moved this logic up one level to handle all cases.

Also moved maxLine test in the block that actually adds a new line.

Updated the unit tests accordingly.

Change-Id: Ib10bc838b1ffa5b8a60259ea4b622d9fecb2ec70
2012-06-27 17:21:21 -07:00
Gilles Debunne
dd0c25c921 Added comments describing the span limit attributes
Patch: replaced left/right by before/after and added a comment on RTL.

Change-Id: Iccd70adfbba4cb5f76d2729eeb81fed9b50403ae
2012-06-26 15:18:49 -07:00
Gilles Debunne
099adfba81 am 4c268a32: am badf5a94: Merge "Fixed text rendering issue with spans." into jb-dev
* commit '4c268a32714fefe141d093abb59806a2d6f2991c':
  Fixed text rendering issue with spans.
2012-06-18 18:59:25 -07:00
Gilles Debunne
badf5a9442 Merge "Fixed text rendering issue with spans." into jb-dev 2012-06-18 18:53:31 -07:00
Gilles Debunne
cd943a7a01 Fixed text rendering issue with spans.
Bug 6598784

The algorithm uses three imbricated loops:
- paragraphs
- span regions (called "blocks" in that description) in these
- characters in these

We can ignore the paragraphs and assume paraStart==0.

The span region loop cuts the text into blocks of text which share
the same set of MetricAffectingSpan spans applied to them. Note that
spanStart and spanEnd represent such a range, and not necessarily an
actual span range.

The third loop then iterates over the characters of these blocks, and creates
a new line (calling out() as soon as the width has been reached.

The core of the problem comes from the 'nextSpanStart' variable.
It is used to restart the block loop from a previous position in case
a line has been created that does not intersect with the current block.

However, in case the current block is larger than the width of the text,
the character loop is going to create other lines of text before we exit the
j-loop. Going back to the block loop, we reset spanStart to the nextSpanStart,
which may be too far back in the text. As a result, the same range of characters
is measured again.

The (spanStart == spanEnd) test was used to handle the case where
nextSpanStart was indeed assigned to a value different than spanEnd.

This fix simplifies this logic and removes the nextSpanStart variable:

When the created line ends before the current block (here < spanStart), we
immediately exit the character loop, re-starting the block loop from the
current position.

Patch 4: added a fix in measured to handle overlapping character ranges.

Change-Id: Ie71b3cf4018b332e335ea916fef08acb43a6679e
2012-06-15 15:29:13 -07:00
Fabrice Di Meglio
7fbede44ed am 99745c01: am 15c9c614: Merge "Fix bug #6661824 Hebrew Text can be clipped" into jb-dev
* commit '99745c01797c34ce7ca76640deab09fc728aee4e':
  Fix bug #6661824 Hebrew Text can be clipped
2012-06-14 11:10:13 -07:00
Fabrice Di Meglio
15c9c6141a Merge "Fix bug #6661824 Hebrew Text can be clipped" into jb-dev 2012-06-14 10:50:36 -07:00
Fabrice Di Meglio
8d44fff7e6 Fix bug #6661824 Hebrew Text can be clipped
- use the correct ellipsis char in both measurement and rendered string

Change-Id: Ia00285fc16da528f18702719026503b5d0610642
2012-06-13 15:54:55 -07:00
Gilles Debunne
30103f6698 am 735b9598: am a447eaca: Merge "Prevent a crash when maxLines is set to 0" into jb-dev
* commit '735b9598a2c7824befbdfc55ef4991ca01550d84':
  Prevent a crash when maxLines is set to 0
2012-06-12 13:01:15 -07:00
Victoria Lease
49ccb116e9 am 1b15102f: am 72b8fc7e: Merge "Revert "Fix fake bold for fallback fonts in frameworks."" into jb-dev
* commit '1b15102fc040f59c72c6453dee15b791f54c9f06':
  Revert "Fix fake bold for fallback fonts in frameworks."
2012-06-12 13:00:37 -07:00
Gilles Debunne
a447eaca55 Merge "Prevent a crash when maxLines is set to 0" into jb-dev 2012-06-12 10:47:31 -07:00
Gilles Debunne
2fba3387c3 Prevent a crash when maxLines is set to 0
Bug 6642222

Using setMaxLines(0) and setMinHeight(30) causes a crash
because Layout#getLineRangeForDraw() returns a [0,0] interval
in that case.

Accessing the Direction in draw causes a NPE.

Change-Id: If50f9b554e3cdc598a721b623992e9196982838c
2012-06-11 17:46:26 -07:00
Victoria Lease
aa0980afab Revert "Fix fake bold for fallback fonts in frameworks."
This reverts commit b26fa0ce68
2012-06-11 14:46:04 -07:00
Victoria Lease
c3672a4e19 am 2203fab2: am 2e6f9be5: Merge "Fix fake bold for fallback fonts in frameworks." into jb-dev
* commit '2203fab24966c80af5c37f0a58263218dbbcd610':
  Fix fake bold for fallback fonts in frameworks.
2012-06-08 17:33:35 -07:00
Victoria Lease
b26fa0ce68 Fix fake bold for fallback fonts in frameworks.
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
2012-06-08 13:52:17 -07:00
Jean Chalard
76abb24afa am 887568c4: am 01bf82f2: Merge "Add/refine comments to reflect key event policies" into jb-dev
* commit '887568c4f4e49b78b1549459b265377c7ee4e8c0':
  Add/refine comments to reflect key event policies
2012-05-29 18:10:13 -07:00
Jean Chalard
405bc51c5d Add/refine comments to reflect key event policies
Make clearer how the platform is handling key events following some
unfortunate uses by third party applications. Also highlight the
changes in Jelly Bean default keyboard.

Bug: 6566711
Change-Id: Ibcdaf54c6d629fd0733529bfe2fffc82f555f084
2012-05-29 19:41:02 +09:00
Gilles Debunne
579cc204a2 am b00ceecb: am 0ae107ff: Merge "Cut long text into multiple DL at start" into jb-dev
* commit 'b00ceecb96063a30bb73b13e156a6da00e3900e7':
  Cut long text into multiple DL at start
2012-05-14 08:36:08 -07:00
Gilles Debunne
0ae107ff34 Merge "Cut long text into multiple DL at start" into jb-dev 2012-05-11 16:14:02 -07:00
Gilles Debunne
71afc39d68 Cut long text into multiple DL at start
Bug 5763685

To improve performance, preventively cut the the into display
list of 3-10 lines of text. Further updates to small parts of
the text (such as adding an underline on a word) will only
invalidate and redraw the affected sub display list.

DLs are aligned with paragraphs, just like they will be during
text edition.

Change-Id: I0d60debc7fdaea8b29080a6eacb2d60205e7d547
2012-05-11 15:32:43 -07:00
Raph Levien
2ab6568046 resolved conflicts for merge of a9cc30ce to master
Change-Id: I507bd7a4650f9a7bfe6a0ad7bb8dd4067adb6a8b
2012-05-11 10:43:39 -07:00
Raph Levien
d570e8987a Add fontFamily XML attribute to select font family by string
Change-Id: I0b649528d3d9888e3561a1a3907a6b6ee2e30238
2012-05-09 23:18:42 -07:00
Gilles Debunne
bb5971a78f am 8779c022: am 0caf421e: Merge "Final fix in SpannableStringBuilder." into jb-dev
* commit '8779c022b401b2a269e058c2c27b885694b696f3':
  Final fix in SpannableStringBuilder.
2012-05-08 11:29:49 -07:00
Gilles Debunne
0caf421e3a Merge "Final fix in SpannableStringBuilder." into jb-dev 2012-05-07 11:17:38 -07:00
Gilles Debunne
e244868053 Final fix in SpannableStringBuilder.
Bug 6448052

The empty EXCLUSIVE removal condition was incorrect.
Also changed the unit test the didn't catch this problem.

Change-Id: I5576d830cdfa6cc3716c878fb698695a2978b296
2012-05-04 16:24:49 -07:00
Fabrice Di Meglio
66388dcb09 Hide RTL related APIs - DO NOT MERGE
- fix bug #6441155 API review: @hide RTL layout APIs

Change-Id: I13c5ea5f579cecffed9d517f06180ab0576cd26a
2012-05-04 13:15:12 -07:00
Gilles Debunne
cefb4bc011 Hide TextDirectionHeuristics
Bug 6435363

Change-Id: I9ba0a3c057af67e2876e64fd8c18adbb8f4d0860
2012-05-02 18:20:25 -07:00
Gilles Debunne
2d589ffa1e Merge "SpannableStringBuilder correctly manages MARK and POINTS" into jb-dev 2012-04-30 15:44:02 -07:00
Gilles Debunne
26b62d4321 SpannableStringBuilder correctly manages MARK and POINTS
Bug 6343982

Finally deeply understood the meaning of the POINT and MARK flags.

Updated the Spanned documentation to reflect this.

Updated tests to come.

Change-Id: I400d56b7b4929bc1e7eb4f0497d8e081ee23682e
2012-04-26 19:04:03 -07:00