mirror of
https://github.com/LawnchairLauncher/lawnchair.git
synced 2026-03-03 17:36:49 +00:00
Limit starting bounds of swipe to animation start rect
* If the starting point is greater than that of the current device's width (in either positive or negative direction), reset the starting rect to be fullscreen task bounds * More details at b/228829958#comment12 Fixes: 228829958 Test: Reboot device and swipe up from home immediately, app doesn't fling from the side. Tested with portrait and landscape launcher. Tested with fake landscape launcher. Change-Id: I6ea24e30e9de5716b7830f487b2ed63f56598c50
This commit is contained in:
@@ -102,6 +102,17 @@ public class LandscapePagedViewHandler implements PagedOrientationHandler {
|
||||
velocity.set(-oldY, oldX);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void fixBoundsForHomeAnimStartRect(RectF outStartRect, DeviceProfile deviceProfile) {
|
||||
// We don't need to check the "top" value here because the startRect is in the orientation
|
||||
// of the app, not of the fixed portrait launcher.
|
||||
if (outStartRect.left > deviceProfile.heightPx) {
|
||||
outStartRect.offsetTo(0, outStartRect.top);
|
||||
} else if (outStartRect.left < -deviceProfile.heightPx) {
|
||||
outStartRect.offsetTo(0, outStartRect.top);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public <T> void setPrimary(T target, Int2DAction<T> action, int param) {
|
||||
action.call(target, 0, param);
|
||||
|
||||
Reference in New Issue
Block a user