70 Commits

Author SHA1 Message Date
Steve McKay
53f109b39e Massage code to better support Files overlay.
Also, allow "productivity_mode" config to be enabled via intent extra
    as a developement aide.

Bug: 28006206
Change-Id: I7be8d96a0e924f9ce8023347e051d28d69a0eec9
2016-04-06 10:25:02 -07:00
Felipe Leme
2ac876945b Minor tweaks on Scoped Directory Access:
- Only allow entire directory access on non-primary volumes.
- Do not display primary storage label on scoped access.

BUG: 27743842
BUG: 27676858
Change-Id: I9884fb1e2df3534fceebc5d5bef44adfb758724c
2016-03-30 16:42:10 -07:00
Felipe Leme
db892b84e5 Allow Scoped Directory Access on whole volume.
There are some scenarios where an app needs access to the whole SD Card,
not subdirectories. For example, user might have a SDCard with
directories like vacation_pictures (instead of Pictures/vacation);
another example is a file management app.

BUG: 27676858
Change-Id: I20ef713de7e4dfa7e2d7d07bab11898af186d673
2016-03-21 14:25:17 -07:00
Aga Wronska
824ac17ae3 Generate more descriptive delete confirmation message.
Change-Id: I194ef353aec9d2841b5f3fc8dfd76df6286ce969
Fixed: 27489240
2016-03-17 16:44:10 -07:00
Felipe Leme
adccb9950e Add a "Do not ask again" checkbox.
When an app request access to a scoped directory which the user already
denied access, it will display a "Do not ask again" checkbox; if the
user checks that option, further requests will be automatically
rejected.

The history of denials is stored in the shared property file.

The UI is not polished yet, the style will be fixed in a future change.

BUG: 26750152

Change-Id: I181923adfb6a1c7c1c17e305d6838314280417fc
2016-03-15 11:12:53 -07:00
Aga Wronska
91c1a434c1 Added word 'selected' to action bar description of selected elements
Bug: 27296839
Change-Id: I30d3b726f281872da298dbc481a22241fbd45a9a
2016-03-08 16:34:14 -08:00
Steve McKay
c8d4e22a72 Don't show title in delete confirmation.
Also, remove "unhide" from Adapter, since it is unused.
Had to add a custom layout because Alert didn't do a
    good job. LOTS of work for a yes/no!

Bug: 27205772
Change-Id: Ic20d73b54fd142287e07402877ac339300b4bbb7
2016-03-01 12:46:29 -08:00
Steve McKay
7a3b811122 Delete confirmation and notification improvements.
Bug: 27344527, 27347647, 27136182
Change-Id: Ia33f05b449a0bc30704e116287e18094e30382e0
2016-02-25 15:47:16 -08:00
Ben Kwa
fd53fdeed3 Update apostophes to material spec.
TLDR: use \u2019 instead of ' for apostrophes.

See
https://spec.googleplex.com/quantum/style/writing.html#writing-capitalization-punctuation.

Change-Id: Idc3bee55dc65a1ebd5bf12483fced85d36c1614f
2016-02-05 08:02:21 -08:00
Ben Kwa
1c3966a389 Merge "Tweak the query error message per UX." 2016-02-05 03:09:44 +00:00
Ben Kwa
c9b3bde667 Tweak the query error message per UX.
BUG=24949214

Change-Id: I207b55ebfff47cc561a536dc1827431545bf0030
2016-02-04 19:06:56 -08:00
Steve McKay
efa1761776 Decouple SD card from ADVANCED storage toggle.
A variety of related fixes:
- don't force size enable when browsing from device mounted notifications.
- don't show settings menu item as action (put in overflow).
- add sd card icon (not quite yet used, need to suss that out).

Bug:26880985,26883578,26771127
Change-Id: I36f153c42217f8092f157ded2a756c02525593ab
2016-02-02 09:28:30 -08:00
Tomasz Mikolajewski
748ea8cc78 Show a warning notification and a dialog in case of conversion when copying.
Change-Id: I451b0944069deb5f0b49b54c514e7761be449e3d
2016-01-28 13:12:55 +09:00
Steve McKay
0bbf302573 Merge "Remove variants of "show/hide" internal storage string." 2016-01-27 19:47:50 +00:00
Felipe Leme
b012f913cb Initial implementation of OPEN_EXTERNAL_DIRECTORY.
It opens a an alert dialog that tells user application X is requesting
access to folder Y on volume Z; if user accepts, it returns the proper
URI, otherwise it returns RESULT_CANCELED.

The requested path must satisfy the following requirements:

1.It's directory (getName()) must be one of the pre-definied folders on
  Environment.
2.It's root (getParent()) must be a valid external storage root.

In order to satisfy #2, DocumentsUI calls the ExternalStorageProvider,
through a custom call() implementation.

BUG:  23011462
Change-Id: I8e491e82ae320df88f7b8923286c4c1ad050ae80
2016-01-27 08:52:58 -08:00
Steve McKay
e3a798c559 Remove variants of "show/hide" internal storage string.
Bug: 26768708
Change-Id: I62a5068eab3104ab379bb0f22a609b9cf0b6777b
2016-01-26 17:45:35 -08:00
Tomasz Mikolajewski
af231f0a67 Remove retry logic from DocumentsUI.
Bug: 26720030
Change-Id: I041caeed7243614e20d92e1bb3308f564f6aae34
2016-01-25 17:25:20 +09:00
Steve McKay
8d4d5c1c20 Merge "Change "touch" to "tap"." 2016-01-22 23:46:17 +00:00
Steve McKay
9814a1a62e Change "touch" to "tap".
Bug: 26744850
Change-Id: I2f0f0c817ea40de4fbc6ef21e68ccbde293d3135
2016-01-22 15:44:49 -08:00
Aga Wronska
31f97bc4ee Merge "Add support for renaming documents" 2016-01-22 23:26:35 +00:00
Aga Wronska
3b327ef9f9 Add support for renaming documents
- Add rename dialog
- Add rename menu option
- Enable rename menu option only when renaming supported
- Rename files and directories
- Present error message if renaming fails

Bug: 20493815
Change-Id: Ic7386d14e3876655fb19245b9a90b4c67a4febb4
2016-01-22 13:36:40 -08:00
Steve McKay
9ed88a4da7 Show empty file cabinet for no search results.
And for empty directory.

Magic-submit? Yes please!

Change-Id: If9e1f8ab48eebd9c275ad043da728e28b850ab73
2016-01-22 11:59:16 -08:00
Steve McKay
3564543e1e Move delete support into FileOperationService.
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
2016-01-21 12:16:04 -08:00
Steve McKay
8fd086a18d Fix broken copy after recent copy related chagnes.
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
2015-12-04 14:24:48 -08:00
Steve McKay
5bbae10c4c Normalize and improve menu fiddling.
Also, don't show copy/paste menu items (though they can still be invoked via keyboard).
Show copy to /move to instead.

Change-Id: I6e7bdf35bf370ea30d4f12a5a200ad38ff0221f4
2015-10-02 09:48:27 -07:00
Steve McKay
9f9d5b432d Add support for opening multiple windows.
Installs an intermediate activity that manages tasks.

Bug: 20562850
Change-Id: If2d0a125b0630c27af07666b0f6a712f58243e9f
2015-09-25 14:46:14 -07:00
Ben Kwa
91bec536ac DocumentsUI: Add an error screen to DirectoryFragment.
- Reorganize the directory fragment.
- Repurpose the "empty" view to hold a message and a button.
- Message is set to the "No items" message if a directory is empty.
- Message is set to the error message if a query error occurs.
- Don't close DocumentsUI when a query error occurs.

Change-Id: I4e1e96f23040606b410ac746252dcb0ab9286f04
2015-09-24 15:06:14 -07:00
Ben Kwa
3b19e31e18 Replace error/info footers with a message bar.
- Remove footers from DirectoryFragment.
- Add a new MessageBar fragment that can display error/info messages.

BUG=22638983

Change-Id: I2075ae8e4dca8954a09c1fc57ed62bb6d3bff7a9
2015-09-18 13:53:41 -07:00
Ben Kwa
304895a8bf Implement undo deletion.
Add a snackbar that pops up upon deleting files, giving the user a chance to
undo the operation.  If the user takes no action, the files are deleted.

This feature basically hides the files temporarily and pops up the said
snackbar, and if the user doesn' hit "undo", the files will be actually
deleted when the snackbar times out.

BUG=23518578

Change-Id: I181395aff967e62ca9287ed6fea2c7c8b8c09a71
2015-09-02 14:07:32 -07:00
Steve McKay
825324369a Improved files icon and activity label.
Change-Id: I7df661b88ce859f94d5f0bbd6687950140cbf39d
2015-07-27 12:03:26 -07:00
Jeff Sharkey
7f9cbf94f4 am 2656fa06: am 415cc610: am 8a265146: Merge "Selected count string needs plurals." into mnc-dev
* commit '2656fa065f820873695ba7743ad0a2ff7d913567':
  Selected count string needs plurals.
2015-06-11 18:47:58 +00:00
Jeff Sharkey
f491c72e4a Selected count string needs plurals.
Bug: 21717427
Change-Id: Ie0db8ac30244b022ca5838969fb085230bfc4499
2015-06-11 09:19:37 -07:00
Jeff Sharkey
9c9661f1b7 am 51b055d3: am e1844c83: am 5fc24733: New strings!
* commit '51b055d330279f5d0a38ad1c33540189e71356e8':
  New strings!
2015-06-11 02:34:28 +00:00
Daichi Hirono
0fe674db7e Merge "DocumentUI: Plish the design of footer bottons." 2015-06-11 01:10:30 +00:00
Jeff Sharkey
5fc247338d New strings!
Bug: 21737573, 21666225, 21756698, 21737666, 21471429
Change-Id: If1c5882d48f798d311f6d2b86277d3c13f06824e
2015-06-10 16:49:11 -07:00
Steve McKay
549636b2aa Fix typo in paste warning string.
BUG=21545788
Change-Id: I6e6265104bb8759c092f247223aef6c0426d844a
2015-06-03 11:23:45 -07:00
Ben Kwa
371dee33df Merge "Fix text on move notifications and toasts." 2015-06-02 14:20:36 +00:00
Ben Kwa
05b7b15310 Fix text on move notifications and toasts.
Some of these still said "copying" instead of "moving".

BUG=21366117

Change-Id: Ib50aaa05617f4f8a88069436a954b56f7be15a44
2015-05-28 16:34:24 -07:00
Daichi Hirono
ac990ceb38 DocumentUI: Plish the design of footer bottons.
* Remove the directory name from "pick" button.
 * Allign buttons at right.
 * Fix bug that the pick button turns to be hidden after screen rotation.

BUG=20285152

Change-Id: I909d52f341bf67c5627431a354a9b0ccec152a05
2015-05-27 15:32:30 -07:00
Steve McKay
bdbd0ffdf2 Add copy/paste menus to StandaloneMode.
Execute encoding/decoding of clipboard data in background...
was seeing a lot of red flashes for large file selections.
Move the majority of the Clipboard management code into a
shared DocumentClipper class.

Hide the copy-to and move-to menus in same.

BUG=20915675
Change-Id: Iff59e846afe6f1e90e6be816f5860d8b7efe3ae1
2015-05-27 14:55:14 -07:00
Ben Kwa
cc3452136e Fix UI for file moves.
Change the destination picker to have a "MOVE" button when moving files.

BUG=20880263

Change-Id: I69686a2f13daa0f0048113e1a2ad71dd37b3de1c
2015-05-19 15:22:36 -07:00
Daichi Hirono
e9cbfe8e5a DocumentUI: Plish the design of footer bottons.
* Remove the directory name from "pick" button.
* Allign buttons at right.
* Fix bug that the pick button turns to be hidden after screen rotation.

BUG=20285152
Change-Id: I909d52f341bf67c5627431a354a9b0ccec152a05
2015-05-18 11:27:15 +09:00
Ben Kwa
ed6fcb5929 Merge "Add a move feature to DocumentsUI." 2015-05-15 16:10:30 +00: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
Steve McKay
3da8afcf30 Add rudimentary keyboard operation support.
Currently only select-all/copy/paste of files is supported.
Note, I wasn't able to push all code into DirectoryFragment,
as Jeff Sharkey suggested, as it doesn't have direct access
to KeyEvents. Bridged this from StandaloneActivity.

Change-Id: I082c457c9c4372e689d3acbca9ae11cd5c554a63
2015-05-06 15:31:19 -07:00
Tomasz Mikolajewski
eafb267bd9 Update strings for the copy error dialog to match the latest specs.
Change-Id: I9adeff3e7e9435237b4b3337e4c687eec39b0335
2015-04-23 19:10:14 +02:00
Tomasz Mikolajewski
3b5adaaca1 Merge "Add an initial version of the copy failure dialog to DocumentsUI." 2015-04-15 04:02:14 +00:00
Daichi Hirono
de021abe40 DocumentsUI: Polish buttons of copy destination dialog.
* Add cancel button to directory picker dialog.
* Turns "select" label to "copy to" label for copy destination picker.

BUG=20170953

Change-Id: I66214804aed75a6fccc716d1a01163c634e73d7f
2015-04-15 12:57:53 +09:00
Tomasz Mikolajewski
61686593fd Add an initial version of the copy failure dialog to DocumentsUI.
Change-Id: Ibdfde661aa5b636570c017d3d00565c193d595a3
2015-04-15 12:39:27 +09:00
Ben Kwa
726cf70fd4 Enable directory copying.
- Enable directory picking for copying.
- Implement recursive copying inside the CopyService.
  - Pretty up the notification (use an indeterminate notification while
    calculating copy size)
  - Do two recursive walks: one to determine the size of the copy job,
    and then another to actually copy the files.
- Switch to using ContentProviderClient instances, for better error
  detection and handling
- Disable copying from the Recents view.

Change-Id: Ieb38cca80edf84a487547b68f0d6b328fc4d7701
2015-04-10 10:28:22 -07:00