* changes:
Wrap up the stable ID refactor.
Re-enable sorting in the DirectoryFragment.
Fix file deletion after the move to Model IDs.
Transition selection to use Model IDs.
Switch DirectoryFragment code to use model IDs.
- Rationalize band selection: make it internally a range selection
operation, that translates positions to IDs only when updating the
Selection.
- Clean up TODOs and comments.
- Fix selection adjustment when things are removed from the view.
Change-Id: If917eb9dd18e755c5a0ce83c84409902c4ef3d2e
- Move sorting from the back-end (using SortingCursorWrapper) to the the
front-end (in DocumentsAdapter). This makes it such that re-sorting
the directory contents doesn't necessitate a reload.
- Update DirectoryLoaders to just return unsorted results, and rely on
the UI to sort them.
- Remove the (now-unused) SortingCursorWrapper.
- Update Model tests to test sorting.
BUG=26024369
Change-Id: I871cc0e496267d381ae546e0309125d04649415a
- Add methods to the DocumentsAdatper to hide and unhide files. This
removes that burden from the Model.
- Remove clunky markForDeletion/finalizeDeletion and all related code
from the Model. Replace with a straight-up delete method.
- Modify deletion code in the DirectoryFragment. Deletion now looks
like:
- user presses delete
- DocumentsAdapter hides the deleted files
- If the user presses cancel, the DocumentsAdapter unhides the files.
- If the user doesn't cancel, Model.delete is called to delete the
files.
- Fix deletion-related Model tests.
BUG=26024369
Change-Id: I02e2131c1aff1ebcd0bdb93d374675fd157d7f51
This CL transitions the MultiSelectManager to (mostly) use Model IDs.
- Add the ability to retrieve all model IDs for the current directory,
from the model.
- Add a map in the DocumentsAdapter that maps from adapter position to
model ID.
- Make the adapter listen for model updates, and update its internal map
of positions to model IDs appropriately.
- Use the aforementioned map when binding ViewHolders.
- Get unit tests to compile; get as many tests passing as possible at
this point. Tests related to deleting things won't work right now.
Still to do:
- Add code to the adapter to sort and group items. After this is done,
SortingCursorWrapper will no longer be needed.
- Add code to the adapter to deal with item addition/removal. After
this is done, the pending-deletion code in the model can be removed.
- Rationalize position-based vs model-based selection. Some code in the
MSM (in particular, code dealing with range selection) is still
position-based. It's becoming clear that it doesn't make sense for
range selection to be ID-based, since "range" is a concept that only
makes sense in the context of items that are positioned in the UI.
Will need to iterate more on the position-based code to make sure it
makes sense.
BUG=26024369
Change-Id: I767cde2d888c101aaf83b59155b14634a236164b
A Model ID is a unique, stable identifier referring to a document.
The basic idea is to move away from doing everything using adapter
positions, and instead use model IDs.
This is the first in a line of CLs toward that goal. It does the
following:
- Introduce the concept of a Model ID, which is unique for each
document.
- Add a method to retrieve items from the Model using ID rather than
adapter position.
- Transition code in the DirectoryFragment to talk to the Model using
Model IDs rather than positions.
- Break the Model class out into a separate file of its own.
BUG=26024369
Change-Id: Ia5171f089d6b8a83855423ec05cf14dbfc7b6ba8
Don't update toolbar before first root load.
This was causing Recents > Home flicker due
to Recents being the default root returned from getCurrentRoot.
Revert change causing regression in selection highlight.
Bug: 26093756
Change-Id: I2c555aa38d68e9bf7962b1407f9fc75c800216a6
This CL simplified the logic by:
* Passing always DocumentInfo, instead Uri/DocumentInfo depending on method.
* Remove redundant logic by calling copy() recursively.
* Which also fixes efficient copy if only some of the files can be copied
efficiently.
Bug: 26176231
Change-Id: I4444077194d0bae3c149c9a012c325e068f946ed
Setting an item animator means the background color of the items needs
to be manually managed by the app code as well, otherwise recycled view
end up having the wrong background color.
BUG=26112851
Change-Id: If08f54eedf8da23abd4424159efa72f2f33def39
Also, add a label to Downloads app, and enabled drag and drop by default.
Cleanued up menu handling in BaseActivity (use switch statement).
Bug: 26033335
Change-Id: I3cef89a4a9f9e30b4e926411e94cf06bc2dc0f8d
Also, rename "ManagerRootActivity" to "DownloadsActivity"
since because...well, it is almost always Downloads
and is specialized for this case.
Bug: 25809806
Change-Id: I496d34393d269d2120c8e214413cb87df8bf171d
Minimally deform CopyService such that we can listen
to the completion of operations in the test.
Add test coverage.
Add equals and hashcode to DocumentInfo...so we can compare
the heck out of 'em. + a test.
WIP: Expose (@hide style) DocumentsProvider.isChildDocument via
DocumentsContract. Use that to check for recusive copies.
Bug: 25794511
Change-Id: I05bb329eb10b43540c6806d634e5b96a753e8178
Update FilesActivityUiTests to verify Home is present
and that clicking a root sets the title accordingly.
Guard addition of WRITABLE flag with a volume test.
Bug: 25147243
Change-Id: Ic20372737cae08a82af0aade0c0dbbd8c22d5f34
- Cleanup: rename the "open copy destination" action to "pick copy
destination", which better reflects what it does.
- Move DocumentsIntent from BaseActivity to Shared.
- Rename ACTION_BROWSE_DOCUMENT_ROOT to ACTION_BROWSE for general browsing.
- Use the new ACTION_BROWSE to open the copy destination when copy
notifications are tapped.
BUG=23137963
Change-Id: I10480b45a16ce716febac5453cb5015d26bb0062