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

keep pageIndex if pageEnabled seted #1537

Merged
merged 1 commit into from
Sep 18, 2018
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
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