chadguo/VerticalViewPager

what's the usage of adjustDownMotion

hqglichao opened this issue · 3 comments

no quiet understand the usage of adjustDownMotion.
or what's effected by removing this func.

@hqglichao fakeDrag interrupt the action_move process of viewPager's child, adjustDownMotion make the child view get the latest touch location when viewPager stop fakeDrag, looks like one of the two call places is redundant;
but i forget the difference of remove adjustDownMotion, so sorry.

By the way, it is because you return true after fakeDrag.
so viewPager's child onTouch return true.
from dispatchTouchEvent source code. if mOnTouchListener.onTouch return true
onTouchEvent will not execute.

SOURCE CODE:
if (li != null && li.mOnTouchListener != null
&& (mViewFlags & ENABLED_MASK) == ENABLED
&& li.mOnTouchListener.onTouch(this, event)) {
result = true;
}

        if (!result && onTouchEvent(event)) {
            result = true;
        }

@hqglichao yes, onTouchEvent won't receive this action_move event, but it will receive the adjustDownMotion's action_down