Commit Graph

104 Commits

Author SHA1 Message Date
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
Jon Miranda
6f455b583f Fix sizing of FloatingIconView so that it matches the workspace.
* Added a cross fade at the end for text and shadows.
* Animate in FolderIcon bg/dot/text after swapping.

Bug: 129297366
Change-Id: Ieeb5d7b8fb389a2f7ee263d38b3021ffdefefd93
2019-03-27 09:42:50 -07:00
Tony
0d447c88b8 Apply spring forces to animate to the final position for swipe home
Now instead of an incorrect hack that simulated accelerating to the target,
we actually apply spring forces to make it feel realistic and work no matter
where the target is.

Added two helper classes for this:
- FlingSpringAnim handles the fling, applying friction until reaching the target,
  then a spring to pull towards the final position (also applies if fling wasn't
  in the right direction or strong enough to reach the target).
- RectFSpringAnim uses 2 FlingSpringAnims (x + y) to animate from a starting rect
  to a target rect. It also has an animation to scale from the start rect to the
  target rect, sending progress update callbacks to the caller.

Bug: 123900446
Change-Id: Iafa89db1d55c42816acfa9f1bb84a7519b69ff12
2019-03-15 17:38:41 -05:00
Jon Miranda
87beed6404 Handle other SystemShortcut view types.
Bug: 127807969
Change-Id: Ifcc24e9261ddc730bcddd5724a230910daafce17
2019-03-13 10:02:59 -07:00
Jon Miranda
270d29c43e Only get drawable on the background thread, everything else on main thread.
Bug: 128259687
Change-Id: I6230bfdc292e9a43ab935cfb6debb7a6fac4d4f7
2019-03-12 14:59:04 -07:00
Jon Miranda
93e0594b3d Fix crash when trying to load SystemShortcut drawable.
Bug: 127807969
Change-Id: I9d7e8bf5b6b45fe6ad61984ab2c0326926076d75
2019-03-11 14:05:41 -07:00
Jon Miranda
4334874f1f Updates to app to icon animation, and turns on ADAPTIVE_ICON_WINDOW_ANIM flag.
- getFirstMatchForAppClose now only looks at the current page, since switching
  pages is disruptive and the animation for app closing to an icon on a
  different page is unclear.
- Searches for package name and user id (in case of work profile app)
  instead of component name to handle shortcuts and trampoline activities.

- Adaptive icon background drawable is now always centered

- Fix crash that occurs when ADAPTIVE_ICON_WINDOW_ANIM is off. We were trying
  to set FolderAdaptiveIcon as the background drawable. Simplest solution is
  to not use folder as a search criteria when the flag is off.

- Similar to DragView, FloatingIconView now uses BubbleTextView icon when
  adaptive icon support is not available. This handles legacy-treated apps.

Bug: 123900446
Change-Id: Idaf292bb39d78db511cf2ee04a16b191454846b3
2019-03-06 13:25:22 -08:00
TreeHugger Robot
111213b0f8 Merge "Fix app to folder icon animation." into ub-launcher3-master 2019-03-05 21:25:17 +00:00