Commit Graph

10 Commits

Author SHA1 Message Date
Ben Kwa
1e2fa5e79f Implement PgUp/PgDn support. (cherry-pick DO NOT MERGE)
- Clean up our LayoutManager code.  We actually only need a single
  layout manager, since a GridLayoutManager is a LinearLayoutManager,
  and list layout is simply grid layout with one column.  Make it so.

- Use the layout manager to compute item offsets for one page's worth of
  items.  Use that to implement page up/page down.

BUG=25195770

Change-Id: I23ddd5fd38532682e7f099b44e188d8c3fec02be
(cherry picked from commit 4d4bf9a21a)
2016-02-09 18:06:11 +00:00
Ben Kwa
6792489dc4 Refactor key handling and selection.
- Pull key handling code out of the MultiSelectManager.

- Tighten up the semantics around range selection:
  - Create an API on MultiSelectManager for handling multi-select.
  - Make the range selection more opinionated (e.g. more state checks),
    to simplify the design and code.

BUG=25195767

Change-Id: I4bbe446ed3059150499db3d28e581b2e68405266
2016-02-02 10:34:19 -08:00
Ben Kwa
0436a75721 Rework selection handling for items in the DirectoryFragment.
- Remove the gesture detector from the MultiSelectManager, and
  consolidate gesture detection and event dispatch logic in
  DirectoryFragment.GestureListener.

- Route single-tap events through the DocumentHolder, so that it can
  apply view-specific logic, like making a tap on the item's icon
  select rather than activate.

- Consolidate event handling logic in the ItemEventListener.

- Add new unit tests for DocumentHandler.

BUG=24326546

Change-Id: Id15cdd11b13e4c063c1baff95aa8ee09c190d6c3
2016-01-21 12:18:01 -08:00
Steve McKay
57a93babd7 Handle shift+arrow correctly in single select mode.
Bug: 25603626
Change-Id: I2f71152b303ac218ecec59e8200acf8a716ea0ee
2015-11-11 16:48:26 +09:00
Steve McKay
f862155e34 Move DirectoryFragment and family to dirlist pkg.
Stuff was getting out of control in the main package.

Change-Id: Ia06ba96f5bbe13388d51e6ad52a9dac76af97cc0
2015-11-04 15:04:57 -08:00
Steve McKay
e4e667e022 Revert "Treat UNKNOWN tooltype events as Mouse events."
https://buganizer.corp.google.com/u/0/issues/24904588 has been fixed.

This reverts commit 260c6980ce.

Change-Id: I341513c06a7bfda364b0efd675e785ce766d5819
2015-10-22 13:59:09 -07:00
Steve McKay
260c6980ce Treat UNKNOWN tooltype events as Mouse events.
Temporary fix for CTS.
Eventually we'll need to update UiAutomator to support specific input tooltypes.

Bug: 24544391
Change-Id: Ief339d0d35c4305811928e9605b535c7ef230f7b
2015-10-12 16:24:07 -07:00
Steve McKay
635b094997 Fix erroneous band selection start.
Fix band selection to not start when crossing off of a grid item into empty space.
This CL also introduces a MotionEvent wrapper class, since MotionEvent
can't be used in tests.
Note that this CL works around several issues with b/23793622.

Bug: 23727363
Change-Id: I010a82db3363d99f2d804db2653a3a25d8cac940
2015-09-04 12:03:37 -07:00
Steve McKay
dbec47a494 Add support for single-select mode.
This is required for some of the intent invoked modes when the
"ALLOW_MULTI_SELECT" extra is not present.

Bug: 23155138
Change-Id: Ib92512c7f1c8e906ecca98d69ff727fc865fd53e
2015-08-14 14:32:49 -07:00
Steve McKay
5353a1eb7d Start selection mode with single mouse click...
Double clicking an item opens it.
BandSelectManager tells MultiSelectManager where its selection begins
    so Shift+Click behavior can be complimentary.
BandSelectManager more actively manages selection...so it doesn't
    clear existing selection on mouse down.

Change-Id: Ibe65e793e84463d333a19f363dfb0d42c37480e3
2015-07-31 11:38:44 -07:00