Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

android Gmail app like List View with a letter in icon

I am looking for a solution like the emails list in gmail's android app, I want a list with swipe to delete and to have title and an icon with the first character of the title. in my application this will be used to show some names in the app from a database table, so there will be this icon like in the gmail app with the first letter of name and then the name next to it. Swiping will give an option to delete.

here is the screenshot for reference (I would be using just the title ,the icon on left and time ! )

enter image description here

UPDATE

Now I am planning to use TextDrawable as EUGEN advised. Now I have this issue, The Sample adapter provided in sample folder of the library, uses listarry as dataset

private List<ListData> mDataList = Arrays.asList(
        new ListData("Iron Man"),
        new ListData("Captain America"),
        new ListData("James Bond"),
        new ListData("Harry Potter"),
        new ListData("Sherlock Holmes"),
        new ListData("Black Widow"),
        new ListData("Hawk Eye"),
        new ListData("Iron Man"),
        new ListData("Guava"),
        new ListData("Tomato"),
        new ListData("Pineapple"),
        new ListData("Strawberry"),
        new ListData("Watermelon"),
        new ListData("Pears"),
        new ListData("Kiwi"),
        new ListData("Plums")
);

I have to use data in the form of string array. I am new to list arrays and adapters so I need help!

like image 516
dmSherazi Avatar asked Jan 04 '15 14:01

dmSherazi


1 Answers

I use the TextDrawable library. The point is this: when you have the user's photo, you display the photo, otherwise the letter. So it's easier to only have one ImageView instead of having an extra TextView on top of it.

like image 91
Eugen Pechanec Avatar answered Nov 03 '22 01:11

Eugen Pechanec