I'm assuming that you already know how to make a list view to display data and/or images as the image above illustrates, and that your primary difficulty is to show the "A", "B", "C", etc.
If that is the case, then a good approach would be to specify a list of models (data), each containing a field of "name", "imageUrl" & an optional "firstLetter" which can be null.
When you sort these models by the "name" field, you go over the list once, and on each iteration you check if the 1st letter of the "name" field is different than the previous one (always true for the 1st element). If this is the case, the "firstLetter" field is set to the upper-case first letter of the "name" field. Otherwise, it will be null.
Then in your adapter, if the "firstLetter" field is not null, then make the TextView which displays this letter visible (otherwise, make it GONE
), and assign the text to the value of "firstLetter".
EDIT:
The above was written before you asked for the "A", "B", etc to be "sticky" and remain until there are no more items beginning with that letter.
To implement the "sticky" behaviour, similar to the WhatsApp app which makes the dates of the texts sticky, you can create an additional view which floats over the list (you'll need to make sure that the paddings, styles and fonts match so that everything looks good).
Then, in your adapter, you'll need to check the following:
- Am I already displaying this "hovering" letter for the letter that my cell wants to show? if that's the case, don't show it. This will prevent showing two "A"'s when the "A" is partially outside the screen.
- Is the position of my cell which is showing the "A" or "B" slightly outside of the screen? If so, make sure to show the "hovering" letter and give it the correct text.