The application relates to the technical field of Android development, and discloses a cross-row-column irregular
list moving and sorting method and device based on RecyclerView, aiming to solve the problem that the existing method cannot maintain the integrity and stability of a grid
layout, and the scheme mainly comprises the following steps: defining a
list item data object for storing self position information, self span information and adjacent span information of adjacent
list items; sequentially traversing data in an
original data list, converting the data into list item
data objects, and generating a regularly arranged list item data object set; when a moving and sorting instruction is received, calculating a
data exchange scheme, reordering the list item data object set, and synchronously updating information of affected list item
data objects; comparing the list item data object set before and after moving and sorting, calculating a data difference set, and driving a RecyclerView adapter to perform local UI refreshing. The application maintains the integrity and stability of the grid
layout and is suitable for cross-row-column irregular lists.