93 Commits

Author SHA1 Message Date
Jeff Sharkey
cc637d9ae5 Merge "New roots UX, async, performance, docs." into klp-dev 2013-09-28 00:27:29 +00:00
Jeff Sharkey
6efba22ce5 New roots UX, async, performance, docs.
Yet another iteration from UX on how roots should be ordered.  Since
we no longer categorize by type, remove from public API.  Updated
asset drop with new dividers.

Update public API docs to be explicit about required columns.  Hide
flags and columns that aren't required for third-party apps.

Move remainder of potentially blocking work to AsyncTasks, including
creating directories, picked root resolution, and creation of new
documents once picked.

Improve performance of layouts by removing baseline alignment and
reduce hierarchy depth.  Set alpha on ImageViews directly to avoid
offscreen rendering hit.

Limit returned recents to 45 days.  Show load in recents when still
waiting for backends.  Show empty message when no recents stacks to
create from.  Use unique key when saving recent stacks.

Bug: 10941423, 10819454, 10964412, 10960718
Change-Id: I08cf589dcda7e203acf67928f4d30322ae36ee94
2013-09-27 17:13:13 -07:00
Jeff Sharkey
10d655927c Merge "Make directories always enabled, for realz." into klp-dev 2013-09-27 02:55:05 +00:00
Jeff Sharkey
3d52dc9c3a Make directories always enabled, for realz.
Bug: 10946731
Change-Id: I3eb132c53e47f31d1d1723ed2262823b54b1fce0
2013-09-26 19:42:52 -07:00
Jeff Sharkey
8c6c04197e Merge "Tighten flags enforcement, API to test Uris." into klp-dev 2013-09-26 20:33:29 +00:00
Jeff Sharkey
ee2f7df9ee Tighten flags enforcement, API to test Uris.
Check and throw if callers request invalid grant flags.  Add API to
test if a Uri is backend by a DocumentsProvider.

Bug: 10919391, 10935608
Change-Id: Ifa6afefb95983558c8c64dc15ddf650e9fe07080
2013-09-26 13:14:45 -07:00
Jeff Sharkey
bb77d99c25 Merge "Directories are always enabled; update assets." into klp-dev 2013-09-26 17:58:41 +00:00
Jeff Sharkey
2a030b05a9 Directories are always enabled; update assets.
Fix bug where item enabled state depended on FLAG_SUPPORTS_WRITE;
directories are now always enabled.  Also unifies enabled testing.

Bug: 10903210, 10946731
Change-Id: I241533d273dfe4a2146bb322a8bd93066bf4ef55
2013-09-26 10:54:19 -07:00
Baligh Uddin
1ffe09e2f1 Merge "Import translations. DO NOT MERGE" into klp-dev 2013-09-26 02:53:59 +00:00
Baligh Uddin
976df296f4 Import translations. DO NOT MERGE
Change-Id: I8d908dee86b15624d846ab335337b88b371ed5d5
Auto-generated-cl: translation import
2013-09-25 17:19:25 -07:00
Jeff Sharkey
e66c1778f8 Require that persistable Uri permissions be taken.
Change our Intent flag to indicate that a Uri permission grant is
persistable, but don't actually persist it until explicitly taken by
the receiving app.  This prevents apps from spamming each other if
persisted permissions aren't really required.

Remember the last time a persisted grant was taken by an app, and
use this to prune away the oldest grants when the number of grants
grows too large.  Allow apps to query persisted grants they are
holding, and allow them to release previously persisted grants. Add
public UriPermission class to return grant details and timestamp.

Track various permission strengths separately, and combine together
after each mutation pass.  Persistable grants are currently treated
like global grants, but they could be moved to have owners in the
future.  Require that grant holders trying to extend a persistable
permission actually hold a persistable permission themselves.

Bug: 10835779
Change-Id: I95b2f797c04ce7fd2612f9a644685dbd44e03759
2013-09-25 15:16:41 -07:00
Jeff Sharkey
6a20e57411 Handle null stacks gracefully.
Bug: 10928395
Change-Id: Ie7c3f7e0eb068ece0cf678a5d6346f18a413856b
2013-09-25 14:39:14 -07:00
Baligh Uddin
86d7136377 Import translations. DO NOT MERGE
Change-Id: Ifaa3920e5a0d002b7bdb9eb668acf5cbc36729fc
Auto-generated-cl: translation import
2013-09-25 09:07:42 -07:00
Michael Wright
870cb43585 Merge "Mirror DocumentsUI assets for RTL layouts" into klp-dev 2013-09-24 22:39:07 +00:00
Jeff Sharkey
deffadeb74 Freshen restored stacks, more UX bug fixes.
When restoring a persisted stack, such as last location or a location
where save occurred, freshen the DocumentStack to get the latest
details from backend, and ensure the path is still valid.

Filter Recent directories in create mode based on roots allowed by
incoming request.

Remember when user last picked an external app, and open drawer next
time user launches for GET_CONTENT.

Fix state list drawable ordering, and avoid clobbering Drawable
callback when wrapping in InsetDrawable; tricksy hobbitses!

Make grid items smaller to always fit two columns on phones.  Draw
grid items all the way to screen edge; don't clip to padding.  Better
error message when folder creation failed.  Show Recents in grid mode
when picking any visual content, not just images.

Bug: 10846100, 10903211, 10898993, 10892808, 10892058, 10892009, 10885012
Change-Id: Ia0f88d911abc6ea03645d6fd3e04271c21d5936a
2013-09-24 12:57:47 -07:00
Michael Wright
56d2030a35 Mirror DocumentsUI assets for RTL layouts
Bug: 10641916
Change-Id: I037adeb5ec7df6e3812be8653929a55ed8b87323
2013-09-24 12:50:00 -07:00
Jeff Sharkey
b180a65d41 Allow saving to Downloads.
Uses new column to mark writability.  Also filter file selection in
create mode to only allow writable files.

Bug: 10667164, 10893268
Change-Id: I90f74efbb7ac634fbdb3cc02a904a96a434d3605
2013-09-23 14:23:45 -07:00
Jeff Sharkey
1feeddf518 Latest UX asset drop, grid padding.
Bring in latest asset drop.  Apply grid padding programmatically
instead of waiting for asset.  Remove alpha from directory animation.

Update save footer background to match spec.

Bug: 10700025
Change-Id: I8eef08f36d04767b78e91b23f72bdbebfbb02f58
2013-09-21 15:26:37 -07:00
Jeff Sharkey
5545f56f75 Create unique files, root ordering, UI bugs.
When a file already exists on disk, try adding a counter suffix to
make a unique name.  Move services near top of roots list, just below
recents.  Remove "Documents" root.

Increase number of recents allowed from single provider, and add more
logging to diagnose wedged loaders.

When launching GET_CONTENT apps, wait for successful result before
relaying result; canceled requests now return to DocumentsUI.

Add CloseGuard to ContentProviderClients, since leaked instances can
keep the remote process alive.

Fix UI bug around trailing breadcrumbs.  Fix bug that dropped Recents
from roots list.  Add up action to Settings activity.  Give our
activity a default icon while waiting for async roots to load.

Bug: 10818683, 10819461, 10819461, 10819196, 10860199
Change-Id: I7b9e26b1cf8353dd3175458b23da2b4bda6c5831
2013-09-21 14:07:16 -07:00
Jeff Sharkey
a9ce049db8 Load RootInfo in background, invalidation.
Move all RootInfo queries to background threads to avoid janking
the UI.  Update passes happen on spawed task, which swaps out updated
cache results when finished.  Support partial updates when only a
single package/authority has changed.  Watch for change notifications
for roots, since flags can change over time.

Ignore stopped packages when in background, but query them for roots
when launching any picker UI.

Optimize management launches by treating as one-shot requests that
don't need to wait for all RootInfo.

Bug: 10600454, 10745490
Change-Id: Ibc7b15688ef6b41bd7e9dd0d7564b501e60e49a9
2013-09-19 19:53:32 -07:00
Jeff Sharkey
f8abf2e387 Also catch one more tablet layout NPE.
Bug: 10837208
Change-Id: I178110431221773658403319b2be7aff22adadc8
2013-09-19 11:25:56 -07:00
Jeff Sharkey
0aaeaab0bf Fix tablet layout and resources.
Bug: 10837208
Change-Id: I563a3b66976b5b02cdb25e077bf0709bb6e66926
2013-09-19 11:19:39 -07:00
Jeff Sharkey
563ee0fbe9 Latest UX asset drop.
Darker action bar overflow icon, larger grid-mode directory icon,
icon for music albums, generic file icon.

Fix bug that allowed null MIME types to be picked.

Bug: 10700025
Change-Id: I2089678eaf793bc3c7214b21c9de5f38429ebb0f
2013-09-18 18:03:49 -07:00
Jeff Sharkey
e20a3acdc2 Save directory state and animate.
Save scroll position and restore when rotating or going up the
directory stack.  Also show directory animations when navigating
the directory stack.

Bug: 10417201
Change-Id: Ia2c508debc2bffffe6306eb9078afefef259dfe2
2013-09-18 17:12:25 -07:00
Baligh Uddin
ad178f5509 Import translations. DO NOT MERGE
Change-Id: I6066e1589c84a842887ac37b737d6852a2ff99a7
Auto-generated-cl: translation import
2013-09-16 09:44:32 -07:00
Baligh Uddin
2a19a5bd50 Import translations. DO NOT MERGE
Change-Id: I45033c9b90cdbf35e1feec31b91df21a27eaaf06
Auto-generated-cl: translation import
2013-09-13 21:45:23 -07:00
Jeff Sharkey
f6db154975 More UX updates around picking images.
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
2013-09-13 16:02:14 -07:00
Jeff Sharkey
3e1189b359 Move search to roots; Documents root; hide empty.
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
2013-09-13 11:35:04 -07:00
Jeff Sharkey
88f322c311 DocumentsUI tablet support.
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
2013-09-12 16:39:50 -07:00
Baligh Uddin
c57bd8b996 Merge "Import translations. DO NOT MERGE" into klp-dev 2013-09-12 02:45:52 +00:00
Baligh Uddin
caaf6979f3 Import translations. DO NOT MERGE
Change-Id: I00a9521d0ac1e2463268295d1ea09f2894b1618c
Auto-generated-cl: translation import
2013-09-11 11:15:47 -07:00
Jeff Sharkey
aca405cd59 Fix SDK build.
Change-Id: Ib12748478cb1b42621454ab2035fb8f3163b6ac8
2013-09-11 09:14:16 -07:00
Jeff Sharkey
ed903213e6 More tweaks to match UX spec.
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
2013-09-10 20:04:11 -07:00
Jeff Sharkey
4ec973925f More UX work for thumbnails, search, management.
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
2013-09-10 16:40:36 -07:00
Baligh Uddin
5f5e84770b Merge "Import translations. DO NOT MERGE" into klp-dev 2013-09-10 05:00:52 +00:00
Jeff Sharkey
b7757a6b32 Rename offer() to add(), remove/hide some APIs.
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
2013-09-09 17:55:10 -07:00
Jeff Sharkey
fb3445c9b3 Sort order is sticky for session, back leaves.
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
2013-09-09 17:35:48 -07: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
Baligh Uddin
903747a347 Import translations. DO NOT MERGE
Change-Id: I8825a1c9aa0d9d85efa50e9ce2849a0e1ee287da
Auto-generated-cl: translation import
2013-09-09 09:39:13 -07:00
Jeff Sharkey
d182bb641f Remember mode and sort on per-directory basis.
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
2013-09-09 09:16:09 -07:00
Jeff Sharkey
28c05ee893 Item layout tweaking, hook up more assets.
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
2013-09-06 13:57:57 -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
Jeff Sharkey
a61dc8e03e Separate root and document management.
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
2013-09-06 08:08:18 -07:00
Baligh Uddin
ca5d413eb9 Merge "Import translations. DO NOT MERGE" into klp-dev 2013-09-05 23:28:26 +00:00
Jeff Sharkey
5d7acbd8be Merge "Filter roots based on supported MIME types." into klp-dev 2013-09-05 21:19:39 +00:00
Jeff Sharkey
923396b772 Filter roots based on supported MIME types.
Using flags to indicate supported types isn't very extensible, so
use newline-separated MIME types instead.

Bug: 10514613
Change-Id: I45641fc20b423b2a0bb2df7457c274f42aa6861a
2013-09-05 13:58:04 -07:00
Baligh Uddin
1eb0aa4b73 Import translations. DO NOT MERGE
Change-Id: I24ceb7ffe39244cb12c97067c3292b460b4a2c8f
Auto-generated-cl: translation import
2013-09-05 09:10:12 -07:00
Jeff Sharkey
7f95595fe7 Merge "Asset drop, icons for common MIME types." into klp-dev 2013-09-05 03:04:18 +00:00
Jeff Sharkey
b145ac127a Merge "Fix document management permission enforcement." into klp-dev 2013-09-05 03:04:09 +00:00
Jeff Sharkey
0b14db3cf5 Asset drop, icons for common MIME types.
Bring in latest assets from UX. Map common MIME types to specific
icons.

Bug: 10510022
Change-Id: I01ea8749ca5515a04efcbc15eb0c8cbb43e5e7ad
2013-09-04 18:46:56 -07:00