57 Commits

Author SHA1 Message Date
Baligh Uddin
e2aea6f859 Import translations. DO NOT MERGE
Change-Id: I6630568359b173cd95d9b76743f682c6e92c7371
Auto-generated-cl: translation import
2013-10-02 12:03:19 -07:00
Jeff Sharkey
ee3e1603fd Fix animations, padding in RTL mode.
Show directory animations coming in from left-side when in RTL
language.  Also fix NinePatchDrawable to correctly mirror its padding
when auto-mirrored, and fix InsetDrawable to propagate the layout
direction to the wrapped Drawable.

Bug: 10987190, 11030793
Change-Id: I1213802a07d0c4ced93438df1e6ddf5aed3df677
2013-10-01 16:03:00 -07:00
Jeff Sharkey
7aa7601c09 Detect wedged ContentProviders, treat as ANR.
All ContentProvider calls are currently blocking, making it hard for
an app to recover when a remote provider is wedged.  This change adds
hidden support to ContentProviderClient to timeout remote calls,
treating them as ANRs.  This behavior is disabled by default.

Update DocumentsUI to use a 20 second timeout whenever interacting
with a storage provider.

Bug: 10993301, 10819461, 10852518
Change-Id: I10fa3c425c6a7225fff9cb7a0a07659028230cd3
2013-10-01 09:50:41 -07:00
Baligh Uddin
bb1abd1ce5 Import translations. DO NOT MERGE
Change-Id: Ibf90ac2ca945f9a5e803f3bbfbb5caa69b08a4ce
Auto-generated-cl: translation import
2013-09-30 10:20:46 -07:00
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
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
976df296f4 Import translations. DO NOT MERGE
Change-Id: I8d908dee86b15624d846ab335337b88b371ed5d5
Auto-generated-cl: translation import
2013-09-25 17:19:25 -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
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
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
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
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
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
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
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
Baligh Uddin
df8fe74455 Merge "Import translations. DO NOT MERGE" into klp-dev 2013-09-04 04:43:51 +00:00
Jeff Sharkey
954be02326 Show loading, error, and info messages as footers.
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
2013-09-03 17:02:47 -07:00
Jeff Sharkey
ded77187ef Updated documents UX around action bar.
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
2013-09-03 14:17:10 -07:00
Baligh Uddin
8213e34b14 Import translations. DO NOT MERGE
Change-Id: I17ec3c595dbf7291f781fa73ce5772d2a647ae91
Auto-generated-cl: translation import
2013-09-03 10:07:16 -07:00
Jeff Sharkey
c22acf6f1f Merge "Instance state, fix sharing, Durable objects." into klp-dev 2013-09-03 03:50:10 +00:00
Jeff Sharkey
b51331116e Instance state, fix sharing, Durable objects.
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
2013-09-01 18:59:38 -07:00
Baligh Uddin
62ee6fab65 Import translations. DO NOT MERGE
Change-Id: Ic6b1048f4afaa520fea602ec4367de5e192186bd
Auto-generated-cl: translation import
2013-08-28 18:05:47 -07:00
Baligh Uddin
a943688bb0 Import translations. DO NOT MERGE
Change-Id: I7be513f3d5decec282200b01900ce480fcf291cf
Auto-generated-cl: translation import
2013-08-26 09:42:10 -07:00
Baligh Uddin
20e4beea1c Import translations. DO NOT MERGE
Change-Id: Ibbd7d5bc59126933bbcf0370cbdcd590f89d0ad7
Auto-generated-cl: translation import
2013-08-23 10:08:48 -07:00
Jeff Sharkey
b448660a22 Request more documents when EXTRA_HAS_MORE.
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
2013-08-18 22:32:02 -07:00
Jeff Sharkey
4eb407a832 Management actions, invalidate caches.
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
2013-08-18 21:14:02 -07:00
Jeff Sharkey
54ca29a5b9 DocumentsUI handles GET_CONTENT; hinting, errors.
Document browser now takes over all GET_CONTENT requests that request
openable Uris. It shows both storage backends and includes other apps
that respond to GET_CONTENT. Only grants transient read permissions.

Better guarding against throwing storage backends. Send sort order
and local-only hinting to backends.

Require that OPEN/CREATE_DOC users include openable category.

Bug: 10330112, 10329976, 10340741, 10331689, 10329971
Change-Id: Ieb8768a6d71201816046f4a4c48832061a313c28
2013-08-15 14:14:48 -07:00
Jeff Sharkey
9fb567b591 Settings, replace files, sorting by size, tweaks.
Add settings to show file sizes and advanced storage devices, both
disabled by default. Add sorting by size when enabled in settings.

Always show all documents, but only allow selection when they match
MIME filter. When creating, select entire filename on focus. When
creating, treat selected documents as replacement targets using that
exact Uri unless display name is changed.

Show available bytes for device roots. Show empty text label in
empty directories. Split grid backend and details into two separate
lines. Fix path label ordering when rendering recent directories.

Change-Id: I44c62e8adb8ca7d4355510a13d1ba975196a2d29
2013-08-07 16:29:51 -07:00
Jeff Sharkey
b156f4bf8c Recents in create, uniform item layouts.
Show recent directories in a separate fragment, and save as serialized
versions of new DirectoryStack. Cleaner behavior around recents and
search, instead of treating them as pseudo-Documents.

More uniform item layouts between list and grid, including both date
and size information, and originating storage root in recents. Avoid
clashing directory loaders by assigning unique numbers. Promote
list/grid switching up into activity.

Change-Id: I9a93460b896067ca036d7e772eeabde31face2e1
2013-08-06 18:16:21 -07:00
Jeff Sharkey
66516697a2 Storage roots in fragment, sectioned.
Move storage roots into a fragment, since it's not a drawer on
tablets.  Cluster and sort roots when displaying.  SectionedListAdapter
to make clustered roots easier to manage.  Add docs for root types.

Move roots cache into separate class to make it easier to share.

Change-Id: Ia0b92eade059e816324641f600c08026c0e268c9
2013-08-06 11:38:46 -07:00
Jeff Sharkey
ef7184a1aa More recents work; filtering and sorting.
Update DirectoryFragment to render List<Document>, making it more
general purpose.  Feed it documents either from a backend Cursor or
after resolving fields from a recents Cursor.  Start in recents when
no persisted stack available.  Synthesize a root for recents.

Local directory filtering and sorting using predicates and
comparators, all performed on background thread.  Introduce
UriDerivativeLoader which handles ContentObserver updates while
producing a derivative work of a Cursor.

Split data model classes into separate files.

Change-Id: Idb88b4ee22c58c8e508328e678877f7e4c978533
2013-08-05 20:14:12 -07:00