Commit Graph

538 Commits

Author SHA1 Message Date
Elliott Hughes
6647f1bd2b am c749261f: Merge "Fix DateUtils.formatElapsedTime."
* commit 'c749261fea1010dfa2d1337bd210c81d13052540':
  Fix DateUtils.formatElapsedTime.
2012-12-15 14:58:01 -08:00
Elliott Hughes
2eda18485c Fix DateUtils.formatElapsedTime.
More reuse of StringBuilders, less broken home-grown formatting code.

Long-term, we should hand this over to icu4c, but they're not ready yet.

Bug: http://code.google.com/p/android/issues/detail?id=41401
Bug: 7736688
Change-Id: Ib3c1e1aad05827df646aa18645cce19dffb7551f
2012-12-14 14:29:47 -08:00
Jeff Sharkey
9f43afad9d am 68363456: am 7420ab68: Merge "Utility to format human-friendly durations." into jb-mr1.1-dev
* commit '68363456c1f360c0f1afe637a1f3028519e059ed':
  Utility to format human-friendly durations.
2012-11-15 11:54:43 -08:00
Jeff Sharkey
68363456c1 am 7420ab68: Merge "Utility to format human-friendly durations." into jb-mr1.1-dev
* commit '7420ab681eaad22f4b8f884e12d3b2ce82cd203a':
  Utility to format human-friendly durations.
2012-11-15 11:51:38 -08:00
Jeff Sharkey
53f6e8a9b9 Utility to format human-friendly durations.
Bug: 6777872
Change-Id: Ie7ebcb456306f4f88b4707030dd7beda3fc90368
2012-11-13 17:26:39 -08:00
Romain Guy
aabe4bb477 am 9c0010f8: am 998d03bd: Merge "A new clock widget to create lock screen appwidgets" into jb-mr1-dev
* commit '9c0010f856d623845b20a7dd13c024023626623c':
  A new clock widget to create lock screen appwidgets
2012-11-01 11:28:13 -07:00
Romain Guy
9c0010f856 am 998d03bd: Merge "A new clock widget to create lock screen appwidgets" into jb-mr1-dev
* commit '998d03bd943053741bab17a8ef0abb355f6bc3ae':
  A new clock widget to create lock screen appwidgets
2012-11-01 11:26:10 -07:00
Romain Guy
3d1728c03a A new clock widget to create lock screen appwidgets
This new widget replaces DigitalClock. It listens to all the correct
system events and offer the ability to customize the formatting
patterns in 12-hour and 24-hour modes. It also supports fixed
time zones to create world clocks.

One more step towards becoming ClockOS!

Change-Id: I677e5dfca8cd8c8d1f8c49e54d7507f4d1885bf4
2012-10-31 20:31:58 -07:00
Raph Levien
fdf263971b am 9defd066: am 74437532: Merge "Fix for bug: Gmail (and other places): cursor placed on top of letter" into jb-mr1-dev
* commit '9defd0663e2b6a486f5bc72621bbbd4dfab666fb':
  Fix for bug: Gmail (and other places): cursor placed on top of letter
2012-10-22 16:01:39 -07:00
Raph Levien
9defd0663e am 74437532: Merge "Fix for bug: Gmail (and other places): cursor placed on top of letter" into jb-mr1-dev
* commit '74437532fe2a3e9ebd15c61327fd3f2b68c299b3':
  Fix for bug: Gmail (and other places): cursor placed on top of letter
2012-10-22 15:59:22 -07:00
Raph Levien
42ef515d18 Fix for bug: Gmail (and other places): cursor placed on top of letter
This patch fixes bug 7346656. In this particular case, the text line in
the EditText was split into multiple spans, with the boundary between
the "r" and "," in "r,". These were being drawn as two separate runs,
but measured as a single run, leading to inconsistent measurements
because this is a kern pair in Roboto.

The fix is to eliminate the special-case code for measuring. This will
actually improve efficiency, as the value computed in one pass is now
more likely to be reused in another.

Change-Id: I04142a0ec98f280fc1027c7cbdbf903e3096f8e4
2012-10-22 15:01:17 -07:00
Raph Levien
e9d419f524 am 6594eca0: am 9704b563: Merge "Fix for 7301594 Html.toHtml creating potentially invalid html" into jb-mr1-dev
* commit '6594eca0a9d9e9e0b429f950a673fa1820d43813':
  Fix for 7301594 Html.toHtml creating potentially invalid html
2012-10-08 12:46:03 -07:00
Raph Levien
6594eca0a9 am 9704b563: Merge "Fix for 7301594 Html.toHtml creating potentially invalid html" into jb-mr1-dev
* commit '9704b563d63d8b5fe8e568dfb7190f8440b56698':
  Fix for 7301594 Html.toHtml creating potentially invalid html
2012-10-08 12:43:12 -07:00
Raph Levien
286da7b6f5 Fix for 7301594 Html.toHtml creating potentially invalid html
Generate <p dir="rtl"> instead of <p dir=rtl>. The form with the quotes
is cleaner and will reduce warnings in apps that consume the output.

Change-Id: Ic9879c8c882c42079598b741e897a24415d96374
2012-10-07 16:57:27 -07:00
Fabrice Di Meglio
b4a80baaff am 5e5169b0: am 33c36895: Merge "Fix bug #7282594 EditText does not allow to move the cursor when typing RTL text and if gravity is set to LEFT" into jb-mr1-dev
* commit '5e5169b0d0d51e042a79ca32d2825fc5f4a25531':
  Fix bug #7282594 EditText does not allow to move the cursor when typing RTL text and if gravity is set to LEFT
2012-10-03 17:48:09 -07:00
Fabrice Di Meglio
5e5169b0d0 am 33c36895: Merge "Fix bug #7282594 EditText does not allow to move the cursor when typing RTL text and if gravity is set to LEFT" into jb-mr1-dev
* commit '33c36895a294c7b731fd59017a7ea0f06ac2a356':
  Fix bug #7282594 EditText does not allow to move the cursor when typing RTL text and if gravity is set to LEFT
2012-10-03 17:45:16 -07:00
Fabrice Di Meglio
db24f0a73f Fix bug #7282594 EditText does not allow to move the cursor when typing RTL text and if gravity is set to LEFT
- fold LEFT/RIGHT into NORMAL/OPPOSITE cases

Change-Id: Idf14342ffed4840e7b4ea53cc42f1cde8f196a4c
2012-10-03 17:17:14 -07:00
Elliott Hughes
3a8b3a85e1 am 3d5be42e: Merge changes I87c2ab9e,I2dafcc34,I731c96c2 into jb-mr1-dev
* commit '3d5be42eaa35914d9b37fe052fa7222dc1992dc0':
  Fix formatDateRange month names for Farsi.
  Use localized digits for Time formatting.
  Use proper digits in formatElapsedTime and format3339
2012-09-20 12:50:52 -07:00
Elliott Hughes
3d5be42eaa Merge changes I87c2ab9e,I2dafcc34,I731c96c2 into jb-mr1-dev
* changes:
  Fix formatDateRange month names for Farsi.
  Use localized digits for Time formatting.
  Use proper digits in formatElapsedTime and format3339
2012-09-20 10:05:44 -07:00
Elliott Hughes
9ccf13cd6b Fix formatDateRange month names for Farsi.
This removes the LLLs seen in Calendar and Settings, for example.

Bug: 6811327
Change-Id: I87c2ab9ee8d897171ce7ca4fe06cfa8b11d36536
2012-09-18 16:40:20 -07:00
Elliott Hughes
6323b6c617 Use localized digits for Time formatting.
This fixes the digits in places like Settings' data usage page
and Calendar's drop-down, for languages such as Arabic.

Bug: 6811327
Change-Id: I2dafcc342e3279937735697b3748b47fdfc8e691
2012-09-18 15:16:00 -07:00
Fabrice Di Meglio
8bf1cb378b am 20586fa0: Merge "Fix bug #7173351 API REVIEW: android.util.LocaleUtil" into jb-mr1-dev
* commit '20586fa0353f63453766140b32a4778793ce2b43':
  Fix bug #7173351 API REVIEW: android.util.LocaleUtil
2012-09-18 15:00:14 -07:00
Fabrice Di Meglio
20586fa035 Merge "Fix bug #7173351 API REVIEW: android.util.LocaleUtil" into jb-mr1-dev 2012-09-18 14:48:48 -07:00
Roozbeh Pournader
315a7c0335 Use proper digits in formatElapsedTime and format3339
Use getZeroDigit() instead of a hard-coded '0' for formatting times using
formatElapsedTime, so locales with different digits like Arabic and Persian
could display the elapsed time properly. This is visible in Settings' list
of running apps.

Also changed android.text.format.Time's format3339 method to always use ASCII
digits, irrespective of the locale.

Change-Id: I731c96c21b3712ec347d9526e4ec3fe884dec276
2012-09-18 14:11:55 -07:00
Fabrice Di Meglio
d3d9f3f100 Fix bug #7173351 API REVIEW: android.util.LocaleUtil
Change-Id: I08fd491eff714059e9ec874fadebe7eb556c34d5
2012-09-18 12:55:32 -07:00
Elliott Hughes
e09e3a1a0d am 7134ef60: Merge "Fix date formatting for fa locales." into jb-mr1-dev
* commit '7134ef60b7ebe81b37dffdd65f22a9aae80e3d14':
  Fix date formatting for fa locales.
2012-09-17 14:48:49 -07:00
Elliott Hughes
34de3bc309 Fix date formatting for fa locales.
This adds support for standalone months (L versus M) and localized
digits.

Bug: 6811327
Change-Id: I4687a4c67605c31b155c0b8d44b3da6ed378fc82
2012-09-17 11:17:10 -07:00
Elliott Hughes
1a698714b9 am c3ff72f5: Use icu4c for CLDR "yesterday", "today", and "tomorrow" strings.
* commit 'c3ff72f5bd5896ad2584e0cc0582cbd2ad8191f2':
  Use icu4c for CLDR "yesterday", "today", and "tomorrow" strings.
2012-09-15 16:12:09 -07:00
Elliott Hughes
5f09b9f52d am 08153ee0: Switch DateUtils and Time over to using the CLDR for all week and month names.
* commit '08153ee01e6aa67061f628bc3fed66c6400dfd1c':
  Switch DateUtils and Time over to using the CLDR for all week and month names.
2012-09-15 16:12:06 -07:00
Elliott Hughes
ee783e6075 am 23321b88: Merge "Use ICU\'s CLDR data for "AM" and "PM" strings." into jb-mr1-dev
* commit '23321b88578a4b4438e7563ff7616b98a1c1a520':
  Use ICU's CLDR data for "AM" and "PM" strings.
2012-09-15 16:12:02 -07:00
Elliott Hughes
c3ff72f5bd Use icu4c for CLDR "yesterday", "today", and "tomorrow" strings.
(cherry-pick of 47a0539ecaf7d7a15008704bd89f748aebf85d47.)

Conflicts:

	core/res/res/values/public.xml

Bug: 6811501
Change-Id: Ifb2e030a9fda85a7f664feac812b63e67780e68f
2012-09-14 20:22:17 -07:00
Elliott Hughes
08153ee01e Switch DateUtils and Time over to using the CLDR for all week and month names.
(cherry-pick of 99c406e42ba154584070ca7ec100e8be7ff8a800.)

Conflicts:

	core/res/res/values-fa/donottranslate-cldr.xml
	core/res/res/values/public.xml

Bug: 6811501
Change-Id: I2ad9608ae34804e02c6b0271197e96611df12b0a
2012-09-14 20:22:17 -07:00
Elliott Hughes
4af85345e7 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

(cherry-pick of b12b61a88a029730b1f2b006ff914c9c719f3942.)

Conflicts:

	core/res/res/values/public.xml

Change-Id: Ic1a811621a0ec338abd77458ac2046577f87c1e4
2012-09-14 17:10:00 -07:00
Elliott Hughes
f49a31626b am 9ceede6d: am 086676a4: am f5437ee8: am 297ad257: Merge "Deprecate those parts of DateUtils the documentation says not to use."
* commit '9ceede6d7e250922e63b0d2c90403089f8736e0c':
  Deprecate those parts of DateUtils the documentation says not to use.
2012-09-14 16:41:11 -07:00
Elliott Hughes
9ceede6d7e am 086676a4: am f5437ee8: am 297ad257: Merge "Deprecate those parts of DateUtils the documentation says not to use."
* commit '086676a4a669b5d3a90c01e4d88ab8d628ca65f0':
  Deprecate those parts of DateUtils the documentation says not to use.
2012-09-14 16:39:12 -07:00
Elliott Hughes
f5437ee86a am 297ad257: Merge "Deprecate those parts of DateUtils the documentation says not to use."
* commit '297ad257464d2ea65cabd45ddb19f6da34b39157':
  Deprecate those parts of DateUtils the documentation says not to use.
2012-09-14 16:34:41 -07:00
Elliott Hughes
d3c01012d8 Deprecate those parts of DateUtils the documentation says not to use.
Applications using these fields and methods are just asking for i18n bugs.

Also @deprecate two int[]s that were never meant to be public.

Change-Id: I29b3a1c0c663fe344d2567df6ed3bb537270b3b7
2012-09-14 16:06:50 -07:00
Elliott Hughes
5ef49427b6 Fix Time.parse and Time.parse3339 crashing bugs. DO NOT MERGE
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

This was committed to master, cherry-picking to jb-mr1-dev
2012-09-07 12:42:18 -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
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
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
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