- create predictor from items in bgModel instead of scanning views
- Launcher no longer checks for duplicates before sending pin/unpin events
- sending cached items from last prediction to reduce UI shuffle
- Switch to using UserCache to persist and read ComponentKey
Bug: 148814143
Bug: 156413231
Bug: 156200931
Change-Id: Ide6330bed8eb7f0c6fbec1d1ac21e7f67a9b2be2
In landscape, the lowest coordinate touch registered
is the actual lowest pixel possible by the screen.
For portrait/seascape the lowest coordinate
is (lowest pixel possible - 1). The difference of the
one pixel makes Rect#contains() return false since
only top left Rect points are inclusive and bottom
right points are exclusive.
Fixes: 156333291
Test: Always able to smoothly go to overview from
landscape.
Change-Id: I6beddad99ae076a167d2a5f5e5acc6e466bff544
- Support dismissing Compose via the reverse gesture from the appear
gesture
- Use Tony Wickham's ag/10204761 with some glue code to enable the
app below Compose panning in the same direction as the gesture as
Compose peeks in
- Add feature flag to use Compose hosted in a window (permits underlying
app panning)
- Use InterpolatingVelocityTracker to fix OtherActivityInputConsumer
processing swipes in the wrong direction ~20% of the time due to a bug
in VelocityTracker (see go/quirky-bubbles)
Change-Id: I3adbaee1763f21557fb628b60d03b0a03e7079ab
- Provide a hint to Launcher to indicate it will be resumed when
swiping home, which allows us to notify sysui before any potential
pip invocation, reducing the likelyhood of two conflicting animations
when entering pip
Bug: 156637223
Change-Id: Iae773e1aac88bbea6f74e1d1332417b448126471
- This activity would create another task (no longer in the same
stack since we don't have activity type stacks) which was causing
the camera to be occluded sometimes, which then cancels the recents
animation
- Tweaking the animation slightly to match the movement of the closing
the activity back to the lockscreen
Bug: 156514461
Test: Launch camera on the lockscreen and swipe up to dismiss (repeatedly)
Change-Id: I8aaac22767288d7fbf183683276c50acaaf831d2
Also converting BaseActivityInterface to an abstract class instead of interface
so that it can hold member variables
Change-Id: I04cab934137eb1d6f470c6a7618c50a2ed2c71c1
It will have a 30dp horizontal paddings and vertically in the middle of the screen.
Test: local
Bug: 155444014
Change-Id: I4f3d627008b2c114cc4921bf683919c6044926e4
-> In addition, this also prevents the drawing of ring effect for predicted icon when view is about to be copied to drag bitmap. Icon will scale to full size (without ring) when dropped.
Video attached to bug report
Bug: 152325754
Test: Manual
Change-Id: Ibd1a5dbf76c41bdc30ae851ad914a4d0e32703c8
Fixes: 154928106
Test: AppIcon and clear all button
shows up as expected in LTR and RTL
configuration.
Change-Id: Idcf367b8aff53002e63a03b64b96e3602127707e
Instead of using shared gesture state, use the swipe handler's
internal state. This ensures that only the handler that started
the new task can finish the controller for it (i.e. starting a
new gesture, which creates a new handler, will ignore the
onTaskAppeared() that the previous handler initiated).
Test: Quick switch to delayed task A, then quick switch to B right
before onTaskAppeared() such that we get onTaskAppeared() during
the transition (easier to repro if you increase animation durations
with springs off). Before this change, A appeared on top.
Bug: 156412706
Change-Id: Ic7d3cd43399005095b2e7c7382218edffefdc27b
Using horizontal padding 48dp to adjust the scale of the taskview and put it in the middle of the vertical space.
Test: local
Bug: 155444014
Change-Id: Iee6096baf18ae1106c24c83b4675abd4d3ff4d4f
Removing optional 'shouldAnimate' flag. This was false only in 3-button mode but
the code was also handling animation, leading to inconsistent expectations. Instead
always assuming animation and finishing the animation promptly.
Change-Id: Ic56476dc5ea64c9a7d7e9744f3e33cd61dfde9e8
If we just finish the controller to resume the running task like
we normally would, the delayed task will appear on top when it's
ready. Instead, we need to start the original task in this case.
- Move mLastStartedTaskId to GestureState, shared between swipe
handlers when continuing the gesture.
- Update logic to change LAST_TASK to NEW_TASK if a task was
started (but not appeared) during the same gesture; likewise,
only change NEW_TASK to LAST_TASK if no task was started.
- Finish the controller when successfully starting the task
that already appeared, since we won't get onTaskAppeared().
Bug: 156132424
Change-Id: I1e9af297840745ab3d5e90214425f10a2616d90a
> also fixing flicker during swipe-up when scroll is applied before recents
has been initialized
Bug: 154761552
Change-Id: I45c2b6801b8b87097c2816e26a234bab41b72ed4
Currently it just crashes, so it shouldn't be there. If
and when we decide to add it back, we will need to get
our package whitelisted to send the necessary Intent.
Bug: 149348244
Change-Id: I5ab292d04ebc5679e34e5a92141df3d86ef6e551
Device policy or app secure surface policy mean that snapshot based
actions shouldn't work.
This is encoded in whether the snapshot is "real", the fake snapshot is
generated when policy doesn't allow captures.
Test: tested with Test DPC fake device policy app
Change-Id: Ib34e5a90ab58fb401d4516c531866d1c13569256
Fixing fling to home animation in landscape and multi-window orientation
Bug: 155896573
Bug: 155816922
Change-Id: I5fdff8694eced415978345b026858f5167c2a198
PreviewPositionHelper was getting the Launcher rotation from context,
instead of RecentsOrientationState
Bug: 156042694
Change-Id: I645eccfcb519c59fe2f78ecb1a77d8a315bc36c9
- Remove mFinishingRecentsAnimationTaskId and related logic;
track mLastStartedTaskId and mLastAppearedTaskTarget instead.
- Don't finish controller if new gesture is in progress, only
finish it when the last started task appears (and invalidate
the handler at that point).
- Remove onTaskAppeared() from GestureState, handle it directly
in BaseSwipeHandler.
- When the end target animation finishes, possibly change the
end target from LAST_TASK to NEW_TASK or vice versa,
depending on the last appeared task.
Bug: 154814771
Bug: 154727089
Bug: 155609695
Bug: 154812078
Change-Id: I38669515d064a131361359087f502783d875ddde
This removes cross dependency between StateManager and State object so
that it can be easily generalized
Change-Id: I62851fc4b653655cb40f37023db9651055ec7c9c
Revert "Compose gesture integrated fully into Nexus Launcher"
Revert submission 11035205-compose_gesture_fully_integrated_launcher
Reason for revert: Broke Launcher Android Studio build, quick switch, and home gesture doesn't work if Compose is open.
Reverted Changes:
I2d97b22d5:OverscrollPlugin refactored to use onTouchEvent
Ia19a55f65:Compose gesture integrated fully into Nexus Launch...
I65aa07ac1:Compose gesture integrated fully into Launcher
Change-Id: Ic05c47eb686b3942ba519e76db32977fc568844b
Loads list of cached apps and shows predicted app icons with the rest of workspace items.
-> Extracted prediction caching logic into a model layer
Bug: 155029837
Test: Manual
Change-Id: I6981594a910f5fe4e8e8cf8fe39db0cb856e7acd
- Support dismissing Compose via the reverse gesture from the appear
gesture
- Use Tony Wickham's ag/10204761 with some glue code to enable the
app below Compose panning in the same direction as the gesture as
Compose peeks in
- Add feature flag to use Compose hosted in a window (permits underlying
app panning)
- Use InterpolatingVelocityTracker to fix OtherActivityInputConsumer
processing swipes in the wrong direction ~20% of the time due to a bug
in VelocityTracker (see go/quirky-bubbles)
Change-Id: I65aa07ac112db8bd89cec9acfa0ce2b6ebacd43f
When continuing a gesture during quick switch, we cancel the
previous animation but don't invalidate it (since the gesture
isn't fully finished), and the new gesture handler calls
mRecentsView.setOnPageTransitionEndCallback(), so the previous
handler will never get STATE_RECENTS_SCROLLING_FINISHED. Thus,
continueComputingRecentsScrollIfNecessary() will never end.
To fix this, also check !mCanceled, since that is set when
continuing the gesture. Also use postOnAnimation() instead of
post() since that has better guarantees that the next
computation will wait for the next animation frame, rather
than whenever the message queue is available, which might
happen too frequently.
Test: quick switch from A to B and back to A before settling
on B, ensure we stop calling computeScroll().
Bug: 153589287
Change-Id: I6b4389ef2cf5a818438c7ae36d8807b3e41c8501
Also fixing the issue where display info is is not correctly initialized
Bug: 155257023
Bug: 155682580
Change-Id: Ib2cc981c1900f3d14f158f4dbb60ae77311f339b
- Always default to true for ENABLE_HYBRID_HOTSEAT
- Allow launcher to show predictions anytime regardless of notification and on-boarding.
- Remove past beta specific plans
- Migrate if first screen can accommodate hotseat items otherwise show tip
Bug: 142753423
Test: Manual
Change-Id: I142cd95d779964822da07a96e5884a0c82813742
Originally touching on the empty space would bring user back to homescreen. We will disable this for select mode.
Test: local
Bug: 154531538
Change-Id: Iee3780755fc2c32682ea0fa039ca5822a95fce2c
- Previously we only check for the flag which is always true in the
normal launcher state, so if the animation starts, we could end up
writing the back alpha value without accounting for window focus or
any other states that launcher is in that affects back button
visibility
Bug: 155129739
Test: Open -1 article and hit back
Change-Id: I42d27a192b23f394f8565a6893ce092603e31654
- Separate the calls to minimize split and to update the flags (we only
want to minimize in split when swiping up, but we want to update the
flags when quickswitching as well)
Bug: 155410195
Change-Id: I56308cc0fbaa8a855383012738f129671d72feff
- We currently end up using the launcher insets when swiping
up into overview due to how we scale the target rect to
the source bounds, but the thumbnail crop is calculated
only from the task thumbnail insets. For apps that are
letterboxed, this results in a jump after the transition
completes when we crop too far (including the letterbox)
and end up showing the task background.
For now, since we are just cropping by the launcher
insets, we can also take the min of those and the
thumbnail insets to calculate the thumbnail view crop.
Bug: 151770104
Test: Test swiping up with a normal app, a letterboxed app
(like authenticator), an app that has no insets (like
Change-Id: I08342b19c54f9078be4613fca9024e2558403bc9
> Removing 'Launcher' as parameter from state methods called by StateManager
> Converting state properties to methods for easier abstraction
> Moving state handling drom state definition to activity class
Change-Id: I997627df606a7e0bb3bf32688d045a942a47fc94
> Fixing scale up calculator for swipe-down
> Offsetting pivot so that the preview is aligned to bottom-right
> Allowing insets to be available in multi-window mode as well
> Offsetting taskViewSimulator appropriately in multi-window mode
Change-Id: I7da4c145efca72ef219a5ffcaf23d726812df270
Was able to repo the bug reliably when calling cancel() and
end() immediately after starting the StaggeredWorkspaceAnim.
Bug: 153584267
Change-Id: I954d38ad69e72a83535f4dd1ec21dba0f61a3cfb
The rect we passed in was in screen space to match the window, but needs to be
be local to launcher.
Also updated code/comments to make it more readable.
Note that the bounds of the targets being off is a separate issue b/153581126
Bug: 135195169
Change-Id: I4a8c0aa2f504bdf69342a927725cd440fb324a36
We don't clear state on EdgeBackGestureHandler
when we go to Recents or Home.
A more robust solution is in the works with
WM team and will probably be built on top of this.
Needs ag/11273364 to work.
Bug: 154580671
Test: Launch app directly in landscape,
should be able to swipe home on first try.
Change-Id: Ia4c685e16645d0237f278a611f6c61f252f3b79c
This still shows up a bit strange with
notched phones because we are using
RecentsView padding to give ClearAll the
right amount of spacing. However, we're only
adding padding to the left and right and not
the top/bottom.
That's captured here: b/154436527
Fixes: 150389833
Test: Tested landscape/portrait/seascape
launcher, w/ RTL as well
Change-Id: I49defd58048e609a1f7a821abb97374bcbb94b9f
Prevent extra IPC calls when checking for
multiWindowMode by using existing DeviceProfile.
This might be made irrelevant by b/142282126
Fixes: 149571513
Change-Id: Ia41cbfd56c67dd78f4d9c10bf1469d0d2a9e581d
Disable overview rotation in 2-Button
until we can figure out the correct
transition/animation.
TODO: b/154665738
Fixes: 154181816
Test: Tested no button and 2 button,
overview actions worked as before.
Change-Id: Ib67906b11e24def870a39f57b5156e29db258fd7
Fixes: 154955192, 150958400
Test: Switched from gesture nav to 3 button,
was no longer able to swipe up
Change-Id: Icc7b27eb7bd1eb5ddf25d7e7c3464a77a3a88f24
Test:
- start sharesheet from overview action, swipe up
- start sharesheet after taking screenshot on home, swipe up
- start sharesheet from an app, e.g. Chrome
The first two use OWFIC, last one uses OtherActivityInputConsumer
as normal.
Bug: 153673244
Change-Id: I7d7887e1f6818346ada75776ec63b43aaf3708f1
Home gesture also exits Back and Home tutorials on the
completion screens (as does back gesture).
Test: Manually verified Back and Home tutorial flows.
Bug: 148542211
Change-Id: I8026745e875e9ccb8cfd60bc438213b2d896254d
Now with hierarachical animation, the layer of
RecentsAnimation / RemoteAnimation are controlled by system.
Now Launcher side don't need to have other way to set layer for ZBoost
case, so remove setLayer & withLayer related logics for cleaning up.
Fix: 151024899
Test: manual, launch google map app -> enter PiP mode,
swipe up to overview screen or launch activity from shortcut,
make sure the PiP window is not covered by other apps.
Change-Id: I8028cd50d66f7d77e5d1ec6514e953c8be9935d6
(cherry picked from commit 99f7da7dd2)
Strictmode leak detector is still a goal, but we might not be able to
achieve it in R. Strictmode has several framework-side bugs that perhaps
hide Launcher-side strictmode violations, while the time to fix
everything is limited, and new leaks get introduced all the time.
For now, implementing a check that is slightly more relaxed than
Strictmode, but still ensures the absence of leaks. I’ll keep
eliminating Strictmode violations as well as keep strengthening the
makeshift checker conditions until we’ll be able to enable Strictmode in
continuous testing.
I’m disabling Strictmode checks for now so that they don’t generate
unnecessary hprof dumps, but leaving the code dealing with strictmode.
Bug: 139137636
Change-Id: Ib10136b0d4e9892f70a19cd052ae5a54cf0a4efb
After reaching overview, we let the user translate RecentsView
if they continue dragging around. But when they let go, we need
to return RecentsView to translation 0 since that's no longer
part of the state machine.
Change-Id: I30b51485339a3b6c3dd52bda113b1a05b6e885fa
This would fix the issue that overview actions UI visibility was not set correctly.
Test: local
Bug: 152047880
Change-Id: Ia335c5c8947b39e580403090f461f87e78645af1
Fixes: 153371258
Test: Tap on icon in portrait,
landscape and seascape. Open menu
then rotate phone.
Change-Id: I38b018371561b502fe211a3c2ddea4ff7fde4274
=> setCurrentPlayTime is bounded between [0, duration] by the animation framework
Instead using interpolator so that we can go outside the bounds
=> Tune spring stiffness and dampening for overview card dismiss animations
Bug: 154061408
Change-Id: Iaa31491fff499db916b36d9779ec159b8a89a2de
1. Tanslating contents of RecentsView instead of recentsView itself. When
translating, we keep the current TaskView from moving. This allows
the remoteTarget to follow an individual taskView.
2. Removing translationY in recentsView and setting the pivot instead
3. Using TaskViewSimulator for swipe handler. This allows using similar
animation creation as Launcher window animation.
Change-Id: I0b7b16c367d9d8cd8dd0ed59061e46853e2f8c83
- With hierarchical animations, the split-secondary shell root
is moved above the split-primary shell root immediately during
transitions, which means that setting the blur on the launcher
surface will also affect the primary docked surface
Bug: 154125518
Change-Id: I21dd01738ee9bc974d41e5964364917a30143a2a
Don't rotate overview if all of launcher can
be rotated.
Fixes: 154243745, 154299710
Test: Toggled system rotation while overview
was showing. Also toggled home rotation to
ensure no intermediate overview rotation
animation.
Change-Id: I49acf2dafb84e7f05c46f8908ba9ffdd43f1d1e7
Screenshot: https://screenshot.googleplex.com/yFfiDbHiyq6
- Wrap ring around badge
- Add shadow to ring
Bug: 153201272
Bug: 152560070
Test: Manual
Change-Id: Ic1f726d080a8e6768417e5174a855a57f3241166
> Linking actions view to state flags
> Creating multiple visibility channels that can be controlled separately
Bug: 153906903
Change-Id: I33d20f5fdc8bcdf0520dae3aac986548eb7e0058
Launcher home screen rotation now works with fixed
transform. When using Quickstep while holding
the phone from an orientation different than
the orientation of the touch, the overview
shown will be that of the phone orientation,
not the touch orientation.
Easier to see this be quickswitching from
portrait to landscape app, turning phone, then
going to overview from the original region you
swiped.
Fixes: 150214193
Test: Created test apps and fixed them
to various rotations to test.
Change-Id: Ic6565cd0ed33c951f45ccb97278045c6070e438e
TaskView height has a lot of other factors such as icon margin
and actions. Since the thumbnail is what we are dragging to fill
the screen, use its height to determine the progress factor.
Test: swipe down on a task in portrait, landscape, and seascape,
and verify that it follows your finger to the bottom of the
screen. Swiping up also follows your finger for dimiss.
Bug: 151770407
Change-Id: I114a261a06b11f550822178945266cc4a6fd54fe
This fixes the bug where depth gets stuck to 1 after opening a transluscent
activity.
Bug: 152950633
Change-Id: I8bf5f61c57ef79d41656865b1ff1fbadb298fc36
- Adds a new launch target in Dev options
- Moves Back handling to the parent TutorialFragment
(so all Tutorials can handle it as necessary)
- Currently uses a dummy translating rectangle in
place of a proper hand animation
- No actual home gesture recognition is in place yet
Test: Manual
Bug: 148542211
Change-Id: Ic5a545eb9f5003914803272c8ffe367220d63336
Removes nested LinearLayout and RelativeLayout, as well
as a Space (instead just aligning buttons to the bottom).
Test: Manually verified result looks same as before.
Change-Id: I773079107be5f8862bae68c0f8f5bf6edff79ce8
Instead, all callers should use EXTRA_SCHEDULER_CALLBACK, set via
addToIntent(), to provide a callback for the next handleIntent().
The updated runCallbackWhenActivityExists() will do that for the
caller if the activity doesn't already exist (otherwise it will
run the callback synchronously as before).
Bug: 151389129
Change-Id: Idbec264354fd6de166ff3bae98249230078d5674
We use this flag to prevent the depth from being immediately set to 0 when
preparing to animate home.
Bug: 152327671
Change-Id: I614c6ae08b9f9e56ecb94fb51748791a38504583
- Extracts abstract classes for common functionality
- Renames some layouts, etc. to not be back-specific
- Consolidates more logic in the controllers rather
than classes like BackGestureTutorialTypeInfo
- Removes redundant TutorialStep enum (combining it
with TutorialType)
Still considering removing additional layers of
abstraction like the Fragment itself (instead
keeping UI within the Activity, which would still
be controlled by a TutorialController).
Test: Built and went through the Back tutorial to
confirm existing funcitonality was not disrupted.
Bug: 148542211
Merged-In: Id893869cb59609141dcdbdca01744d0f5952b546
Change-Id: Id893869cb59609141dcdbdca01744d0f5952b546
This reverts commit 6b99a7d397.
Reason for revert: Launcher3 AOSP cannot link to uieventloggerlib because it's private API
Change-Id: Id652b8a4cba54b97d1d8b8644c2939903cc0e88a
Specifically, when switching from right to left edge, the
animation disappeared. This change forces the animation
to restart whenever you switch to another tutorial.
Bug: 148542211
Change-Id: Ie74c636a4afd1018c7c8e6998a1e7a176bf8099e
(cherry picked from commit e725b6fe56)
- Due to tasks only being loaded in the task list and not in the
task hierarchy, ensure that we listen to the task list callback
to invalidate the cached list as well.
Bug: 144892997
Change-Id: I0aa2ac0e629b8883410ebafbdc4ca2d5d9bc0fca
Launcher can now receive onTaskAppeared callback from
RecentsAnimationController to get remote animation target when in quick
switch mode.
Note: This CL just demonstrates how to receive callback and then
calling removeTask & finish recents animation,
in order to really improve quick switch flicking, launcher side needs
to implement the rest of logic to animate task's remote animation target
to make task switching more smoothly.
Bug: 152480470
Test: WIP
Change-Id: Id0371db7339cfe84942cc905a89b0a2c1fab62ec
(cherry picked from commit bec41bc5b9)
Before the two-zone model introduced with ENABLE_OVERVIEW_ACTIONS, we
scaled down the workspace when swiping up, since you could pause at
any time to go to overview (which has workspace scaled down behind it).
But in the two-zone model, that scaling is potentially confusing since
it looks similar to the HintState (when swiping from the nav bar).
Bug: 143361609
Change-Id: I3ee9f6eb45abb0123563d283a3145f27c3a63dd5