Display Namelist In Recyclerview under each letter in alphabetic Order Android

前端 未结 6 1552
無奈伤痛
無奈伤痛 2021-02-06 08:19

I have list of contacts which has to be displayed in alphabetic under each alphabet as shown in the image shown

How can I do this in RecyclerView, please suggest a solut

6条回答
  •  感情败类
    2021-02-06 08:40

    1. Sort list with data by name
    2. Iterate via list with data, and in place when current's item first letter != first letter of next item, insert special kind of object.
    3. Inside your Adapter place special view when item is "special".

提交回复
热议问题