Android implements the draggable GridView effect. Long press to delete the data source
The Android draggable GridView effect is realized. Long press to drag and exchange items in real time
Simply modify and complete the functions you want: long press, move to the trash can and delete data.
The main ideas are:
1. Get the user's long press operation
2. Get the bitmap of the pressed image and dynamically refresh the image when moving
3 action_ When up, judge the position of the image and enter whether to delete the logic
Custom control
MainActivity.java
UninstallListener.java
activity_ main.xml
gridview_ item.xml
summary
The above is what Xiaobian introduced to you. Android implements the draggable GridView effect. Long press to drag and delete the data source. 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!