mirror of
https://github.com/LawnchairLauncher/lawnchair.git
synced 2026-03-03 17:36:49 +00:00
New spring overscroll in pagedView
> Using EdgeEffect in PagedView for overscroll > Keeping RecentsView overscroll similar to S, by created a custom EdgeEffect Bug: 183966408 Test: Manual Change-Id: Ia547cf14ea315468b12a4ff5f389ac2d2beceafa
This commit is contained in:
@@ -38,10 +38,8 @@ import android.view.accessibility.AccessibilityEvent;
|
||||
import android.widget.LinearLayout;
|
||||
|
||||
import com.android.launcher3.DeviceProfile;
|
||||
import com.android.launcher3.PagedView;
|
||||
import com.android.launcher3.R;
|
||||
import com.android.launcher3.Utilities;
|
||||
import com.android.launcher3.util.OverScroller;
|
||||
import com.android.launcher3.util.SplitConfigurationOptions.SplitPositionOption;
|
||||
|
||||
import java.util.Collections;
|
||||
@@ -60,18 +58,23 @@ public class LandscapePagedViewHandler implements PagedOrientationHandler {
|
||||
}
|
||||
|
||||
@Override
|
||||
public void delegateScrollTo(PagedView pagedView, int secondaryScroll, int minMaxScroll) {
|
||||
pagedView.superScrollTo(secondaryScroll, minMaxScroll);
|
||||
public int getPrimaryValue(int x, int y) {
|
||||
return y;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void delegateScrollBy(PagedView pagedView, int unboundedScroll, int x, int y) {
|
||||
pagedView.scrollTo(pagedView.getScrollX() + x, unboundedScroll + y);
|
||||
public int getSecondaryValue(int x, int y) {
|
||||
return x;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void scrollerStartScroll(OverScroller scroller, int newPosition) {
|
||||
scroller.startScroll(scroller.getCurrPos(), newPosition - scroller.getCurrPos());
|
||||
public float getPrimaryValue(float x, float y) {
|
||||
return y;
|
||||
}
|
||||
|
||||
@Override
|
||||
public float getSecondaryValue(float x, float y) {
|
||||
return x;
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -86,11 +89,6 @@ public class LandscapePagedViewHandler implements PagedOrientationHandler {
|
||||
velocity.set(-oldY, oldX);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void delegateScrollTo(PagedView pagedView, int primaryScroll) {
|
||||
pagedView.superScrollTo(pagedView.getScrollX(), primaryScroll);
|
||||
}
|
||||
|
||||
@Override
|
||||
public <T> void set(T target, Int2DAction<T> action, int param) {
|
||||
action.call(target, 0, param);
|
||||
@@ -241,13 +239,13 @@ public class LandscapePagedViewHandler implements PagedOrientationHandler {
|
||||
}
|
||||
|
||||
@Override
|
||||
public float getTaskMenuX(float x, View thumbnailView) {
|
||||
public float getTaskMenuX(float x, View thumbnailView, int overScroll) {
|
||||
return thumbnailView.getMeasuredWidth() + x;
|
||||
}
|
||||
|
||||
@Override
|
||||
public float getTaskMenuY(float y, View thumbnailView) {
|
||||
return y;
|
||||
public float getTaskMenuY(float y, View thumbnailView, int overScroll) {
|
||||
return y + overScroll;
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
Reference in New Issue
Block a user