772 Commits

Author SHA1 Message Date
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
Ben Kwa
207968345a Make grid items be square.
Introduce a new GridItem class whose onMeasure method enforces a square
aspect ratio, and use it for rendering items when in grid mode.

Change-Id: Ieda82b644d0155354ee8e4c1dacae4af7436b7aa
2015-08-20 13:16:36 -07:00
Steve McKay
58efce36cd Use type inference where possible.
Normalize use of Annotations like VisibleForTesting, Nullable and so on.
Also, fix a small issue where we were not doubling the marging on cells when calculating columns for grid view.

Change-Id: Ia02f683c2682fa8d0963d13f253a359911d27965
2015-08-20 13:10:07 -07:00
Steve McKay
4f1604088f Move Drawer management code to a facade.
Update Standalone mode to use drawer on smaller form factors.
While we're not implementing this now, we'll probably want
to switch to drawer mode when in portrait mode, even on relatively
larger devices.

Change-Id: I244cd3c6021d63cf43d0631a5397b05339a96ced
2015-08-19 10:18:26 -07:00
Steve McKay
dbec47a494 Add support for single-select mode.
This is required for some of the intent invoked modes when the
"ALLOW_MULTI_SELECT" extra is not present.

Bug: 23155138
Change-Id: Ib92512c7f1c8e906ecca98d69ff727fc865fd53e
2015-08-14 14:32:49 -07:00
Geoff Mendal
008b929a46 Import translations. DO NOT MERGE
Change-Id: I6eafa63bf01b3562d539543e701211e8097ccf19
Auto-generated-cl: translation import
2015-08-08 05:45:58 -07:00
Kyle Horimoto
617328b4a5 Merge "Add scrolling functionality to BandSelectManager." 2015-08-06 18:08:42 +00:00
Kyle Horimoto
155e5615ea Add scrolling functionality to BandSelectManager.
Now, if band select reaches the top or bottom of the view, the view scrolls in that direction. Very fast scrolls may cause some items not to be selected properly, but this will be fixed in a future CL.

BUG=20669231

Change-Id: Ie3110156c69ec620713c4929d2583c2ed5ab32df
2015-08-06 11:06:48 -07:00
Geoff Mendal
a0eab26d8c Import translations. DO NOT MERGE
Change-Id: I10981d7c3b340e4a0194be8df144a7456ba3a677
Auto-generated-cl: translation import
2015-08-05 05:22:20 -07:00
Steve McKay
6eaf3863c8 Populate quick view intent w/ file uris.
Change-Id: Ie4f15b11be1939f8b71752505caa9d74ab9f9680
2015-08-04 15:06:40 -07:00
Steve McKay
2909598322 Merge "Use an explicit intent for "Quick View"..." 2015-08-04 16:40:37 +00:00
Steve McKay
c78bcb8c7f Use an explicit intent for "Quick View"...
Define Intent.ACTION_QUICK_VIEW.

Change-Id: Iae85a2a6fe35cfd135ff1af6672d37cc6b33dce4
2015-08-04 09:36:29 -07:00
Tomasz Mikolajewski
5527f6457e Update colors of the create dir dialog in DocumentsUI.
Change-Id: I3c7d452999eb0d18c87a2e767cfc69b0cb1c4928
2015-08-04 16:41:11 +09:00
Tomasz Mikolajewski
9c5e50169c Merge "Align root icons with the action bar icon." 2015-08-04 00:09:19 +00:00
Tomasz Mikolajewski
09c6f0265e Merge "Enable a ripple on the roots list in DocumentsUI." 2015-08-04 00:08:06 +00:00
Tomasz Mikolajewski
44adb33c7b Align root icons with the action bar icon.
Change-Id: I37ac445a562aaba55496adcf7cbf1768236bf7c0
2015-08-03 19:02:04 +09:00
Tomasz Mikolajewski
2893434701 Merge "Remove some duplicated code in DocumentsUI." 2015-08-03 09:43:31 +00:00
Tomasz Mikolajewski
d89a2e44a8 Enable a ripple on the roots list in DocumentsUI.
Change-Id: I380cd66ace4ee1478e5a182545f916ac39e47d8d
2015-08-03 18:42:40 +09:00
Geoff Mendal
fc10a337d6 Import translations. DO NOT MERGE
Change-Id: I9c0cb95293f14a2fb4865c31824c4b7fee8ff8b6
Auto-generated-cl: translation import
2015-07-31 19:05:36 -07:00
Steve McKay
5353a1eb7d Start selection mode with single mouse click...
Double clicking an item opens it.
BandSelectManager tells MultiSelectManager where its selection begins
    so Shift+Click behavior can be complimentary.
BandSelectManager more actively manages selection...so it doesn't
    clear existing selection on mouse down.

Change-Id: Ibe65e793e84463d333a19f363dfb0d42c37480e3
2015-07-31 11:38:44 -07:00
Kyle Horimoto
6b0265eeea Add BandSelectManager.
BUG:20669231

Change-Id: Iea8c3866a9de020a7bebd93a967aa42d45f8e2bd
2015-07-30 10:59:53 -07:00
Tomasz Mikolajewski
eafc24a4a4 Remove some duplicated code in DocumentsUI.
Change-Id: I065baeb73d0b3e01abecb8f7957b93379ac2426f
2015-07-30 11:26:32 +09:00
Steve McKay
5542d91998 Add a TestSuite for running unittests.
Change-Id: If9777dd23d3a4cb2969e2709f98806417e412c5d
2015-07-29 14:34:57 -07:00
Steve McKay
e63dce7fbd Add SHIFT+Click selection support.
Bug: 22799741
Change-Id: Ia1221675db8c2813667bfde561c23304e4d0b31f
2015-07-29 12:07:14 -07:00
Geoff Mendal
f1dcbc9823 Import translations. DO NOT MERGE
Change-Id: If6b0135a10eaea48ab3e0343304b464d9569cd59
Auto-generated-cl: translation import
2015-07-29 05:13:45 -07:00
Steve McKay
7f8eec09f5 Merge "Make horizontal and vertical margins equal in DocumentsUI." 2015-07-28 17:18:17 +00:00
Tomasz Mikolajewski
7f9f4c4493 Make horizontal and vertical margins equal in DocumentsUI.
BUG=None

Change-Id: I78fd3191259fa1e9a420b105f2a2be8bd5f853bb
2015-07-28 15:42:01 +09:00
Tomasz Mikolajewski
f5eb9b3047 Update colors for the standalone activity of DocumentsUI.
BUG=None

Change-Id: Iaf1f9bed243654d1378f0b23c72f128dcbb291f6
2015-07-28 15:02:18 +09:00
Steve McKay
825324369a Improved files icon and activity label.
Change-Id: I7df661b88ce859f94d5f0bbd6687950140cbf39d
2015-07-27 12:03:26 -07:00
Steve McKay
b04b1648c5 Clear selection when empty space is tapped.
Change-Id: I37f3ce8ec8d6b4c69a990ad129ff37229a8d2ac2
2015-07-27 11:25:25 -07:00
Steve McKay
0ba3a14b5f Update grid layout only on recView layout changes.
Else, trying to measure the layout of recycler view would
sometime return unexpected results.

Change-Id: Ie97c1bce7e7cc59112c386b2cf77055a4aea811e
2015-07-24 11:10:40 -07:00
Steve McKay
d13f3c9742 Grid item fixups.
Use margin instead of padding (so clicks on empty space don't do unexpected things).
Make background of items white.

Change-Id: I98996c90276911535b7addad1aad4a3c9ca47156
2015-07-23 18:39:54 -07:00
Steve McKay
1dfc482cc0 Allow Files app to be enabled via overlay.
Actual changes to Andromeda overlay are in: http://ag/733602/

Change-Id: Iad5a4cb2d087d574613ba6e9c9c9c69bd8611e8c
2015-07-23 16:41:31 -07:00
Steve McKay
73610b37de Include padding in calculation of column count.
Also rename background color and don't sepcify background in grid items.

Change-Id: I4b565604156864384626e75f0bfd41c98623f90a
2015-07-23 14:47:58 -07:00
Steve McKay
3c8afe2011 Merge "Apply hirono@'s logic for disabling delete action" 2015-07-23 01:04:54 +00:00
Steve McKay
709b61de16 Pick column count based on available space.
Set background color of RecyclerView.

BUG: 22640007
BUG: 22672201
Change-Id: Ic9c65a2a25164698bc08b4620bfa0b067d620f1b
2015-07-22 17:29:10 -07:00
Steve McKay
503648ddc3 Apply hirono@'s logic for disabling delete action
...when selection contains non-deletable items.

BUG=22441292
Change-Id: I716e5c1f685c9f3d12b01b193753775094cde481
2015-07-22 12:46:15 -07:00
Steve McKay
3b409d01b9 Push equals impl into SparseBooleanArray.
Also, implement hashcode, because it is naughty to not.

Change-Id: I2042dac6840cf07027871783a7b6763578fa805d
2015-07-22 11:53:14 -07:00
Steve McKay
0ab6b0e824 Merge "Update DirectoryFragment to use RecyclerView." 2015-07-22 18:20:33 +00:00
Geoff Mendal
aa3bd27dd9 Import translations. DO NOT MERGE
Change-Id: I551ef78dd9fa8b0ac1652937f70862e6f5d8e1ba
Auto-generated-cl: translation import
2015-07-22 05:19:47 -07:00