summaryrefslogtreecommitdiffstats
path: root/packages/DocumentsUI
Commit message (Collapse)AuthorAgeFilesLines
* More UX updates around picking images.Jeff Sharkey2013-09-139-42/+109
| | | | | | | | | | | | | | | | When picking images or videos, hide the titles in recents, since the thumbnails should speak for themselves. Also respect new flag that allows a directory to request their titles be hidden. Show directory icon hint in grid mode when showing a thumbnail, to remind user it's a directory. Filter directories out of recents. Hide most action bar icons on phones, even when room. Only show drawer on first launch. Hide most drawer headers to match spec. Bug: 10710331 Change-Id: I0ef1973ddd62750f57345336388366eda1449720
* Move search to roots; Documents root; hide empty.Jeff Sharkey2013-09-136-16/+41
| | | | | | | | | | | | | Documents searches now happen root-wide, instead of only under a subdirectory. Updates abstract class and flags to match. Add flag for a root to indicate it's empty, and hide empty roots in UI unless creating. Define "Documents" public directory and storage backend to contain files. Bug: 10712057, 10710865, 10710758 Change-Id: I8716367568969f9cb1d83927b2bf5a7013809350
* DocumentsUI tablet support.Jeff Sharkey2013-09-1215-91/+449
| | | | | | | | | | | | | | Shows as a faux dialog on larger tablets, since the normal dialog themes from framework don't support action bars. Instead, this hacks itself to look like a dialog with an InsetDrawable. Detects touches in dim area to dismiss dialog. Show all action bar icons on tablets, and roots panel is always visible with a different shadow. Show settings in dialog. Allow mode switches in recents. Bug: 10329832 Change-Id: Id02982ce7b0d4694962d32f8d5286fdfcc207208
* Merge "Import translations. DO NOT MERGE" into klp-devBaligh Uddin2013-09-1259-264/+118
|\
| * Import translations. DO NOT MERGEBaligh Uddin2013-09-1159-264/+118
| | | | | | | | | | Change-Id: I00a9521d0ac1e2463268295d1ea09f2894b1618c Auto-generated-cl: translation import
* | Fix SDK build.Jeff Sharkey2013-09-111-8/+0
|/ | | | Change-Id: Ib12748478cb1b42621454ab2035fb8f3163b6ac8
* More tweaks to match UX spec.Jeff Sharkey2013-09-1014-66/+162
| | | | | | | | | | | Fixed text colors to match spec. Behold The Greyening! Centered loader spinner in grid mode. Show multiple lines in status messages. Add string descriptions. Fix bug where toggling size setting didn't kick a UI rebind. Bug: 10510022 Change-Id: Icb41ebeb4de0fed8c04fc6cf5213af1587b72641
* More UX work for thumbnails, search, management.Jeff Sharkey2013-09-1013-61/+241
| | | | | | | | | | | | | | | | | | | | | | | Hide non-finished downloads from normal picker UI, but keep them around in management mode. Uses a Uri query parameter and a hidden API on DocumentsProvider. Scale thumbnails to fit viewport, always show MIME icon while waiting on thumbnails, and crossfade between them. Cancel thumbnail tasks when views are recycled. Filter directories out of search results for now. Also leave sort ordering from backend intact, since it's custom ranking. Fix SearchView interaction to dismiss properly and restore across orientation and drawer state changes. Hide most actions when drawer is open. Invalidate RootInfo cache when locale changes. Apply sort ordering when showing recent create directories. Hide recent summary string when icon is enough for user to disambiguate. Bug: 10667184, 10665663 Change-Id: I331d3272a08c497f88dc659d9e112231cb35aa69
* Merge "Import translations. DO NOT MERGE" into klp-devBaligh Uddin2013-09-104-4/+4
|\
| * Import translations. DO NOT MERGEBaligh Uddin2013-09-094-4/+4
| | | | | | | | | | Change-Id: I8825a1c9aa0d9d85efa50e9ce2849a0e1ee287da Auto-generated-cl: translation import
* | Rename offer() to add(), remove/hide some APIs.Jeff Sharkey2013-09-091-1/+0
| | | | | | | | | | | | | | | | | | Change MatrixCursor offer() to add() based on review feedback. Remove some now-unused XML metadata. Hide document creation, since it's not supported in initial version. Bug: 10577809, 10461706, 10678563 Change-Id: I7b3f4c6899c28f633471ef816bee22bf032aa0d2
* | Sort order is sticky for session, back leaves.Jeff Sharkey2013-09-093-68/+86
| | | | | | | | | | | | | | | | | | | | | | | | | | | | Instead of persisting sort order per-directory, the order is now sticky for that session. Any user selected sort order takes precedence over an ordering hinted by a backend. When a restored DocumentStack is untouched, the back key now leaves the dialog, instead of popping from the restored stack. Persist list/grid mode changes async. Bug: 10659604, 10672973 Change-Id: I9f022a081c014537447c9c2af10e19d8cd9566aa
* | Disabled states, more UX work, bug fixes.Jeff Sharkey2013-09-095-45/+132
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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
* | Remember mode and sort on per-directory basis.Jeff Sharkey2013-09-0913-278/+682
|/ | | | | | | | | | | | | | | | | Persist the last user-selected list/grid mode and sort order for each directory. Remembered user choice always overrides provider hinting. Filter out recent documents that don't match requested MIME type, and show recents in grid mode when picking images. Hide mode and sort order in recents. Add hinting flag for backend to indicate a directory would like to be sorted by last modified. Include explicit root in DocumentStack and clearly mark derived fields. Bug: 10392047, 10608506 Change-Id: I2dd3a0e4112852ebf87e7dbb08b3781c86587dcf
* Item layout tweaking, hook up more assets.Jeff Sharkey2013-09-0614-139/+231
| | | | | | | | | | | Update layouts for items in both list and grid mode to reflect latest UX. Use new card background in grid mode, and apply gradient treatment over thumbnails. Visibly mark currently selected root. Bug: 10510022 Change-Id: I36b290d7082b5cdfd7b3167df7d976032bc01bd6
* Another asset drop, provider icons, tests.Jeff Sharkey2013-09-06214-33/+192
| | | | | | | | | 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
* Separate root and document management.Jeff Sharkey2013-09-063-17/+23
| | | | | | | | | Two hidden intents for managing roots and documents, used to support Downloads UI. Touching an item tries launching as MANAGE_DOCUMENT first before falling back to VIEW. Provide MIME type for roots. Bug: 10446265, 10531347, 10599641 Change-Id: Ia5584bd6ce3e5a9b0048e8caf1447e3053664413
* Merge "Import translations. DO NOT MERGE" into klp-devBaligh Uddin2013-09-0558-116/+58
|\
| * Import translations. DO NOT MERGEBaligh Uddin2013-09-0558-116/+58
| | | | | | | | | | Change-Id: I24ceb7ffe39244cb12c97067c3292b460b4a2c8f Auto-generated-cl: translation import
* | Merge "Filter roots based on supported MIME types." into klp-devJeff Sharkey2013-09-053-48/+30
|\ \ | |/ |/|
| * Filter roots based on supported MIME types.Jeff Sharkey2013-09-053-48/+30
| | | | | | | | | | | | | | | | Using flags to indicate supported types isn't very extensible, so use newline-separated MIME types instead. Bug: 10514613 Change-Id: I45641fc20b423b2a0bb2df7457c274f42aa6861a
* | Merge "Asset drop, icons for common MIME types." into klp-devJeff Sharkey2013-09-05140-51/+254
|\ \ | |/
| * Asset drop, icons for common MIME types.Jeff Sharkey2013-09-04140-51/+254
| | | | | | | | | | | | | | | | Bring in latest assets from UX. Map common MIME types to specific icons. Bug: 10510022 Change-Id: I01ea8749ca5515a04efcbc15eb0c8cbb43e5e7ad
* | Merge "Fix document management permission enforcement." into klp-devJeff Sharkey2013-09-052-21/+57
|\ \ | |/
| * Fix document management permission enforcement.Jeff Sharkey2013-09-042-21/+57
| | | | | | | | | | | | | | | | | | | | | | | | | | | | Allow both explicit holders of the MANAGE_DOCUMENTS permission and those holding Uri grants to perform management tasks. Extend grants for newly created documents when caller doesn't have permission. Revoke grants when deleting documents. Test now writes actual content into picked file. Workaround updated flags for Drive app. Bug: 10623211 Change-Id: Ia8e90b33e0fac8294b2cacb96d083c43fdf75aab
* | Merge "Import translations. DO NOT MERGE" into klp-devBaligh Uddin2013-09-0459-0/+118
|\ \ | |/ |/|
| * Import translations. DO NOT MERGEBaligh Uddin2013-09-0359-0/+118
| | | | | | | | | | Change-Id: I17ec3c595dbf7291f781fa73ce5772d2a647ae91 Auto-generated-cl: translation import
* | Show loading, error, and info messages as footers.Jeff Sharkey2013-09-037-5/+259
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | A provider can include extras in their Cursors to indicate that loading is ongoing, or include an error or informational message, which are now shown in footer views. Fix registration to always get change notifications. Test provider that verifies common provider behavior of holding a reference to "cloud" resources that are released by GC when the remote Cursor is closed. Also used to validate Recents behavior for slow providers. Bug: 10599268 Change-Id: I331c31058dbb80261e7d279b851197c65ac87e32
* | Updated documents UX around action bar.Jeff Sharkey2013-09-036-104/+107
|/ | | | | | | | | | | | | | | Change action bar to match current design; drawer is always available and navigation dropdown is used to interact with current traversal path in hierarchy. On first launch, show recents with drawer expanded. On subsequent launches, resume from last location with drawer closed. If last location root isn't applicable, then behave like initial launch. Move sort order into action bar submenu. Delete documents using contract. Use unstable provider when inflating DocumentInfo from Uri. Bug: 10330219, 10510851 Change-Id: I6e94637d70ebca156a6c5d50272e878156d0dd62
* Merge "Filter roots based on incoming request." into klp-devJeff Sharkey2013-09-036-30/+129
|\
| * Filter roots based on incoming request.Jeff Sharkey2013-09-026-30/+129
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | When incoming request is for local-only content, or for ACTION_CREATE, only include roots advertise those features. Filters roots based on the allowed MIME types and the supported types advertised by each root. This supports displaying Images and Audio roots only when requesting those content types. Applies the same filter when deciding which roots to query for recents. Fixes advanced filtering instead of limiting to just devices. Update sorting so that Recent always appears first. Add testing support for LOCAL_ONLY. Bug: 10597317, 10526535 Change-Id: Ic5ccf475c4fe93fd52b29388d369d7f6915c0c42
* | Merge "New recents behavior to match spec." into klp-devJeff Sharkey2013-09-039-53/+493
|\ \ | |/
| * New recents behavior to match spec.Jeff Sharkey2013-09-029-53/+493
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Updated behavior queries each documents root for recently modified documents. It uses a new variant of DirectoryLoader which limits the maximum number of parallel queries to relieve memory pressure. When first started, it waits up to 500ms for everyone to finish, then publishes whatever results are ready, and then refreshes results as each straggler finishes. New RootCursorWrapper that always blends in authority and rootId columns, which are used for binding root details from blended cursors. Bug: 10593596, 10329994 Change-Id: Icc0d4a2f1b6166edc72f78a4c88f444eeba6f2f0
* | Merge "Instance state, fix sharing, Durable objects." into klp-devJeff Sharkey2013-09-0312-197/+486
|\ \ | |/
| * Instance state, fix sharing, Durable objects.Jeff Sharkey2013-09-0112-197/+486
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Remember instance state across configuration changes, and enable rotation. This remembers current modes and in-progress traversals. Always finish action modes after launching an action. Fix sharing by always putting Uris in extras, and always wrap in a chooser. Find common MIME types when sharing multiple documents. Fix downloads launching by following directory MIME type change. Introduce "Durable" which is like Parcelable, but can be used for both byte[] storage and Parcel transport. Make both DocumentInfo and DocumentStack durable. Disable recents until new behavior is implemented. Bug: 10460236, 10446265, 10533674, 10456344, 10456702 Change-Id: I4eaf2b0b4cde611c69a1e7b5f1586f6b02019b27
* | Merge "Use Cursors directly when binding documents." into klp-devJeff Sharkey2013-09-036-190/+511
|\ \ | |/
| * Use Cursors directly when binding documents.Jeff Sharkey2013-08-316-190/+511
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Instead of creating a DocumentInfo for every list item, bind the adapter against Cursor directly. Create new SortingCursorWrapper which performs sorting at query time and keeps a O(1) mapping from sorted to unsorted positions in the underlying Cursor. Suppress extra loader passes that had been kicked off. Use unstable provider when querying to guard against broken providers. Bug: 10567506, 10510851 Change-Id: I535814da6b17c38de04a1175e0afcc78c6b966ce
* | Merge "Refactoring of DocumentsContract." into klp-devJeff Sharkey2013-09-0313-172/+235
|\ \ | |/
| * Refactoring of DocumentsContract.Jeff Sharkey2013-08-3113-172/+235
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Combines related columns and constants onto the same class so they are easier to discover. Move back to surfacing roots with columns so they are consistent with documents. Advanced roots are represented with a flag instead of distinct types. Flags to indicate supporting of well-known media types, instead of arbitrary an MIME filter. Reintroduce well-formed rootId to support recents. Always use the expanded version of "documents" in constants, methods, and argument names. Refactor DocumentProvider method names to clearly distinguish if a single item or multiple could be returned, and of which type. Add documentation to clearly define which methods have already been overridden. Bug: 10567506, 10567557 Change-Id: I981f26ab82f2b520a19aa1ce66f659de50d7fac0
* | Merge "Stronger DocumentsProvider contract." into klp-devJeff Sharkey2013-08-2914-463/+172
|\ \ | |/
| * Stronger DocumentsProvider contract.Jeff Sharkey2013-08-2814-463/+172
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Using a contract class requires that a provider implement it exactly with little help. This change introduces a DocumentsProvider abstract class that provides a client-side implementation of the contract that greatly reduces developer burden, and improves correctness. This also moves to first-class DocumentRoot objects, and moves calls with complex side effects to be ContentProvider.call() invocations, offering more granular permission control over Uri operations that shouldn't be available through Uri grants. This new design also relaxes the requirement that root information be burned into every Uri. Migrate ExternalDocumentsProvider and DocumentsUI to adopt new API. Bug: 10497206 Change-Id: I6f2b3f519bfd62a9d693223ea5628a971ce2e743
* | Import translations. DO NOT MERGEBaligh Uddin2013-08-2814-27/+133
| | | | | | | | | | Change-Id: Ic6b1048f4afaa520fea602ec4367de5e192186bd Auto-generated-cl: translation import
* | Import translations. DO NOT MERGEBaligh Uddin2013-08-2645-2970/+1485
|/ | | | | Change-Id: I7be513f3d5decec282200b01900ce480fcf291cf Auto-generated-cl: translation import
* Merge "Add CancellationSignal support to file operations." into klp-devJeff Sharkey2013-08-231-1/+0
|\
| * Add CancellationSignal support to file operations.Jeff Sharkey2013-08-231-1/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Since ContentProvider file operations can end up doing substantial network I/O before returning the file, allow clients to cancel their file requests with CancellationSignal. Ideally this would only be needed for openFile(), but ContentResolver heavily relies on openAssetFile() and openTypedAssetFile() for common cases. Also improve documentation to mention reliable ParcelFileDescriptors and encourage developers to move away from "rw" combination modes, since they restrict provider flexibility. Mention more about places where pipes or socket pairs could be returned. Improve DocumentsContract documentation. Bug: 10329944 Change-Id: I49b2825ea433eb051624c4da3b77612fe3ffc99c
* | Import translations. DO NOT MERGEBaligh Uddin2013-08-2359-0/+4645
|/ | | | | Change-Id: Ibbd7d5bc59126933bbcf0370cbdcd590f89d0ad7 Auto-generated-cl: translation import
* Request more documents when EXTRA_HAS_MORE.Jeff Sharkey2013-08-187-80/+122
| | | | | | | | | | | | | | Implement EXTRA_HAS_MORE and EXTRA_REQUEST_MORE contract with document providers. Providers can include EXTRA_HAS_MORE when additional data is available with additional cost, such as a network request. Listen to content changes based on returned cursor instead of original Uri. Include a test backend to exercise. UX still under development. Bug: 10350207 Change-Id: Iaa8954df55a1a1c0aa96eb8a4fd288e12c2fbb01
* Management actions, invalidate caches.Jeff Sharkey2013-08-1814-104/+368
| | | | | | | | | | | | | | In manage mode, touching launches a VIEW intent for the file. Also adds actions for sharing and deleting. Move roots and thumbnail caches into Application object, and flush cache when thumbnail size changes. Listen for package changes and broadcasts that should invalidate our roots cache. Pick default grid/list mode based on provider hint. Bug: 10329983, 10330210, 10378834, 10330069 Change-Id: I75afb1c58ab71bb9d55852b1059da7257a376248
* Resized thumbnails; async; extend MatrixCursor.Jeff Sharkey2013-08-172-6/+141
| | | | | | | | | | | | | | | | | When requesting thumbnails, check if their dimensions are larger than requested, and downscale to avoid memory pressure. Load them async and with LruCache. Extend MatrixCursor so that RowBuilder can offer() columns without requiring they know the projection map. This makes it easier to respond to query() calls, where the remote side controls the projection map. Use it to handle custom projections in external storage backend. Update date/time formatting to match spec. Bug: 10333418, 10331689 Change-Id: I7e947a8e8068af8a39b55e6766b3241de4f3fc16
* Documents management mode; API adjustment.Jeff Sharkey2013-08-159-56/+112
| | | | | | | | | | | | | | | Create documents manage mode to support Downloads and transient storage devices. Locks user into requested backend root, and forces file sizes on and sorting by last modified. Separate API constants for Documents versus Roots, and give concrete MIME types for roots. Treat null sizes as unknown. Documents are always enabled in list so that divider is drawn. Mark external storage file as writable. Bug: 10329983, 10332993, 10332952 Change-Id: I05f4fdf5b04041a38e1ba7fb30202a3b0c615bf6