Commit Graph

230 Commits

Author SHA1 Message Date
TreeHugger Robot 512a3c59ea Merge "Fallback recents should wait for remote anim ready" into ub-launcher3-qt-dev 2019-05-13 19:21:04 +00:00
Kevin 8bab8fa391 Fallback recents should wait for remote anim ready
Hook into the remote animation API on the recents view for the
fallback recents code path. This ensures the views are attached before
attempting the layout animation.

Bug: 132112131
Test: Set separate default launcher, go to recents from app, views
animate correctly
Change-Id: Id73f18e5f864e1970f954c7ec633e25e466d832e
2019-05-13 12:06:10 -07:00
Sunny Goyal 7a39b1bc5f Fixing insets mapping in 3-button and 2-button mode
Bug: 131360075
Change-Id: If6e3a4fbb011fc313efeb91686a9d787761862c5
2019-05-13 10:29:11 -07:00
TreeHugger Robot 5ffdc9c625 Merge "Add bottom margin to recents Go again" into ub-launcher3-qt-dev 2019-05-13 16:10:29 +00:00
Hyunyoung Song 2aa9647321 Revert "Implement scrim method"
This reverts commit d849ef084c.

Reason for revert: not needed

I was too eager to merge this CL. It turns out all I need is these
three constants and doesn't actually need the aidl change.

public static final int MAIN_COLOR_LIGHT = 0xffdadce0;
public static final int MAIN_COLOR_DARK = 0xff202124;
public static final int MAIN_COLOR_REGULAR = 0xff000000;

Change-Id: Iafd539a06455ba0878a6d3750f3c7194f8919fbf
2019-05-11 07:50:34 +00:00
Lucas Dupin d849ef084c Implement scrim method
Bug: 130451254
Test: make
Change-Id: Ifd66f9e53dd86d21fe66e4617cc4b209fecd7328
(cherry picked from commit 904c429b99)
2019-05-11 05:29:39 +00:00
TreeHugger Robot 3ab2ada712 Merge "Add task launch logging to Recents Go" into ub-launcher3-qt-dev 2019-05-11 02:11:02 +00:00
Kevin 162e2c5fb0 Add bottom margin to recents Go again
Navigation bar insets are not always transparent and shouldn't be used
for margin. So we put the margin back to get a bit more space from the
nav bar.

Bug: 132461256
Test: Manual test, see margins
Change-Id: Id92e8b80a0d2c18c0a603942600366e355649ea8
2019-05-10 16:48:58 -07:00
TreeHugger Robot 695e8df526 Merge "Add basic home to recents anim for fallback recents" into ub-launcher3-qt-dev 2019-05-10 21:08:28 +00:00
TreeHugger Robot 76696be287 Merge "Fix missing early return." into ub-launcher3-qt-dev 2019-05-10 21:07:57 +00:00
Kevin d0863ae5c4 Add basic home to recents anim for fallback recents
For users/OEMs who ship with a different default launcher, we should
provide at least a basic animation from home to recents. This creates a
simple cross-fade animation if coming from a separate home activity.

Bug: 132449252
Test: Have different default launcher, go to home, go to recents
Change-Id: I5ac7b0eedbcdf1e020c31d9cf120887a4bb3826a
2019-05-10 13:46:23 -07:00
TreeHugger Robot 763a7bffa3 Merge "Refactor lambda to use listener instead" into ub-launcher3-qt-dev 2019-05-10 19:49:36 +00:00
Kevin 8f1ac1efeb Refactor lambda to use listener instead
We should not use an in-line lambda here as we allocate a new
RemoteAnimationProvider object to do so which hooks into the already
existing AppToOverviewAnimationProvider. This can be a problem if
AppToOverviewAnimationProvider overrides methods as we would not use the
overridden methods but instead the default ones.

Instead, we use the same AppToOverviewAnimationProvider object but hook
into the activity ready and window animation calls with a listener to
add on the logging logic.

Bug: 132112131
Test: Manual test; app to overview functions as before
Change-Id: Ie70541691ed420c33770d6ed4f54d9555374dc0a
2019-05-10 12:19:11 -07:00
Kevin b35b7dee18 Update scrim if insets are added later.
If insets are set after the activity requests the foreground scrim to be
shown, the scrim will not be correctly added. This is an issue for
fallback recents which requests the foreground scrim right after
initialization.

To fix this, we save the request to show the scrim in a local variable
and check this on inset updates to determine whether we should show the
scrim or not.

Bug: 131853975
Test: Fallback recents now has foreground scrim added correctly
Change-Id: I15a19a3184bbc97a20fbcbba2106fd7221410df0
2019-05-10 12:13:00 -07:00
TreeHugger Robot 7b48548546 Merge "Set "usingRemoteAnim" for fallback recents" into ub-launcher3-qt-dev 2019-05-10 18:30:37 +00:00
Kevin 3792c733f8 Fix missing early return.
Fix a missing early return for when we don't have the bottom view laid
out on remote animation start.

Test: Builds
Change-Id: Iba0d5097ce59d017dc43030552f2171c5e6e4fb1
2019-05-10 11:19:37 -07:00
Kevin 32f55bf02d Set "usingRemoteAnim" for fallback recents
Ensure fallback recents uses the correct layout animation by hooking
into usingRemoteAnim API.

Bug: 132112131
Test: Manual test
Change-Id: I9bb96dbf436018e5488ede0c5ca48af787180aec
2019-05-10 10:28:07 -07:00
Kevin 47fc4f1316 Only do content fill anim after layout anim
The new remote animation may start after the tasks are loaded and we
start the content fill animation. This means the layout happens after
and the content fill animation will conflict with the layout animation.
To fix this, we should only do the content fill animation after the
layout animation as intended. If the tasks load before we start the
layout animation, we should just directly update to the latest UI
without animating as the views won't be visible before the layout
animation starts.

Bug: 132381412
Test: Manual test
Change-Id: Ibb55d8ef4499260ffa4bef5c6bba605ffdc85da7
2019-05-10 10:18:05 -07:00
TreeHugger Robot fc65c357a1 Merge "Fix anim done callback not being called sometimes" into ub-launcher3-qt-dev 2019-05-10 01:42:47 +00:00
Kevin f574bd5535 Ending pending anim should set to end values.
Pending animations have not started but when ending animations, we
should ensure they are set to their end values based off the
documentation for ItemAnimator's endAnimations and endAnimation.

Bug: 132285006
Test: Build using endAnimations and manual test
Change-Id: I3039a4f192d68a0ead700cd81675b3e7b4ef51f9
2019-05-09 17:47:37 -07:00
Kevin b0fcded7aa Move shared end pending anim logic for reusability
Some of the logic in endAnimations and endAnimation is shared and should
be moved to a common helper method.

Test: Builds and functions as before
Change-Id: I4973d50ad8778bb397938b5d65d9f95f48ff145b
2019-05-09 17:40:08 -07:00
TreeHugger Robot f079b277cf Merge changes from topic "polish-app-recents-anim" into ub-launcher3-qt-dev
* changes:
  Polish app => recents animation (5/5)
  Polish app => recents animation (4/5)
  Polish app => recents animation (3/N)
  Polish app => recents animation (2/N)
  Polish app => recents animation (1/N)
2019-05-10 00:07:18 +00:00
Kevin 5c0ee7ca37 Polish app => recents animation (5/5)
Add the part of the animation where task views fade in from bottom to
top. For the app animating in, we only fade in the label and the icon as
the snapshot needs to be visible as the app window scales down to it.

Bug: 132112131
Test: Manual test animation
Change-Id: Ia3fb98fde0b14fa4f72b53a1941cc2ee6b9f2294
2019-05-09 16:38:54 -07:00
TreeHugger Robot 1350be3c21 Merge "Use Animator cancel instead of end" into ub-launcher3-qt-dev 2019-05-09 23:25:54 +00:00
TreeHugger Robot f66f6aefcc Merge "Fix fallback recents not updating list from app" into ub-launcher3-qt-dev 2019-05-09 23:24:53 +00:00
Kevin 4ff2a278a2 Use Animator cancel instead of end
Animtor's cancel() skips some animator init logic that end() does so
we'd like to use that instead. The on end callback will still set the
animation value to its target end value so this doesn't affect
correctness.

Bug: 132285006
Test: Build and manual test endAnimations
Change-Id: I450a888c7b37a7dc74f24035d9abc5bda1cbbbd8
2019-05-09 16:08:09 -07:00
Kevin 63517a7a07 Fix anim done callback not being called sometimes
We should call dispatchFinishedWhenDone in endAnimations instead of
calling dispatchAnimationsFinished as the former will run the listener.
However, we only do this if we were running animations in the first
place.

Bug: 132285006
Test: Build and manual test endAnimations() call
Change-Id: I31afdc4c9e3ef5f56eda6178569d5c264c16ae78
2019-05-09 16:01:01 -07:00
Kevin 90137b035c Add task launch logging to Recents Go
Add logging points for launching tasks in Recents Go to match up with
non-Go Recents.

Bug: 131840601
Test: Log calls to confirm writing to stats log on task launch
Change-Id: I3d7b1ed30f99ce9f551c3481628ca81540e366b5
2019-05-09 14:12:40 -07:00
Kevin cde60e24b0 Fix fallback recents not updating list from app
When launching an from recents, onStop is not called until the app is
fully taken over and the remote animation finishes. As a result, if the
user hits the overview button right before the animation finishes, we
animate back to recents but never call onStart which is where we hook in
to update the recents list.

The fix naturally is to move this to onResume instead as once the
animation begins, the activity is paused.

Bug: 132293341
Test: Repro from bug, correctly updates
Change-Id: Ie6cfdc4d5aa6b1742a3bce3e14ab5ab6a4f05526
2019-05-08 18:23:52 -07:00
TreeHugger Robot 75d2bcbe41 Merge "Apply insets correctly to fallback Recents Go" into ub-launcher3-qt-dev 2019-05-09 01:21:19 +00:00
TreeHugger Robot 8c61598243 Merge "Fix 1.5x layout values" into ub-launcher3-qt-dev 2019-05-09 00:59:48 +00:00
Kevin 249e19fde9 Fix 1.5x layout values
Some of the values in the 1.5x scale layout dimens were incorrect. This
fixes them so that they are correctly roughly 1.5x the 1.0x dimens while
still being aligned to the 4 dp grid.

Test: Test on walleye_svelte, more closely aligns mocks
Change-Id: I26d2e216c67c523799e3a159d864718da211cec1
2019-05-08 17:41:37 -07:00
Kevin fe634af0c4 Apply insets correctly to fallback Recents Go
Insets were not being correctly consumed by the root view in the
fallback recents activity. This CL properly passes on the system insets
to the recents view so that tasks flow under the system insets.

Bug: 131853975
Test: Have separate default launcher, go to recents, go to landscape,
tasks scroll under status bar
Change-Id: I16f78da896522c5cf41951817747a24cd5cfe32c
2019-05-08 16:58:01 -07:00
TreeHugger Robot 827b8ada0d Merge "Fix bug skipping certain animations from ending" into ub-launcher3-qt-dev 2019-05-08 23:36:00 +00:00
Kevin 41d3a2a1d7 Fix bug skipping certain animations from ending
endAnimations forces an end to all running animations. This also removes
it from the list which changes the list while we're iterating over it.
This fixes the issue.

Bug: 132285006
Test: Manual test w/ build forcing endAnimations
Change-Id: I0ee9917866dafe00ef3122dd9a43259d19fb9f79
2019-05-08 15:30:33 -07:00
Kevin 07e12ee573 Polish app => recents animation (4/5)
Add the vertical ease in component to the app => recents animation. In
addition to animating over all task views, this should also animate over
the closing app surface so that the surface movement matches the
thumbnail as it moves to cover it. As a result, we take in the
transformation matrix thats passed in to the app surface and apply the
vertical motion to it.

Bug: 132112131
Test: Manual
Change-Id: I77c6716082af6ee722b96a2c362e16030cec8b8b
2019-05-08 15:11:25 -07:00
Kevin e590014834 Polish app => recents animation (3/N)
This CL takes the current scale down animation and updates its
interpolators and durations to match the UX spec. In addition, we move
the core logic to a helper method as the whole remote animation will
have other animations as well in the future.

Bug: 132112131
Test: Manual
Change-Id: I68b1d623b1b2c980dc34e41bbb5460cc021b5887
2019-05-08 14:06:55 -07:00
Kevin 1b4b960ff1 Polish app => recents animation (2/N)
This CL moves the core "app to overview" animation logic into
the main view as the newer animation would need to animate over several
of the main view's children and so the animation logic needs knowledge
of those children.

Bug: 132112131
Test: Build and test, functions as before
Change-Id: I9cbde55a582bee62e0a97e38c5fdf1d5841502db
2019-05-07 18:01:23 -07:00
Kevin f95e84a385 Polish app => recents animation (1/N)
As part of building out a better remote app to overview animation, we
first separate out the logic so that we only do the default layout
animation when coming from a Launcher state (i.e. from home or all
apps) and only then, so coming from an app no longer leads to the tasks
animating.

We do this with a simple flag that indicates that recents will be
using a remote animation.

Bug: 132112131
Test: Go to app, go to recents. No layout animation.
Test: Go to home, go to recents. Layout animation works as normal
Change-Id: I30988d944571fd5317d0c9d13e2a99b167c1291b
2019-05-07 17:09:43 -07:00
Kevin 141ab952e7 Ensure Recents Go layout finishes before remote anim begins
We would like to assume a correct up-to-date layout for Go recents
before the remote animation begins to ensure correctness of the app to
overview transition and allow for animating all the newly laid out task
views in sync.

We do this by checking if recents is the remote target we are animating
to and if so, checking if the view is ready.  If it is not, then we
delay the remote animation until the layout is finished and everything
is attached.

Bug: 132112131
Fix: 132108983
Test: Run Recents Go, have no tasks in recents, open app, press
overview to go to recents
Test: Test on AOSP and NexusLauncher that animations to Launcher work as
before (both to recents and to home)
Change-Id: Id74d90cffc9fe5db1dbb5fe63b8819c7436fef21
2019-05-07 15:05:39 -07:00
TreeHugger Robot 4ec8209c38 Merge "Check orientation changes on task item attaching" into ub-launcher3-qt-dev 2019-05-02 20:56:28 +00:00
TreeHugger Robot b0d9ef6cdc Merge "Fix bug where we left recents right after entering" into ub-launcher3-qt-dev 2019-05-02 20:50:03 +00:00
TreeHugger Robot 79be2caf1d Merge "Add scrim under status bar and above thumbnails." into ub-launcher3-qt-dev 2019-05-02 20:41:15 +00:00
Kevin b731c07e04 Check orientation changes on task item attaching
onConfigurationChanged is only passed down to views that are currently
attached. Naturally, a recycler view has some views in its pool that are
not attached and thus do not get the call when the orientation changes.
When this happens and the view is then attached later, it can be in an
incorrect orientation.

To fix this, we save the current orientation the task item is using and
check on attaching if it's still the same as the orientation the device
is in. If it isn't we then run the orientation change logic.

Bug: 131848689
Fix: 131848689
Test: Change orientation with some views not attached, see that they are
correct orientation when attached
Change-Id: I3dec501c332338444e321b4a50876c7840a5bc6e
2019-05-02 13:40:18 -07:00
Kevin 990e7d4593 Fix bug where we left recents right after entering
There was an issue where tapping recents while there were no tasks and
we first launched would not actually go to recents. This was because we
had the leave recents call tightly coupled with showing the empty view.
When the user first goes to recents and no task is available, we animate
to the empty view. However, this also causes us to leave the view even
though nothing happened and it results in the user leaving right after
enterring.

Instead, we should couple the leaving logic with the actual action,
removing the task.

Bug: 131708240
Fix: 131708240
Test: Go to recents while empty, goes on first tap now
Test: Ensured swipe to remove => leave recents logic still works
Change-Id: Ifff6d051d957838c3cfae200a2a8ebb316b22965
2019-05-02 12:09:26 -07:00
Kevin e659758f17 Add scrim under status bar and above thumbnails.
For Recents Go, the thumbnails actually go directly under the status bar
text, so we should ensure that there is some scrim to ensure it's always
readable. We do this by adding a foreground drawable scrim to the
activity's root view.

Since this root view is used in other Launcher states, Launcher has to
toggle this on and off when going/leaving recents. When this view is
just being used for recents as a stand-alone, however, (i.e. when the
user has a different default launcher), it's fine to set this once at
the beginning since nothing else uses the root view.

Bug: 131834685
Fix: 131834685
Test: When quickstep is the default, go to recents and back. Status bar
is readable. Scrim does not animate when going to and from recents.
Test: When quickstep is not the default, scrim shows up fine
Change-Id: I5d88a1fd873860887b3141e1ec0ee999f59ccfad
2019-05-02 11:46:32 -07:00
Kevin 70aa79ffa1 Anti-alias thumbnail corners to look smoother
Thumbnail corners should be anti-aliased so that they look smoother and
less rough.

Bug: 131779031
Test: Manual, go to recents and see corners
Change-Id: I49a299671ec37f56b6eebe2dd2eb71790e8cb2b4
2019-05-02 11:14:01 -07:00
TreeHugger Robot 34659d2153 Merge "Fade task items when swiping out" into ub-launcher3-qt-dev 2019-04-30 21:27:23 +00:00
Kevin 72e8025f75 Fix recents order being reversed sometimes
Occasionally, the recents list items were reversed.  This is because
RecentsTaskList#getTasks returns the actual backing list which we were
reversing, so we solve this by making a new array list.

Bug: 131367388
Test: Do repro in bug, no longer gives reversed order
Change-Id: I825d284e4768c2b53fedf07480e99d195acfa6d6
2019-04-30 13:39:10 -07:00
Kevin d8144a6304 Overlap insets with item margins
The system insets already create visual space for us, so there is no
need to add additional margin if we already have the insets acting as a
buffer. So we can just overlap them, preventing scenarios where we have
too much scrollable white space.

As a bonus, we get a more robust way of determining the clear all
button's bottom margins as we now base it directly off whether the
insets cover the space as opposed to using the orientation (which is
an indirect way of knowing the insets).

Bug: 131636735
Test: Test on 320x569 mdpi. Matches UX spec.
Change-Id: I6a3a3a5475ed303ed21bca3ed3cc363276c6e745
2019-04-30 10:33:55 -07:00