mirror of
https://github.com/LawnchairLauncher/lawnchair.git
synced 2026-02-19 18:58:19 +00:00
First pass of the Launcher Overlay interface / impl
-> Added simple reference launcher extension -> Make launcher able to handle a null qsb Change-Id: Ib1575243cac800a335e95bbf00cdc394bb4741c3
This commit is contained in:
@@ -204,6 +204,8 @@ public abstract class PagedView extends ViewGroup implements ViewGroup.OnHierarc
|
||||
|
||||
protected boolean mAllowLongPress = true;
|
||||
|
||||
private boolean mWasInOverscroll = false;
|
||||
|
||||
// Page Indicator
|
||||
private int mPageIndicatorViewId;
|
||||
private PageIndicator mPageIndicator;
|
||||
@@ -625,6 +627,7 @@ public abstract class PagedView extends ViewGroup implements ViewGroup.OnHierarc
|
||||
|
||||
// a method that subclasses can override to add behavior
|
||||
protected void onPageEndMoving() {
|
||||
mWasInOverscroll = false;
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -663,6 +666,7 @@ public abstract class PagedView extends ViewGroup implements ViewGroup.OnHierarc
|
||||
if (isXBeforeFirstPage) {
|
||||
super.scrollTo(0, y);
|
||||
if (mAllowOverScroll) {
|
||||
mWasInOverscroll = true;
|
||||
if (isRtl) {
|
||||
overScroll(x - mMaxScrollX);
|
||||
} else {
|
||||
@@ -672,6 +676,7 @@ public abstract class PagedView extends ViewGroup implements ViewGroup.OnHierarc
|
||||
} else if (isXAfterLastPage) {
|
||||
super.scrollTo(mMaxScrollX, y);
|
||||
if (mAllowOverScroll) {
|
||||
mWasInOverscroll = true;
|
||||
if (isRtl) {
|
||||
overScroll(x);
|
||||
} else {
|
||||
@@ -679,6 +684,10 @@ public abstract class PagedView extends ViewGroup implements ViewGroup.OnHierarc
|
||||
}
|
||||
}
|
||||
} else {
|
||||
if (mWasInOverscroll) {
|
||||
overScroll(0);
|
||||
mWasInOverscroll = false;
|
||||
}
|
||||
mOverScrollX = x;
|
||||
super.scrollTo(x, y);
|
||||
}
|
||||
@@ -1513,6 +1522,7 @@ public abstract class PagedView extends ViewGroup implements ViewGroup.OnHierarc
|
||||
mLastMotionXRemainder = 0;
|
||||
mTouchX = getViewportOffsetX() + getScrollX();
|
||||
mSmoothingTime = System.nanoTime() / NANOTIME_DIV;
|
||||
onScrollInteractionBegin();
|
||||
pageBeginMoving();
|
||||
}
|
||||
}
|
||||
@@ -1752,6 +1762,7 @@ public abstract class PagedView extends ViewGroup implements ViewGroup.OnHierarc
|
||||
mActivePointerId = ev.getPointerId(0);
|
||||
|
||||
if (mTouchState == TOUCH_STATE_SCROLLING) {
|
||||
onScrollInteractionBegin();
|
||||
pageBeginMoving();
|
||||
}
|
||||
break;
|
||||
@@ -1940,6 +1951,7 @@ public abstract class PagedView extends ViewGroup implements ViewGroup.OnHierarc
|
||||
getScrollY(), vX, 0, Integer.MIN_VALUE, Integer.MAX_VALUE, 0, 0);
|
||||
invalidate();
|
||||
}
|
||||
onScrollInteractionEnd();
|
||||
} else if (mTouchState == TOUCH_STATE_PREV_PAGE) {
|
||||
// at this point we have not moved beyond the touch slop
|
||||
// (otherwise mTouchState would be TOUCH_STATE_SCROLLING), so
|
||||
@@ -2025,6 +2037,15 @@ public abstract class PagedView extends ViewGroup implements ViewGroup.OnHierarc
|
||||
mActivePointerId = INVALID_POINTER;
|
||||
}
|
||||
|
||||
/**
|
||||
* Triggered by scrolling via touch
|
||||
*/
|
||||
protected void onScrollInteractionBegin() {
|
||||
}
|
||||
|
||||
protected void onScrollInteractionEnd() {
|
||||
}
|
||||
|
||||
protected void onUnhandledTap(MotionEvent ev) {
|
||||
((Launcher) getContext()).onClick(this);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user