Commit Graph

104 Commits

Author SHA1 Message Date
Stefan Andonian
d768f73f37 Correctly position the landscape / rtl FloatingIconView's background drawable when swiping back to home.
Bug: 235812580
Test: Verified the correct "Swipe Back to Home" position for the
floating icon view in landscape and portrait (rtl and ltr for both
orientations) with a tablet. There is a screen recording on the bug.

Change-Id: Id06f43e70ef617e39e1b26d0c8b7466147e325d2
2022-09-21 17:54:24 +00:00
Sunny Goyal
0d88d0088a Clone the drawable lazily instead of on the UI thread while initializing
Bug: 234764579
Test: Manually
Change-Id: I557a532e4f71475e9294854d17068007a2eb7338
2022-06-09 09:59:42 -07:00
Stefan Andonian
2a7fbee0d4 Give FloatingIconView a copy of, rather than, the original icon.
Previously, if a user tapped on the clock icon then rapidly swiped back,
the clock icon would stop updating. This fixes that issue by avoiding
changes to the original icon's inner callback state while preparing and
displaying the FloatingIconView.

Bug: 188377749
Test: Locally enabled the second hand on the clock icon in addition to
the minute and hour hands, then verified that it was incrementing
correctly every second even after tapping then rapidly swiping back on
the clock icon.

Change-Id: Ib8eddb53de293194e5f9dce2fcafe8a481a6116c
2022-05-31 17:32:08 +00:00
Sunny Goyal
c317d925f7 Improving folder icon drawable
> Only clearing bitmap for foreground layer.
  Background and dot have only one draw command and is waster without rasterizing
> Moving bitmap creation to background thread
> Removing folder clipping since the folder draws outside bounds anyway
> Fixing the size of the foreground layer to what is actually needed

Bug: 224945025
Test: Manual
Change-Id: I72a8149ce4c44c266d5bdf45368d3dda5a960ac2
2022-04-08 14:41:40 -07:00
TreeHugger Robot
906e96a68e Merge "Allow icons to take up full width in all cases where width > height." into tm-dev 2022-03-08 19:08:59 +00:00
Jon Miranda
39334f4013 Allow icons to take up full width in all cases where width > height.
Previously we only let the icons take up the max width if the
device was in vertical bar layout. For tablets this meant
that the icons would be smaller than the actual window crop.

We want the full width in any cases where the profile width
is greater than the height, so created a new method to check for that.

Bug: 203157974
Test: phone/tablet in portrait/landscape
Change-Id: I467f142bac87ec7c3b369c01f8d9c96ddf74fc76
2022-03-07 18:17:50 -08:00
Jon Miranda
a0fb57dc43 Let BubbleTextHolder extend IconLabelDotView
This properly hides just the icon/dot and leaves the
text for All Apps views  during the app launch/exit animation.

Bug: 213306709
Test: open/close apps on workspace, open/swipe back apps in all apps
Change-Id: I327ce3e41298e50e34b8809491fc6d97a89f9f96
2022-03-07 14:45:13 -08:00
TreeHugger Robot
19fff8cb74 Merge "Do not theme icons when the original view is not themed." 2022-02-16 17:13:10 +00:00
Jon Miranda
0aa263c5a0 Do not theme icons when the original view is not themed.
Fixes bug where animations uses themed icons in All Apps, where the
icons are not themed.

We want the DragView themed since all valid drop locations will have it
appear themed.

Bug: 215650713
Test: open/close an app from All Apps
Change-Id: I9969ce4921831dd12858ed9b0fe64379e9e3b188
2022-02-15 13:16:22 -08:00
Jon Miranda
b2670d2051 Init FloatingIconView properties before fetching drawable.
& Make sure properties are reset when recycled.

This fixes the bug that causes BubbleTextView drawable not to get set.

Bug: 207389002
Test: locally disable loading AdaptiveIcons, ensure BubbleTextView
      drawable always gets drawn for closing animation

Change-Id: Ifdbf3e733e27918c57a5e9b23e5a11b65f8f338c
2022-02-14 14:43:32 -08:00
Jon Miranda
78d0d4f832 Remove ADAPTIVE_ICON_WINDOW_ANIM feature flag.
Has been enabled for past few releases, no longer needed
as a debug flag.

Bug: 209856611
Test: manual
Change-Id: Id25e36522636e5c5d8ee60cdec49b3ee3f4d4251
2022-01-24 18:00:04 -08:00
Jon Miranda
f9d4932707 Merge "Display in-memory icon for app close while AdaptiveIcon loads." into sc-v2-dev am: b788f9f7f7 am: 2539cd207e
Original change: https://googleplex-android-review.googlesource.com/c/platform/packages/apps/Launcher3/+/16441110

Change-Id: I759f7a0194d730af565dd140d057dff618701630
2021-12-10 23:55:41 +00:00
Jon Miranda
b788f9f7f7 Merge "Display in-memory icon for app close while AdaptiveIcon loads." into sc-v2-dev 2021-12-10 23:20:42 +00:00
Jon Miranda
0c2f0faef1 Display in-memory icon for app close while AdaptiveIcon loads.
- We already display the BubbleTextView icon during app close
  since we need the shadows to ensure a clean handoff.
- Previously, we waited until the icon and the AdaptiveIcon were
  both loaded to show the FloatingIconView.
- This change immediately shows the BubbleTextView icon so that
  we can have something displayed in the cases where AdaptiveIcon
  is slow to load (ie. immediately after killing/restarting launcher).

Currently there are cases where we defer some BubbleTextView drawing to
ClipIconView. We can refactor in master so that ClipIconView is only used
when drawable is an AdaptiveIcon.

Bug: 207389002
Test: manual
Change-Id: Ie54642fef4258862a155ab0aba6e49cea9c9ead0
2021-12-10 13:25:39 -08:00
Sunny Goyal
331e6e94f9 Merge "Updating icon badging logic" 2021-12-03 02:14:42 +00:00
Sunny Goyal
d872a97bd0 Updating icon badging logic
Bug: 201682172
Test: Manual
Change-Id: I57421b0c77e12f1cd464e532d2a1383c2cf93981
2021-12-02 22:14:25 +00:00
Jon Miranda
73a7e1ce41 Fix NPE in FloatingIconView
Happens when view is reset before animation starts

Bug: 201946253
Test: manual
Change-Id: I62817f698996dc1c6bebcd038d01eb8d6923a305
2021-11-19 13:40:59 -08:00
Alex Chau
53c7ed5084 Avoid calling getIconResult if recycle is called after request is queued
Fix: 203582251
Test: atest -c NexusLauncherTests:com.android.launcher3.memory.MemoryTests
Change-Id: Ice1e981e1813df516008be578aa89ee17fb79fab
2021-10-25 21:06:27 +01:00
Jon Miranda
f8441cc276 Fix notification dot not always being up to date.
- Prediction row views were never updated when notification changes.
- FloatingIconView set the BubbleTextView to force hide dot, but never restored it.
  BubbleTextView is instanceof IconLabelDotView, so its already handled in the end runnable

Bug: 183360736
Test: 1. swipe up to go home such that the closing app has a notification,
         note that the notification dot is properly updated
      2. have all apps open
         make notification update for a predicted app
         ensure dot is properly updated

Change-Id: I35dacf9b71a3d8b8a857be450690d65ea9199bf6
2021-07-16 17:50:56 -07:00
Jon Miranda
0750f03c96 Address LAUNCHER_APP_LAUNCH_FROM_ICON jank.
- Delay app launch animations by a frame, and skip logic to skip the first frame.
- Note the icon pressed state animation still occurs, so there is still some
  visual feedback for the user that something is happening.

Bug: 181901105
Test: ensure animation still looks smooth (using window animation scale & record in slow mo)
Change-Id: Ia904b8b96301042c900e0589f33fc625c1c1148b
Merged-In: Ia904b8b96301042c900e0589f33fc625c1c1148b
2021-06-14 23:29:29 +00:00
Sunny Goyal
c4c3269206 Crossfading splashscreen if icon is themed
Bug: 188840653
Test: Manual
Change-Id: Ibd00bb1a94576a7512872eba39a936c174f9871d
2021-05-25 18:25:18 +00:00
Jon Miranda
7d2dfcfb3f Add WorkspaceRevealAnim, successor to StaggeredWorkspaceAnim.
- Added support for widgets for the new close animation.
- This anim is used with the new app close.
- This anim is not compataible with the old app close, so we need to
  keep StaggeredWorkspaceAnim in case we turn the app close flag off.

- We will also use this anim in the lockscreen to launcher anim, will
  connect them in a follow up CL.

Bug: 188413065
Bug: 173107751
Test: manual
Change-Id: Icab3fd700f2c268bb1c4509a37466e4e6748f789
2021-05-17 23:04:07 +00:00
Jon Miranda
88b7f6a0d5 Move color extraction utils to extractor class so each instance can
have its own set of temp variables.

- Pass in float[] param to not create new obj in each frame
  for dragging widget case.

Bug: 175329686
Bug: 187019711
Test: manual, verify
Change-Id: I4350fb7e66a80c73def5659fb41abc14d357e667
2021-05-04 09:00:01 -07:00
Jonathan Miranda
21930da9a2 Revert "Revert "Use color extraction for arrow popup.""
This reverts commit 17fda29bf3.

Reason for revert: Fixing the memory leak

Leak was detected in caused launcher tapl tests to fail.
For instructions on how to debug leaks, see go/launcher-testing.
Using AS memory profiler, the color extractor class is holding
onto a reference to launcher that has already been destroyed.
The fix is to set the listener to null when view is closed.

Bug: 175329686
Test: run profiler in AS, open and close popups, and verify no leaks

Change-Id: I2d4a87f0481cbc88f3587dce91278e85ca113545
2021-05-04 08:53:58 -07:00
Vadim Tryshev
17fda29bf3 Revert "Use color extraction for arrow popup."
This reverts commit 242c805f82.

Reason for revert: Introduces a leak. I haven't seen a bug for it yet, but this CL is the only in the culprit list; the leak can block multiple teams presubmits, and the leak is via ArrowPopup. Enough evidence.
https://fusion2.corp.google.com/invocations/4b50db71-d598-4e52-9076-e91d42b65014/targets

Change-Id: I1700a9eea8705983598aee43c0a63e67c1d9cf71
Bug: 187075409
2021-05-03 18:27:41 +00:00
Jon Miranda
242c805f82 Use color extraction for arrow popup.
- Updated logic to accept any view that is a a child of draglayer
  (from being workspace dependent)
- Move color extraction logic from widget class to utility class.
- Initial CL, future CL will interpolate between colors
  and expand color extraction to other abstract floating views.

Bug: 175329686
Test: long press on colorful wallpaper and test colors are extracted
      test in multiwindow mode
Change-Id: I18a6bb5013de4eea7e9b45810401f5b9b3cd7302
2021-04-30 15:54:17 -07:00
Jon Miranda
c9ad2dd6c7 Add new app close implementation.
- We remove the fling completely
- We set damping to 1 for x/y springs so there is no
  bounciness, and updated the stiffness and bounds to tighten
  up the path to the final location.
- During the animation, we translate all launcher content
  down
- When the x/y springs, and rect animator all finish,
  we use a spring to bounce the launcher content back up

- Added AppCloseConfig so that the entire animation can
  be defined in one location, with getter methods so that
  all the involved parties of the animation can access the
  current value.
- The animations are all defined linearly, and then
  interpolated over using a 3 point curve.

Building behind feature flag as we tune the values.

Bug: 173107751
Test: manual, visual
Change-Id: I83ad0fa2c4234cf30004240d43e191354595adc8
2021-04-22 16:11:11 -04:00
Jon Miranda
92f130fdf5 Add BubbleTextHolder interface.
Bug: 184817903
Test: manual, verify correct app open animation
Change-Id: I3723922aff5c71ae6ec7340d3c00cffef7b010b8
2021-04-12 13:12:58 -04:00
Schneider Victor-tulias
b40b98db3a Update FloatingIconView to display PreloadIconDrawables during swipe home animations.
Swiping up to go home on an app that is downloading incrementally would cause a jittery animation. Updated FloatingIconView to animate directly to a PreloadIconDrawable.

Demo: https://drive.google.com/file/d/1ddr8OGR4c1ZneyQ0VkkAAxGpwNcP8Wyn/view?usp=sharing

Fixes: 177685929

Test: manual
Change-Id: I4cd2daa18f6d3fed42a9b666063e0b1c1c46e5d9
(cherry picked from commit b8cab8d878)
2021-01-29 01:00:07 +00:00
vadimt
c610f26404 Removing unused tracing
Test: presubmit
Bug: 139891609
Change-Id: I30b432d329d6606b3d955409c167bddbacce8a37
2020-12-11 19:43:49 -08:00
Winson Chung
f99351888c Revert "Revert "Merge commit '8d14dbe041199d611839140f1c9285fd4174e9f4' ...""
This reverts commit 087a9e39b6.

Change-Id: I05b17a6e4aaaef6de3c2fa26aad45a39eb2833f9
2020-10-23 09:27:48 -07:00
Alistair Delva
087a9e39b6 Revert "Merge commit '8d14dbe041199d611839140f1c9285fd4174e9f4' ..."
Revert "Merging from ub-launcher3-master @ build 6877130"

Revert "Merging from ub-launcher3-master @ build 6877130"

Revert "Merging from ub-launcher3-master @ build 6877130"

Revert submission 12738409-merge_ub-launcher3-master_6877130

Reason for revert: Introduced crashes to global presubmit

Reverted Changes:
I624658ce6:Merge commit '8d14dbe041199d611839140f1c9285fd4174...
Iccd2f1e3a:Merging from ub-launcher3-master @ build 6877130
I791d64951:Merging from ub-launcher3-master @ build 6877130
Icdd32ab01:Merging from ub-launcher3-master @ build 6877130

Bug: 169963211
Change-Id: I77a4ae59e823147beae8dd7cb9b54ccdace2c7f4
2020-10-05 14:46:26 +00:00
Jon Miranda
5e315bc7a9 Draw BubbleTextView drawable behind ClipIconView during app close animation.
The BubbleTextView drawable has built in shadows.

Prior to this, we waited for the FloatingIconView to finish
animating into place before fading in the BubbleTextView behind it.
We did this to prevent the shadow from blinking in.

Now that we've refactored FloatingIconView & ClipIconView,
we draw the BubbleTextView behind the ClipIconView so that the shadow is
revealed when the icon finishes clipping to its final shape and it
no longer has to be faded in.

Bug: 168608912
Change-Id: Ic0809f74ecbbec2f6e7caf7eca2fb560a8a02dec
2020-09-30 12:07:32 -07:00
Sunny Goyal
eaf7a95546 Changing minimum supported Launcher version to 26
Change-Id: I49fcf874430ac53c3246371e179fbd828e14e4da
2020-07-29 17:30:19 -07:00
Sunny Goyal
30ac97d938 Adding home animation support for non-system Launcher
When user swipes up to home, Launcher will receive a onNewIntent
callwith a bundle-extra gesture_nav_contract_v1. It will contain
the componentName & UserHandle of the closing app & a callback.
Launcher can use the callback to return the final position where
the app should animate to and an optional surface to be used for
crossFade animation. The surface cleanup can be handled in
onEnterAnimationComplete.

Change-Id: I76fdd810fdcb80b71f7d7588ccac8976d9dfe278
2020-07-21 11:43:21 -07:00
Sunny Goyal
6fd105b69a Updating gesture tutorial home animation
> Using a separate View as icon, instead of the taskView
> Updating swipe animation logic to abstract out FloatingIconView dependency

Change-Id: Ib466262afead11ebe4ca035d589f0382c37e3e97
2020-07-09 07:51:34 -07:00
Jon Miranda
77d8903f4a More logging for pause non-detection
Bug: 156044202
Change-Id: I0831735aa743360c16e1f940c30875f32432fec5
2020-05-29 19:43:52 -07:00
Jon Miranda
b133a52e86 Fix app open/close animation in landscape.
When we refactored ClipIconView, we never init mIsVerticalBarLayout.
Instead we pass it in along with the rest of the info from FloatingIconView.

Bug: 155039118
Change-Id: Iff93105c512a8e6478dc49d8ab9100fd129af48c
2020-04-30 22:50:59 -07:00
Jon Miranda
d08f8ac409 Ensures that the swipe up to home animation is ended prior to view recycling.
Bug: 154163960
Change-Id: I70b2c6290a2a17be8b80ba0209528173d6627332
2020-04-21 15:12:40 -07:00
Vinit Nayak
326d93bd56 Re-enable home screen rotation
Launcher home screen rotation now works with fixed
transform. When using Quickstep while holding
the phone from an orientation different than
the orientation of the touch, the overview
shown will be that of the phone orientation,
not the touch orientation.
Easier to see this be quickswitching from
portrait to landscape app, turning phone, then
going to overview from the original region you
swiped.

Fixes: 150214193
Test: Created test apps and fixed them
to various rotations to test.

Change-Id: Ic6565cd0ed33c951f45ccb97278045c6070e438e
2020-04-17 14:38:12 -07:00
Sunny Goyal
e396abf502 Moving model data structures to a separate file
Change-Id: I77ad7a5219e72d2e0d6c1803de2ac3ed6a65a8f7
2020-04-09 13:20:39 -07:00
Sunny Goyal
c4d3201538 Removing support for fake landscape
Bug: 111068105
Change-Id: If31d2f700ddee1d21541735de3a8006ee2a53c5c
2020-04-03 17:11:35 -07:00
Jon Miranda
4848604882 Polish badge animation on app open/close.
Create new ClipIconView so that the adaptive icon foreground/background can
get clipped properly, and the badge gets drawn separately on top of it.

Bug: 142105172

Change-Id: Ie5d65c20f845d9219fd01daa383f273dde0e096c
2020-03-23 12:24:04 -07:00
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