Commit Graph

75 Commits

Author SHA1 Message Date
vadimt
a8f77a6afd More debug tracing for switching to all apps not sending the final event
(to the test)

Bug: 134172603
Bug: 133867119
Change-Id: I00cf3a35daefa23d2e72a89d21e6ce37c8a9a46d
2019-05-31 13:34:24 -07:00
Sunny Goyal
ab3963ddcf Moving TestInformationProvider to Launcher3 so that it can be used for
testing Launcher3 without quickstep

Also keeping the provider as disabled until needed

Change-Id: Ib5f459e02ae551724b390f3b74f43d601568d749
2019-05-23 14:02:33 -07:00
vadimt
e17d1feb79 Adding tracing for a lab-only flake
We had a resolved case in the past where an app's context menu didn't
open on a long click (thanks to app updates), now the menu opens, but
the drag gesture doesn't drag the icon.

Bug: 133009122
Change-Id: I45d104a92fab6556ecd937aef76f0a8147e67f56
2019-05-21 17:19:23 -07:00
Sunny Goyal
dedda05568 Using a proxy activity for startActivityForResult
This ensures that the home task is never blocked by a different task

Bug: 74500048
Change-Id: I01fd26f1d6242e39b2d8fabac5e064b748aebe62
2019-05-15 16:33:06 -07:00
Sunny Goyal
9cc1b2f242 Calling onTransitionEnd when starting a user controller animation so
that any transient property is cleared

Bug: 80529128
Bug: 131360075
Change-Id: I613a0df4a06861be1c7195e1473c907489de1d1a
2019-05-03 11:56:18 -07:00
Hyunyoung Song
a310a80c7b Add important dump logging
Bug: 130851537
Bug: 119992316

Change-Id: I3de7c1d910d1aecd80b47a85284565c79fe0e2cc
2019-04-25 15:14:44 -07:00
Sunny Goyal
7368fa4369 Skip state animation if animations are disabled
> Also update the animation disabled check to use new-API

Bug: 118678948
Change-Id: Ib709844e34bdb7e369b368a7c33f2e8ff120024b
2019-04-22 10:00:01 -07:00
vadimt
a42dc530ee More improvements for wellbeing tests
Change-Id: I3c5866660bfb96378cdc80c1afc70ec438fc9add
2019-04-15 16:50:12 -07:00
Tony Wickham
7f78e23ccc Don't scale/translate hotseat icons if they are visible in overview
Bug: 129145824
Change-Id: I02af7ad21b6dbc46041e774dfc6f5d3efb0ab8a9
2019-04-10 14:02:38 -07:00
Tony Wickham
96d065d87d Make sure overview visibilty is GONE when it stops peeking
Bug: 129711952
Change-Id: Ib33c3d360e8810e5cbf59049dd90ba28957dbe8f
2019-04-02 16:00:13 -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
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
9244f518f2 Add FLAG_DONT_ANIMATE_OVERVIEW to AnimatorSetBuilder
This allows us to specify when a second animation will handle the overview
animation, so it doesn't conflict with existing state transitions.

Bug: 125362112
Change-Id: I497c02924862bfba558c107bee3c88a9f40ec0f1
2019-03-27 14:21:06 -05:00
Sunny Goyal
2db5342f04 Fixing some Launcher crashes because of using old model data even
after launcher has reloaded

Bug: 126289691
Bug: 124288578
Change-Id: Id7fb29716241a13f4e03ee0fc0e879523de4f878
2019-03-05 12:43:50 -08:00
Tony
4bb4b89b9a Scale and translate hotseat with workspace instead of all apps
- Move the hotseat alongside workspace instead of on top of all apps in xml layout
- Set pivot point of hotseat to match the workspace's, and apply the same scale
- Translate the hotseat with the workspace instead of all apps
- SpringLoadedState does not scale or translate the hotseat

Change-Id: Ic45fe99f83f0e0012afa78073d9577e65da444e2
2019-03-03 15:43:50 -08:00
Sunny Goyal
b52ff2269b Fixing alt-tab is properly dispatched to the RecentsView
Change-Id: I14a5569877bc0e7fe3aa30d3cd1fa74920b3e9db
2019-02-14 13:49:57 -08:00
Sunny Goyal
7f45514d15 Unifying the two different state listeners
Bug: 123376689
Change-Id: I61d4865044a1bd27ee78002a4083a686233740b7
2019-01-28 11:56:54 -08:00
Hyunyoung Song
63dd081b36 setVisibility should not propagate focus on children views
Bug: 120064903
Change-Id: I2d58d1ef89db7749f9e6551c716b3cc0567915b3
2018-11-30 13:31:37 -08:00
Sunny Goyal
d230307a95 Migrating to android-x
Change-Id: I9a774152d13a541e8496dd84f2469bfed407f86d
2018-08-14 15:22:12 -07:00
Sunny Goyal
379e8e0fa2 Preventing state change duing the swipe up animation when the previous app
transition is not complete

> This state change causes the RecentsView to get reset making the first
task visible

Bug: 111404703
Change-Id: I8ff2577bf965fb4cdf736fb18683ded63ade1872
2018-07-12 15:15:00 -07:00
Matthew Ng
f8fafa2847 Immediate 2nd quickscrub should not cancel if same state
Trigging quickscrub immediately after a previous quickscrub would cause
the controller to cancel even if the state change was from overview to
overview, then controller will not do auto-advancing because it thinks
quickscrub has been cancelled. If the state changes but both are
overview then do not cancel and quickscrub can do auto-advancing.

Change-Id: I309937572ad23eea14662501f41c13cd79dd10ab
Fixes: 110006796
Test: quickscrub, then let go and soon after quickscrub again
2018-06-14 11:05:44 -07:00
Android Build Merger (Role)
69652337ef [automerger] Revert "Set mState = mCurrentStableState in onAnimationCancel" am: d6692cedff
Change-Id: Ic38e6db9bb62e04d017db93e906be2be02a33294
2018-06-06 18:48:00 +00:00
Sunny Goyal
d6692cedff Revert "Set mState = mCurrentStableState in onAnimationCancel"
This reverts commit 8935d9515c.

Reason for revert:
Bug: 109814458
Bug: 79935289

Change-Id: I33e4933a68060b6055ad7af8e45cffceec14880d
2018-06-06 18:47:59 +00:00
Sunny Goyal
87a6ad18cd Fixing controller state is not properly cleared when the animaiton is cancelled.
This was leading to a pending animation running while the state had changes,
leaving user in an inconsistent state.

Various atomic animation fixes
> Ensuring that there is only one success listener on atomic animation, so that atomic
  controller is created only once and to the final mToState
> If atomic controller is already running, skip animating the atomic conmonenets as
  part of main animaiton
> Cancel atomic controller if it is going to a different state

Bug: 80549582
Bug: 109583168
Change-Id: Ie7a032e0fa73b1f1c2ef53055c08d16444f0385e
2018-06-05 16:07:29 -07:00
Sunny Goyal
d936f6a5e9 Do not change state in the middle of quickstep gesture
Changing states causing quickscrub to get cancelled and recentsView to
get reset to page 0, causing an abrupt jump.

Bug: 80537625
Bug: 80497058
Change-Id: I19cfe4380bbff15734b9d90dc31596904da27483
2018-06-05 10:12:23 -07:00
Tony
67f9cad75a Fix animation not playing when going home while another animation is playing
When going to a new state, we cancel any currently playing animation. When
canceling the animation, we reset mState = mCurrentStableState. Thus, when
determining the duration of the new animation, we have both state == NORMAL
and mState == NORMAL, leading to a duration of 0 and therefore no animation.
Storing the fromState before canceling/resetting fixes the issue.

Change-Id: I92332deae8058c4dd41212fe7f749955ede28b1c
2018-05-29 17:33:16 -07:00
Tony Wickham
8935d9515c Set mState = mCurrentStableState in onAnimationCancel
mState is set when the transition starts toward that state even if it is
never reached. If the animation is canceled, therefore, we should reset
mState = mCurrentStableState since that is the state we came from.

For instance, when swiping up from overview, mState = ALL_APPS, but when
swiping back down we cancel that animation and create the task launch
animation. When creating the task launch animation, we reapplyState(),
which, before this change, was still ALL_APPS instead of OVERVIEW.

Bug: 79935289
Change-Id: I59c5799e92350747e4ef1d99a80ba678a2ce7b98
2018-05-29 21:58:52 +00:00
TreeHugger Robot
159d6949a1 Merge "Fix prediction tip shows when user attempts but does not swipe up all the way to All Apps when quickstep is disabled." into ub-launcher3-edmonton 2018-05-25 00:49:23 +00:00
Tracy Zhou
5d89e1be98 Fix prediction tip shows when user attempts but does not swipe up all the way to All Apps when quickstep is disabled.
Bug: 80268964
Test: Manual test
Change-Id: I9b0620d57ccd466392c1db4c4899da3368a854db
2018-05-24 17:24:23 -07:00
Vadim Tryshev
1b0c5032d1 Fixing keyboard navigation when Overview list is empty
Bug: 80155387
Change-Id: Ife86fe4b718ef01291a04b21020155110d75fa7b
Testing: Manual
2018-05-24 13:06:18 -07:00
Tony Wickham
4e21c1b552 Cleanup how we set back button alpha
Add BackButtonAlphaHandler to set back button alpha, instead of setting
it from multiple places.

Also force back button alpha to be 1 if swipe up is disabled (b/80091187)

Change-Id: I49b63a0e6b033a3a947a847669a398f1b9ff0564
2018-05-22 11:05:01 -07:00
Tony Wickham
b2ddf10041 Update interpolators and durations for state animations
When we enter overview (overview appears, workspace disappears):
- Workspace scales down from 1f to .8f with OvershootInterpolator(1.2f) at 200 ms
- Workspace fades from 1f to 0 with OvershootInterpolator(1.2f) at 200 ms
- Overview scales down from 1.33f to 1f with OvershootInterpolator(1.2f) at 200 ms
- Overview fades from 0 to 1f with OvershootInterpolator(1.2f) at 200 ms

When we exit overview (overview disappears, workspace appears):
- Workspace scales up from .92f to .1f with DecelerateInterpolator() at 200 ms
- Workspace fades from 0 to 1f with AccelerateInterpolator() at 200 ms
- Overview scales up from 1f to 1.1f with AccelerateInterpolator() at 180ms
- Overview fades from 1f to 0 with DecelerateInterpolator(1.7f) at 200 ms

Parallax while the finger moves: Workspace translates half the distance as the shelf

Bug: 79776746
Change-Id: I319d982cf202bcd6dbbcd68ffc5c0c7853629c7e
2018-05-16 15:59:31 -07:00
Tony Wickham
d4ece9a74c Don't reapply state when setting user controlled animation
Bug: 79525106
Change-Id: Ia41a51559196d4aa657fae47727c7366d9073295
2018-05-10 10:03:54 -07:00
Tony Wickham
6becf7c07d Add atomic recents animation while swiping up
State handlers can now specify atomic and non-atomic components of
their animations to states, which can be specified when creating a
new animation. There is now one atomic animation, when going from
NORMAL to OVERVIEW (and in reverse):
- RecentsViewStateController's animation (scale/alpha) is all atomic
- WorkspaceStateTransitionAnimation has atomic and non-atomic:
  - Hotseat and workspace alpha is atomic, as is workspace scale
  - Everything else (scrim, translation, qsb and drag handle alpha) is
    non-atomic
- All apps progress is non-atomic

Also simplified dragging through overview; no longer pulls against you,
so we use an OvershootInterpolator when flinging instead of our custom
interpolator for the spring effect.

Bug: 76449024
Bug: 78089840
Change-Id: Iafac84d0c2b99ee9cf9dd5b30e2218286713b449
2018-05-09 12:33:46 -07:00
Sunny Goyal
a6616dec28 Fixing stateManager not correctly deduping existing animations
Bug: 79251716
Change-Id: I40c3ebf0ec4d49aa1fe1948ad3d83eb87cc1c5f1
2018-05-08 09:16:04 -07:00
Tony
31fbd4c08b Fix some state issues with user-controlled animations
Previously, user-controlled animations weren't properly being canceled when a
non-user-controlled animation started, e.g. when hitting home. Thus, we could
end in the wrong or inconsistent state because the user-controlled animation's
end runnable was still used. Now we add a cleanup callback for when we reset
the user-controlled animation for one that isn't user-controlled.

Also fixed a couple typos.

Tests (easier with animation durations extended):
- Swipe up and hit home before reaching overview -> land on home
- Go to overview, swipe down slightly (before threshold to go to workspace)
  and let go -> return to overview without flash (recents was resetting)
- Swipe up, press home while swiping -> goes home, stops responding to drag
- Start dismissing task and hit home before it finishes (or while dragging)
  -> goes home, stops responding to drag

Bug: 78249220
Change-Id: If11d8999e3fadba38c987b25af67cd2304cd859b
2018-05-01 13:45:27 -05:00
Sunny Goyal
ed2d2bcbb8 Force finish any pending animations if the insets or orientation change
Some animation might be running from a previous orientation, which can cuase property changes
to get skipped.

Bug: 77848165
Bug: 77774619
Change-Id: I3e198196192746abdd72a1970ff2ef407bf4aff9
2018-04-20 20:53:16 +00:00
Sunny Goyal
d754dcd5d9 Only skip the animation, if we are going to the same state
Bug: 77487950
Change-Id: I2d3e376094b0fb0d3120ab6c4d6569f52ab8273f
2018-04-12 14:17:06 -07:00
Sunny Goyal
7eff40ff2d Several app transition fixes:
> If launcher already started, creating the state transition only after threshold crossed, so that previous animations are not cancelled
> Not posting animaiton callbacks at the front of the queue, as that sometimes causes it get executed before onNewIntent
> Farking the activity as forceInvisible while launching an opaque app, so that quickly pressing home/back runs the reverse animation
> Not running state animations when force-invisible is true

Bug: 77830325
Bug: 77898806
Change-Id: I50a7e915ca35fd6aeb284c8f321ecca74396fe98
2018-04-11 17:08:31 -07:00
Sunny Goyal
b35f50cf55 Do not reset the previous state animation, if it is a part of the new state animaiton
Change-Id: Ic433db8cd2b0701923185d0a2db2a4361567437f
2018-04-09 16:31:12 -07:00
Sunny Goyal
1c6d566870 Ensuring that previous animation is completed before starting a new state animation
Bug: 76231621
Bug: 77150113
Change-Id: I086e8063b08d2ba69ead1bd0ee1772d65fb6075c
2018-04-02 15:29:47 -07:00
Tracy Zhou
a706f00d78 Move default pip position to right above the shelf (Pt. Launcher)
SysUI change: ag/3721784, ag/3793664

- Track LauncherState and launcher activity state through callbacks.
- Devise logic to send shelf visibility and height signal to SysUI based
on LauncherState and Launcher activity state.

Bug: 73961893
Test:
- By default, pip shows up right above the shelf.
- Transitioning to all apps moves the pip down as the shelf becomes
invisible.
- Going to any specific app moves pip down. Hitting home moves pip
right above the shelf again.
- Dismissing IME should push PIP down but above the shelf on home
screen, bottom if not.

Change-Id: I1ab6ceb8007a5a7b5d932a456efa0a07f586ea4c
2018-03-28 14:40:49 -07:00
Sunny Goyal
2e38cf4825 Merge "Changing the overviewState to show appsearch and floating header" into ub-launcher3-master 2018-03-20 17:01:49 +00:00
Sunny Goyal
a246727501 Registering app transition animations with the internal stateManager,
so that the animation is reset when we start a state animation from
launcher

Bug: 74975768
Bug: 75290288
Change-Id: If7f71f087d7bb64fb25c085c476a6fcbc86518e2
2018-03-19 20:11:41 -07:00
Sunny Goyal
7185dd63eb Changing the overviewState to show appsearch and floating header
Change-Id: I2cfd61cfc9978e4c8e4520f0f7217e49e7344c79
2018-03-19 20:02:34 -07:00
Tony
1e6eaea0a4 Improve quick scrub
- Snap to the next task when quick scrub starts, but don't allow
  snapping to further pages until the transition to overview
  completes (to prevent overshooting)
- Simplify quick switch to just launch the task that was snapped
  to in onQuickScrubStart
- Cleanup some state code

Bug: 70180755
Bug: 74014237
Change-Id: I7a4a0f1a568947b1f5e56a27d7328e47b05a675d
2018-03-13 14:50:26 +00:00
Sunny Goyal
6586062f71 Ensuring that we finish the last transition before starting a new one.
> Finishing the active animation instead of cancelling it. This ansures
  that the animation callbacks are called properly and RecentsAnimaiton is finished
> If a transition is already running, using main thread for next transtion so that
  this new transition is not started before the last transition is finished.
> If the transition is expected to finish at Launcher, directly use the Launcher
  consumer. RunningTaskInfo is not updated until the screen shot is complete.

Bug: 74481901
Change-Id: I2b1128f1f2eff0e6bd94b3adb9cef6ae0578bd0c
2018-03-12 15:25:17 -07:00
Sunny Goyal
f58e0df0ab Skipping resetting transition if the same transition is running
Bug: 73838765
Change-Id: I1a428f1b5d5b04397a317e0f35f3effb53c24405
2018-03-01 10:25:55 -08:00
Hyunyoung Song
b3fbc0ba8f Quick step/scrub/switch logging
- state transition happening due to Home and back is handled by
  specifying src target as 'from' container and dst target as the 'to'
  container
- Source and Destination container shows FROM and TO state for SWIPE/FLING
- event.isStateChange = true indicates that an action resulted in
  state transition
- Elapsed container millis is the screen time on the source container

Bug: 70181187

- logcat printout with setprop log.tag.UserEvent VERBOSE
1) State: WORKSPACE -> ALLAPPS
  action:FLING direction=UP
  Source child:HOTSEAT id=0	parent:WORKSPACE id=0
  Destination child:ALLAPPS
  Elapsed container 1225 ms, session 1225 ms, action 0 ms

2) ALLAPPS -> HOMESCREEN
  action:FLING direction=DOWN
  Source child:ALLAPPS	parent:ALLAPPS
  Destination child:WORKSPACE id=0
  Elapsed container 971 ms, session 2197 ms, action 0 ms

3) HOMESCREEN -> OVERVIEW
  action:FLING direction=UP
  Source child:NAVBAR	parent:WORKSPACE id=0
  Destination child:TASKSWITCHER
  Elapsed container 4834 ms, session 4834 ms, action 0 ms

4) OVERVIEW-> ALLAPPS
  action:FLING direction=UP
  Source child:TASK	parent:TASKSWITCHER
  Destination child:ALLAPPS
  Elapsed container 2176 ms, session 7010 ms, action 0 ms

5) ALLAPPS->OVERVIEW
  action:FLING direction=DOWN
  Source child:ALLAPPS	parent:ALLAPPS
  Destination child:TASKSWITCHER
  Elapsed container 3683 ms, session 10693 ms, action 0 ms

6) OVERVIEW-> HOMESCREEN
  action:FLING direction=DOWN
  Source child:TASK	parent:TASKSWITCHER
  Destination child:WORKSPACE id=0
  Elapsed container 2108 ms, session 12801 ms, action 0 ms

7) APPS-> OVERVIEW
  action:FLING direction=UP
  Source child:NAVBAR	parent:APP
  Destination child:TASKSWITCHER
  Elapsed container 104 ms, session 104 ms, action 0 ms

8) Quickscrub: action:DRAGANDDROP Source child: QUICK

9) Quickswitch: action:FLING Source child: QUICK

Change-Id: I5898230859ff600f48a2a873a40b670fe4d39a0d
2018-02-20 22:40:19 -08:00
Jon Miranda
8b08a1fd81 Cancel existing launcher animation earlier to prevent unnecessary AllApps animation.
Prior to this change:
* User presses home before opening app transition finishes
* Close app transition starts
* AllAppsTransitionController#mProgress = 1.3 (starts offscreen)
* Launcher#onNewIntent makes call to AllAppsTransitionController#setStateWithAnimation
* targetProgress != mProgress (1 != 1.3),  so it runs an animator that looks odd
  ie. fast duration, only AllApps animates compared to expected full closing app transition

Change-Id: I755787aebf637675cb9aae23fc5784f5a5b6c811
2018-02-20 06:48:31 -08:00