Code Monkey home page Code Monkey logo

Comments (7)

mcxtzhang avatar mcxtzhang commented on May 28, 2024

已经紧急修复,在侧滑动作时,不会触发长按。

from swipedelmenulayout.

androidXiaoHao avatar androidXiaoHao commented on May 28, 2024

还是不行啊,我下载了最新代码,我用的是ListView,侧滑出现时,我长按这个item的内容区仍然会触发长按监听,然后才是关闭侧滑菜单,不知道怎么回事?

from swipedelmenulayout.

mcxtzhang avatar mcxtzhang commented on May 28, 2024

switch (ev.getAction()) {
//add by zhangxutong 2016 11 04 begin :
// fix 长按事件和侧滑的冲突。
case MotionEvent.ACTION_MOVE:
//屏蔽滑动时的事件
if (Math.abs(ev.getRawX() - mFirstP.x) > mScaleTouchSlop) {
return true;
}
//能到这里说明是静止的
if (isLeftSwipe) {
if (getScrollX() > mScaleTouchSlop) {
if (ev.getX() < getWidth() - getScrollX()) {
smoothClose();
return true;//true表示拦截
}
}
} else {
if (-getScrollX() > mScaleTouchSlop) {
if (ev.getX() > -getScrollX()) {
smoothClose();
return true;
}
}
}
break;
//add by zhangxutong 2016 11 04 end

from swipedelmenulayout.

mcxtzhang avatar mcxtzhang commented on May 28, 2024

最新代码已经提交了,如上修改的。

from swipedelmenulayout.

mcxtzhang avatar mcxtzhang commented on May 28, 2024

不好意思,今天太忙了,现在我试了,侧滑菜单打开下,点击内容区域,会直接关闭,只能点击侧滑菜单区域了

from swipedelmenulayout.

androidXiaoHao avatar androidXiaoHao commented on May 28, 2024

多谢大神热心解答,不过还有一点小问题,就是现在长按冲突解决了,但是,出现了当侧滑菜单处于展开状态时,点击内容区会出现侧滑菜单不关闭的情况,有时候要点击好几次侧滑菜单才关闭,希望大神在空闲时间能看下,这样就完美了,再次感谢

from swipedelmenulayout.

mcxtzhang avatar mcxtzhang commented on May 28, 2024

问题已经解决,哈哈 都是解决了一个小BUG又引发了另外的小BUG,所以这次麻烦你再试试?
我同样也要谢谢你,感谢你给我反馈。完善它,以后用起来大家都方便。

from swipedelmenulayout.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.