Giter Club home page Giter Club logo

zwrecycle's Introduction

zwRecycle

拖拽排序,长按显示删除按钮

参考项目:RecycleView&ItemTouchHelp,更改:点击编辑按钮删除改为长按显示删除按钮,解决长按拖动删除时position错乱问题。*

参考项目: https://github.com/huyue05/ItemTouchHelper-RecycleView

以下是演示图片

image
最近要做一个可以拖拽排序、可以长按显示删除按钮、还有分组展示item等要求的recycleview或gridview
开始不想重复找轮子,就在网上找了很多,都不能满足公司的要求,最后找了一个又自己改了一些,才满足要求。
解决隐藏问题:长按拖动后,在没有点完成前又点了删除,会删除错误的item
原因是拖动完还没有刷新整个控件的话position不会变化,所以拖动完删除position没变
最后重写了RecycleView,在里面加上了onTouchEvent监听手指松开事件,松开后刷新控件,position就更改过来了

如果有好的解决办法请联系我,谢谢!

zwrecycle's People

Contributors

840631861 avatar

Stargazers

 avatar  avatar  avatar

Watchers

 avatar  avatar

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.