711 Commits

Author SHA1 Message Date
Steve McKay
72ae6e0444 Eliminate bad type parameterization.
Change-Id: Id886098926f3c62583f34cfbcc04953bb2f4e8c3
2015-09-23 08:42:39 -07:00
Steve McKay
c643386e28 Update RecentsCreateView to use RecyclerView.
Move common DirectoryContainerView handling to BaseActivity.

Change-Id: I2c34b23b7050b68999f16e6d7f651c94ea8e47b6
2015-09-22 15:58:15 -07:00
Ben Kwa
91caed80b1 Restore more missing DirectoryFragment functionality.
- Add a material-style horizontal progress bar to DocumentsUI.  This
  replaces the old loading footer.
- Restore the view-switching code that displayed a dedicated "empty"
  view when displaying an empty directory.
- Fix tests.

Change-Id: Ifecb867f6edecbdeb37b8607d87d9797879a589d
2015-09-22 13:24:51 -07:00
Ben Kwa
631509a60f Merge "Replace error/info footers with a message bar." 2015-09-18 20:54:56 +00: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
Vladislav Kaznacheev
ede5f5480e Handle content URI permissions on drop
Change-Id: I846071f01ecd1eff8e3a54a1806e68e1a4b335d2
2015-09-16 17:35:10 -07:00
Ben Kwa
e0fa3b4693 Merge "Adjust theming for Files mode." 2015-09-15 17:57:46 +00:00
Ben Kwa
7cc80013f3 Adjust theming for Files mode.
- Bring files mode in line with MD spec platform colors.
- Normalize selection highlight color in grid and table mode.
- Fix status bar and accent colors in portrait mode.

BUG=23797347
BUG=24012021

Change-Id: I3427939b39f3f39f5e04bd4d854166dd6b3881b1
2015-09-15 10:55:22 -07:00
Ben Kwa
5e65d1a991 Merge "Clean up unit tests." 2015-09-12 00:19:44 +00:00
Ben Kwa
ce9a87928b Clean up unit tests.
- Rework unit tests to eliminate some null checks from production code.
- Fix some flakiness in the tests resulting from a coupling between
  DirectoryFragment.Model and the application View.

Change-Id: I6b23774a5b4897f33d8641e677bda9e66d86cb96
2015-09-11 15:15:45 -07:00
Ben Kwa
874062e395 Merge "Refactor DocsUI to break out a new ManageRootActivity." 2015-09-11 21:04:00 +00:00
Ben Kwa
0f7078f004 Refactor DocsUI to break out a new ManageRootActivity.
- Split all ACTION_MANAGE-related functionality off from
  DocumentsActivity, into a new activity.
- Create new full-screen layouts for said activity.
- Fix some styling issues in {Documents,Files}Activity.

Change-Id: I0384715ad3c7d70a3a3daf510f1a09e8c5732348
2015-09-11 13:58:41 -07:00
Ben Kwa
8b4d28a3b7 Merge "Fix a crash during file deletion." 2015-09-09 21:10:29 +00:00
Ben Kwa
1f051b18eb Fix a crash during file deletion.
Fix an off-by-one error when checking deletion candidates, that was
causing item positions to be incorrectly bumped following a successful
deletion.

BUG=23823860

Change-Id: Id261ad49271fb0c1a5ff1cba88fea1451412d7f3
2015-09-09 13:49:07 -07:00
Steve McKay
b99837361c Merge "Don't start band select on empty grid." 2015-09-09 19:12:20 +00:00
Steve McKay
c3ef0d6410 Don't start band select on empty grid.
Masks an issue in band controller resulting in index out of bounds exceptions.
Eliminate the need to cast helper when constructing BandController.
Improve naming of Band related classes for clarity of purpose.
Normalize some "helper" class method names.
Rename BandSelectModelTest to match existing convention for tests on inner classes.

Bug: 23905473
Change-Id: Iaf7604fb729cf563a04dc92d78b24e2fe4812abe
2015-09-09 12:11:11 -07:00
Ben Kwa
18fce3cd3c Add unit tests for DirectoryFragment.Model.
Refactor DirectoryFragment.Model to be a static class.
Introduce some unit tests.

BUG=23754695

Change-Id: Iaa064292ab26b23ac7247e49c05ba91033d84a18
2015-09-08 09:58:35 -07:00
Geoff Mendal
16774c9816 Import translations. DO NOT MERGE
Change-Id: I88e15a674412aeb7de73e20d2af49bd5e95c747b
Auto-generated-cl: translation import
2015-09-07 06:47:51 -07:00
Steve McKay
ac1e9d62be Merge "Don't start BandselectManager in single-select mode." 2015-09-04 22:28:31 +00:00
Ben Kwa
545407f6c0 Merge "Factor and consolidate style and color names." 2015-09-04 22:01:45 +00:00
Steve McKay
a698d636c5 Don't start BandselectManager in single-select mode.
Change-Id: I3adfe578107cf88b153ad8d8b483462c29a24e28
2015-09-04 14:52:02 -07:00
Steve McKay
49f34019b6 Merge "Fix erroneous band selection start." 2015-09-04 19:05:16 +00:00
Steve McKay
635b094997 Fix erroneous band selection start.
Fix band selection to not start when crossing off of a grid item into empty space.
This CL also introduces a MotionEvent wrapper class, since MotionEvent
can't be used in tests.
Note that this CL works around several issues with b/23793622.

Bug: 23727363
Change-Id: I010a82db3363d99f2d804db2653a3a25d8cac940
2015-09-04 12:03:37 -07:00
Vladislav Kaznacheev
87fc05b85d Merge "Fix drag and drop in Files app." 2015-09-04 18:20:44 +00:00
Ben Kwa
92b547b813 Factor and consolidate style and color names.
Change-Id: I02d344a4e5528d58e57255a31fbf127402e8ea31
2015-09-04 11:06:49 -07:00
Vladislav Kaznacheev
b5999ef48a Fix drag and drop in Files app.
It got broken after the migration to Recycler view.
This patch might be not the perfect fix, but it returns
drag and drop into a working condition.

Testing requires recompile with DEBUG_ENABLE_DND=true

Bug: 22725110
Change-Id: I82cf01af68c6284878af8e46e290d117a0e505c1
2015-09-04 09:17:37 -07:00
Steve McKay
6c86b19fdc Consume event on singleTapUp.
Fixes issue with last-selected-item tap resulting in view/quickview.

Bug: 23615434
Change-Id: I94af6f6c17dd199930f9eeccbccb78648c0cb608
2015-09-02 16:06:05 -07:00
Ben Kwa
860f98467f Merge "Implement undo deletion." 2015-09-02 21:09:22 +00: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
Ying Wang
94252de384 Add android.support.v7.recyclerview resource
Change-Id: I74b8eba475205fae5a9bb51f35d70daed37cc475
2015-09-02 11:17:04 -07:00
Ben Kwa
cd0b88dc0d Merge "Fix DocumentsUI error-reporting code for handling copy errors." 2015-09-01 19:38:49 +00:00
Ben Kwa
69fc99be90 Fix DocumentsUI error-reporting code for handling copy errors.
- Correctly handle the case when opening the src file fails.

- Add logging for easier debugging.

- Add the transfer mode extra so that the failure dialog displays the
  correct message, and retries in the correct mode.

BUG=23414397

Change-Id: I3bba11ed393678d614779d9b687e7e123c4fb618
2015-09-01 12:37:07 -07:00
Steve McKay
d62fe97cdf Fix broken build.
Was broken by d017db0c6b07b178649679e7b84865c3ddb576ef.

Change-Id: Ib1fcb5a8bc7aad6b3fcc501d57f19c931912af75
2015-09-01 12:32:44 -07:00
Kyle Horimoto
d017db0c6b Band selection: Add handling for layout changes.
Previously, the app would crash druing band selection after the layout had changed.

Change-Id: I51ed2908d30e16f4d77769c798dfcef5f1ee1602
2015-08-31 16:12:13 -07:00
Ben Kwa
b7a97fc271 Merge "Refactor DirectoryFragment." 2015-08-31 22:51:11 +00:00
Ben Kwa
c64cb252ab Refactor DirectoryFragment.
Consolidate data logic in a DirectoryFragment.Model class, instead of
having it spread out between the DirectoryFragment and the DocumentsAdapter.

BUG=23518578

Change-Id: I7c2b6c7aa388f5872ac18c320b86445f3c354792
2015-08-31 15:29:23 -07:00
Ben Kwa
284e1dbf32 Merge "Switch DocumentsUI over to use AppCompat themes." 2015-08-31 18:46:07 +00:00
Ben Kwa
a747d2e223 Switch DocumentsUI over to use AppCompat themes.
Switches from Material to AppCompat themes in order to start using
Snackbar.

Also, factor the common bits out of DocumentsNonDialogTheme and
FilesTheme, and make the theme names clearer.

BUG=23518578

Change-Id: I94a00e910469c57315823ae9df33024f2c7360ee
2015-08-31 11:43:46 -07:00
Kyle Horimoto
c61b3aabdd Merge "Use SparseIntArray as performance optimization." 2015-08-27 23:09:42 +00:00
Kyle Horimoto
786babe999 Use SparseIntArray as performance optimization.
This reduces the amount of space (and auto-boxing) needed to support the grid model.

Change-Id: Iaf5e6792df519cb94b5ee9f23d15cff1d60fa67d
2015-08-27 16:05:58 -07:00
Kyle Horimoto
ea910a15c2 Fix band select UI issue.
The issue was that scrolling past the top or bottom of the view caused the band
select rectangle to grow in the wrong direction. This was caused by adjusting
the origin of the band select rectangle based on the calculated number of pixels
to scroll instead of the actual number of pixels scrolled. There can be a
discrepancy when the calculated value is higher than the maximum that can be
scrolled (when the view is already scroll almost to the top or bottom of the
view).

Bug: 23081362

Change-Id: I343cdec89260ab0571a792009d0c08585ed41199
2015-08-27 15:48:00 -07:00
Kyle Horimoto
2c80257e14 Integrate band selection into the files app.
This consists of:
1) Moving both BandSelect* classes into MultiSelectManager as nested
classes. This removes extra layers of indirection and makes code easier
to comprehend.
2) Fixing an issue where band selection could start within an item
instead of only within margins between items.
3) Adding "provisional selection" support to the Selection class. This
gives band select the ability to select some items "temporarily" such
that when the band select no longer covers those items, they are
deselected.
4) Adding glue code between the classes.

Bug: 23081429, 23083146, 20669231

Change-Id: I0dc57e2c0d2ccedb3e1218f0e496de637be227a2
2015-08-27 14:43:30 -07:00
Steve McKay
38b4c6f436 Use resource aliases in-lieu of ViewStubs.
This eliminates the double resource inflation necsesitated by the use of ViewStubs.

Change-Id: I9749356bed24f48b8304897dc6d8dc47cc11736c
2015-08-24 12:11:28 -07:00
Steve McKay
12055474a7 Show a drawer when in portrait mode.
This makes more space available for content.
Rename all the "Standalone" stuff to just "Files".
Move layout inflation into base class.
Move backbutton > drawer interaction into BaseActivity.

Change-Id: Ie778b323c6e80122389f029be148dd9e0c4bfb6e
2015-08-24 09:05:51 -07:00
Ben Kwa
b347436a3d Merge "Load appropriately sized thumbnails in grid mode." 2015-08-20 21:49:51 +00:00
Ben Kwa
147bdc9f93 Load appropriately sized thumbnails in grid mode.
Fix a bug that is causing thumbnail size to be 80px regardless of the
display mode.  This causes larger thumbnails to be used in grid mode,
resulting in better image quality.

BUG=23385406

Change-Id: Ic62ed0de1c6326a7ccd9ca31bdead15b49c481c1
2015-08-20 14:41:16 -07:00
Kyle Horimoto
164752df2a Merge "BandSelectMatrix: Create matrix tracking location of RecycleView items and band selection." 2015-08-20 21:39:12 +00:00
Kyle Horimoto
8f0c98b646 BandSelectMatrix: Create matrix tracking location of RecycleView items and band selection.
Change-Id: Ia5d1011427ba1321571d999bc2425e1443e71ca6
2015-08-20 14:37:10 -07:00
Steve McKay
3349dbd491 Merge "Use type inference where possible." 2015-08-20 21:27:34 +00:00
Ben Kwa
5fbd153466 Merge "Make grid items be square." 2015-08-20 21:00:45 +00:00