Commit Graph

276 Commits

Author SHA1 Message Date
Sunny Goyal
8f90dcff37 Removing wrong dead code around direction matching
Change-Id: Ic8349fcac4bfe6222b1cbf26e8cbb1810dc32298
2016-08-18 15:08:22 -07:00
Sunny Goyal
06e21a2587 Moving the state changes during drag-n-drop from startDrag to onDragStart
This will allow drag controller to optinally defer drag, based on some
threshold, by simply deferring the callback onDragStart

Change-Id: I17c06a15e2092b9797c7e57529b12a53d2acae6e
2016-08-15 10:08:16 -07:00
Winson
be9798b6a2 Fixing issue with shadow drawing over search bar.
- Adding notion of clip-against view for click shadow alignment.

Bug: 30255227
Change-Id: Id5716a3484051a55690025d61f709e3d96cbe024
2016-07-20 16:21:24 -07:00
Sunny Goyal
6178f13e2d Moving the QSB out of the cell layout to the Drag layer
This allows better edge matching for the QSB. The QSB position
is kept synchronized with the page scroll and all-apps transition.
But its not visible in spring loaded and overview mode

Change-Id: I4e6723607ea966ee672273a9ca67c792fd6b5661
2016-07-13 12:37:08 -07:00
Sunny Goyal
7c786f75d1 Allowing the first screen to expand to the screen edge
This allows the QSB to extend all the way to the edge
Change-Id: I43c6e21e44fef7fffe6fb12b7afb95549b68679f
2016-06-06 16:41:57 -07:00
Sunny Goyal
da4fe1a624 Moving the QSB to the workspace grid.
The QSB will only be resent on the first screen of the workspace
covering the full width of the first row. If will not be movable.
The first screen of the workspace will not be movable.
The searchDropTargetBar no longer contains the QSB (it can be
renamed in aseparate cl).

Refactoring all QSB related logic by moving it to a custom view
inflated only using xml.
Change-Id: Icb4fd6eb855df1af15f685961c38351bf4fd4f4a
2016-05-27 18:23:29 -07:00
Sunny Goyal
ff4ba2d995 Refactoring out grid occupancy management in a separate class
Change-Id: I37a830c0f2eb0a0dd4f5fc78fa29127cb18cb3c2
2016-05-27 09:12:26 -07:00
Sunny Goyal
6dc98b9dc0 Simplifying view cluster by using a single int flag instead of 4 booleans
Also fixing the bug where dirty flgas were never being set to false

Change-Id: Idbb16d07bef5a157502e1652bd1beb33ff39faaa
2016-05-11 15:46:45 -07:00
Tony Wickham
5b9a6e3f39 Merge "Stop animating highlighted page border in spring-loaded mode." into ub-launcher3-calgary 2016-04-07 01:24:14 +00:00
Tony Wickham
33326074b1 Stop animating highlighted page border in spring-loaded mode.
It looked weird, because the scrim cutout happens immediately
and the border flickered into place shortly after.

Bug: 27135377
Change-Id: Iff861db73c438c7dabccd6ed7c4ee38dbeb77ea1
2016-04-04 15:05:49 -07:00
Adam Cohen
f172b747c2 Fix a couple polish bugs with new folder previews
-> Don't reuse the same background object for the folder create preview
   since this can cause interruptions in the animations for previous
   creation previews.
-> When drawing the background to preview creation, don't draw the stroke
   above the icon since the icon is not yet contained by the folder.

Change-Id: Ib666dc2453df465b342c02f3bd109b553a769dcc
2016-04-01 11:50:31 -07:00
Adam Cohen
efca0279eb Switch all folder preview rendering to be programmatic (ie. no assets)
-> Refactored the preview background rendering to be much more self-contained.
   This cleans up a lot of code in the CellLayout, and keeps the logic in the
   right place.
-> We switch to software rendering for performance and compatibility reasons.
-> Removed all assets.
-> FolderIcon accept animation includes animation of the clipped region.
-> 1:1 hand-off of drawing of the FolderIcon background between the FolderIcon
   and the CellLayout. Unfortunately, CellLayout rendering is still required
   to work around clipping issues (due to use of software layer). We also
   need this to support folder creation feedback.

Change-Id: Ib8f7fa6359dfedff8145f38dd50ba03849ca0d51
2016-03-03 09:24:45 -08:00
Sunny Goyal
261194387b Revert "Reverting refactoring of Folder and FolderIcon to avoid dependencies breakage"
This reverts commit fc956e5a2a.

Change-Id: Ib3b5156b8fc3cad35c4634d61d5390c848ce1f93
2016-02-23 02:02:54 +00:00
Sunny Goyal
fc956e5a2a Reverting refactoring of Folder and FolderIcon to avoid dependencies breakage
Change-Id: Ifd0d717d70aff4c83c9eb5cba397d04500b2c869
2016-02-17 13:27:13 -08:00
Adam Cohen
f9c184a619 Refactor FolderIcon to separate the preview effect into it's own class
-> Created com.android.launcher3.folder package to house most folder-related files
   (aside from the FolderInfo) which is more related to the model than the UI.

Change-Id: I767063e1e4c775c01a799a3bede30cd94ac48ade
2016-02-12 17:28:31 -08:00
Sunny Goyal
8ddb390914 Merge "Making some view properties exported. These will be visible in hierarchy viewer" into ub-launcher3-calgary 2016-02-11 22:08:45 +00:00
Sunny Goyal
4ffec48dec Making some view properties exported.
These will be visible in hierarchy viewer

Change-Id: I940724a7f61d67b8502d77be203a94875bc92668
2016-02-09 11:29:34 -08:00
Tony Wickham
e0c3323656 Tweak spring-loaded workspace.
- No page indicators in spring-loaded mode
- Don’t move workspace up as high
- Scale workspace at 90% instead of 80% on phones
- Increase speed of workspace -> spring-loaded -> workspace
- Widgets were being scaled down twice when dragging from widget picker
- Don't scale up icons when dragging (scaling other stuff down is enough)
- Make scrim less dark and panels more transparent
- Thin white border around page instead of highlight when hovering

Change-Id: I963e91c20d4c0340480d165e0f3b8064783c0cb2
2016-02-08 11:37:19 -08:00
Tony Wickham
0f97b7874f Added config_springLoadWorkspace to enable/disable spring-loaded workspace.
- Added side hints back
- Only scale down icons if spring-loaded
- Only show App Info drop target if spring-loaded

Change-Id: I4b0dddccbe0e80b7ceb6b7266fc527f757744148
2015-12-04 14:56:54 -08:00
Tony Wickham
11c45f1141 Merge "Add appropriate (tiny) offset to widget drops so they land correctly." into ub-launcher3-burnaby-polish
am: 8db5d7ca60

* commit '8db5d7ca60e79f007bfce7952c15c74d0ee44bc0':
  Add appropriate (tiny) offset to widget drops so they land correctly.
2015-12-04 14:21:19 -08:00
Tony Wickham
a501d49a6a Add appropriate (tiny) offset to widget drops so they land correctly.
Also removed some unused parameters I found on the way.

Bug: 25191623
Change-Id: Ib9a30db106467c114cc8b54a5b13ed3e88162d56
2015-12-03 11:54:13 -08:00
Tony Wickham
2ef6abc091 Merge "Skip to the end of the folder open animation in battery saver mode." into ub-launcher3-burnaby-polish
am: 6e83dc4031

* commit '6e83dc4031b78ac6e65102b2d936e9e769686fec':
  Skip to the end of the folder open animation in battery saver mode.
2015-11-25 00:06:14 +00:00
Tony Wickham
112ac95571 Skip to the end of the folder open animation in battery saver mode.
Bug: 25666809
Change-Id: I867d56a34fc5e0ad6aaabd8b6df47be05ec31966
2015-11-12 12:51:06 -08:00
Tony Wickham
a71391a5b1 Don\'t add offset to CellLayout\'s fullscreen children.
am: 26b0142543

* commit '26b01425436277447fe24d01ad50d9e64f82109e':
  Don't add offset to CellLayout's fullscreen children.
2015-11-10 23:38:00 +00:00
Tony Wickham
26b0142543 Don't add offset to CellLayout's fullscreen children.
Bug: 25411084
Change-Id: Ifbcd0a53cf04a7fc29386f4f09aaf7f972e7354a
2015-11-10 14:49:36 -08:00
Sunny Goyal
4f63c76bfe Merge "Refactoring WallpaperOffsetInterpolator to a new file Removing some us unused methods" into ub-launcher3-master 2015-10-30 00:33:46 +00:00
Sunny Goyal
9eba1fd75e Refactoring WallpaperOffsetInterpolator to a new file
Removing some us unused methods

Change-Id: Ife790e5ca6848fa13dc3fab1bba1e6220bf83743
2015-10-16 09:02:25 -07:00
Tony Wickham
9ccb94b6e4 resolved conflicts for a8709ddb to ub-launcher3-master
Change-Id: I172395e6e172914627b6dec721070a66520557b1
2015-10-15 11:18:26 -07:00
Tony Wickham
a0628cc521 Fix "The specified child already has a parent" IllegalStateException.
The problem was due to a race condition between removing a prebound
widget view from the drag layer and adding the same view to the
workspace upon dropping it; if you let go of the widget immediately
after picking it up, the latter happened before the former.

Specifically, the flow was: long-click a widget --> drop --> remove
the view from the drag layer if it's not null (it is, so nothing
happens) --> the view is finally bound/inflated and added to the drag
layer --> add the view to the workspace --> already has a parent.

There are actually 2 problems here: one is that the bind/inflate is
asynchronous, and can therefore happen after dropping the widget view
being inflated, and the other is that the view is added to the
workspace even though the transition has barely started (we usually
ignore drops if the transition is less than half complete). It turns
out that this second problem was also due to a race condition, this
time between dropping a widget or app onto the workspace and calling
LauncherStateTransitionAnimation.dispatchOnLauncherTransitionStart().
If the drop happened before the dispatch, as in the case of the
crash, then the drop was accepted because the transition progress was
still 1.0 from the previous transition.

I fixed the first problem by removing the drag layer widget view
in Launcher where it is potentially used instead of Workspace. And I
fixed the second problem by setting mTransitionProgress to 0 in
Workspace.onLauncherTransitionPrepare().

I also added some debugging logs.

Bug: 23896857
Change-Id: I66944e6d3f23b70dea15f7fb01af0763a1bfcbda
2015-10-15 10:07:06 -07:00
Sunny Goyal
d1a0e8b5c8 Jailing the saved instance state of all the dynamically generated views
Using itemId instead of generating a new id for each item. This is because
if the process gets killed, View.generateId will get reset but we will still
receive the generated item id map in onRestoreInstance. This will cause
conflicts with newly generated item ids.

We wrap all the generated homescreen views inside a single sparse array. This
ensures that we do not cause any conflict with dynamically generated views in
other parts of the UI.

Bug: 16840760
Change-Id: I6fe69c2e1dd463402f51222715fae31b9d4dd240
2015-10-05 18:25:49 +00:00
Sunny Goyal
9d4380856f resolved conflicts for e78e3d73 to ub-launcher3-master
Change-Id: Idc119a57e21cf6016ee0fd91866839301db072d6
2015-09-25 11:50:16 -07:00
Sunny Goyal
e78e3d734b Accessibility fixes
1) Use a different content description for temporary new page
2) Use different accessibility description for add widget toast
3) Announce when an item is deleted
4) Announce when hovering over a drop target
5) Announce state during drag-n-drop and widget resize (similar to seekbar)

Bug: 23573321, 24057944
Change-Id: Icabb317625e70c78e11c0b4f99b9339172d93594
2015-09-25 10:22:47 -07:00
Tony Wickham
0c29decbfd am 1cdb6d06: onDropChild() always marks the cell as occupied.
* commit '1cdb6d066123cb9b2f9ea2c66246b29bf1dd9cf2':
  onDropChild() always marks the cell as occupied.
2015-09-17 19:54:10 +00:00
Tony Wickham
1cdb6d0661 onDropChild() always marks the cell as occupied.
Bug: 24164487
Change-Id: I11ef638a56b638ee82c3cd748340995970fc7e32
2015-09-17 19:48:08 +00:00
Tony Wickham
869306140d When placing a widget, go to a page with enough space.
The search for this page starts at the current one and
continues to the right (on LTR) until a page is found that
can accomodate the widget, taking possible resizing and
reordering into account.

Bug: 11338870
Change-Id: I2e9a310eb8f74024dca9150f55a525e1309c2f07
2015-09-09 17:08:50 -07:00
Tony Wickham
489fc56df8 Don't repeat ReorderPreviewAnimation for folders/widgets in power save mode.
Since power save mode (introduced in Lollipop, also known as battery saver)
disables animations, the ReorderPreviewAnimation looks bad - instead of
displaced folders subtly and smoothly moving up and down, they violently jump
between up and down positions in rapid succession. Setting the animation to not
repeat in this case avoids this issue.

Bug: 23675090
Change-Id: I8149610af75e7023dca28a942b3447228083cd33
(cherry picked from commit 9e0702f4af)
2015-09-04 21:57:25 +00:00
Tony Wickham
9e0702f4af Don't repeat ReorderPreviewAnimation for folders/widgets in power save mode.
Since power save mode (introduced in Lollipop, also known as battery saver)
disables animations, the ReorderPreviewAnimation looks bad - instead of
displaced folders subtly and smoothly moving up and down, they violently jump
between up and down positions in rapid succession. Setting the animation to not
repeat in this case avoids this issue.

Bug: 23675090
Change-Id: I8149610af75e7023dca28a942b3447228083cd33
2015-09-02 15:06:00 -07:00
Sunny Goyal
e2fd14b9f6 Jailing the saved instance state of all the dynamically generated views
Using itemId instead of generating a new id for each item. This is because
if the process gets killed, View.generateId will get reset but we will still
receive the generated item id map in onRestoreInstance. This will cause
conflicts with newly generated item ids.

We wrap all the generated homescreen views inside a single sparse array. This
ensures that we do not cause any conflict with dynamically generated views in
other parts of the UI.

Change-Id: I6fe69c2e1dd463402f51222715fae31b9d4dd240
2015-08-27 17:53:28 -07:00
Mady Mellor
bb83520a62 Refactor StylusEventHelper to provide onButtonPress/Release methods
This will enable an easier migration to the new M APIs for identifying
button presses from stylus / other tools.

Bug: 20430722
Change-Id: I41cfa6eff8d76bb83cf1bdaf6623ec1092ed554c
2015-08-21 11:18:14 -07:00
Vadim Tryshev
fedca43d39 Moving drag-drop related code into a separate package.
This is per an earlier CR comment "we should probably move all this code to its own package (launcher3.dragndrop) in a separate cl".

I'm not moving DragSource because it's referred from gsa code.

Bug: 22609426
Change-Id: Ia7204dab99c0c395c66b77143a2d60411153f5f3
2015-08-20 07:45:57 -07:00
Sunny Goyal
106bf64f4a Some cleanup around drag and drop
> Instead of resizing the rect for dragoutline in onDrow, store the resized rect itself
 > Remove unnecessary inverse matrix calculation

Change-Id: If13c3c5aaecba5a1d3a4f5d39199ed82e9662c62
2015-08-13 16:54:58 -07:00
Sunny Goyal
3c938a7e0d resolved conflicts for merge of 3f7550c1 to ub-launcher3-master
Change-Id: I3bb155473d48832e496a8983f84c20e6e935fa41
2015-08-04 10:33:30 -07:00
Sunny Goyal
233ee964a9 Calculating widget minSpans and spans statically/independent of orientation
> Filtering the widget list and excluding widgets which dont fit the grid
 > setting minSpans for the widget item when binding.

Bug: 22541314
Bug: 22559137
Change-Id: Ieda48b56c95bee0c7ec71dd691af7e23e2d43db6
2015-08-03 16:39:49 -07:00
Sunny Goyal
4ac89e2444 Merge "Several animation calls cleanup" into ub-launcher3-master 2015-08-03 19:23:16 +00:00
Winson Chung
2285b30003 am ec70312d: Merge "Fixing issue with flash during overview transition." into ub-launcher3-burnaby
* commit 'ec70312dea4083416d2d132ea8853455b0dec616':
  Fixing issue with flash during overview transition.
2015-07-31 20:09:03 +00:00
Sunny Goyal
5d2fc32e6d Several animation calls cleanup
> Using View property instead of strings to avoid extra reflection step
> Using ViewPropertyAnimator when several properties are being animated

Change-Id: I41625643b38b70bac11e2c81d18058ec878d73bd
2015-07-31 13:07:14 -07:00
Winson Chung
e8f1d047b1 Fixing issue with flash during overview transition.
- This is due to the TransitionDrawable which does not actually
  start an animation until it is first drawn.  This workaround
  will just immediately reset the transition if it is not currently
  visible instead of animating (which is actually deferred until
  the next animation into overview mode).

Bug: 22414257
Change-Id: Id481303d0c99a20c1d16396c024ab50303f45576
2015-07-31 12:59:11 -07:00
Sunny Goyal
5e758cae9a Merge "Changing the dogfood check to a static boolean to better handle proguard optimizations" into ub-launcher3-master 2015-07-28 19:37:00 +00:00
Sunny Goyal
05be6b7649 am b04136b4: Merge "Adding minSpanX and minSpanY for all the launcher widgets" into ub-launcher3-burnaby
* commit 'b04136b4714a0d9afddab6a70045f4f4f7fa1ee4':
  Adding minSpanX and minSpanY for all the launcher widgets
2015-07-17 19:06:46 +00:00
Sunny Goyal
3a30cfeb7c Adding minSpanX and minSpanY for all the launcher widgets
Bug: 22353460
Change-Id: Id4450dee42a83e4603dcd56e1c4dec2b0e405858
2015-07-17 11:10:05 -07:00