126 Commits

Author SHA1 Message Date
Kyle Horimoto
2c80257e14 Integrate band selection into the files app.
This consists of:
1) Moving both BandSelect* classes into MultiSelectManager as nested
classes. This removes extra layers of indirection and makes code easier
to comprehend.
2) Fixing an issue where band selection could start within an item
instead of only within margins between items.
3) Adding "provisional selection" support to the Selection class. This
gives band select the ability to select some items "temporarily" such
that when the band select no longer covers those items, they are
deselected.
4) Adding glue code between the classes.

Bug: 23081429, 23083146, 20669231

Change-Id: I0dc57e2c0d2ccedb3e1218f0e496de637be227a2
2015-08-27 14:43:30 -07:00
Kyle Horimoto
164752df2a Merge "BandSelectMatrix: Create matrix tracking location of RecycleView items and band selection." 2015-08-20 21:39:12 +00:00
Kyle Horimoto
8f0c98b646 BandSelectMatrix: Create matrix tracking location of RecycleView items and band selection.
Change-Id: Ia5d1011427ba1321571d999bc2425e1443e71ca6
2015-08-20 14:37:10 -07:00
Steve McKay
58efce36cd Use type inference where possible.
Normalize use of Annotations like VisibleForTesting, Nullable and so on.
Also, fix a small issue where we were not doubling the marging on cells when calculating columns for grid view.

Change-Id: Ia02f683c2682fa8d0963d13f253a359911d27965
2015-08-20 13:10:07 -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
Steve McKay
5542d91998 Add a TestSuite for running unittests.
Change-Id: If9777dd23d3a4cb2969e2709f98806417e412c5d
2015-07-29 14:34:57 -07:00
Steve McKay
e63dce7fbd Add SHIFT+Click selection support.
Bug: 22799741
Change-Id: Ia1221675db8c2813667bfde561c23304e4d0b31f
2015-07-29 12:07:14 -07:00
Steve McKay
b04b1648c5 Clear selection when empty space is tapped.
Change-Id: I37f3ce8ec8d6b4c69a990ad129ff37229a8d2ac2
2015-07-27 11:25:25 -07:00
Steve McKay
3b409d01b9 Push equals impl into SparseBooleanArray.
Also, implement hashcode, because it is naughty to not.

Change-Id: I2042dac6840cf07027871783a7b6763578fa805d
2015-07-22 11:53:14 -07:00
Steve McKay
4b3a13c1d0 Update DirectoryFragment to use RecyclerView.
Add MultiSelectMaanger class to manager selection on a RecyclerView instance.
There are several outstanding issues that still need to be addressed
surrounding Grid mode as the GridLayout manager doesn't support
automatic column count calculation.
Also, we're missing the puddle effect on touch...
And probably other stuff. But it all *mostly* works.
Oh, also. Footers are currently commented out.
Add traditional unit tests for MultiSelectManager.

BUG: 22225617
Change-Id: I3cd26a10683f42053556d463a5d2f0d2a0bbde84
2015-07-21 17:30:32 -07:00
Ben Kwa
cf1e2f03df resolved conflicts for merge of 3aff4fc6 to master
Change-Id: Id816d859f929de3bd0328ef3a67e2bef9fadf28b
2015-06-10 18:22:10 -07:00
Ben Kwa
77797400ec Enable apps to exclude their own roots from the DocumentsUI roots list.
- Add DocumentsContract.EXTRA_EXCLUDE_SELF (boolean extra)
- Add code to DocumentsActivity to cache the providers of the calling
  app if EXTRA_EXCLUDE_SELF is set on incoming Intents.
- Add code to RootsCache to exclude roots from the calling app.
- Add code to allow only system apps to use EXTRA_PACKAGE_NAME.

Change-Id: Ia7cc2a1a297676c7b26f6e583042a4607d8c9a4e
2015-06-10 11:24:55 -07:00
Ben Kwa
0b4a3c47c6 Add a move feature to DocumentsUI.
Add a menu item (protected behind a system property) for moving files.
Add an extra to the copy intent for transfer mode (copy/move).
Add code to CopyService to delete files after copy when in move mode.
Add tests.

BUG=20559838

Change-Id: I983f57a528327d1e7a12982b599094aad2c856ed
2015-05-15 07:48:28 -07:00
Ben Kwa
c7a01cfe15 Cherry pick beefed-up error handling in the CopyService from master. DO NOT MERGE
Send copy errors to the destination provider.
Big overhaul of tests to make them simpler.
Test that errors during copying are detected and partial copies are
cleaned up.
Test that copying empty directories works properly.

Change-Id: I3fe0e73bdc92c2b6f522857ca5631f6d03d5a666
(cherry picked from commit dae8c378d6c680ae9efa8e1202d9bc92fb0dfb11)
2015-05-04 20:28:44 +00:00
Ben Kwa
dae8c378d6 Beef up error handling in the CopyService.
Send copy errors to the destination provider.
Big overhaul of tests to make them simpler.
Test that errors during copying are detected and partial copies are
cleaned up.
Test that copying empty directories works properly.

Change-Id: I3fe0e73bdc92c2b6f522857ca5631f6d03d5a666
2015-05-04 10:26:50 -07:00
Ben Kwa
448dbbbf0e Implement some tests for com.android.documentsui.CopyService.
- Add a unit test for CopyService.
- Make some changes to StubProvider to make it more configurable, for
  testing.

Change-Id: I3d726099feaf6b7a3fdd40bf2449f4ee3e848d77
2015-04-21 15:39:12 -07:00
Tomasz Mikolajewski
97397938c4 Add support for notifying about child changes in StubProvider.
Change-Id: I256856a2bbefa6d831e6b912583eca86eeb03ba7
2015-04-13 13:35:23 +09:00
Tomasz Mikolajewski
d5d5c91dfc Add support for opening files in StubProvider.
Change-Id: Ia3df58850cc3df24dc310b29035a41fb75eadeff
2015-04-13 13:03:23 +09:00
Tomasz Mikolajewski
738154ee84 Add support for removing files and directories in StubProvider.
Along the way it updates clients about changes in used storage.

Change-Id: I02fb1333e1f97f1476b87310a27b75d99fa00854
2015-04-13 11:40:04 +09:00
Tomasz Mikolajewski
30b669465d Simulate running out of space in StubProvider.
Change-Id: I0a069c07bcf8784aeb5c5993d90d0a6db6e2afb1
2015-04-13 09:37:54 +09:00
Tomasz Mikolajewski
78699be5ff Add StubProvider::isChildDocument().
Change-Id: Ib17df4307c1f658c42468f86e1f66d4469eefe58
2015-04-08 19:38:55 +09:00
Tomasz Mikolajewski
0fc8beb2df Add an initial version for a StubProvider for DocumentsUI.
It will be used for testing as well as for development.

Change-Id: I1556836e1070d9e4483d2574bba40aa2fdfde229
2015-04-08 13:14:52 +09:00
Tomasz Mikolajewski
8090ffe633 Fix broken tests in DocumentsUI.
Change-Id: Ia41eda4d9f500882ca7eb62b13a4bca60978bc33
2015-04-08 09:54:43 +09:00
Jeff Sharkey
3f4c205fd3 Disabled states, more UX work, bug fixes.
Fix drawable state to correctly show dimmed disabled state.  Update
disabled state for all children to grey out text.

Block multi-selection of documents not matching MIME filter.  Load
thumbnails in parallel.  Show thumbnails in list mode based on MIME
type to match spec.

Give each footer a unique view type to avoid recycler crashes.

Show breadcrumb icons in recent create paths.  Fix timestamp bug when
querying/updating recent paths.

Make ContentProviderClient.closeQuietly() really be quiet.

Bug: 10668364, 10510022, 10668701, 10534224, 10667726
Change-Id: I3c705412fb211519f15ad41a273a7533b878e9e5
2013-09-09 16:55:35 -07:00
Jeff Sharkey
6d97d3c1a2 Another asset drop, provider icons, tests.
Latest asset update, including provider icons which are treated as
special cases for now instead of checking into separate apps.  Add
tests for MIME type matching of roots.  Remove unused XML.

Bug: 10510022
Change-Id: Id567a9e06ba241f60ac011823e550253c6c797fb
2013-09-06 10:46:54 -07:00