Commit Graph

61 Commits

Author SHA1 Message Date
Adam Cohen
650869973a Refactor / Cleanup / Simplify a bunch of dnd related rendering / animation
Addresses:
=> Fix folder icon drop location mapping (was very far off)
=> Fix BubbleTextView drop animation shifted by a few pixels
=> Get rid multiple unnecessary calls to setDragMode(none), was breaking
   some of the reorder flow; still some issues to address here.
=> Fix folder icon parallax (didn't work when the folder had a dot)

Test: manual

Change-Id: I5959cf341996f75d30212353ec096ed25bf40ea5
2020-03-21 01:26:09 +00:00
Jon Miranda
23a2bec581 Use original disabled icon for app animations with disabled icons.
Bug: 129328259
Change-Id: I7617d6d87e299a0bb0a963b5eec573dd372fd799
2020-01-30 11:29:07 -08:00
Jon Miranda
ad7e30f5d7 Fix bug where icon remains invisible after returning home.
- The bug is caused by cancelling of the RectFSpringAnim before the
  StaggeredWorkspaceAnim has started.
- Instead of having logic in StaggeredWorkspaceAnim control the visibility
  of the icon, we instead maintain all the visibility within the
  FloatingIconView class itself.

Bug: 142120338
Change-Id: I082291ca9b288f57701cc00d61a9b3a84da8b084
2019-11-20 13:17:51 -08:00
Sunny Goyal
14168431bd Adding support for dynamic calendar and clock icons
Change-Id: Icdba34340a27a4f6dff7310d0bf9fd29aef1330c
2019-10-29 13:50:02 -07:00
Jon Miranda
1dd2e48190 Wait until listeners/end runnable is created before checking icon result.
This prevents the case where original icon is in hidden state, then the
view gets recycled and since there is no listener/end runnable the original
icon is left in the hidden state.

Bug: 142120338
Change-Id: I5f5bfa2a7c70d10869f51edf5c40bbaab1ef93bc
2019-10-11 11:03:26 -07:00
Jon Miranda
08857d2f13 Ensure the icon load request matches the ItemInfo for the floating view.
This fixes the bug where the wrong icon is present during the app close
animation.

Bug: 138195597
Change-Id: Ib3767ec5c2b4eb22b35e5148879e11d2c1b28e3c
2019-09-10 00:52:23 +00:00
Jon Miranda
a87abbad31 resolve merge conflicts of 1bd96b1e96 to ub-launcher3-qt-future-dev
Test: I solemnly swear I tested this conflict resolution.
Bug: None
Change-Id: Ide6c914d4e69eb4fa70d6634780324cd45a21610
2019-09-06 11:35:34 -07:00
Jon Miranda
9b78e190fa Update app open/close animations.
- For app open, the icon text remains where it is and only the icon moves.
- Similarly for app close, the icon text remains where it is and fades in
  with the rest of the other icons text.

- With this change, the original view is always "VISIBLE"
  (if BubbleTextView/FolderIcon) but we hide certain elements.

Added video to bug.

Bug: 137200188
Bug: 139885365
Change-Id: I3d20c5f05bc7c0b9d052d8074ac3bfc21531c83d
Merged-In: I3d20c5f05bc7c0b9d052d8074ac3bfc21531c83d
2019-09-04 21:45:05 +00:00
Sunny Goyal
6fe3eec95c Moving various common executors to a single location
Change-Id: I44bca49b8adb6fa22c3b48d10f674e42c28d792c
2019-08-20 14:36:17 -07:00
Jon Miranda
42bd7dad6c Fix app open/close animation in RTL.
Bug: 135165284
Change-Id: Ib50f213904cb7ac7c769fac04dbfc70005fe25b8
2019-07-16 13:58:29 -07:00
Jon Miranda
cabbaf986c Fix bug where floating icon and workspace icon visible at the same time.
- Add a signal for the animation to be "cancelled"
- Allow the workspace view to be attached to a spring during the animatoin
  (but kept hidden) to prevent any jumpy movement

Bug: 137215697
Change-Id: Ie6868a7f45fefaee5366c8d30bb323fe042e9156
2019-07-10 14:14:23 -07:00
Jon Miranda
826cdcd32f Fix bug where icon is no present during app close animation.
* WindowTransformSwipeHandler closes all AbstractFloatingViews, including
  ListenerView, which results in FloatingIconView getting removed.
* In IconLoadResult.onIconLoaded, we remove the check for isIconLoaded since
  its not needed. This was also causing a race condition since isIconLoaded
  is not set to true until after we tell onIconLoaded to run.
* In BaseDragLayer, we have a delay before checking if the view is open and
  then closing the floating view if true. This caused issues since we reycle
  the view. Now we check if the view is open before running the delay to call
  close.

Bug: 136044361
Change-Id: I7442a589a62c3cdf90b70d146e0ecf3e4300ddf7
2019-07-02 14:35:11 -07:00
Jon Miranda
6dfa312896 Preloads the icon drawable for app open to reduce latency b/w swapping views.
For app close, we already load the icon as soon as we can.

Bug: 135130011
Change-Id: Ia2c45737cf24d1ab5911b222ae097d7a1f9d6a31
2019-06-13 13:17:25 -07:00
Sunny Goyal
bda6b45341 Fixing wrong origin when launching new task from overview
> Also removing some unnecessary layout passes during launch animation

Bug: 133226418
Change-Id: I36fe69827853366deb7c56ca25f39e20c1a0b825
2019-06-05 12:25:28 -07:00
Hyunyoung Song
ed45267bf9 Merge "Add shape detection logic only for circle icons" into ub-launcher3-qt-dev 2019-06-03 22:34:02 +00:00
Hyunyoung Song
f69426c484 Add shape detection logic only for circle icons
b/119330044

Change-Id: I93042effa8417167d844f073275e8b941e861e60
2019-06-03 14:05:20 -07:00
Jon Miranda
b3c9077c76 Tuning app open/close animation.
* Mostly value changes.
* Added a way to round the corners during swipe up to home animation.

Bug: 123900446
Change-Id: Id61d241d919ba51ced0633585e36b7d93efe30b0
2019-05-30 18:43:22 -07:00
Jon Miranda
a1898247ca Hide original icon immediately for app close.
Bug: 123900446

Change-Id: I12d906267dafe80a9dc5d5e39452bddd95b0f748
2019-05-30 11:24:29 -07:00
TreeHugger Robot
efd5f86a0a Merge "Hide original icon immediately for app close." into ub-launcher3-qt-dev 2019-05-30 18:06:24 +00:00
Jon Miranda
928fc8d1e2 Fix bug where shape reveal progress gets started too early.
* This caused the shape to not match the window size on app close.

Bug: 123900446
Change-Id: Iaa2c06f19c535f72ae4c080b4bc847d336f1a77d
2019-05-29 14:19:16 -07:00
Jon Miranda
7aa9000642 Hide original icon immediately for app close.
Bug: 123900446
Change-Id: I46e54da39e3bf4fe79e0583b52c568c702a9f16a
2019-05-29 11:41:46 -07:00
TreeHugger Robot
1d847cf266 Merge "Lock launcher rotation during activity transition to allow proper seamless transition at the end" into ub-launcher3-qt-dev 2019-05-24 18:07:08 +00:00
Sunny Goyal
9fd2d0ee0a Fix crash when launching some apps which require icons to be loaded on
the model thread

Change-Id: I945a94c458d872b41e44b4b3a2d023f85d8a7c88
2019-05-23 18:13:43 -07:00
Sunny Goyal
be8c34077c Lock launcher rotation during activity transition to allow
proper seamless transition at the end

Bug: 131360075
Change-Id: I2b76d4b3e0528e56b7b4709fd3708bc858bf1612
2019-05-22 15:21:56 -07:00
Sunny Goyal
5686333117 Adding a utility class to cache views at an activity level
Bug: 122345781
Change-Id: I9a939e0b19c06c1089c1ceb515f8b97fb5dbb49e
2019-05-22 14:23:12 -07:00
Jon Miranda
4c76bb8b3e Fix bug where recycled FloatingIconView stays clipped to outline.
Bug: 123900446
Change-Id: I9507dab86cc0da27626d1b48e0f6a236f2b3f219
2019-05-22 07:33:31 -07:00
Jon Miranda
ae975a613d Swipe up to home into FolderIcon animation bug fixes.
- Fixes clipping issues.
- Fixes badge being shifted.

Bug: 124510042
Change-Id: I2520d963fb2041a049650c2b8c12ddb3de7b8d87
2019-05-20 11:10:25 -07:00
Jon Miranda
c2968da372 Fix bug where FloatingIconView did not use IconShape normalization scale.
This fix allows for a clean tradeoff between the FIV and the original icon
in all icon shapes.

Bug: 130292844
Change-Id: Ief2eec2673161e0f9d32d8710713a1f01880040d
2019-05-16 14:21:28 -07:00
Jon Miranda
ffaca2e162 Fix landscape app open/close animations.
Bug: 123900446
Bug: 124510042
Change-Id: I3db80d6f8064ce26f97cdede63c0d25499416e98
2019-05-15 10:46:33 -07:00
Jon Miranda
4028575ba0 Fade in badges on top of icons after swipe up animation.
Bug: 123900446
Change-Id: I54e367e0be72781e24d13ec6ea64dbddd85fb0bd
2019-05-15 09:37:24 -07:00
Jon Miranda
a03f96caef Tone down foreground springs until they are properly tuned.
Change-Id: I8c66bc9b4828da82d5dcf74d1479795c4d75ed7c
2019-05-14 14:21:19 -07:00
Jon Miranda
4b8b5fd4e4 Center align foreground during app open, use springs during app close.
Bug: 123900446
Change-Id: Ic4ffed28f6ba8782c3d8dfa031ebd70022c4c520
2019-05-14 12:57:05 -07:00
Jon Miranda
5bbc3b7054 Force hide notification dot until fade animation is complete.
When the animation is complete, the notification dot animates in.

Bug: 123900446
Change-Id: Ie98342f2945ac4e42fb810b4334ef03a734ebef2
2019-05-12 18:19:30 +00:00
Jon Miranda
2da1da3076 Initial app open/close polish using tuned values.
* Rect and radius now match the app window size.

Bug: 124510042
Bug: 122843905
Change-Id: Ibc85bfe1d75d01cefe00b6bf32557e04a0ee4716
2019-05-10 10:11:35 -07:00
Sunny Goyal
56b3dfaa04 Merge "Updating floating animation target if layout changes during the animation" into ub-launcher3-qt-dev 2019-05-04 19:39:20 +00:00
Sunny Goyal
abb55950f6 Updating floating animation target if layout changes during the animation
Bug: 131360075
Change-Id: Id71e154aa59177955baa9daab00ecf11ee7d8c43
2019-05-04 11:38:47 -07:00
Sunny Goyal
905262c1a7 Adding utility method to get adaptive icon scale
Change-Id: I5ff190c3b794bb13309375782ccd420e85b59091
2019-05-03 21:31:46 -07:00
Sunny Goyal
878f6d3871 Fixing FloatingIconView position and rotation in rotated layout
Bug: 131360075
Change-Id: I4e39f35df99a07e00f3e86865b330d91e9461da0
2019-05-03 11:35:10 -07:00
Jonathan Miranda
a34072b76b Merge "Use original BubbleTextView icon for legacy stamped forced adaptive icons." into ub-launcher3-qt-dev 2019-05-02 22:15:45 +00:00
Sunny Goyal
ae6e318711 Initial changes to creating a fake landscape Launcher UI
Workspace and hotseat are drawn in rotated UI giving the impression that the
device is in Portrait, even though it is in landscape

Bug: 131360075
Change-Id: I29c4068af25fd4dcf7039b9a45886e864a137977
2019-05-02 10:59:28 -07:00
Jon Miranda
27530c99e2 Use original BubbleTextView icon for legacy stamped forced adaptive icons.
Bug: 129297366
Change-Id: Ic71c42e603cc361b716ba65067a772d19ef394f7
2019-05-02 08:45:27 -07:00
Jon Miranda
063211f620 Fix app open animation in landscape.
Bug: 130828765
Change-Id: Ic447d05a8fe2097a6afd0bfec73039a62bbf5a4b
2019-04-30 12:03:39 -07:00
Jon Miranda
de0093dfa5 Add ListenerView so that we can fast finish the FloatingIconView fade anim.
This change allows us to quickly end the animation if the user begins
interacting with launcher before the animation is over. This can currently
happen when the user swipes up to go home, and then quickly swipes up again
to enter overview.

Bug: 129421279
Change-Id: I88c7d55ef8ac09f999c082317de3bb3693c11466
2019-04-19 15:13:10 -07:00
Jon Miranda
2d08ca47f6 Restore line to make original view invisible when hideOriginal is true.
Accidentally removed the entire if statement in
Id4312d692b2a337aefe082e40faec344e76ecabb.

Change-Id: I14f87bc516a85986bbbd305f78e7b60f03a021ba
2019-04-17 18:27:35 -07:00
Jon Miranda
799c54a89a Do not draw anying in FloatingIconView if we are not hiding the original icon
Bug: 129328259
Change-Id: Id4312d692b2a337aefe082e40faec344e76ecabb
2019-04-17 13:52:08 -07:00
Jon Miranda
83cdca67ba Fix bug where BubbleTextView text fades in after long press.
Introduced by Ieeb5d7b8fb389a2f7ee263d38b3021ffdefefd93.

Change-Id: I45e180dda09f03297530e5b5575b71f60c03fb5f
2019-04-15 13:28:26 -07:00
Jon Miranda
d53a9bf8a0 Fix bug where app icons stay invisible after app open animation.
For the app open animation, we load the adaptive icon on the bg thread.
When the icon is done loading, we swap the og view with the FloatingIconView.
If the icon loads after the animation is done, we still set the og view
to INVISIBLE and it never gets restored since the animation is already done.
To fix this, we do not swap the views if the animation has already ended.

Bug: 130245920
Change-Id: I5cf85de4e2c533da8c395a23899980d27a941e1b
2019-04-10 15:21:47 -07:00
Jon Miranda
bba6451b5f Refactor app open animation so that FloatingIconView tracks window.
Before, the window used to track the FloatingIconView. With this refactor,
both app open and app close use the same update method.

With the refactor, we can now use adaptive icons to morph the icon into the
size of the window.

Movement/interpolators are still the same as the original except for the
alpha and the clip animation. To ensure a perfect tradeoff, we wait for the
icon to match the size and shape of the window before crossfading.
Currently it is set up so that the tradeoff happens when the animation is
15% done, but this can be tuned later.

Bug: 122843905

Change-Id: I7d3edbefffb15fe26958a62ab33cf23dc1203908
2019-04-01 13:19:28 -07:00
Jon Miranda
ae9f62095a Fix bug where folder icon dot anim plays every time.
Change-Id: I6a7e075be62dfcea01c38b2a6a630427e1c5974a
2019-03-28 14:19:43 -07:00
Jon Miranda
83fb1b0ed8 Temp remove fade animation.
Bug: 129421279
Change-Id: I7c1a9906ea9dbf888c0f156cc21d10109d92e85d
2019-03-27 14:09:56 -07:00