Skip to content

the issue of SwipeMenu hard swipe and twitch swipe #1

@SnowWindSaveYou

Description

@SnowWindSaveYou

Hello, i use your SwipeMenu in my school homework, it works well when i test on simulator,
But when i use the real device to test it became very hard to use, it always twitch between open and close when i try to swipe it.

While, i discover it's just some numeric issue,
This component can works well again after few adjustment
in smoothScrollTo() use duration time 500 rather than 100 make
in onTouchEvent() the condition of open action use if(getScrollX() >= getChildAt(1).getMeasuredWidth() / 10)

Also add one more condition of ACTION_CANCEL

case MotionEvent.ACTION_CANCEL:
                if (getScrollX() >= getChildAt(1).getMeasuredWidth() / 10) {
                    Log.d(TAG, "onTouchEvent: 1");
                    haveShowRight = true;
                    mSwipeMenu = this;
                    moveTo(getChildAt(1).getMeasuredWidth());
                }

Those measures can make the the component more sensitive to user actions and makes control more smoothly.

(学校作业对一个开源项目做出小贡献,想起年初踩的这个坑过来回复下,但是时间有点久远可能写的不怎么到位 = =|||,打开自己代码都不记得自己改了啥 )

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions