Skip to content
This repository has been archived by the owner on Jun 3, 2021. It is now read-only.

Commit

Permalink
keep pageIndex if pageEnabled seted (#1537)
Browse files Browse the repository at this point in the history
  • Loading branch information
Darin726 authored and YorkShen committed Sep 18, 2018
1 parent e95972b commit 32621fc
Showing 1 changed file with 10 additions and 1 deletion.
Expand Up @@ -437,11 +437,15 @@ public void onScrollChanged(WXHorizontalScrollView scrollView, int x, int y, int
scrollView.addView(mRealView, layoutParams);
scrollView.setHorizontalScrollBarEnabled(false);

if(pageEnable && this.pageSize != 0) {
if(pageEnable) {
mGestureDetector = new GestureDetector(new MyGestureDetector(scrollView));
scrollView.setOnTouchListener(new View.OnTouchListener() {
@Override
public boolean onTouch(View v, MotionEvent event) {
if (pageSize == 0) {
pageSize = v.getMeasuredWidth();
}

if (mGestureDetector.onTouchEvent(event)) {
return true;
}
Expand Down Expand Up @@ -685,6 +689,11 @@ public void scrollTo(WXComponent component, Map<String, Object> options) {
}
}

if(pageEnable) {
mActiveFeature = mChildren.indexOf(component);
}


int viewYInScroller=component.getAbsoluteY() - getAbsoluteY();
int viewXInScroller=component.getAbsoluteX() - getAbsoluteX();

Expand Down

0 comments on commit 32621fc

Please sign in to comment.