Git Product home page Git Product logo

droplayout's Introduction

DropLayout

这里自己动手dropTopLayout实现的一个类库 但这个类本身似乎就有问题 有人提出了优化http://www.jianshu.com/p/22f213f0c42f 我自己重写的时候碰到了很多问题,一些问题虽然在上链接中有提示 但是远远没有自己写一边后清晰
在使用ViewDraghelper 碰到两个简单的问题

  • 忘 记给getViewVerticalDragRange赋值,代码注释上说如果返回0,无法返回正确的获取view,结果我在clampViewPositionVertical中就可以限制view活动的范围, range忘了写,根据以往看到的demo 直接在onInterceptTouchEvent方法结尾返回true,果然也是可以滑动,但是这样在嵌套时事件永远无法传递到子view, 在shouldInterceptTouchEvent 结尾判断mDragState == STATE_DRAGGING时 如果range == 0 ,状态永远是0

  • 如果cancel时,ViewDragHelp 没有调用processTouchEvent 那么状态用户是STATE_DRAGGING 事件依然无法分发

另外手动调用dragContentView.dispatchTouchEvent(ev); 可以继续分发事件

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.