Commit Graph

38 Commits

Author SHA1 Message Date
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
Winson Chung
d782394132 Revert "Revert "Remove back button when on home screen""
This reverts commit dd176e65e3.

Reason for revert: Post-drop revert

Change-Id: If93eb4bca636bfba2471c8992621a59895bfcbe2
2018-02-16 03:23:47 +00:00
Winson Chung
dd176e65e3 Revert "Remove back button when on home screen"
This reverts commit 663759e444.

Reason for revert: Temporary revert for NL build

Change-Id: I8614ee348e6e9290c0de0dfdf3e24663f220e356
2018-02-16 02:42:26 +00:00
Tony Wickham
663759e444 Remove back button when on home screen
Add OverviewInteractionState to handle setting OverviewInteractionFlags.

Hide back button when in NORMAL state and launcher's window is focused.
Show it when in other states or when launcher's window loses focus.

Change-Id: I35919561b9972789e995f1cc434c23e2afe9e77c
2018-02-15 12:20:16 -08:00
Tony Wickham
a066e4434b Re-enable quick scrub/switch from launcher
When we get the onQuickScrubStart() or onQuickSwitch() callbacks, we go
to the overview state with a quicker duration (the same used from apps).
Then we follow the same logic as starting quick scrub/switch from apps
except that we allow you to scrub back to the workspace card.

Bug: 70180755
Change-Id: Iebcdcc4c4ad1e1210e2d1c11e5007c27d3c1eef3
2018-02-12 11:46:40 -08:00
Jon Miranda
0d5daafd2f Prevent blinking when user presses home.
Intead of finishing the entire animation (launcher animation and
window animation), we finish just the launcher animation.

Bug: 73071035
Change-Id: Ied84cb641f3cedc367433ad99d21ab1b258ae7f8
2018-02-07 17:41:22 -08:00
Sunny Goyal
af161fd20c Preserving the last state when going to overview.
> Resetting the state to NORMAL on every onStop so that the user
  never starts on the overview screen

Change-Id: If3c17693b7125a3969809e60891a2ab978fe83bc
2018-02-06 10:06:53 -08:00
Tony
dc76f8e856 Cancel launcher app transition when changing states
The app transition might change an object that the new
state depends on, causing an inconsistent state.

Bug: 72816542
Change-Id: Ia6dd52971b52be5589c88f4f6d93d06146fbadab
2018-02-05 18:48:24 -08:00
Sunny Goyal
ce8809a588 Reapplying state UI when the insets change
Change-Id: Ief9588400f332b2c5b084a8a11c3102b2c20c4ea
2018-01-18 14:03:19 -08:00
Sunny Goyal
75c59acf5c Ensuring that Recents view is always loaded when going to Overview state
Change-Id: If2337a0be66f4ca68dd54954b7368f38d70a40d4
2018-01-16 12:01:57 -08:00
TreeHugger Robot
dfa46e1d62 Merge "Adding a back stack to go to overview from all-apps" into ub-launcher3-master 2018-01-12 23:27:52 +00:00
Tony
6d6fe041c7 Implement quick scrub and quick switch callbacks
Bug: 70180755
Change-Id: I011dd5b0435cea7ba493e83b973ce5be7d18c1f0
2018-01-11 17:20:35 -08:00
Sunny Goyal
49bcf34e81 Adding a back stack to go to overview from all-apps
Change-Id: I94e7c27aa505123ddbe40ffa29b1bbc9b2748293
2018-01-11 14:45:11 -08:00
Sunny Goyal
cc96aa1fd4 Running state animations if launcher is visible
Change-Id: Ibc522edec4f86375ea75ac645b748fec43fceb31
2018-01-11 09:56:23 -08:00
Sunny Goyal
7c8a65e740 Adding support for auto-cancelling an action mode when interacting with launcher
Change-Id: Iba0207e36e9e5bd94bd9016318a4e00c6e1f6393
2017-12-22 11:11:54 -08:00
Sunny Goyal
de5535a1ec Initial interaction for two state swipe to overview
> Currently swipe only works from NORMAL and ALL_APPS state
> All interpolation is spread linearly

On pausing the drag for some time, the workspace moves to overview state,
and all other transitions interpolate linearly from there over the
remaining swipe range

Change-Id: Ic79f9d0f446c9bfff11e4af4d31ddc1c86c45ab2
2017-12-11 09:56:17 -08:00
Sunny Goyal
3c585ddbf7 Removing view layer support during state animation.
View layer was only being used when fading in/out hotseat in overview.
From API 21+, android automatically create layers when animating alpha

The current support for view layers does not work properly when cancelling
animations and controlling partial animations

Change-Id: I2d5785471af9819575beefe65f1f2bdd28c76bd5
2017-12-07 14:18:16 -08:00
Sunny Goyal
e3c6d58b71 Adding support for tagging animations per controller, so that they can be controlled independently
Change-Id: I6f360362aa16f7e02fe5fe84976b23663f228030
2017-12-07 12:46:26 -08:00
Sunny Goyal
bc683e9d06 Separating various UI properties into state variables
> Using workspace scale and translation for all-apps
> Without quickstep, workspace has the parallex effect as before
> With quickstep, workspace scales down to match the recents card width
> Using a single animator for recents views in case of state transtion and
  controlled transition to prevent going into inconsistant state.

Change-Id: I1864de6892052ca771f4d0062e3d60c28840a72d
2017-12-06 14:29:33 -08:00
Sunny Goyal
67419a1512 Defering AppWidgetHost updates if Launcher resumes in an non-NORMAL state
Change-Id: Ib0ef587de7207a3bd1bb5051fe8599293dfb4d59
2017-11-14 18:49:43 -08:00
Jon Miranda
758d5047be Refactor InsettableFrameLayout/DragLayer and add StateListener interface.
Bug: 65387919
Change-Id: I5eb94c0f3962d44f63af3efc92d852e019bba711
2017-11-09 11:23:07 -08:00
Sunny Goyal
c4fa8c312b Changing the state UI logic for normal build and quickStep build
> Creating ShareHandlers for managing UI
> In normal build, hotseat is hidden in overview, while in QuickStepBuild, it is visible

Change-Id: I5f8d35c75b861d912d93fce186b5dd74106184c3
2017-11-07 12:24:47 -08:00
Sunny Goyal
85525173ce Rearranging the code structure to allow replacing state logic.
Change-Id: I6f83d0f77045ba189f02dd465bf70ffc2a239aa1
2017-11-06 14:57:50 -08:00
Sunny Goyal
031022029b Using state animation to control all-apps transition
> Separating all-apps transtions control and vertical shift touch handling
> Creating separate spring handler for search box (to avoid adding and removing spring)
> Driving all-apps vertical shift using state AnimatorSet

Bug: 67678570
Change-Id: I3b6a4d1f43275a5f485b399444742b6b9a8c4bb9
2017-10-31 15:29:02 -07:00
Sunny Goyal
ea60926c3f Moving mState from Workspace to StateManager
Bug: 67678570
Change-Id: I8cdab044d0760fcc4c188830cde4f963d072b907
2017-10-25 15:48:01 -07:00
Sunny Goyal
3e3f44c3ad Exposing the state manager directly instead of providing various helper methods for state change
Bug: 67678570
Change-Id: If3d05c804c034ffa5e403da8eaa23e85e373c863
2017-10-25 13:41:13 -07:00