Skip to content

Commit

Permalink
Add momentum events invoking
Browse files Browse the repository at this point in the history
  • Loading branch information
savelichalex committed Nov 19, 2021
1 parent c1c8d32 commit ddd2482
Showing 1 changed file with 16 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,8 @@
import com.mixiaoxiao.overscroll.PathScroller;

import java.lang.reflect.Field;
import java.lang.reflect.InvocationTargetException;
import java.lang.reflect.Method;

/**
* https://github.com/Mixiaoxiao/OverScroll-Everywhere
Expand Down Expand Up @@ -78,6 +80,20 @@ public boolean onTouchEvent(MotionEvent event) {
// TODO: it's fired twice for some reason
ReactScrollViewHelper.emitScrollEndDragEvent(this, 0, 0);
mDragging = false;

// TODO: create a wrapper with method invoker
try {
Method handlePostTouchScrolling = getClass().getSuperclass().getDeclaredMethod("handlePostTouchScrolling", int.class, int.class);
handlePostTouchScrolling.setAccessible(true);
// TODO: velocity
handlePostTouchScrolling.invoke(this, 0, 0);
} catch (IllegalAccessException e) {
e.printStackTrace();
} catch (InvocationTargetException e) {
e.printStackTrace();
} catch (NoSuchMethodException e) {
e.printStackTrace();
}
// return true;
}
int offset = this.superComputeVerticalScrollOffset();
Expand Down

0 comments on commit ddd2482

Please sign in to comment.