Android imitation wechat conversation list sliding deletion effect
The sliding deletion effect of wechat conversation list is very good, which draws lessons from swipelistview on GitHub (project address: https://github.com/likebamboo/SwipeListView ), some refactoring is carried out on it, and finally the sliding deletion effect of wechat dialogue list is realized.
Implementation principle 1 Get the pressed position through pointtoposition (int x, int y) of listview, and then through Android view. ViewGroup. Getchildat (position) to get the sliding object swipeview 2 Calculate the distance to slide in ontouchevent and call swipeview Just scroll to.
The operation effect is as follows
The following is the core swipelistview Code:
Demo download address: http://xiazai.jb51.net/201608/yuanma/SwipeListView (jb51.net). rar
In the swipeadapter source code of demo, there is a careless error, which will lead to an array out of bounds exception when sliding down. Now correct it as follows:
This article has been sorted into "Android wechat development tutorial summary", welcome to learn and read.
The above is the whole content of this article. I hope it will be helpful to your study, and I hope you can support programming tips.