Commit Graph

644 Commits

Author SHA1 Message Date
Elliott Hughes
f9818d33f9 Fix NPE in DateFormat.is24HourFormat.
In some cases, we end up being called by code that doesn't have a valid
Context. It got away with this historically because it wasn't formatting
times (just dates), so it never went down a path that tried to query the
user's 12/24-hour preference. This patch just ensures that we don't try
to get the preference unless we actually need it.

Bug: 10339015

(cherry picked from commit 8d8ef00c82)

Change-Id: If074a67fa52943c0ec7bb5c5bbe5a11f54fb1f97
2013-08-16 14:53:26 -07:00
Elliott Hughes
12285f3d9f DateUtils should use the user's 12/24-hour preference, not the locale's.
Bug: 10312832

(cherry picked from commit f0b79aeed3)

Change-Id: I0d78725d47009553f9003ccfba06f70f178a6ec1
2013-08-14 15:27:17 -07:00
Amith Yamasani
d8415f4bf0 Developer option to force RTL layout
Make sure screen layout changes are taken into account in Configuration diffs.
Initialize the SystemProperty from Global settings on startup of
ActivityManagerService.

TextUtils checks the override flag to decide if the default layout direction
should be forced to RTL.

Bug: 10244047
Change-Id: I23a2583d790a355060d0d898ba44e5f7dc896b46
2013-08-08 13:42:02 -07:00
Elliott Hughes
89a8250e24 am 710f3e2c: am 60ae2617: Merge "If frameworks wants ASCII casing, it should explicity ask for it."
* commit '710f3e2cc6bc2cdc2f2cddb2190823ea31efd52a':
  If frameworks wants ASCII casing, it should explicity ask for it.
2013-08-02 17:58:33 -07:00
Elliott Hughes
cb64d43062 If frameworks wants ASCII casing, it should explicity ask for it.
http://elliotth.blogspot.com/2012/01/beware-convenience-methods.html

Bug: https://code.google.com/p/android/issues/detail?id=58359
Change-Id: Iaab02e718a7be7bda22e626dca05d79bfd2a8fc4
2013-08-02 15:12:32 -07:00
Elliott Hughes
efaad3e2c6 resolved conflicts for merge of a35ec14f to master
Change-Id: Ib2eb18fe6df2e404d0bf739b300fc200ca81f539
2013-07-25 10:36:59 -07:00
Elliott Hughes
6139e64cd6 Switch DateUtils.formatDateRange over to an icu4c-based implementation.
Bug: 7289514
Change-Id: Ia382f49aa23737bde91b7891d95545da084ec57c
2013-07-24 14:46:31 -07:00
Fabrice Di Meglio
ff4ea79877 Merge "Fix bug #9073962 - Carret is still on the left with an empty EditText in Arabic Locale" 2013-06-19 22:12:50 +00:00
Fabrice Di Meglio
e631889e1a Fix bug #9073962 - Carret is still on the left with an empty EditText in Arabic Locale
- fix StaticLayout special case with empty string or new line

Change-Id: Icb51feedce49db661ed17b6907eb0db83d0b763c
2013-06-19 14:45:13 -07:00
Scott Main
2887271ff3 am 8303a203: am 94ba190e: am de04dfb6: Merge "some extra docs for TextDirectionHeuristic" into jb-mr2-dev
* commit '8303a2036efd93eecda6da1e481e1659a40ca12e':
  some extra docs for TextDirectionHeuristic
2013-06-17 22:14:28 -07:00
Scott Main
8303a2036e am 94ba190e: am de04dfb6: Merge "some extra docs for TextDirectionHeuristic" into jb-mr2-dev
* commit '94ba190ebbd4fe7f8933d531cce7b4be8e04f287':
  some extra docs for TextDirectionHeuristic
2013-06-17 22:13:17 -07:00
Scott Main
e442662330 some extra docs for TextDirectionHeuristic
Change-Id: I8ceac72a76a29bde0e25ed418110a6e4120654e3
2013-06-17 19:05:29 -07:00
Elliott Hughes
f0542ee466 am 704dfbfe: am 48fa06f3: am f6a67139: Merge "Correct Date format for el_GR, sv_SE and tr_TR locales"
* commit '704dfbfec40b4a51000e244a98e8723bb00ba321':
  Correct Date format for el_GR, sv_SE and tr_TR locales
2013-06-17 13:43:53 -07:00
Elliott Hughes
48fa06f34f am f6a67139: Merge "Correct Date format for el_GR, sv_SE and tr_TR locales"
* commit 'f6a671394ca3d269835d5f5b882b46f9539e9a96':
  Correct Date format for el_GR, sv_SE and tr_TR locales
2013-06-17 13:38:59 -07:00
howardb
5ad2451f9f Correct Date format for el_GR, sv_SE and tr_TR locales
Amend DateFormat.getDateFormat to CLDR data from icu4c
instead of locale specific resource entries which are incorrect
for several locales.

No CTS tests are added as they require changing the locale which
is not currently possible.

Bug: https://code.google.com/p/android/issues/detail?id=56385

Change-Id: Ibd11c7fd9b595e19a3e2bf508e1585aa50067e03
Signed-off-by: howardb <android@howardb.com>
2013-06-17 13:35:29 -07:00
Raph Levien
5d0db65e73 am 38272ad2: am 21403857: Merge "Fix for bug 8911390 RTL text alignment is changed ..." into jb-mr2-dev
* commit '38272ad2b1d3ab90c83fcd74139503fcd3148a19':
  Fix for bug 8911390 RTL text alignment is changed ...
2013-05-15 13:49:46 -07:00
Raph Levien
38272ad2b1 am 21403857: Merge "Fix for bug 8911390 RTL text alignment is changed ..." into jb-mr2-dev
* commit '214038571992a4ba65531297bf4a89af9a0b5fd4':
  Fix for bug 8911390 RTL text alignment is changed ...
2013-05-15 13:35:06 -07:00
Raph Levien
01524651cb Fix for bug 8911390 RTL text alignment is changed ...
The predicate for detecting whether text was right aligned was missing
some cases - it was correctly sensing RIGHT or OPPOSITE aligned text
in the LTR case, but was missing NORMAL for rtl. This patch just adds
that case.

Change-Id: I06691e7122e1ca91d66299cf0d7ef1f8a476a44b
2013-05-14 14:00:07 -07:00
Victoria Lease
176498b5ea Merge "enable selection of Linkify-annotated text" 2013-05-07 18:08:09 +00:00
Elliott Hughes
ba8d2e58f8 am c2639e58: am 0bb4c701: Merge "Use ICU for getDateFormatOrder."
* commit 'c2639e58fa5724c06a1d910ad76aebed647b4ba2':
  Use ICU for getDateFormatOrder.
2013-04-30 12:17:25 -07:00
Elliott Hughes
c2639e58fa am 0bb4c701: Merge "Use ICU for getDateFormatOrder."
* commit '0bb4c701bab0f69172417b7a511acb6bdfa052db':
  Use ICU for getDateFormatOrder.
2013-04-30 12:15:00 -07:00
Elliott Hughes
edd6f9e688 Use ICU for getDateFormatOrder.
Bug: 7207103
Change-Id: I680bb727cb74cd4b050f237f036d9e696201fc0b
2013-04-30 11:09:53 -07:00
Victoria Lease
cd0b01327b enable selection of Linkify-annotated text
Bug: 8515643
Change-Id: I74e8b9e45e2645ec6287abd1cd6e47d383c4f3e0
2013-04-29 14:42:01 -07:00
Fabrice Di Meglio
16cea16570 am b241f60f: am c3d0a81a: Merge "Fix bug #8656546 API REVIEW: android.text.bidi / android.text" into jb-mr2-dev
* commit 'b241f60fe76677d106d472d4118d1e6959563331':
  Fix bug #8656546 API REVIEW: android.text.bidi / android.text
2013-04-20 21:37:04 -07:00
Victoria Lease
a5d3459316 am 7e170b63: am bcf3ec96: Merge "do not attempt to parcel unknown ParcelableSpans" into jb-mr2-dev
* commit '7e170b632147da55f93864223419a9f7fa651410':
  do not attempt to parcel unknown ParcelableSpans
2013-04-20 21:36:55 -07:00
Fabrice Di Meglio
8c08fc9a86 Fix bug #8656546 API REVIEW: android.text.bidi / android.text
- clean BidiFormatter APIs

Change-Id: I8591ce3c3e8f2de4138698aa14ddb38b933de5e1
2013-04-19 17:34:01 -07:00
Victoria Lease
577ba5354b do not attempt to parcel unknown ParcelableSpans
Bug: 8639983
Change-Id: I27335f6e9d3a0671ecdd161fdbf765785ef8065d
2013-04-19 13:38:34 -07:00
Fabrice Di Meglio
98c8c890aa am 4febbf35: am bd286426: Merge "Fix bug #8599905 Add simple BidiFormatter getInstance() helper API" into jb-mr2-dev
* commit '4febbf35011ecb30796c78cf3e159ef781564f45':
  Fix bug #8599905 Add simple BidiFormatter getInstance() helper API
2013-04-11 17:50:26 -07:00
Fabrice Di Meglio
cd5af79bf9 Fix bug #8599905 Add simple BidiFormatter getInstance() helper API
Change-Id: I85ff074904025c724409ccc52bc82a1fd23803de
2013-04-11 16:25:21 -07:00
Victoria Lease
9bd9404383 am 1e2c967b: am 8712e4cc: Merge "use libphonenumber for Linkify.PHONE_NUMBER" into jb-mr2-dev
* commit '1e2c967b16afc0750d9d00fbaed8e2175937e1f4':
  use libphonenumber for Linkify.PHONE_NUMBER
2013-04-04 07:50:49 -07:00
Victoria Lease
8712e4cc4a Merge "use libphonenumber for Linkify.PHONE_NUMBER" into jb-mr2-dev 2013-04-04 14:40:52 +00:00
Victoria Lease
430fc97e7e use libphonenumber for Linkify.PHONE_NUMBER
This commit replaces a regex pattern match for Linkify.PHONE_NUMBER
with a call to libphonenumber's PhoneNumberUtil.findNumbers().

Bug: 5533245
Change-Id: I0e0563b241fb62e77d7f49e4a8484c6b0685dd8f
2013-04-04 07:38:24 -07:00
Elliott Hughes
435d11205a am 11139563: am dbca824d: Merge "Add DateFormat.getBestDateTimePattern." into jb-mr2-dev
* commit '1113956349e25bd081590842ec6f6b300765d786':
  Add DateFormat.getBestDateTimePattern.
2013-04-02 12:25:35 -07:00
Elliott Hughes
031b581af2 Add DateFormat.getBestDateTimePattern.
Bug: 8283323
Change-Id: Id8d94456b93555d799229b7dd88fcbcf5c6bf7ff
2013-04-02 12:00:47 -07:00
Raph Levien
85973db79d am 0a914107: am 8fed6bc8: Merge "Make zero width space a line breaker" into jb-mr2-dev
* commit '0a914107205981a8baa079736c959ea9abedbf50':
  Make zero width space a line breaker
2013-03-29 14:34:46 -07:00
Raph Levien
8fed6bc894 Merge "Make zero width space a line breaker" into jb-mr2-dev 2013-03-29 16:58:33 +00:00
Raph Levien
8d087c349f Make zero width space a line breaker
This patch makes ZWSP (U+200B, zero width space) a potential line break
in text layouts. This is a fix for bug 8501809.

Change-Id: I18c1f8464e6c821ff75f819141bacc714a878700
2013-03-29 09:25:48 -07:00
Elliott Hughes
4818dbab51 am 08dbf6a8: am 82718153: am 6f14ef70: am 083bfa5a: Merge "Remove dead DateUtils code that was never in an API level."
* commit '08dbf6a88a95771465a3b16c7a1925f36465ed1d':
  Remove dead DateUtils code that was never in an API level.
2013-03-26 16:58:08 -07:00
Elliott Hughes
827181538c am 6f14ef70: am 083bfa5a: Merge "Remove dead DateUtils code that was never in an API level."
* commit '6f14ef70664d13295ffca524fb0b08365351b1f7':
  Remove dead DateUtils code that was never in an API level.
2013-03-26 16:51:10 -07:00
Elliott Hughes
fbf37c79bd Remove dead DateUtils code that was never in an API level.
Also rewrite @deprecated comments to use an initial capital so they
look right in the generated documentation.

Also improve formatIpAddress documentation.

Change-Id: I317ebe411ef76e16a4535318ce73e00b63af38da
2013-03-26 15:11:28 -07:00
Fabrice Di Meglio
3807312e9b am 0bcec06b: am 19eceaad: Merge "Fix bug #8437358 Clean any ICU related code from TextLayout / Paint and their dependencies" into jb-mr2-dev
* commit '0bcec06b24e7bc67ab4922f6bb18e6bc7737ba69':
  Fix bug #8437358 Clean any ICU related code from TextLayout / Paint and their dependencies
2013-03-20 22:32:45 +00:00
Fabrice Di Meglio
19eceaadd7 Merge "Fix bug #8437358 Clean any ICU related code from TextLayout / Paint and their dependencies" into jb-mr2-dev 2013-03-20 22:27:37 +00:00
Fabrice Di Meglio
665f02c667 Fix bug #8437358 Clean any ICU related code from TextLayout / Paint and their dependencies
- remove the ICU related methods and update the methods using the "reserved" argument
- update to CTS in another CL too

Change-Id: I5509736568c342d9d17bfeafc17951117ab5d3cc
2013-03-20 14:56:05 -07:00
Elliott Hughes
a25731f87d am 96112802: am 80828f46: am c1562075: am ebebb80b: Merge "Remove dead code from DateUtils."
* commit '96112802bc1f37e2f5c75c53b919231a61866bd2':
  Remove dead code from DateUtils.
2013-03-19 19:31:10 +00:00
Elliott Hughes
80828f465a am c1562075: am ebebb80b: Merge "Remove dead code from DateUtils."
* commit 'c1562075b0be58fa9dd09c2f2e9fa45601088574':
  Remove dead code from DateUtils.
2013-03-19 12:27:10 -07:00
Elliott Hughes
9a6fa1d637 Remove dead code from DateUtils.
This stuff is @hide, @deprecated, unused, and was never in any API level.

Change-Id: I87d132d77d7296a2de8527e05c2def362cab1c37
2013-03-19 11:36:12 -07:00
Elliott Hughes
d81830d67e am 110a98b6: am f7c01e5a: am eda35cb7: am a8974d3f: Merge "Clean up (some of) our many clocks to use H instead of k."
* commit '110a98b67285ec213720c542e6fb4711d9fd3114':
  Clean up (some of) our many clocks to use H instead of k.
2013-03-19 16:35:46 +00:00
Elliott Hughes
182af50b2c am 561a0ef4: am c3e513e5: am c5c6d416: am 6317315e: Merge "Deliberately break DateFormat.format\'s formatting of \'k\' for compatibility."
* commit '561a0ef4bf4153960d5796cd74d6cc9c8405843d':
  Deliberately break DateFormat.format's formatting of 'k' for compatibility.
2013-03-19 16:35:37 +00:00
Elliott Hughes
f7c01e5a8a am eda35cb7: am a8974d3f: Merge "Clean up (some of) our many clocks to use H instead of k."
* commit 'eda35cb7c5781a32b038f1ef76b8e50f26f9bfaf':
  Clean up (some of) our many clocks to use H instead of k.
2013-03-19 09:31:04 -07:00
Elliott Hughes
c3e513e51c am c5c6d416: am 6317315e: Merge "Deliberately break DateFormat.format\'s formatting of \'k\' for compatibility."
* commit 'c5c6d4167b66c79652c5208a2dfe091a8c735e6d':
  Deliberately break DateFormat.format's formatting of 'k' for compatibility.
2013-03-19 09:30:51 -07:00