Commit Graph

3874 Commits

Author SHA1 Message Date
Romain Guy
a4b7965cc2 Merge "Replace HashMap with ArrayMap to remove unnecessary allocations" 2013-06-03 22:52:20 +00:00
Romain Guy
6876b4fb90 Replace HashMap with ArrayMap to remove unnecessary allocations
This change also fixes a race condition. If multiple UI threads are used
in a single process, RelativeLayouts could end up using the same nodes
in different windows, causing mayhem and headaches.

Change-Id: I9ba4a0bf05d44e1a1e7a82443d40c500c657cd7a
2013-06-03 15:40:52 -07:00
Romain Guy
36e337f971 Merge "Remove unnecessary lock to save 1 allocation per TextView" 2013-06-03 22:38:07 +00:00
Romain Guy
31f0544293 Remove unnecessary lock to save 1 allocation per TextView
Change-Id: I4fb885c61b44e57b8abaf3beedf61aaab3ef5d71
2013-06-03 14:19:54 -07:00
Alan Viverette
20914c6ae9 Merge "Cleaning up AbsListView, fixing annotations and updating API calls." 2013-06-01 01:37:46 +00:00
Alan Viverette
66dbeac0e9 Merge "Split AbsListView.onTouchEvent into multiple methods for readability." 2013-06-01 01:37:01 +00:00
Alan Viverette
8fa327a2fc Cleaning up AbsListView, fixing annotations and updating API calls.
Change-Id: I87ce7714d0cc9e10a1466f474b828f2a27c57e15
2013-05-31 14:53:13 -07:00
Alan Viverette
e7f30dc14d Split AbsListView.onTouchEvent into multiple methods for readability.
Change-Id: Iaa28b70f9d708857e64c3d857c65aa075ab4208a
2013-05-31 14:14:51 -07:00
Svetoslav
6a3c3b838b am 5fecbf9d: am ec586994: Merge "CalendarView header not updated on year change." into jb-mr2-dev
* commit '5fecbf9d10cd6e40204187e6a2970ed113e48350':
  CalendarView header not updated on year change.
2013-05-30 15:16:25 -07:00
Svetoslav
5fecbf9d10 am ec586994: Merge "CalendarView header not updated on year change." into jb-mr2-dev
* commit 'ec58699413ebe4cc2a72a8aae3c420fb3d764457':
  CalendarView header not updated on year change.
2013-05-30 12:50:15 -07:00
Svetoslav
a085179558 CalendarView header not updated on year change.
The calendar view was updating its header only if the focused
month changes. Removed the check whether the displayed month
changed before setting it since the setter is carefully called
only in cases when there is a change. Hence, now if the year
or the month change, we update the header. This is the safest
and least intrusive fix.

bug:9167305

Change-Id: I98200bb57580f6416abd30c6c25454d4474add64
2013-05-29 14:37:34 -07:00
John Spurlock
883ffa243d Merge "Hideybars feature confirmation toast bar." 2013-05-28 22:23:17 +00:00
Dianne Hackborn
bbf6ecc981 am 4e73e8a8: am 95b79966: am 0a40bef9: Merge "Fix CalendarView to show the month title properly."
* commit '4e73e8a817ff99a19ba9ed6fa68754007731406d':
  Fix CalendarView to show the month title properly.
2013-05-28 13:49:59 -07:00
John Spurlock
dcf4f21460 Hideybars feature confirmation toast bar.
Enhance Toast to support new standard toast bar style, similar
to the undo bar in Gmail.  Toast bars can be interactive,
and can have a single action.  Add a new toast duration to
indicate persistent toasts (no auto-hide delay).

Use the new toast bar to implement a feature hint when hiding
the navigation bar in hideybars mode.

Per UX, the feature confirmation bar can also be dismissed on
any outside touch as long as the user confirmed it using the
OK button at least once globally.

Bug: 8754108
Change-Id: Iaa85d3b4da7ada1952a562f1e31de04380f5d587
2013-05-28 13:09:23 -04:00
Dianne Hackborn
95b7996693 am 0a40bef9: Merge "Fix CalendarView to show the month title properly."
* commit '0a40bef955c937189841b6f1695e8001311758fa':
  Fix CalendarView to show the month title properly.
2013-05-26 00:02:41 -07:00
Dianne Hackborn
0a40bef955 Merge "Fix CalendarView to show the month title properly." 2013-05-26 06:58:14 +00:00
Dianne Hackborn
2e39f5c5cb Merge "New ArrayMap class." 2013-05-24 23:37:16 +00:00
Dianne Hackborn
f4bf0ae2a7 New ArrayMap class.
This is a new kind of key/value mapping that stores its data
as an array, so it doesn't need to create an extra Entry object
for every mapping placed in to it.  It is also optimized to reduce
memory overhead in other ways, by keeping the base object small,
being fairly aggressive about keeping the array data structures
small, etc.

There are some unit and performance tests dropped in to some
random places; they will need to be put somewhere else once I
decided what we are going to do with this for the next release
(for example if we make it public the unit tests should go in
to CTS).

Switch IntentResolver to using ArrayMap instead of HashMap.

Also get rid of a bunch of duplicate implementations of binarySearch,
and add an optimization to the various sparse arrays where you can
supply an explicit 0 capacity to prevent it from doing an initial
array allocation; use this new optimization in a few places where it
makes sense.

Change-Id: I01ef2764680f8ae49938e2a2ed40dc01606a056b
2013-05-24 16:36:14 -07:00
Alan Viverette
4026a797bc am 14ccf554: Merge "DO NOT MERGE. Fix number picker accessibility focus." into jb-mr2-dev
* commit '14ccf554d0168d94c35c058b057d7d1aca228c6e':
  DO NOT MERGE. Fix number picker accessibility focus.
2013-05-24 14:21:55 -07:00
Alan Viverette
14ccf554d0 Merge "DO NOT MERGE. Fix number picker accessibility focus." into jb-mr2-dev 2013-05-24 21:19:55 +00:00
Alan Viverette
dbed27e5e4 DO NOT MERGE. Fix number picker accessibility focus.
The node bounds populated by the child TextView were not consistent
with the bounds manually populated for its parent NumberPicker.

Bug: 9072003
Change-Id: Icbfa64f52cf11fd39c7243936227b8ba36280c3c
2013-05-24 10:03:24 -07:00
Alan Viverette
0e2d281083 Fix number picker accessibility focus.
The node bounds populated by the child TextView were not consistent
with the bounds manually populated for its parent NumberPicker.

Bug: 9072003
Change-Id: Icbfa64f52cf11fd39c7243936227b8ba36280c3c
2013-05-21 17:15:30 -07:00
Adam Powell
2e46b60d84 Merge "Fix out-of-screen item can take focus issue" 2013-05-21 00:23:50 +00:00
Fabrice Di Meglio
ea0735ff12 am 5d19f506: am 28df6d3d: Merge "Fix bug #8913650 spinner dropdown(android.R.layout.simple_spinner_dropdown_item) random alignment on RTL." into jb-mr2-dev
* commit '5d19f506b43e9e7e4c27ca70da1d44a58da71d75':
  Fix bug #8913650 spinner dropdown(android.R.layout.simple_spinner_dropdown_item) random alignment on RTL.
2013-05-20 15:50:48 -07:00
Fabrice Di Meglio
5d19f506b4 am 28df6d3d: Merge "Fix bug #8913650 spinner dropdown(android.R.layout.simple_spinner_dropdown_item) random alignment on RTL." into jb-mr2-dev
* commit '28df6d3d4f719d4dbdf82751db46e10ff3d044bb':
  Fix bug #8913650 spinner dropdown(android.R.layout.simple_spinner_dropdown_item) random alignment on RTL.
2013-05-20 15:49:03 -07:00
Fabrice Di Meglio
28df6d3d4f Merge "Fix bug #8913650 spinner dropdown(android.R.layout.simple_spinner_dropdown_item) random alignment on RTL." into jb-mr2-dev 2013-05-20 22:47:43 +00:00
Svetoslav Ganov
f1cfdcee27 am 5315953b: am 78a4630e: Merge "Taking into account data change for AbsListView when prefetching node infos." into jb-mr2-dev
* commit '5315953b86ee7ca29756504535e124b053286623':
  Taking into account data change for AbsListView when prefetching node infos.
2013-05-20 15:46:18 -07:00
Svetoslav Ganov
5315953b86 am 78a4630e: Merge "Taking into account data change for AbsListView when prefetching node infos." into jb-mr2-dev
* commit '78a4630edaa11846b09bdad84bac18a0441c500a':
  Taking into account data change for AbsListView when prefetching node infos.
2013-05-20 15:43:36 -07:00
Jaewan Kim
49fc4dcd4c Fix out-of-screen item can take focus issue
In case of a ListView has a item which takes more than 33% of its height
(result from getMaxScrollAmount), scroll does not move enough to show
all the item. In this case, consecutive arrow scroll moves selection
everytime while scroll may not move that much.

This fixes the issue by checking the visibility of current selection in
advance.

Bug: 8831751
Change-Id: Ic747bd5513c6734aaf1a1d08e497c1e3ef835004
2013-05-21 05:08:38 +09:00
Svetoslav Ganov
50776863a2 Taking into account data change for AbsListView when prefetching node infos.
We are prefetching accessibility node infos to minimize the number of IPC
calls when an accessibility service introspects the screen. It is however,
possible that the view we are prefetching is a child of an AbsListView whose
adapter changed its data but the AbsListView still did not perform a layout
pass to sync its children with the new adapter state. This may lead to an
exeption when trying to query for the state of a child's position. If the
data of the adapter is changed and the layout pass still not performed,
we return null for the AbsLIstView's children. When the layout pass
completes we already notify the accessibliity layer so it will be able to
refetch the children of the AbsListView.

bug:8433433

Change-Id: I56313c721aef3848b15fad50027d068ba1d291f7
2013-05-17 18:36:57 -07:00
Fabrice Di Meglio
a423f5033a Fix bug #8913650 spinner dropdown(android.R.layout.simple_spinner_dropdown_item) random alignment on RTL.
- add missing assignment for text direction (mTextDir)
- when layout direction change, update text direction (mTextDir again)

Change-Id: Id600fb0c5897a0d2ee5f9fe18a63437dc3e528d9
2013-05-15 19:24:56 -07:00
Romain Guy
398051b8ee Revert "Reduce the number of measurement passes in RelativeLayout"
This reverts commit 4cb81d6423.
2013-05-15 11:02:25 -07:00
Svetoslav
06ccc77f48 am 80127981: am c0a979ce: Merge "Fixing the accessibility text traversal in extend mode." into jb-mr2-dev
* commit '80127981f85a0be842007596830c1675a9a3665e':
  Fixing the accessibility text traversal in extend mode.
2013-05-14 11:09:35 -07:00
Svetoslav
80127981f8 am c0a979ce: Merge "Fixing the accessibility text traversal in extend mode." into jb-mr2-dev
* commit 'c0a979ce30cf9b96c0a84d0679aeeef7153a22fa':
  Fixing the accessibility text traversal in extend mode.
2013-05-14 11:07:08 -07:00
Svetoslav
c0a979ce30 Merge "Fixing the accessibility text traversal in extend mode." into jb-mr2-dev 2013-05-14 17:39:36 +00:00
Svetoslav
abad55d860 Fixing the accessibility text traversal in extend mode.
We added APIs to allow an accessibility service to extend the
selection while moving the cursor at a given granularity such
as word, character, etc. The problem is that the traversal was
extending only the end of the selection while moving forward
and the start of the selection while moving backward. This leads
to a case in which the user cannot shrink/extend the selection
because for example instead of shrinking the end of the selection
the implementation was extending the start.

Now extending the selection moves only the selection end. This is
the same behavior as text view using a keyboard.

Tests: https://googleplex-android-review.googlesource.com/#/c/307062

bug:8839844

Change-Id: Id6965b102647df909f61301fcc8ec05458dd5881
2013-05-10 20:14:40 -07:00
Romain Guy
a7bf9d363a Merge "Reduce the number of measurement passes in RelativeLayout" 2013-05-11 00:59:11 +00:00
Romain Guy
4cb81d6423 Reduce the number of measurement passes in RelativeLayout
Change-Id: I96ad8676f6344a1e0877f9dfbe782747bc0ff36d
2013-05-10 17:58:44 -07:00
Svetoslav
6f3a6a453a am 1e4c6589: am b3c2b21b: Merge "Accessibility should not query for list items when data set changed." into jb-mr2-dev
* commit '1e4c6589941e459871eed6e9d4675b05d977325c':
  Accessibility should not query for list items when data set changed.
2013-05-10 15:16:57 -07:00
Svetoslav
1e4c658994 am b3c2b21b: Merge "Accessibility should not query for list items when data set changed." into jb-mr2-dev
* commit 'b3c2b21b5ba30d82938ae2ef93d8120f5fd0cc80':
  Accessibility should not query for list items when data set changed.
2013-05-10 13:10:41 -07:00
Svetoslav
b3c2b21b5b Merge "Accessibility should not query for list items when data set changed." into jb-mr2-dev 2013-05-10 20:06:42 +00:00
Marco Nelissen
c08d4d99e2 am 1d3488cb: am 86e0b491: Merge "Add VideoView.getAudioSessionId()" into jb-mr2-dev
* commit '1d3488cba90bea114c9c5e8f0d4a008d2aa34bfd':
  Add VideoView.getAudioSessionId()
2013-05-10 12:46:36 -07:00
Marco Nelissen
1d3488cba9 am 86e0b491: Merge "Add VideoView.getAudioSessionId()" into jb-mr2-dev
* commit '86e0b491d1b50e59221420de3005184b1dee8373':
  Add VideoView.getAudioSessionId()
2013-05-10 12:44:05 -07:00
Marco Nelissen
13bfebd6b7 Add VideoView.getAudioSessionId()
This lets apps get the audio session id of the video being played, so
they can apply effects to the audio track.
b/8767565

Change-Id: Iaa39d97d0b6fb528ed04b52d579afa58444ebcfe
2013-05-09 15:50:38 -07:00
Svetoslav
5b578daac9 Accessibility should not query for list items when data set changed.
AbsListView is backed by an adapter. After the adapter data changes
the view sets a flag that its state is dirty and requests a layout.
If an accessibility service asks for the state of a list item at
this point, it may incur an error since the views and the adapter
are not in sync.

Now if an accessibility service queries for a list item when the
data set is changed and the item views are dirty, we pretend the
children do not exist. After the layout happens, we notify the
accessibility layer that the screen content changed so it can
refetch the views if desired (this notification mechanism is
already in place in AbsListView#handleDataChanged()).

bug:8433433

Change-Id: I4287a0ac2ef6bb33f1f988d5ddad973556c305ca
2013-05-08 14:23:38 -07:00
Dianne Hackborn
3aa49b6fec New UndoManager.
Basic implementation of an undo manager.  Supports
multi-level undo/redo, building on the top undo state
as edits occur, managing multiple distinct entities in
the undo state (such as embedded objects in a document),
and saving/restoring the full undo state.  Still some
work remaining on correctly dealing with dependencies
between undo states that hold multiple owners.

Also do a simple implementation of undo state in TextView
to see how things actually work.  The implementation here
is very primitive: it needs a lot more work to correctly
identify when to merge undo ops, is not trying to do
anything smart with style spans, etc.

Change-Id: Ie30f4e133351e2f569ffb48c6c44a2b19cadee27
2013-05-07 15:05:09 -07:00
Elliott Hughes
c3bc1b671e am c255800f: am 6d82f86f: Merge "Show CJK dates as all-numeric in the DatePicker."
* commit 'c255800fb0f46ea5f68d2c145605ac7dcd3a89b6':
  Show CJK dates as all-numeric in the DatePicker.
2013-05-01 14:56:59 -07:00
Elliott Hughes
c255800fb0 am 6d82f86f: Merge "Show CJK dates as all-numeric in the DatePicker."
* commit '6d82f86fa01800ee0523743366e0dc1113178fd9':
  Show CJK dates as all-numeric in the DatePicker.
2013-05-01 14:53:28 -07:00
Elliott Hughes
949e9df25b Show CJK dates as all-numeric in the DatePicker.
Before, we'd have something like 2006 4月12. After, we have 2006 4 12.
The alternative would require using custom NumberPicker.Formatter instances
for the year and day fields in these locales, and that seems significantly
more disruptive.

Bug: 8766552
Change-Id: I568578aae2f80f2acfc53cd277ef3beae6743472
2013-05-01 14:12:05 -07:00
Elliott Hughes
a5e5196bec am 76c643c9: am e3f2735f: Merge "when locale is non-Enligh, sometimes month spinner needs a number IME"
* commit '76c643c9b600ef31c22f807c2874c879a7fa5069':
  when locale is non-Enligh, sometimes month spinner needs a number IME
2013-04-30 13:23:17 -07:00