- Add helper class for the Ui tests. It creates basic test environment.
It is intermediate layer between UiBot/DocumentsProviderHelper and UiTest classes.
- Refactor SearchView tests
- Add renaming support in the test DocumentsProvider
- Add renaming tests
Bug=26799799
Change-Id: I2849913a1addabff0087bb06b80f36de7cb144f3
- Remove whitespace from the GridModel, which isn't set up to deal with
it.
- Use absolute column bounds whenever translating the band rectangle
into column indices. This necessitates additional binary searching,
but is necessary when columns aren't fully populated, which happens
with the new grid layout.
BUG=26512327
Change-Id: I5016d5de8f00c366f575f0722739007ac1612923
- 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
Refactor Jobs to work with files from multiple providers.
Don't shut down threadpool until service#onDestroy is called.
Bug: 26696797, 26462789, 26567205, 25162803, 26714663
Change-Id: Id43e8e3dc2294cd07dcd6a3477b19efb298c260f
Swith to using a regular service.
Perform file ops on thread pool.
Separate Job tests from service test.
Check in service test that wake lock is released and service shut down.
Increase copy buffer size to 32k (suggested by mtomasz).
Rework Copy testing to use an out-of-process provider (which has caused a content validation problem).
Move copy testing logic into base test and share it with Move testing.
Change-Id: I2f97d6c9f23c205b0f39ca6ba93bec119d63c80b
- Move SearchManager out of BaseActivity.
- Refactor usage of onCurrentDirectoryChanged(int anim).
- Cancel search when directory changes.
- Enable testing for cancelling search when directory changes.
- Avoid recreating action bar when only the content of the directory is
changed.
BUG=26495573
Change-Id: I1400090fcb529ad3905018d1640fdb7416542989
This is necessary to prevent UI thrash (items continually shuffling
around) when the underlying Provider doesn't return its contents in a
stable order from one load event to another (DownloadStorageProvider is
an example).
BUG=26417297
Change-Id: Ie99e56b610f5d01d5318be07c0379b506c828735
The shift-selection code was failing to correctly anchor the selection
prior to shifting focus. This meant that the first shift-navigation
event (i.e. starting from non-selection mode) would not select the right
set of stuff.
BUG=26459949
Change-Id: I62ed959fb549198c503cfd2131d2499f9a61f7e5
The divider is extraneous when a directory contains only subdirs, or
only files. The "only dirs" case works (the divider is omitted) but in
the case where a directory contains only files, a divider gets inserted
at position 0, which messes up navigation. This change adds code to
avoid adding a divider when a directory contains only files.
BUG=26406821
Change-Id: I7333911baf94e34bf428a3dd18b55694a73e3a62
Make the service operation agnostic, so we can also move delete operations to it.
In a followup change we'll see about adding support for multiple concurrent
operations. We'll need to evaluate how to do this in IntentService (which
serializes requests....a major limitation).
Change-Id: I03eca9c1ecaba519af42d88edffeb0dce78bd1da
To be compatible with ContentProvider, DocumentsProvider should not
require checking for a flag before calling openTypedAssetFile.
This CL removes the flag, and makes the default implementation throw
FileNotFoundException instead.
Bug: 26222645
Change-Id: I3492f05804e39583ebb8584109c7017b3082846e
We were bouncing calls out to the adapter pulled from RecyclerView,
but the adapter is easy to write a test double for and
we can readily inject the adapter when needed at runtime.
Eliminates unnecessary indirection.
Also, protect against failure when documents can't be loaded for delete.
Change-Id: Ief6585bf2e3e4fd407d801d485a9d7cd888b8500
This fixes:
- UI to show selection which was broken in ag/838866
- Delete undo, which throws IOB exception
when undoing a a full delete of all entries.
Change-Id: Idbb43510974e130d283313602a71ac15ad10aadf
Move section break support into a separate wrapper class.
Fix issue where intermediate directory updates were briefly showing hidden files.
Add a rudimentary test for ModelBackedDocumentsAdapter.
Bug: 26293561, 26383237, 26293561, 26309025
Change-Id: I1fa489b110754d8801091b2009caebe9d2278701
Change the sort code in the Model to bucket items into two separate
categories (folders and documents) and then sort the two buckets
separately.
Add code to the adapter to insert a visual break in the UI, between
folders and documents.
Change-Id: I759fedcef829aba9ad61554326489a9e62641cc7
- 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
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