My favorites | Sign in
Project Home Wiki Issues Source
READ-ONLY: This project has been archived. For more information see this post.
Project Information
Members

这是一个自定义控件,继承自ListView 控件有三个属性在attr.xml中 代码主要参考自Android自带音乐播放器,该播放器实现了拖动排序效果

我将这个控件应用在自己的一个便签应用中,使便签的列表可以拖动排序,同时还能识别左划或右划事件。

使用: 1.将文件添加到项目中 2.继承其中的接口,将接口中的方法改为自己需要的方法 这些方法可以在事件触发后被ListView调用,实现与外界类交互。 3.修改事件触发后的操作即可,同时也可以修改其中的动画效果, 默认动画效果是:左滑滑动70%,右滑全部滑出,长按可以拖动一条item并排序

The code is based on Android Music Player. I used it in my notes app which the listview could be sorted by long click and then drag the item. Also, this listview can detect left or right fling gesture and do whatever you want.

It has three attributes in the attr.xml.

To use it: just copy it into your project and replace the code in the specific place. There's also an interface which you should implement in the outside and add some your methods. Those methods then can be called when some touch events happened.

Powered by Google Project Hosting