Android imitates QQ sideslip to delete listview function example
Requirements:
1. Listview can slide the item to show the delete button. Click the delete button to delete the current item
2. When the delete button is displayed, click the hide delete button, which does not respond to the click event of item
3. When the delete button is hidden, click item to respond to the click event
According to the above requirements, there are examples of finding responses on the network. There are also imitation QQ sideslip codes, but they can not meet the requirements of 2 and 3. Therefore, one is modified. The codes are as follows. We beat bricks
Step 1: Rewrite listview
Step 2: adapter
Step 3: write a testlistviewactivity
Step 4: layout file
Step 5: layout file of item
Key points:
Downposition gets - 1 during use, resulting in an exception in the subsequent method call!
The above is an example of Android imitating QQ sideslip to delete listview function introduced by Xiaobian. I hope it will be helpful to you. If you have any questions, please leave me a message, and Xiaobian will reply to you in time. Thank you very much for your support for the programming tips website!