HVScrollView fling changed
This commit is contained in:
parent
3855227e74
commit
7140190adf
@ -21,7 +21,7 @@ import com.github.pengfeizhou.jscore.JSValue;
|
||||
|
||||
import pub.doric.DoricContext;
|
||||
import pub.doric.extension.bridge.DoricPlugin;
|
||||
import pub.doric.widget.NewHVScrollView;
|
||||
import pub.doric.widget.HVScrollView;
|
||||
|
||||
/**
|
||||
* @Description: pub.doric.shader
|
||||
@ -29,7 +29,7 @@ import pub.doric.widget.NewHVScrollView;
|
||||
* @CreateDate: 2019-11-18
|
||||
*/
|
||||
@DoricPlugin(name = "Scroller")
|
||||
public class ScrollerNode extends SuperNode<NewHVScrollView> {
|
||||
public class ScrollerNode extends SuperNode<HVScrollView> {
|
||||
private String mChildViewId;
|
||||
private ViewNode mChildNode;
|
||||
|
||||
@ -50,12 +50,12 @@ public class ScrollerNode extends SuperNode<NewHVScrollView> {
|
||||
}
|
||||
|
||||
@Override
|
||||
protected NewHVScrollView build() {
|
||||
return new NewHVScrollView(getContext());
|
||||
protected HVScrollView build() {
|
||||
return new HVScrollView(getContext());
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void blend(NewHVScrollView view, String name, JSValue prop) {
|
||||
protected void blend(HVScrollView view, String name, JSValue prop) {
|
||||
if ("content".equals(name)) {
|
||||
mChildViewId = prop.asString().value();
|
||||
} else {
|
||||
|
@ -1960,11 +1960,12 @@ public class HVScrollView extends FrameLayout implements NestedScrollingParent,
|
||||
if (getChildCount() > 0) {
|
||||
int axes = getAxes();
|
||||
startNestedScroll(axes, ViewCompat.TYPE_NON_TOUCH);
|
||||
mScroller.fling(getScrollX(), getScrollY(), // start
|
||||
velocityX, velocityY, // velocities
|
||||
Integer.MIN_VALUE, Integer.MAX_VALUE, // x
|
||||
Integer.MIN_VALUE, Integer.MAX_VALUE, // y
|
||||
0, 0); // overscroll
|
||||
int height = getHeight() - getPaddingBottom() - getPaddingTop();
|
||||
int width = getWidth() - getPaddingRight() - getPaddingLeft();
|
||||
int bottom = getChildAt(0).getHeight();
|
||||
int right = getChildAt(0).getWidth();
|
||||
mScroller.fling(getScrollX(), getScrollY(), velocityX, velocityY, 0, Math.max(0, right - width), 0,
|
||||
Math.max(0, bottom - height), width * 2 / 3, height * 2 / 3);
|
||||
mLastScrollerX = getScrollX();
|
||||
mLastScrollerY = getScrollY();
|
||||
ViewCompat.postInvalidateOnAnimation(this);
|
||||
|
File diff suppressed because it is too large
Load Diff
Reference in New Issue
Block a user