Commit Graph

285 Commits

Author SHA1 Message Date
Winson Chung 0b70cd4ca4 Finish recents animation when starting a new activity
- Defer starting the activity when an activity is paused, and finish
  the current animation to trigger launcher to be resumed

Bug: 132811175
Test: Swipe up and launch a new app
Change-Id: I78b76800052512eb93f69ccf0523f4d752a82ece
2019-06-26 14:01:56 -07:00
Rajeev Kumar 8ca7205c24 Fix NPE in OverviewComponentObserver constructor while accessing activityInfo.
Bug: 132461400
Test: Manual tests
Change-Id: Icee3730454db8129e597714c147c2cbaddc70987
(cherry picked from commit 219208a0f5)
2019-06-25 20:55:53 +00:00
Tony Wickham 59c6901823 Some improvements to home to overview transition for 0 button mode
- Peek in overview further, and with more overshoot
- Fade out and scale down workspace faster while swiping up
- Scale and translate workspace slower when letting go to enter
  overview (so it doesn't zoom out at warp speed)
- Fade in all apps shelf sooner

Bug: 132455160
Change-Id: Ieafad0ccf9bb587889bc35d536627661db10e358
2019-06-19 14:48:57 -07:00
Tony Wickham e8836dc082 Gracefully handle failed task launches during quick switch
When quick switching from home or overview, go to OverviewState if the
task launch failed. Otherwise we get stuck in BackgroundAppState.

Bug: 135038270
Change-Id: I42785c261cef0df95666bc106ec5ca6ef0553cc7
2019-06-12 15:24:58 -07:00
Tony Wickham a04e746e84 Fix getting stuck in BackgroundAppState for 2-button mode
When ending in recents, we reapply the state - therefore, it's important
to make sure we are in OverviewState before onSwipeUpComplete(). This is
done by mLauncherTransitionController, which sets OverviewState on end.
We already force mLauncherTransitionController to end before calling
onSwipeUpComplete(), but in this case we were calling cancel() and
setting mLauncherTransitionController = null, which meant we could never
call end() on it. Instead, we should always call end() if we set it to
null.

Also ensure mLauncherTransitionController is created even if the gesture
is completed, if an existing controller isn't already running. This can
happen if you swipe up quickly enough that we get onGestureEnd before
launcher is drawn, and in that case we still want the launcher component
to animate once its ready. This is even more important for 2-button
mode, because again, we rely on mLauncherTransitionController to set the
state to OverviewState before we reapply it.

Finally, clarified some methods by renaming "swipeUp" to
"swipeUpToRecents".

Bug: 132757019
Change-Id: Ieb24a4f36a39780e5d64d7bc312791608db474d1
2019-05-31 16:11:40 -07:00
Kevin 3c7d5fb9db Recents Go: Conform to device default style
System apps in Q should attempt to conform to device style, so naturally
Recents Go should also conform to this so that text changes with the
device style changing. This CL ensures all text views change font based
off system theming title fonts.

Bug: 131839392
Fix: 131839392
Test: Change device theme body font, see that change is propogated to
Recents Go app texts, clear all, and empty recents message
Change-Id: Ib85ff49383221ef18ed8aa9e53eff129129e37c2
2019-05-22 13:39:32 -07:00
TreeHugger Robot d2e40927a7 Merge "Scale down thumbnail with app surface" into ub-launcher3-qt-dev 2019-05-14 23:26:46 +00:00
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
Kevin fd968a79a8 Scale down thumbnail with app surface
The recents Go app to overview transition has app scale down to a
thumbnail but normally covers the thumbnail.  However, apps with
transparency will be semi-visible and will allow the user to see
the thumbnail in the back at its final size. Instead, we should fit
the thumbnail to the surface so that they both scale down at the same
time.

Bug: 132458092
Test: Go to app with transparency, scale down
Change-Id: Iaebeaaf2ddcfc86fd4f55ef9d8c3f19583947c48
2019-05-10 16:09:04 -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
Kevin 8f6d41ee53 Fade task items when swiping out
As we have a fixed width for the task list now, we have to ensure that
we do not clip the task items when we swipe them out. In addition, we
should fade them out by the end of the swipe as the swipe end location
may still be on a visible part of the screen.

Bug: 131686863
Test: Go to landscape mode, swipe out tasks
Change-Id: If86136a9f9d47098a6dd5d355d3a99d540165c77
2019-04-30 09:13:51 -07:00
TreeHugger Robot 40689ca9ab Merge "Fix thumbnail views not rotating w/ orientation" into ub-launcher3-qt-dev 2019-04-30 00:45:37 +00:00
Kevin 27831e1b01 Fix thumbnail views not rotating w/ orientation
View has an optimization where it will not measure again if it
is exact and the measurement has not changed. This means that when an
onMeasure pass starts off for each task view on orientation change,
it does not get passed down to the view holding the thumbnail and
icon as its measure specs have not changed. This causes an issue as
we use this measure call to react to orientation changes and
re-measure the thumbnail view to match the orientation of the device.

To fix this, we call forceLayout on the child explicitly on orientation
change to ensure that we get the measure call. This sets the flag to
force a re-measure in the next layout.

Bug: 131427332
Test: Do repro in bug, view rotates correctly
Change-Id: I0ef84dfcd0b3883582c8903d99d5e8a757ae8e74
2019-04-29 17:15:20 -07:00
TreeHugger Robot 67b6541d7e Merge "Add 1.5x dimens for screens that are large enough" into ub-launcher3-qt-dev 2019-04-29 23:55:29 +00:00
Kevin 3dae6383f4 Add 1.5x dimens for screens that are large enough
For phones with smallest width at least 480 dp, we can scale
everything by 1.5x to fill in the space better. For phones with less
width than this, we maintain the current 320 dp specification.

Bug: 131610834
Test: Emulate on 240x320 ldpi, 480x800 hdpi, 480x800 mdpi, 800x1280 mdpi
on both portrait and landscape and layouts work as intended
Change-Id: I3f7d28dc22aa3a2de96b3de51b1aa5b5c2cb19fc
2019-04-29 16:43:12 -07:00
Kevin 0448ab6d7d Don't clip recents items with system bars
In order for items to go under the system bars, we have the recents view
consume the insets by setting padding to the recyclerview instead of
setting the margins with it. Then, we ensure the recycler view does not
clip to padding so that items are still visible even when scrolled past.

Bug: 131626311
Test: Manual test; items go under system bars
Change-Id: Iecbab537b8f9e2993ad5f74f87ba2e0c56fb0f63
2019-04-29 16:06:32 -07:00
Kevin dd165d2d7c Align layout to dp grid for landscape
Set a fixed width for the recyclerview and center it for landscape mode.
In addition, put a margin below the clear all button as we no longer
have the nav bar padding the area below.

Bug: 131610834
Test: Manual; See recents UI in landscape mode
Change-Id: I8c74d2d7cc363a76c4c978befdc975693d700f86
2019-04-29 15:21:08 -07:00
Kevin fc3a79e45e Layout aligned to dp grid for portrait (3/3)
Remove old custom view functionality to size based off device height
since we now specify dimensions exactly.

Bug: 131610834
Test: Builds, layout meets spec in portrait mode
Change-Id: Id401f27360f6bb2450d3ffb77888a1f709dc62f8
2019-04-29 14:52:56 -07:00
Kevin ad8ca82e61 Layout aligned to dp grid for portrait (2/3)
Add vertical margins to all recycler items. In the future, we will
change these dynamically to ensure a task item is semi-visible on screen

Bug: 131610834
Test: Builds
Change-Id: I0b21c8ea7249e7fac640705e8128e309b954815b
2019-04-29 14:48:48 -07:00
Kevin eb815415da Layout aligned to dp grid for portrait (1/3)
This CL sets fixed dp values for the recents item views based off the UX
spec.  Vertical margins will be handled by an item decorator in the next
CL to handle special cases.

Bug: 131610834
Test: Builds
Change-Id: Ieb7936bd24933552844a6bd1bdb9e3101b8cdca4
2019-04-29 13:12:54 -07:00
TreeHugger Robot f5ef0be08d Merge "Rotate thumbnail view based off device orientation" into ub-launcher3-qt-dev 2019-04-26 00:57:58 +00:00
Kevin a4949471be Rotate thumbnail view based off device orientation
In landscape mode, recents thumbnails should be shown horizontally, so
this CL modifies the custom view so that it resizes to display a
horizontal snapshot.

Bug: 114136250
Bug: 131095241
Test: Rotate recents, see view width change appropriately
Change-Id: Ic3d8d039535c673567d19c372da211d177691a81
2019-04-25 17:43:48 -07:00
Kevin 90bddf0cf8 Round thumbnail corners
Round the task thumbnail corners as per the mocks by setting the bitmap
as a shader.

Bug: 114136250
Test: See rounded thumbnails on recents Go
Change-Id: I2bf8ebce34deb0d1cb6199cf8f6d5fa6ac746bb8
2019-04-25 17:27:01 -07:00
Kevin 1335c36c15 Don't layout empty tasks in layout anim if we have the actual content.
When we load the task content (icons, snapshots, etc), oftentimes, we
are still in the middle of the layout animation where items are fading
in from bottom to top. At this point, we start a second content-fill
animation from bottom to top that fades from empty => filled after the
first animation.  However, we can improve this so that empty views
aren't shown for a split second for some of the later laid out views.

If the first animation has not finished and we would animate a content
change from empty => filled but the view is currently still not visible,
we should just complete the content transition on the spot so that the
layout animation lays out the filled version instead.

Bug: 131339235
Test: Go to recents, observe lay out animation does not continue to lay
out the empty view first

Change-Id: I936a81e6cf8b3552cdee90c183fc841f50ec9ea8
2019-04-25 12:53:20 -07:00
Kevin 71d3e30fd1 Fix overview cmd launching wrong task in landscape
Previously we used the bottom most view in recents list to launch the
recent task when the user pressed the overview button. However, if
the user is in landscape and scrolls up so the bottom view is not
attached, pressing overview command will launch whatever the bottom task
is visually which is incorrect. Instead, we get the actual task from the
model to launch and only use the "view => app" animation if the view for
that task is attached. If it isn't, we use the basic animation.

Bug: 130735711
Test: Go to landscape, scroll up, hit command, launches correct task
Change-Id: Idff88054443259e917bbec1b47d78efbb1544283
2019-04-24 18:01:08 -07:00
TreeHugger Robot 648d088e6e Merge "Use custom drawable for Recents Go thumbnails (2/2)" into ub-launcher3-qt-dev 2019-04-24 01:06:25 +00:00
Kevin 483d2ddd41 Use custom drawable for Recents Go thumbnails (2/2)
Hook up the thumbnail drawable created in the first CL to the task
thumbnail so that the drawable automatically rotates and resizes based
off the device orientation.

Bug: 114136250
Bug: 131095241
Test: Go to app in landscape, go to recents, rotate => thumbnail rotates
Change-Id: Ib58e45ab3e94aeb080e47b1d5b38c221acce5ef3
2019-04-23 15:35:05 -07:00
Kevin 8d5d17bf53 Tweak clear all button layout UI
Add vertical margins to clear all button and add horizontal padding.

Bug: 114136250
Test: Manual test on marlin_svelte and emulated tablet (1280 x 800)
Change-Id: Iae8d6609ca1031947e8e8d90f526d9cbda070ee5
2019-04-23 14:47:55 -07:00
Kevin 0eefc8530e Clear all button should not be swipable
Unlike other task items in the recycler view, the clear all button
should not be swipable as you obviously can't remove the button.

Bug: 114136250
Test: Go to recents, attempt to swipe clear all, does not work
Change-Id: I0ab00c03b697f2174431b69bbf758c3ff104db97
(cherry picked from commit cd88cf8d1c)
2019-04-23 19:28:17 +00:00
Kevin 072dcc3aeb Use custom drawable for Recents Go thumbnails (1/2)
In order to support rotated thumbnails based off the device orientation,
we should create a custom drawable that supports drawing a rotated
bitmap based off some requested orientation. This CL adds this class,
and we'll use it in a later CL.

By baking this directly into the drawable, we prevent unnecessary
allocations of rotated bitmaps.

Bug: 114136250
Bug: 131095241
Test: Builds
Change-Id: Ib4e83e3619028c583e10f1b8d743a365ec310346
(cherry picked from commit 518ff10856)
2019-04-23 19:28:05 +00:00
Kevin 728deff7c0 Add clear all view that scales off device height
Add a custom clear all view that scales its height based off the height
of the device in portrait. This view holds and lays out the actual
button.

Bug: 114136250
Test: Task items + clear all scale to fit flush with screen size
Change-Id: I72b175681c104588970d57cde34cebc0f06b55a0
(cherry picked from commit a2b8ca8830)
2019-04-23 19:27:53 +00:00
Kevin 52645638e9 Ensure recents scrolled to first task in landscape
The app should animate to the bottom view which means we should ensure
the bottom view is scrolled to be visible at the bottom when we animate
in. Note that this is only a consideration in landscape since in
portrait, all tasks are always visible and the recyclver view is not
scrollable.

Bug: 114136250
Test: Go to recents Go from app in landscape mode
Change-Id: If4ea35759cc881f2c32565368d031620b62a45dd
(cherry picked from commit 64bb5bbb78)
2019-04-23 19:27:42 +00:00
Kevin 5f4e2fead0 Enable landscape mode for Recents Go.
Set rotate state to request rotate on the overview state being enabled

Bug: 114136250
Test: Go to recents go, rotate screen
Test: Go to recents from app
Change-Id: If63bf25f61b873f67986e463a980e6d67a9b5ae4
(cherry picked from 20e1f17340)
2019-04-23 19:27:30 +00:00
Kevin 6af38e14aa Remove old recyclerview layout logic
Remove old layout logic for recycler view as there is no need for the
recycler view height to change based off device profile. Instead the
task items themselves will change.

Bug: 114136250
Test: Builds
Change-Id: Ia6dae22e3e73fafe46d4adf834bf7d24af36a607
(cherry picked from commit cacf7df2d4)
2019-04-23 19:26:21 +00:00
Kevin 1834728db6 Calculate task height directly off portrait height
Change task height calculation implementation to be directly based off
device height in portrait mode. This allows the recycler view
layout manager's job to be simpler while still ensuring that task height
changes dynamically based off device configuration changes.

Bug: 114136250
Test: Go to recents Go, task height is based off portrait mode height
Change-Id: I9c7cada3b89d2b2cea5ece8c357a40ce5974a2e6
(cherry picked from commit 3172c6811b)
2019-04-23 19:26:10 +00:00
Kevin b6519e1036 Fix task adapter notify merge conflict
Resolved merge conflict of ag/7093095 incorrectly and accidentally kept
both HEAD and CL changes. Resolved in this CL.

Test: Manual test
Change-Id: Iad42ab12b486201f496c83f99c8c6094273543f3
(cherry picked from 420115e7f1)
2019-04-23 19:25:50 +00:00
Kevin 4ba81d1c6f Move clear all to recycler view (2/2)
This finishes moving the clear all button to the recycler view.
Primarily, this CL deals with changes to calls that depended on recycler
children being task item views and starting at the 0th index.

Bug: 114136250
Test: Build, manual test
Change-Id: Icecf257409207de351345997205def11e1048ab0
(cherry picked from 8659925532)
2019-04-23 19:25:14 +00:00
Kevin eda02641a2 Move clear all to recycler view (1/2)
First part of moving clear all button to recycler view.  This CL adds
support in the recycler view adapter for a clear all holder type and
hooks it up to the previous clear all animation.

Adding this breaks several assumptions made externally on the type of
the item and index which will be addressed in the second part.

Bug: 114136250
Test: Builds, testing pending 2nd part
Change-Id: Ib16790028d4e9f520945a987b3dace40d19f2468
(cherry pick from 8573ff04b4)
2019-04-23 19:25:05 +00:00
Kevin 56abdd7ade Only switch item animator on content fill if needed
We currently switch to a different recycler view item animator for a
special content fill animation when we have loading item UI up and want
to animate to the actual content. However, it's possible if the task
content loading is fast enough, we may return before the adapter
changes have actually propogated to the recycler view layout. In this
case there is no loading UI to fill and we should not switch item
animators.

Bug: 130820737
Test: Go from app => overview, try to remove, remove animation occurs
properly
Change-Id: Ic95854d04df98023f444daf967c58bdd8177722a
(cherry picked from commit 035f0d2157)
2019-04-23 19:24:58 +00:00
Kevin 1866ecf638 Fix NPE and make getTask return Optional
Fix an NPE when attempting to update the thumbnail in IconRecentsView.
If the task item is binding the loading UI, it has no task so the app
will crash, so we just need to ensure the task is actually present
first.

While we're here, also change the API to return an Optional<Task> and
make a tighter contract, making it harder to make this mistake in the
future.

Bug: 130746661
Fix: 130746661
Test: Go from app => overview on recents Go
Change-Id: I1402fcd2e58bdeb703c7dcc1b9dcf0d258808b3d
(cherry picked from commit 77f01524bd)
2019-04-23 19:24:52 +00:00
Kevin 532fb48331 Fix ViewTreeObserver crash on Recents Go
The view tree we originally attach the onGlobalLayout listener to may no
longer be alive when we get the callback as the view tree observer
merges when the view attaches to a view hierarchy, giving us an
exception. Instead, we should request the view tree observer again and
remove it from there.

Bug: 130740246
Fix: 130740246
Test: Manual test, no longer crashes
Change-Id: Idb982022e72db75b8e20fd5bea00655212dc0258
(cherry picked from commit 60f21a8d3a)
2019-04-23 19:24:43 +00:00
Kevin a94154970a Fix snapshots not updating on app => overview.
Previously we were only updating the model on snapshot update and not
the view itself, so the view would have an outdated snapshot if it
loaded everything before the data updated itself.

Bug: 114136250
Fixes: 130635650
Test: Go from app to overview, transitions properly with new snapshot
Change-Id: Ife9cae7a700a855788b5d25b05d78e562e1b27f0
(cherry picked from commit 025799ba9c)
2019-04-23 19:24:32 +00:00
Kevin 9c91de5a9d Fix views not being visible on Recents Go.
If we bind the loading task views but then on the tasks being loaded
realize there are no items, it's possible to animate from the empty
content view to the regular content view and then back. Currently, this
leads to updateContentView not being called properly the second time
since both views are still visible during the animation, so this CL
fixes that and cancels any on-going crossfade animations.

Bug: 114136250
Fixes: 130580680
Test: Remove last item from recents, go to recents again, empty view
shown
Change-Id: If1a4caab15f9b6d7ccd3abbc06f5866e06650db8
(cherry picked from commit cce954f334)
2019-04-23 19:24:22 +00:00
Kevin 3f343b7b53 Smarter task laying out based off onMeasure
Previously laid out via calls to layoutParams. This isn't as optimized
as being baked into the measure + layout system and has the issue of
being less flexible. For example, if the device profile changes (e.g.
orientation change), we'd have to apply new layout params for all the
views. With this CL, we would only need to do this for top-level views
and the children will resolve themselves.

Bug: 114136250
Test: Check layout on marlin + walleye
Change-Id: Iddd503a8844bdde7724d3f804660da61719d5c90
(cherry picked from commit c98f116b77)
2019-04-23 19:24:13 +00:00
Kevin f17917fab3 Change layout size to be dependent on device size
This CL changes the layout sizes to be dependent on device height as
opposed to static values so that it works on different decides out of
the box.

Bug: 114136250
Test: Tested how layout looks on marlin_svelte and walleye
Change-Id: Ie000bc797d7dd2e38cd705d54f3e09c79e1a2176
(cherry picked from c06522c826)
2019-04-23 19:24:05 +00:00
Kevin e47543d03f Update Go recents visibility based off adapter
View visibility should be based off adapter since that's what the layout
items are based off of.

Bug: 130440957
Test: Loading UI is shown when going to recents Go
Change-Id: I1f167553b6fdce757865c739b9793b63a20e7f57
(cherry picked from commit f1a47a0fe6)
2019-04-23 19:23:57 +00:00
Kevin 29cdac41f1 Animate content fill animation to Recents Go
This CL adds the animation that occurs when transitioning from a set of
empty views to the actual task list after it is loaded. This is done by
setting a one-shot item animator that animates changes, for item views
that fade from empty to filled, and removes, for when we have too many
empty views.

Bug: 114136250
Test: Artificially increase task list load time and see animation fill
Change-Id: Ibbc09db702e591063ceea61df2359f18a3fcf8f9
(cherry picked from commit 987799dfa1)
2019-04-23 19:23:44 +00:00
Kevin 1060a0d7fc Animate to bottom view in app => overview
We always want to animate to the bottom so we should just do that if we
have the view laid out even if at the time the app task doesn't actually
match the view.

Bug: 114136250
Test: Go to recents, press overview twice quickly, see it animate
correctly
Change-Id: I0516ef127ff6ef0f865c85314c9ffe4a7c6ef9e3
(cherry picked from commit 86957f28ff)
2019-04-23 19:23:25 +00:00
Kevin 6f927ecd8e Differentiate empty UI from default in recents Go
Use the "empty" drawable as the initial UI until the recents task list
and order is loaded, then switch to default/filled UI.

Bug: 114136250
Test: Manual test; see empty UI when loading takes time
Change-Id: I85b72e6d40d7224b28217cbf4e05515ec1e9451b
(cherry picked from commit a2c4200cde)
2019-04-23 19:22:42 +00:00
Kevin 2ee78b7310 Add task content animation property
Add API to animate task item content transition from one set of task
content (icon, thumbnail) to another. To do this, we provide two things
to the caller: startContentAnimation which allows the caller to set the
icon, thumbnail, and label to animate to and the
CONTENT_TRANSITION_PROGRESS property which the caller can use to control
the transition progress.

We will eventually hook this up to onBindViewHolder for the task adapter
when there is a data change event to prepare to animate content in.
Currently it still changes immediately.

Bug: 114136250
Test: Builds
Change-Id: I16e9b757ee91be54fe8cba6780b399e3cc313e3e
(cherry picked from commit a3d80d102e)
2019-04-23 19:21:58 +00:00
Kevin 7b42d2287a Fix transition progress not applying to drawables
TaskLayerDrawable should reapply UI changes from the transition progress
when there is a new drawable. In addition, the transition should check
if the drawable in the front and back are the same (i.e. on
initialization when both are showing the empty drawable) so that it only
applies the front-drawable alpha.

Bug: 114136250
Test: Builds
Change-Id: I74836b5043da555358742ba0a3f46f170f590904
(cherry picked from commit 1531982d1e)
2019-04-23 09:27:46 -07:00
Kevin fbe9182b75 Change layout anim from Animation => Animator
Change the layout animation to use animators instead of the built-in
animation-based layout animation. Animator-based animations are more
flexible and can act on the view properties themselves, making it
easier to deal with if we need to cancel the animation later from a
conflicting animation (i.e. we find out we need to animate a view
out).

Bug: 114136250
Test: Go to recents, see items animate in
Change-Id: Id8227cd50e81999cac98912ac58cd2d6864c40af
(cherry picked from commit 26ad999b10)
2019-04-23 09:26:52 -07:00
Kevin 6092a6ee1e Add drawable for default thumbnail for Recents Go
This CL adds a drawable for the default thumbnail view and
refactors the logic to get the default icon/thumbnail/label if
null to separate methods for re-use in later CLs.

Bug: 114136250
Test: Manual; Go to icon recents
Change-Id: I511ea40ace040fc53ffc69c27149f24d69bda7b0
(cherry picked from commit 34ee30c4f9)
2019-04-23 09:25:54 -07:00
Kevin e6e1463ed2 Add task layer drawable class for Recents Go.
Add a custom drawable class that provides a hook to the caller to
control a crossfade animation between two drawables. This will be
helpful going forward to sync up all the animations to the controller.

Note that this CL only adds the class and does not replace the current
implementation.

Bug: 114136250
Test: Builds
Change-Id: I3cc6be79cb2ca5d64c8cc2945ff7f2ebd49632b6
(cherry picked from commit bb956bd028)
2019-04-23 00:42:49 +00:00
Winson Chung 4060a75d8f Add state callback in launcher
Bug: 129785904
Test: Manual, change states and verify state is sent
Change-Id: Ia1f69494a6cbae68085fb09670ffa309ce147430
(cherry picked from commit c4b88c3dfb)
2019-04-11 18:11:51 +00:00
TreeHugger Robot 2945bc84b5 Merge "Removing unnecessary corner size caching in RecentsModel" into ub-launcher3-master 2019-04-05 23:32:17 +00:00
Sunny Goyal c7cc3dc2c5 Removing unnecessary corner size caching in RecentsModel
Change-Id: I1be87dc15a3b9ec8225dccce701bff19785658d6
2019-04-05 15:11:42 -07:00
Kevin 2bd36dd326 Don't put up loading UI if load isn't necessary.
Do not put up the loading UI when we don't need to load (whether that's
because we're already up to date or there is already a load in progress)

Bug: 114136250
Test: Manual; go to recents and see that it doesn't load when updated
Change-Id: Idbcc3731e4ecab8f67b7b5b07a98cb112ed4e07a
2019-04-05 14:44:16 -07:00
Kevin 3e98796189 Add layout animation for Recents Go
Add a layout animation where views fade in upward in a cascade and play
it every time the user goes to Recents.

Bug: 114136250
Test: Go to Recents and see cascade animation
Change-Id: Ia6fdd344f0bfb46c4d507e50f278a86a4432c2b6
2019-04-05 12:20:55 -07:00
Kevin fc6781992d Control logic for putting up loading UI
This CL introduces the logic to put up and bind loading task views while
the first phase of loading occurs (i.e. loading the number and order of
recents items).

Bug: 114136250
Test: Go to recents, see tasks loading
Change-Id: I59bdc0fccc7f309ea4cded175c04a464b5a3665e
2019-04-05 11:04:10 -07:00
Winson Chung 41d58f7100 Add launcher logging of back button
Bug: 127848641
Test: adb shell setprop log.tag.UserEvent VERBOSE, then hit back
Change-Id: I020738280d2e51a8a192e577baf48c0b092f22f6
(cherry picked from commit df7d00328c)
2019-04-03 22:41:39 +00:00
Sunny Goyal 65f2396ecd Merge "Adds the ability for Launcher3 to respond to QSB alpha change requests." into ub-launcher3-master 2019-04-03 20:20:12 +00:00
Sunny Goyal 27211592e1 Removing unused import in TouchInteractionService
Change-Id: I207e56189bbdb0105430a47f6a9069c6382354b2
2019-04-03 11:03:14 -07:00
Govinda Wasserman 24e489e5a3 Adds the ability for Launcher3 to respond to QSB alpha change requests.
Test: Tested locally
BUG:124063782
Change-Id: I8c4bfaa62d9608fcfffff5e30b2913f3a6fb2f75
(cherry picked from commit 827f0807d3)
2019-04-03 17:33:55 +00:00
TreeHugger Robot 3388e34799 Merge "Disable input while animating clear all on Go" into ub-launcher3-master 2019-04-02 00:41:55 +00:00
Kevin 1497112599 Disable input while animating clear all on Go
Prevent janky things from happening by preventing user input from going
through while the clear all animation is occurring.

Bug: 114136250
Test: Hit clear all => try to clear all / tap task, nothing happens
Change-Id: If7bd6b54e4b1b8185fafda990561973ea17b9648
2019-04-01 17:04:31 -07:00
TreeHugger Robot 3b4794f6d2 Merge "Boost correct layer for Recents Go transition" into ub-launcher3-master 2019-04-01 21:14:34 +00:00
TreeHugger Robot 639598245c Merge "Hook up Go recents view API to recents activity" into ub-launcher3-master 2019-04-01 21:06:46 +00:00
Kevin 552071b5f4 Boost correct layer for Recents Go transition
For transition from app to fallback recents, the apps were on the same
Z-layer causing both to show up in the animation. We should instead
boost the closing app so that it's visually on top as it shrinks down.

Bug: 114136250
Test: Press overview in app to go to recents, behaves as expected
Change-Id: Iaca1e4fc1486721468a5bfffb1d139259d48739f
2019-04-01 13:00:57 -07:00
Kevin b6320aeeb6 Hook up Go recents view API to recents activity
Hook up onBeginTransitionToOverview for fallback recents as well by
hooking it up to activity start.

Bug: 114136250
Test: Go to recents for fallback recents
Change-Id: I5445bce13ecf7c0dbc2f2b3ff0d8a0aee1449ae1
2019-04-01 12:06:43 -07:00
Kevin b2c73b43a1 Fix crash on fallback recents Go activity
Recents Go would crash when attempting to touch the fallback recents
activity since it's based off the base dragging activity in launcher
which assumes some touch controllers are initialized. As we leave
all touch input to hooks on the views themselves, we do not need touch
controllers and initialize an empty list instead.

Bug: 114136250
Test: Launch fallback recents activity, touch around
Change-Id: Ic136ace6f968d8c469c6f300daf4ee28fbde5e69
2019-04-01 11:20:56 -07:00
Sunny Goyal 5743f8635b Making navigation mode listener a singleton so that the change is dispatched
everywhere synchronously.

Change-Id: Iee8c5957d78dfad3fb03e814de0367adcaa0c98b
2019-03-29 09:36:45 -07:00
TreeHugger Robot a978f4d76e Merge "Add clear all animation to Recents Go." into ub-launcher3-master 2019-03-29 02:14:50 +00:00
TreeHugger Robot 7c1d69e515 Merge "Show ASAP for Recents Go and load content after" into ub-launcher3-master 2019-03-29 02:07:01 +00:00
Kevin b589241fd6 Show ASAP for Recents Go and load content after
Recent UX discussion led to decision to show as soon as we have the list
and order and then load the content in after as soon as it comes. This
introduces API in TaskListLoader to facilitate this and default values
for the view when the content is not yet loaded.

Bug: 114136250
Test: Go to recents, see content load in
Change-Id: I6766cf014e3de78894353614157dbc8798031c2f
2019-03-28 18:10:52 -07:00
Tony e4c2e2b86c Add QuickSwitchTouchController on home
- Added QuickSwitchState, which we animate to when swiping right
  on the nav bar from NORMAL state
- Task launches when the state transition to QuickSwitchState ends

Bug: 126596417
Change-Id: Id66650401d817703fc6d044fb26a25cccbc07e11
2019-03-28 15:09:25 -05:00
Tony e06fef45a4 Move some classes to packages
Added states/ and touchcontrollers/ packages

Change-Id: I8d59c47770c24c9edd1b7ce879e6a80ca8b88c71
2019-03-27 19:45:04 -05:00
Tony 1787ee9596 Peek overview on motion pause, then animate fully on touch up
Add AnimationComponents.ATOMIC_OVERVIEW_PEEK_COMPONENT, and rename
previous ATOMIC_COMPONENT to ATOMIC_OVERVIEW_SCALE_COMPONENT.

When SWIPE_HOME is enabled:
- Overview lives to the left of Workspace, which is encoded in
  LauncherState.NORMAL.getOverviewScaleAndTranslation().
- Create atomic animation based on ATOMIC_OVERVIEW_PEEK_COMPONENT
  and OVERVIEW_PEEK state when swiping and holding from home screen.

Bug: 111926330
Change-Id: Iab6dbef7238dae15b3036d4b2a026b781eee6b4b
2019-03-27 19:45:04 -05:00
Tony bc23440d73 Add translationX to overview state
States return ScaleAndTranslation instead of float[].

Also separate overview translate interpolator from overview scale interpolator.

Change-Id: I5e65dde3f436055ff5e7f5736f1a4b712377b9cb
2019-03-27 14:36:48 -05:00
Kevin 5bf71b2268 Add clear all animation to Recents Go.
Add clear all animation where task views fade out to the right and the
view fades to home.

Bug: 114136250
Test: Hit clear all
Change-Id: I5a3336da5b724ce19d9ef854efde0dd1f654941a
2019-03-22 16:18:28 -07:00
Kevin c977ea9a3c Add overview button handling to Go recents.
Add the same overview button handling as in the original launcher.
Specifically, pressing overview on recents will launch the next
appropriate task (e.g. the next most recent task if you came from an
app).

Bug: 114136250
Test: Go to recents from launcher, press overview => launch task.
Test: Go to recents from app, press overview => launches next task
Change-Id: I946974b4c2b65b6d0f212d8e8c0816983386d952
2019-03-22 12:53:02 -07:00
Kevin 969e7a6c57 Rename task input controller.
The TaskInputController class doesn't need to be tightly coupled with
the actual input method, so we should rename it and the methods to
correspond to the actual logic. For example, both tapping a task and
pressing the overview button on recents should launch a task and should
both use this logic.

Bug: 114136250
Test: Launch tasks, clear tasks, clear all
Change-Id: If4f7f1d6ee9b05ffaf65cb13df633679cc8efcbe
2019-03-21 18:00:44 -07:00
Kevin fefe8b6d0e Add clear all button to Recents Go
Add a button to clear all tasks to the recents Go layout and hook it up
to the model.

Bug: 114136250
Test: Open recents, hit clear all
Change-Id: Id67310ce88053528d372e4dc21e2b011ed957646
2019-03-21 15:04:21 -07:00
TreeHugger Robot d6585350d0 Merge "Add recents launch animation to Recents Go" into ub-launcher3-master 2019-03-20 21:57:49 +00:00
Kevin 72114efef6 Add recents launch animation to Recents Go
We use the basic clip reveal animation to animate from the task
thumbnail view to the opening app.

Bug: 114136250
Test: Tap task from recents
Change-Id: Id582385fc022c75ee322beebdc6cf7a0f209e720
2019-03-20 14:47:32 -07:00
Tony bfc9dde03e Replace translationYFactor with just translationY
Now that we don't have quick scrub, the only state that has a non-zero translation is all apps,
which just uses that to have a slight parallax. This is much simpler to define in terms of pixels
like other states do.

Change-Id: I108c8505d85591399256b3475f7566ff51e2c5ad
2019-03-20 15:36:31 -05:00
Kevin 502847f7eb Add app to overview anim for Recents Go.
This CL adds the first iteration of window animation to go from
the app back to recents provided that the view is ready to be
visible to the user.

Bug: 114136250
Test: Go to recents, launch app, press overview to go back to recents
Change-Id: Ic0567e7c87fa964bdad25d07eca61b78407a9ff5
2019-03-18 17:15:15 -07:00
TreeHugger Robot 9b4c82cbf9 Merge "Add activity interface to Recents Go view" into ub-launcher3-master 2019-03-15 22:19:21 +00:00
Kevin 5163b58d52 Add activity interface to Recents Go view
Add an interface for recents to activity logic that can be set on the Go
recents view. This CL includes a method for the logic that should occur
when leaving recents due to having no tasks remaining.

As the view has no knowledge of the containing activity (could be
Launcher or could be a separate activity), this interface must be set
externally.

Bug: 114136250
Test: Remove all tasks, see that it goes to home when l3goIconRecents is
the default launcher
Change-Id: I110abab49c22e245b98a1f9b91b0b0f052886098
2019-03-15 15:09:38 -07:00
vadimt d64b4f44da Switching swipe-up to overview to using test info provider
Also moving test provider to Quickstep to have access to the new info;
and now Launcher3 doesn't have it.

Bug: 123904290
Change-Id: I653376610e83839d102beb9c0604950dd314e8ba
2019-03-15 11:42:06 -07:00
TreeHugger Robot 65b1cdbdea Merge "Fade to empty view when no tasks for Recents Go" into ub-launcher3-master 2019-03-13 22:55:15 +00:00
Kevin 3cb12c8d20 Fade to empty view when no tasks for Recents Go
This CL adds a view for when there are no tasks and fades into/out of it
appropriately based off changes to the adapter.

Bug: 114136250
Test: Add task, remove task, see empty view shows up properly.
Change-Id: I47d0bbfb19d56f5f0de5bec3c0ac2b5cfb63253f
2019-03-13 15:46:41 -07:00
Sunny Goyal 1e6641fc74 Merge "Removing fade animation on swipe up" into ub-launcher3-master 2019-03-13 22:05:27 +00:00
Kevin 100e1263e2 Add thumbnails to the task view.
This CL adds thumbnails to the task view so that the labels are next to
a combined view with the thumbnail to the left and the icon at the
bottom right.

Due to the way launcher creates shadows on icons, the icons are actually
smaller than desired, so there need to be further changes to determine
the appropriate scale in order to have the bottom of the icons be flush
with the snapshot's bottom.

Bug: 114136250
Test: Launch l3GoIconRecents, see thumbnails + icon
Change-Id: Ief1cf54634544b9e310c68588998901871efda44
2019-03-13 12:59:39 -07:00
Sunny Goyal 58ddac1d09 Removing fade animation on swipe up
Fade animation is no longer required as the transform is also handled on
the main thread. So we will get the RecentsAnimaiton always after Launcher
has drawn

Change-Id: Ieb05406c9a5b9132b0518155bdbda16c1f73a6ec
2019-03-12 16:24:05 -07:00
Kevin 013af455b1 Implement swipe to delete on Recents Go
Introduce a ItemTouchHelper.Callback implementation that hooks up remove
logic to swiping right on task items. Additionally, tighten the
modification access to the task list in TaskListLoader so it is harder
to mis-use.

Bug: 114136250
Test: Removed app via swiping
Change-Id: I9b6e2783d1f6d56e655e9b7ffa9af85328f98159
2019-03-12 15:10:22 -07:00
Kevin 1ae97d81f6 Add TaskInputController for Recents Go
Add TaskInputController, a class handling input logic for the Recents Go
view. This CL hooks up the tap to launch logic with swiping + clear all
to be added in a later CL.

Bug: 114136250
Test: Build Launcher3IconRecentsGo and tap apps; see that they launch
task
Change-Id: I03e14a6f66307b9c6239cdeaec95d09f160fa3e0
2019-03-11 15:05:52 -07:00
TreeHugger Robot 8f8fae4b46 Merge "Add task item view for Recents Go." into ub-launcher3-master 2019-03-09 02:20:05 +00:00
Kevin c0a67af456 Add task item view for Recents Go.
Add a task item view for the recycler view to inflate when task data
updates. Currently, the adapter only binds the icon and label.
Thumbnails will be handled in a separate CL.

Bug: 114136250
Test: Manual test Launcher3GoIconRecents
Change-Id: Iaff2001fbbf0a3fc6f5781f90b336bee43f9076e
2019-03-08 17:42:53 -08:00
TreeHugger Robot 5f094590f2 Merge "Add task thumbnails to the Recents Go loader." into ub-launcher3-master 2019-03-09 00:41:56 +00:00
Kevin b9ebd812a4 Add task thumbnails to the Recents Go loader.
This CL adds thumbnails to the content loading for Recents Go so that
they are fully loaded before recents show. We utilize the underlying
recents model thumbnail cache to make the loading faster.

Bug: 114136250
Test: Build Launcher3GoIconRecents
Change-Id: Ib21f617e83d307621364c2eeb6fef84aad49814b
2019-03-08 12:07:01 -08:00
Sunny Goyal 826405d095 Merge "Using the new contract for some systemUI constants" into ub-launcher3-master 2019-03-06 21:40:12 +00:00