Commit Graph

13 Commits

Author SHA1 Message Date
Tony Wickham
70a556da1d Add translation component to swipe up resistance am: ce8b2b5180
Original change: https://googleplex-android-review.googlesource.com/c/platform/packages/apps/Launcher3/+/12174363

Change-Id: I18d7be49bb3bfc9f846c14a9138b5daf381e1d56
2020-08-07 20:22:52 +00:00
Tony Wickham
ce8b2b5180 Add translation component to swipe up resistance
Now recents view follows your finger all the way to the top of the
screen. Specifically, your finger tracks the bottom of the window
until resistance starts (when RecentsView is at 75% scale), then
we add translation to compensate for the slower rate of scaling
down, such that your finger slips to the top of the window by the
time it reaches the top of the screen.

Also reset this translation back to 0 in the state handlers.

Bug: 149934536
Fixes: 158701272
Change-Id: Iaee58da758d422f0173c29d002f5c451ce0c1809
2020-08-07 12:32:50 -07:00
Andy Wickham
17d0080cc3 Adjusts Clear all to be vertically centered with the tasks.
I made a sample task where the content of the app was
centered, and I added lines to demonstrate the center
while in Overview. As you can see, the center of the
app content is slightly different from the TaskView
in Recents - it seems part of the bottom of the app
gets removed when transitioning to Recents (for the
rounded corner radius or nav bar?). On Pixel 4, I
had to add 46dp of padding to the bottom line for it
to appear at the bottom of the screenshot in Recents.

Screenshot: https://drive.google.com/file/d/1xzQNXWb0T0UGDhDS9Ov-AduM3nd-pfg8/view?usp=sharing
Before: https://drive.google.com/file/d/1ghN9VWP44XjcZkdmI106dy4_jB4Vs4J3/view?usp=sharing

Rotating between landscape and portrait:
https://drive.google.com/file/d/1OD5aKT9LCE5w950-6AaHfWXU4sLyW3Qe/view?usp=sharing

Fixes: 154964045
Change-Id: I594057e3b5df58c5a907b6ca14daa700d5011b7b
2020-08-05 19:44:07 -07:00
Tony Wickham
94be66acd6 Fix tracking window being slightly off when swiping from an app
Test: swipe up from an app in landscape, seascape, and portrait,
and verify the window tracks with the finger 1:1 until pullback

Bug: 149934536
Change-Id: Ia469877e7152c8135e0b9153f69c191ba86cbd14
(cherry picked from commit f0a1b2ccd8)
2020-07-16 20:03:36 +00:00
Tony Wickham
f0a1b2ccd8 Fix tracking window being slightly off when swiping from an app
Test: swipe up from an app in landscape, seascape, and portrait,
and verify the window tracks with the finger 1:1 until pullback

Bug: 149934536
Change-Id: Ia469877e7152c8135e0b9153f69c191ba86cbd14
2020-06-25 11:51:28 -07:00
Vinit Nayak
84f30b213a Remove unused HomeRotatedPageHandler
Transfer functionality of choosing
task menu layout to PortraitPageHandler,
which is what it should have been to
begin with.

Fixes: 158484000
Change-Id: Iadda53e7e1f796c063a111823f7f6278f3fdbf58
2020-06-10 18:47:05 -07:00
Vinit Nayak
08a8327b1d Update recents child views RTL handling
Fixes: 154928106
Test: AppIcon and clear all button
shows up as expected in LTR and RTL
configuration.

Change-Id: Idcf367b8aff53002e63a03b64b96e3602127707e
2020-05-12 22:24:26 -07:00
Vinit Nayak
bb55f9e982 Use rotation based on PagedOrientationHandler instead of touch
Fixes: 154928106
Test: Tested overview w/ and w/o
home rotation enabled.

Change-Id: Ib7e91e51b2181824e5520ad69965ed3379302c27
2020-05-04 11:58:11 -07:00
Vinit Nayak
48ea9e9502 Use appropriate start padding for clear all button
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
2020-04-27 22:44:05 -07:00
Vinit Nayak
e553e380d0 Rotate Overview Task Action Menu
Fixes: 153371258
Test: Tap on icon in portrait,
landscape and seascape. Open menu
then rotate phone.

Change-Id: I38b018371561b502fe211a3c2ddea4ff7fde4274
2020-04-22 14:16:05 -07:00
Vinit Nayak
326d93bd56 Re-enable home screen rotation
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
2020-04-17 14:38:12 -07:00
Vinit Nayak
acaf0749b3 Adjust target and src rects for swipe to home animation
Floating icon animation runs entirely in portrait
since that's what orienation launcher starts in.
Current app window target rects are in landscape to
be able animate to Overview correctly (which is not
in portrait since the leash from WM is in the same
orientation as that of foreground app).
Invert that rect as the animation from app window
to floating icon progresses.

Fixes: 148528795
Change-Id: Ie1149a1a8904afc80bd1986f8d67b6f2d88c49f2
2020-03-02 18:02:52 -08:00
Vinit Nayak
a406f727ad Add vertical layout support for Overview in portrait
WM is making changes which allows apps to maintain
their orientation independent of the orientation of
the foreground app. This allows recents to always start
in portrait even when the app currently running is in
landscape. This means we have to give the illusion of
a landscape oriented overview when user swipes up in
gesterual nav when launcher is started in portrait
configuration.

PagedOrientationHandler abstracts all coordinate specific
logic from Paged/RecentsView primarily, but also all
other dynamic calculations throughout launcher.
PagedViewOrientationState is the single point of exposure
to other classes that depend on those changes. The goal
is to also minimize holding state to allow for default
implementations of PagedOrientationHandler for all the
3p/Fallback classes. PagedViewOrientationState also
holds other data around rotation that isn't
specifically tied to view logic.

The fake landscape overview can be toggled with:
adb shell settings put global forced_rotation [0/1]

Fixes: 146176182
Change-Id: I65d8d4e9f92b93931cbe0053ccaf0cda8d2ffd6c
2020-03-02 18:02:35 -08:00