mirror of
https://github.com/LawnchairLauncher/lawnchair.git
synced 2026-02-28 07:46:55 +00:00
Add personal / work tabs for work profile widgets
Video: https://drive.google.com/file/d/1TORRNcvVM7fIvNd_WZaajLbI7D9z4VFA/view?usp=sharing Test: Main profile only: run AddConfigWidgetTest. With work profile: manually launch the full widgets sheet. Go to the personal tab: only personal widgets are shown. Go to the work tab: only work widgets are shown Successfully add personal / work widgets from the full widgets sheet. Bug: 179797520 Change-Id: Iad8b90c2af35e0580319d7a05510ec88e4f8b86c
This commit is contained in:
@@ -96,6 +96,8 @@ public abstract class PagedView<T extends View & PageIndicator> extends ViewGrou
|
||||
private static final int MIN_FLING_VELOCITY = 250;
|
||||
|
||||
private boolean mFreeScroll = false;
|
||||
/** If {@code false}, disable swipe gesture to switch between pages. */
|
||||
private boolean mSwipeGestureEnabled = true;
|
||||
|
||||
protected final int mFlingThresholdVelocity;
|
||||
protected final int mEasyFlingThresholdVelocity;
|
||||
@@ -857,6 +859,14 @@ public abstract class PagedView<T extends View & PageIndicator> extends ViewGrou
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* If {@code enableSwipeGesture} is {@code true}, enables swipe gesture to navigate between
|
||||
* pages. Otherwise, disables the navigation gesture.
|
||||
*/
|
||||
public void setSwipeGestureEnabled(boolean swipeGestureEnabled) {
|
||||
mSwipeGestureEnabled = swipeGestureEnabled;
|
||||
}
|
||||
|
||||
/**
|
||||
* {@inheritDoc}
|
||||
*/
|
||||
@@ -879,6 +889,8 @@ public abstract class PagedView<T extends View & PageIndicator> extends ViewGrou
|
||||
* scrolling there.
|
||||
*/
|
||||
|
||||
if (!mSwipeGestureEnabled) return false;
|
||||
|
||||
// Skip touch handling if there are no pages to swipe
|
||||
if (getChildCount() <= 0) return false;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user