Android: How to remove an element from a gridview by shuffling elements in place

BACKGROUND:
I have a grid of 36 buttons, say 6 rows and 6 columns with numbers from 1 to 36, displayed 2 rows at a time using a GridView and a custom adapter

The grid displays fine, and all scrolling works correctly.

Question:
I want to be able to click an element, remove it from the grid, and the remaining objects are shuffled into place. Currently, I can disable an item that has been disabled, set its visibility to INVISIBLE or GONE, but none of them will remove it from the screen.

Suggestions?

+5
source share
2 answers

, , adapter.notifyDataSetChanged(). , , .

tween , , , . , , AdapterView.

+2

All Articles