Commit Graph

269 Commits

Author SHA1 Message Date
Xavier Ducrohet
7719436342 am b732b7b5: am ce57a7f3: am 6504490c: am dff6b8e7: Merge "Add --non-constant-id to aapt."
* commit 'b732b7b5e8192501360edc15fb8c6399d11fb97d':
  GpsLocationProvider: Clean up HAL initialization/cleanup sequence
  Fixed GSM encoded network initiated position request
  Ensuring thread-safe usage of DateFormat.
  Fixing infinite loop for zero duration.
  Fix for an infinite loop while scrolling lists.
  WAPPushManager, WAP Push over SMS message handler
  Add --non-constant-id to aapt.
2011-02-28 10:15:48 -08:00
Xavier Ducrohet
b732b7b5e8 am ce57a7f3: am 6504490c: am dff6b8e7: Merge "Add --non-constant-id to aapt."
* commit 'ce57a7f35344e76689d30f45964d1e37b78280cb':
  GpsLocationProvider: Clean up HAL initialization/cleanup sequence
  Fixed GSM encoded network initiated position request
  Ensuring thread-safe usage of DateFormat.
  Fixing infinite loop for zero duration.
  Fix for an infinite loop while scrolling lists.
  WAPPushManager, WAP Push over SMS message handler
  Add --non-constant-id to aapt.
2011-02-28 10:10:38 -08:00
Jeff Brown
d17247164b Make SHIFT+Backspace be forward delete.
Bug: 3416383
Change-Id: I8f20a6793abd15741aff222edcfe33f7019b9095
2011-02-26 14:58:04 -08:00
Jeff Brown
8f34567c71 Add scroll wheel support to TextView.
Change-Id: I6e4258c50b0d754dccf07266ff4b2abcbccd733a
2011-02-26 13:35:35 -08:00
Jozef BABJAK
25d8b05fb7 Ensuring thread-safe usage of DateFormat.
DateFormat is inherently unsafe for multithreaded use. This patch adds
proper synchronization. The 'sLock' is re-used. To avoid two consecutive
lockings, locked version of initFormatStrings() method is created and
used where appropriate, i.e. in original method AND in added synchronized
block.

Change-Id: Id3c34613623e743e703aadb2342aa788679dda8a
2011-02-22 09:17:51 +01:00
Gilles Debunne
f3fa0cdbae Bugfixes in StaticLayout.
Bug 3422121

With ellipsize, lines starting with a very long word that does not
fit inside the width were simply ignored. Cut the long word instead.

start - widthStart index offset shift in BiDi.

The original ellipsize-end patch that added '...' after the last
word on end-ellipsized lines has been punted in favor of a true
ellipsize support in I.

I believe the StaticLayout calculateEllipsise is a no-op since textwidth <= avail
by construction: fitWidth and okwidth are < outerWidth. The only exception is the
paraEnd != here case in generate (when not a single character fits in width).
This case is exercised by StaticLayoutTest in cts (width of 8 pixels) and revealed
an offset error in widstart.

All in all, it looks like this code was probably never really tested. I tried some
typical text configuration to make sure these changes improved the situation.

Change-Id: Ibee410bd7db453abf93e10e8beb844eae998922c
2011-02-18 16:05:15 -08:00
Fabrice Di Meglio
8761bfaa8d Merge "Code cleaning" 2011-02-16 10:48:12 -08:00
Fabrice Di Meglio
121c82c813 Code cleaning
- remove unused local variables
- add char constants
- some variables renaming to be more understandable

Change-Id: Id54dd671b1449cca6463bf77160dc72c8bf0c805
2011-02-15 17:41:10 -08:00
Fabrice Di Meglio
2fa160840c Merge "Small optimization when getting the spans" 2011-02-15 15:28:50 -08:00
Fabrice Di Meglio
a2a035ef47 Small optimization when getting the spans
- loop earlier if the kind is not the one we want

Change-Id: I5b020f20a144678ad2f7a4bca8fef64eb6ae491f
2011-02-15 14:31:26 -08:00
Gilles Debunne
f75c97e023 Text insertion cursor is now defined by a Drawable.
Bug 3261766

If defined, the drawable is used instead of directly drawing a 1 pixel
line. This makes the cursor more fancy and more visible.

The drawable is currently clipped by the TextView's limits, which is
currently visible on the left when the cursor is at the first position.
To solve this issue properly, we would need to propagate a do-not-clip
up in the hierarchy.

Change-Id: I99f6001048eed14104994acf6bab942dda8eb38e
2011-02-14 18:29:39 -08:00
Paul Eastham
19e70cbbcb am 9a5bda87: am be46d145: Revert "Fix for StaticLayout bug with ellipsized text"
* commit '9a5bda875f86b188b501ce7cf73810dd92288251':
  Revert "Fix for StaticLayout bug with ellipsized text"
2011-02-07 13:50:42 -08:00
Kenny Root
7679365b54 am 6465889e: am c4dfa998: am d2a99617: am c94a9998: Merge "JPtextinput: Dont break emoji characters when cutting strings."
* commit '6465889ecbf4c04bb4bb6f4e8d4306727f7ca837':
  JPtextinput: Dont break emoji characters when cutting strings.
2011-02-07 13:49:08 -08:00
Gilles Debunne
de1285e7ea am 63308bd0: am a324a581: Merge "Fix for StaticLayout bug with ellipsized text" into honeycomb
* commit '63308bd092a0edcea685d9f81b3d6d6d345c663b':
  Fix for StaticLayout bug with ellipsized text
2011-02-07 13:46:21 -08:00
Paul Eastham
9a5bda875f am be46d145: Revert "Fix for StaticLayout bug with ellipsized text"
* commit 'be46d1456beb7e2f3e8b82bda2d0a5023db3debd':
  Revert "Fix for StaticLayout bug with ellipsized text"
2011-02-04 19:23:10 -08:00
Paul Eastham
be46d1456b Revert "Fix for StaticLayout bug with ellipsized text"
This reverts commit bbc910f229.
2011-02-04 19:17:54 -08:00
Kenny Root
6465889ecb am c4dfa998: am d2a99617: am c94a9998: Merge "JPtextinput: Dont break emoji characters when cutting strings."
* commit 'c4dfa998b7660b9afc4d41b0c940d798f2122fc3':
  JPtextinput: Dont break emoji characters when cutting strings.
2011-02-04 16:16:19 -08:00
Gilles Debunne
bbc910f229 Fix for StaticLayout bug with ellipsized text
This fixes the test, but I believe this class still needs a lot of fixing.

Change-Id: Ib6386196908ea8432b175d6994f9299778a322d2
2011-02-03 17:42:18 -08:00
Mike Cleron
fbcba51ab2 am b118bd1c: am ad97c1b1: Merge "Remove MeasuredText debug messages" into honeycomb
* commit 'b118bd1c2bb665eec1a78a6cf5c76a0aa6eba6af':
  Remove MeasuredText debug messages
2011-02-01 13:25:40 -08:00
Gilles Debunne
15f16e3f86 am 65383292: am 8f8aac5e: Merge "Pixel were missing on the last line of text when using MaxLines." into honeycomb
* commit '6538329258ee01b27586d8b0e46e96160d719a68':
  Pixel were missing on the last line of text when using MaxLines.
2011-02-01 10:09:29 -08:00
Mike Cleron
ad97c1b128 Merge "Remove MeasuredText debug messages" into honeycomb 2011-01-31 23:22:36 -08:00
Kenny Root
fbc8630736 Remove MeasuredText debug messages
MeasuredText debug messages were left in the tree. Remove them before
shipping.

Bug: 3408963
Change-Id: Ia220eae5835d1325bb6053de0025d8016a1edcad
2011-01-31 13:54:58 -08:00
Gilles Debunne
0a4db3c527 Pixel were missing on the last line of text when using MaxLines.
Bug 3295544

Only the last line of text includes the bottomPadding (extra line
spacing below the characters' descent. When The text is clipped using
maxLines, the desired height correctly added this value, but getLineTop
and getLineDescent are also used when the layout is drawn.

The fix is to make the layout aware of its clipping so that these
values are correctly updated.

Change-Id: I703656cf45022d34a90f55f0ed8fc5e4b30f80b1
2011-01-30 18:23:13 -08:00
Brian Muramatsu
4f92dd2a4d am 910be3e8: am 9eaefb82: Merge "Fix TextUtils#commaEllipsize" into honeycomb
* commit '910be3e855738eab783f2e280b76dcef90a841ec':
  Fix TextUtils#commaEllipsize
2011-01-28 14:55:31 -08:00
Brian Muramatsu
4c8ad6eb62 Fix TextUtils#commaEllipsize
Bug 3400770

TextUtils#commaEllipsize creates a MeasuredText "mt" object with the
text to be ellipsized. It calls setPara which initializes mt's mPos
member to be 0. It then calls addStyleRun which moves mPos to the end
of the string. The loop back in commaEllipsize then calls mt addStyleRun
again and this causes IndexOutOfBoundsException, because the paint
object is trying to measure text past the text's length.

It seems this was a typo and that the tempMt variable should be used,
because the code is trying to measure the format string...not the
the string to be ellipsized. This makes the saner parts of CTS test
for this method pass now.

Change-Id: Ib6aa6e4bbd6afff4c95ad4c4d51a384cc1389875
2011-01-27 18:13:39 -08:00
Gilles Debunne
277ae7e3dc am 7a417821: am 47fc854a: Merge "Fix for a call to startActivity from outside of an app." into honeycomb
* commit '7a417821957bac70bfd4cb4a357b143a1a1570e3':
  Fix for a call to startActivity from outside of an app.
2011-01-25 16:18:51 -08:00
Gilles Debunne
47fc854ae9 Merge "Fix for a call to startActivity from outside of an app." into honeycomb 2011-01-25 14:20:09 -08:00
Gilles Debunne
d9ed795ca5 Fix for a call to startActivity from outside of an app.
Bug 3246715

Regression introduced by https://android-git.corp.google.com/g/#change,86174

Change-Id: Icba170746d196386bd9b0309582f724cb076d937
2011-01-25 13:40:06 -08:00
Gilles Debunne
3971b8cd52 am 2b5a62af: am 2a32a39e: Merge "Removed warnings in DynamicLayout" into honeycomb
* commit '2b5a62afdef5efc47e223057de0c867ffafef22d':
  Removed warnings in DynamicLayout
2011-01-25 11:38:33 -08:00
Gilles Debunne
2a32a39e9a Merge "Removed warnings in DynamicLayout" into honeycomb 2011-01-25 11:34:19 -08:00
Gilles Debunne
9854161e8f am 9eaa9b97: am b6b15dca: Merge "TextLine cache is used, even for long lines of text." into honeycomb
* commit '9eaa9b97d78e3efed1ac497822ca06c03db890cd':
  TextLine cache is used, even for long lines of text.
2011-01-25 10:47:33 -08:00
Gilles Debunne
d6e568c4f3 Removed warnings in DynamicLayout
Change-Id: Ied1c330795412d0bdcac1236b466951112fabc7d
2011-01-25 10:14:43 -08:00
Gilles Debunne
f902d7bc49 TextLine cache is used, even for long lines of text.
Bug 3381368

The 250 characters limit is passed for long URLs. There are only 3
TextLine objects, so their total size is not an issue. Recycle long
lines as well to make sure we fill the cache and avoid object creation.

Change-Id: I843bf623594312a0fcf0edbb13b7cd64cce0ddd1
2011-01-25 09:09:46 -08:00
Leon Scroggins
2c2aa7c4d2 am 62fd9903: am d5188657: Do a better job of lining up text with page text.
* commit '62fd9903a756eb5d8e7bcafbbc5a3a311fdbcefc':
  Do a better job of lining up text with page text.
2011-01-21 13:01:08 -08:00
Leon Scroggins
d5188657dc Do a better job of lining up text with page text.
Bug:3085564
Bug:3196224
Bug:3321608

Remove Touch.getMaxScrollX(), which is incorrect for my
purpose, and is not used anywhere else.  Instead use the
layout to determine the maximum horizontal scroll of a
textfield.

Now that textareas use layers, scroll the layer's picture
in the UI thread for vertical movement.  When passing a
click to webcore, also pass a message to scroll the actual
textarea so the click will be in the correct place.

Lastly, do not override bringPointIntoView, which allows
moving the insertion handler beyond the edge of a field to
scroll it.  Instead, override requestRectangleOnScreen to
do nothing, since my actual goal is to prevent the TextView
from changing the scroll of the WebView, which is done by
webkit.

Requires a change to external/webkit.

Change-Id: Ib91907599b792287c373d3678cb04e0cb5e34471
2011-01-21 15:42:03 -05:00
Ishibashi Takako
2f0f44212f JPtextinput: Dont break emoji characters when cutting strings.
In the LengthFilter make sure that we do not cut the
string so a last emoji character gets broken and replaced
by some garbage character.

We need to check if the last char is the high surrogate and
if so drop the high surrogate also.

Change-Id: I210e7e41aa0761ecbb2b32e3ebf680a04382c287
2011-01-10 08:23:15 +01:00
Jesse Wilson
07481ccd1d Deprecate a method that formats only IPv4 addresses.
Anyone calling this method is probably storing IP addresses
in an int, which doesn't make sense anymore.

Change-Id: Iba535b66f6cff47ce07b5ecc6427e3b2fd846998
2011-01-06 19:33:00 -08:00
Gilles Debunne
d434d2334d MaxLines is respected in TextViews, even when ellipsize is set to end.
Bug 3322607

Re-applying the revert that fixed the ANR (https://android-git.corp.google.com/g/#change,87129),
whith an updated here value that seems to fix the problem.

This layout code is pretty involved, with destabilizing variable names and
uses. Althought I tested it, this fix is not 100% garanteed.

Change-Id: I1f4b09b329fb8a328ae8ab26ae472e343453beda
2011-01-04 18:05:53 -08:00
Dianne Hackborn
87121accdb Some new API cleanup.
- Tweak Fragment docs to match new sample code.
- Make some new attributes public.
- Hide all of the XmlAdapter stuff, since it is not actually being used.

Change-Id: Iae2062f91d1ca0c6b1d656ae948417d3d048482f
2011-01-04 17:42:01 -08:00
Gilles Debunne
4cf435df2e Revert "Fix for ellipsized text that has two lines at maximum."
This reverts commit 32ea4ffdca.

This change introduces an ANR in AutoComplete text view. There is
an infinite loop when the suggestion TextView is measured.

Reverted to fix the ANR, opening a new bug for the ellipsize.

Bug 3315813, 3320375, 3318059

Change-Id: I1872116ca1f39324ed4500d338bafac7e0d195ec
2011-01-04 15:37:41 -08:00
Gilles Debunne
75b7a931bc Removed simple compilation warnings.
Change-Id: I471b8895db4321d49e324e7137a1f5cee08ff5d4
2011-01-04 13:36:17 -08:00
Ken Wakasa
82d731ac5d Add TYPE_NUMBER_VARIATION_PASSWORD for entering a numeric password.
Also, bug fix in EditoInfo.makeCompatible().

bug: 3296883
Change-Id: Icc663b375cffbe1f4506d1758d624a1acca3576b
2010-12-25 01:22:53 +09:00
Gilles Debunne
9a99244a95 Merge "Fix for ellipsized text that has two lines at maximum." 2010-12-23 11:20:48 -08:00
Jeff Brown
0099863155 Merge "Add support for forward delete key." 2010-12-21 18:12:33 -08:00
Jeff Brown
14d0ca1473 Add support for forward delete key.
Change-Id: Ib356abddd92db12d6b33e19234136c0d167f0e15
2010-12-21 18:04:26 -08:00
Jeff Brown
67b6ab72ae Add TextView support for Home, End, PageUp, PageDown.
Change-Id: If8aa2a63b5fc33528d54eef68e695082a129acce
2010-12-21 18:03:08 -08:00
Gilles Debunne
32ea4ffdca Fix for ellipsized text that has two lines at maximum.
The breakOnlyAtSpaces test did not include the reset at the end of the loop
which resets j and w (current position and width). As a result, the second line
was too long from the start and never cut again.

Hours a debug, a simple { change.

Bug 2969667

Change-Id: I1e5b4a37cd9e64d115e6343d7788db3a6ef881e0
2010-12-21 11:28:34 -08:00
Jeff Brown
52715a7c10 Fix a regression in clearMetaKeyState.
Bug: 3267519
Change-Id: Ibbc7d4e38ef3208b9ece09566e44e8421866ab95
2010-12-08 18:29:08 -08:00
Svetoslav Ganov
50f34d14f6 Adding DatePciker widget based on the Calednar team code. Updated DatePciker and DatePickerDialog as the second part of the Time/Date pciker refresh feature.
Change-Id: Id32c614bcd799463ca33bf08fb7d5cf44f8326a6
2010-12-07 13:34:23 -08:00
Gilles Debunne
0bb000931b Fix in vertical measurement in text lines with different text sizes
The last span of the TextLine was defining the FontMetrics, instead of
min/maxing the different values.

Bug 3220698

Change-Id: I7394b1699a15aeee4cc38462d561faf329d3e1f6
2010-12-02 16:18:54 -08:00