mirror of
https://github.com/LawnchairLauncher/lawnchair.git
synced 2026-02-18 18:28:20 +00:00
Allow custom content to lock the workspace
Change-Id: Ic337df1b2cd54b99d4ef02dcfaca955c90297df0
This commit is contained in:
@@ -1159,12 +1159,20 @@ public class Workspace extends SmoothPagedView
|
||||
(mTouchDownTime - mCustomContentShowTime) > CUSTOM_CONTENT_GESTURE_DELAY;
|
||||
|
||||
boolean swipeInIgnoreDirection = isLayoutRtl() ? deltaX < 0 : deltaX > 0;
|
||||
if (swipeInIgnoreDirection && getScreenIdForPageIndex(getCurrentPage()) ==
|
||||
CUSTOM_CONTENT_SCREEN_ID && passRightSwipesToCustomContent) {
|
||||
boolean onCustomContentScreen =
|
||||
getScreenIdForPageIndex(getCurrentPage()) == CUSTOM_CONTENT_SCREEN_ID;
|
||||
if (swipeInIgnoreDirection && onCustomContentScreen && passRightSwipesToCustomContent) {
|
||||
// Pass swipes to the right to the custom content page.
|
||||
return;
|
||||
}
|
||||
|
||||
if (onCustomContentScreen && (mCustomContentCallbacks != null)
|
||||
&& !mCustomContentCallbacks.isScrollingAllowed()) {
|
||||
// Don't allow workspace scrolling if the current custom content screen doesn't allow
|
||||
// scrolling.
|
||||
return;
|
||||
}
|
||||
|
||||
if (theta > MAX_SWIPE_ANGLE) {
|
||||
// Above MAX_SWIPE_ANGLE, we don't want to ever start scrolling the workspace
|
||||
return;
|
||||
|
||||
Reference in New Issue
Block a user