android - 离线地图的这种列表该怎么实现?
怪我咯
怪我咯 2017-04-17 17:44:13
0
4
441

就是下图这种列表,前两个分组为单层的,其他身份的为双层的,想了好久没想通,只能来请教各位了...

怪我咯
怪我咯

走同样的路,发现不同的人生

reply all(4)
刘奇

There are many expandableListView libraries on github. You can find out if there is a suitable one, but it can also be achieved simply by using recyclerView. There are three types of trpe in the adapter, title (popular provinces, etc.), sub-title (Shandong Province, etc.), and specific province.

Click on the extended list to directly insert data and then use adapter.notifyItemIntert() to refresh the list

刘奇

Recommend two libraries
https://github.com/zaihuishou...
https://github.com/bignerdran...
I feel that the single-layer click effect can be processed separately, download the map directly, and expand the double-layer , secondary menu to download map

阿神

I have written briefly before. Define a simple tree structure by yourself, which records the child nodes, the number of layers of this node, whether to display the child nodes of this node and whether this node is a leaf node, and judge the itemType based on these (for example, if it is a leaf node, click Yes Download the map (if it is a non-leaf node, it will expand the next level list), but notifyDataSetChanged() will be triggered every time you click, which I feel is not good.

Android creates an arbitrary level tree control to test your data structure and design. Master Hongyang once wrote a similar article, but he used linear table storage

After thinking about it for a while, there are still many pitfalls, so I just sit quietly and wait for the master

迷茫

Recommended open source recyclerview https://github.com/bignerdran...
Define tree structure
├─ItemStructure
│ ├─ItemParent
│ │ ├─ItemChildrens
│ │ │ ├─ItemChildren1
│ │ │ ├─ ItemChildren2
│ │ │ ├─ItemChildren3
│ │ │ ├─.............
ItemStructure is the entire structure of the Item, ItemParent is the drop-down part of the Item, and ItemChildrens is the most sub-layer that can be downloaded content. Classify HeaderView, ItemParent, ItemChildrens list by ViewType

Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template