You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@weex.apache.org by GitBox <gi...@apache.org> on 2018/09/18 07:44:58 UTC
[GitHub] YorkShen closed pull request #1537: keep pageIndex if pageEnabled
seted
YorkShen closed pull request #1537: keep pageIndex if pageEnabled seted
URL: https://github.com/apache/incubator-weex/pull/1537
This is a PR merged from a forked repository.
As GitHub hides the original diff on merge, it is displayed below for
the sake of provenance:
As this is a foreign pull request (from a fork), the diff is supplied
below (as it won't show otherwise due to GitHub magic):
diff --git a/android/sdk/src/main/java/com/taobao/weex/ui/component/WXScroller.java b/android/sdk/src/main/java/com/taobao/weex/ui/component/WXScroller.java
index 2bcdf21b65..814e8542cd 100644
--- a/android/sdk/src/main/java/com/taobao/weex/ui/component/WXScroller.java
+++ b/android/sdk/src/main/java/com/taobao/weex/ui/component/WXScroller.java
@@ -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;
}
@@ -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();
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
With regards,
Apache Git Services