Commit Graph

43 Commits

Author SHA1 Message Date
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
Jon Miranda
69b35e0195 Fix app to folder icon animation.
- Needed to account for the preview bounds (similar to BubbleTextView icon
  bounds)
- Also needed to update the bitmap shift amount so that it is re-centered
- Moved ShiftedBitmapDrawable to its own class in graphics package

Bug: 123900446
Change-Id: Ifa9e3f688e55d017cf86a0285f5cdb1b014f01e6
2019-03-05 12:23:28 -08:00
Jon Miranda
3145839f65 Fix bug caused by trying to set background to AdaptiveIconDrawable.
Solution is to flatten the drawable when useDrawableAsIs is true.

Bug: 123900446
Change-Id: I3b86db201ef4fccf10ac42ec367c0538573b7ad8
2019-03-04 20:54:53 -08:00
Jon Miranda
1a49fb5733 Transform closing window to icon on workspace using adaptive icons.
With adaptive icons, we can have FloatingIconView match the shape
and size of the closing window, regardless of the icon shape.

FloatingIconView starts off as a rounded rect (same corners as task view)
and then morphs into the icon shape using FolderShape#createRevealAnimator
in reverse.

Decided to add FeatureFlag.ADAPTIVE_ICON_WINDOW_ANIM since there are still
some issues with folders, badges, and a visible jump when swapping the
FloatingIconView with the original icon.

Bug: 123900446

Change-Id: I94969eea6d5f4b932a84a11eb403611276042b46
2019-03-01 12:48:25 -08:00
Jon Miranda
0128d3f6e0 App to home animation zooms into the app icon.
- Created FloatingIconView which is now used by both the app close and
  app open animation.
- getItemLocation in DeviceProfile is used to get an item's final location
  since getLocationOnScreen may return a View's location mid-animation.
- Added getFirstMatchForAppClose which is optimized to return for best
  visual animation.
- Also fixes app open RTL bug.
- Next CL will use AdaptiveIcons and FolderShape reveal animator to match
  the app icon to the app window.

Bug: 123900446
Bug: 123541334
Change-Id: Ief75f63fc5141c1ee59d4773946d08794846cb31
2019-02-14 16:54:45 -08:00