Commit Graph

259 Commits

Author SHA1 Message Date
Tony Wickham 2785a5996c Improve quick switch from home by tracking both x and y motion
- Add NoButtonQuickSwitchTouchController which uses
  BothAxesSwipeDetector to track horizontal and vertical motion.
- Initially, we only detect swipe left to right to quick switch
  (like before), but then we allow swipe up to either go to
  overview (if you hold) or back home (if you don't hold).
- xDisplacement transitions non-overview components out (e.g. shelf
  and workspace), and translates overview in.
- yDisplacement translates overview up and scales it down

Bug: 126596417
Change-Id: Id679ad84c08246e205c667a78ed5df00d7276258
Merged-In: Id679ad84c08246e205c667a78ed5df00d7276258
2019-11-14 12:31:01 -08:00
Tony Wickham 42a9ef0e9f Move shelf peeking anim code to ShelfPeekAnim class
Bug: 126596417
Change-Id: I5ba501b04b3eaf12a20ba1312ef362f9734761c3
Merged-In: I5ba501b04b3eaf12a20ba1312ef362f9734761c3
2019-11-14 12:30:32 -08:00
Pinyao Ting 1397a42fc2 include predicted_rank in app launch logging
Test:
1. . build/envsetup.sh && tapas NexusLauncher
2. ccdebug && cclogcat
3. launch from workspace any app that is also in predicted apps
4. verify in terminal it has correct predicted_rank

Bug: 143855018
Change-Id: I07a62f07057537a6c09384cf944bbc5aa5888d22
Merged-In: I07a62f07057537a6c09384cf944bbc5aa5888d22
2019-11-13 01:15:37 +00:00
Andy Wickham ddc9622e92 Reduces padding of the Overview shelf in no button mode.
Before: https://screenshot.googleplex.com/iw6baTCfoy2.png
After: https://screenshot.googleplex.com/8CcsQvLhYDo.png
Desired: https://b.corp.google.com/action/issues/139551306/attachments/26925873?download=false

Test: Examined before and after padding and verified 3-button is unaffected.
Fixes: 139551306

Change-Id: Ia416399cf25e7c6c2fb8aa84ad20e7ad74dcd31b
2019-08-29 11:11:12 -07:00
Sunny Goyal 6fe3eec95c Moving various common executors to a single location
Change-Id: I44bca49b8adb6fa22c3b48d10f674e42c28d792c
2019-08-20 14:36:17 -07:00
Pinyao Ting 49a3e699f9 show dot in deep shortcuts when notification contains exactly identical
set of person

Bug: 132336512
Change-Id: I975524e28168c10a186cdc24b188c161faf433cf
2019-08-05 20:41:58 -07:00
Becky Qiu 9c6cfb4e04 Fill the log container as hotseat or workspace based on position.
am: 84fa94e2fc

Change-Id: If9a5d88062addbd09909e04ef5c2c59e7e5488a7
2019-08-01 16:00:47 -07:00
Becky Qiu 84fa94e2fc Fill the log container as hotseat or workspace based on position.
Test: manual
Bug: 137953006

Swipe from workspace:
07-30 15:15:44.031  9779  9779 D UserEvent: action:FLING direction=UP direction=UP
07-30 15:15:44.031  9779  9779 D UserEvent:  Source child:WORKSPACE id=0 span(951,1313)	parent:WORKSPACE id=0
07-30 15:15:44.031  9779  9779 D UserEvent:  Destination child:ALLAPPS
07-30 15:15:44.031  9779  9779 D UserEvent:  Elapsed container 826 ms, session 9361 ms, action 0 ms

Swipe from hotseat:
07-30 15:15:46.010  9779  9779 D UserEvent: action:FLING direction=UP direction=UP
07-30 15:15:46.010  9779  9779 D UserEvent:  Source child:HOTSEAT id=0 span(786,1908)	parent:WORKSPACE id=0
07-30 15:15:46.010  9779  9779 D UserEvent:  Destination child:ALLAPPS
07-30 15:15:46.010  9779  9779 D UserEvent:  Elapsed container 1139 ms, session 11339 ms, action 0 ms

Change-Id: I959528889fda778efc569bb59e7f44d3bd5b81bc
2019-08-01 22:24:44 +00:00
Pinyao Ting 0cd5bd5f95 Ensure each dot contains only relevant notification to the shortcut
and displays system shortcut when long click on deep shortcut.

In this CR we
1) for each shortcut, we filters the notifications to ensure we only
 get notifications with identical shortcutId.
2) allow system shortcut to be displayed when user long click on a
DeepShortcut

Bug: 132336512
Change-Id: Idc9eaed55e900ed4027a43ee9c3fd7dc6f4480b2
2019-08-01 02:47:24 +00:00
Pinyao Ting bf608722b9 Ensure each dot contains only relevant notification to the shortcut
and displays system shortcut when long click on deep shortcut.

In this CR we
1) for each shortcut, we filters the notifications to ensure we only
 get notifications with identical shortcutId.
2) allow system shortcut to be displayed when user long click on a
DeepShortcut

Bug: 132336512
Change-Id: Idc9eaed55e900ed4027a43ee9c3fd7dc6f4480b2
Merged-In: Idc9eaed55e900ed4027a43ee9c3fd7dc6f4480b2
2019-07-31 23:56:54 +00:00
Pinyao Ting 4d1a0e2a7b show dot on shortcut when incoming notification contains exactly the
same shortcut id

Bug: 132336512
Change-Id: Iddf4cfe8ad60c12e8de8b171bed392f1bb0a6761
Merged-In: Iddf4cfe8ad60c12e8de8b171bed392f1bb0a6761
2019-07-30 19:39:10 +00:00
Pinyao Ting 559dd806d7 show dot on shortcut when incoming notification contains exactly the
same shortcut id

Bug: 132336512
Change-Id: Iddf4cfe8ad60c12e8de8b171bed392f1bb0a6761
2019-07-29 16:53:52 -07:00
Sunny Goyal 87dcde6d6c Separating apps list callback from model callback and simplifying various events
Bug: 137568159
Change-Id: I4d8bb5c01cabe642731ebd3f57fe15bdc5a569b7
2019-07-25 11:29:16 -07:00
Sunny Goyal 6d9eed757f Merge "Using the first frame delay based on the display refresh rate instead of hardcoding it to 16ms" into ub-launcher3-qt-r1-dev
am: b7094fcf36

Change-Id: Icd4e52b33b33718cb91b2fd082d85637e820390f
2019-07-24 12:57:15 -07:00
Sunny Goyal 4e6c45bcd3 Using the first frame delay based on the display refresh rate instead of
hardcoding it to 16ms

> Creating a utility class for caching display property changes

Bug: 128940249
Change-Id: I6f9a214548de65bd1c8530508d665ee88312da4a
2019-07-24 10:12:37 -07:00
vadimt d3c2a6cecf Fix waiting for launcher initialization
am: c8d496fe00

Change-Id: I7d764152d5d9da8c9df8db479dd01683d9e6148a
2019-07-18 19:10:06 -07:00
vadimt c8d496fe00 Fix waiting for launcher initialization
Bug: 137836033

Change-Id: Ifc8ce867abd85eaeacd09a2b39636ecc4109c046
2019-07-18 18:31:49 -07:00
Sunny Goyal 31ab19f71d Removing global state from DeepShortcutManager
This makes DeepShortcutManager thread-safe and avoids any locks

Change-Id: If4593b3541da6259591ff7a607efa58158006481
2019-07-17 15:16:33 -07:00
vadimt 853852351f Correctly restarting Launcher from OOP tests
Waiting for touch interaction service; waiting for package-restart
events.

Bug: 136215685
Change-Id: I0c31c09fe3a58b898168dfdb4e4d23757b94a47c
2019-07-11 14:17:06 -07:00
Sunny Goyal f11dd8e107 Using a higher priority executor than BackgroundExecutor for various recents tasks
BackgroundExecutor is also using thread pool executor where the order is perserved

Change-Id: Ieef8825599f35fe22da3e9adb1270c5525449d62
2019-07-11 09:38:54 -07:00
Sunny Goyal 4f2d926d42 Resetting UI state when the last has launched
Bug: 135038270
Change-Id: Ie0af9c7d47f69b32caedd72f98ed1706bdbef5fa
2019-06-28 14:50:24 -07:00
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