1

Do you know if it is possible to achieve a listview with this kind of layout? If so, how should I have to proceed? I have the card image for separated and I would like the text to be dynamic (gradient text with white shadow)

Thanks!

enter image description here

Edward Falk
  • 9,991
  • 11
  • 77
  • 112
Jordi Puigdellívol
  • 1,710
  • 3
  • 23
  • 31

2 Answers2

1

You can use Shape tag to create rounded corner Listview in drawable folder and you can set that shape tag file as background to your listview.

For more information on shape tag and all those stuff you can refer the following question.

  1. Rounded corner of list item on Android?

  2. How do I create a ListView with rounded corners in Android?

and also refer the following blog

  1. http://shenhengbin.wordpress.com/2012/03/19/android-practice-listview-with-round-corner/
halfer
  • 19,824
  • 17
  • 99
  • 186
Sankar Ganesh PMP
  • 11,927
  • 11
  • 57
  • 90
  • And will it overpose the previous list item? if you can see in the image each list item is over the previous one, how can achieve it with the background image? – Jordi Puigdellívol Oct 18 '12 at 11:40
1

Yup its definitely possible. Just set the listview row layout to have a background drawable (png) of the card background.

The text is a little trickier. This library can help you create gradient text - https://github.com/koush/Widgets.

Then you should also be able to set the shadow color, size and offset of the GradientTextView.

athor
  • 6,848
  • 2
  • 34
  • 37
  • And will it overpose the previous list item? if you can see in the image each list item is over the previous one, how can achieve it with the background image? – Jordi Puigdellívol Oct 18 '12 at 11:39
  • It's all about faking it :) Crop your background image to look something like this: http://imgur.com/67c9d Then position your text at the bottom of the layout,and it will appear like the list items are overlapping when in reality they arent, the background just makes it appear so. Just make sure you background is cropped exactly so it 'repeats' vertically properly. – athor Oct 18 '12 at 20:51
  • And the the last one can have a diferent bg right? so I make it end properly? – Jordi Puigdellívol Oct 19 '12 at 07:41
  • In your row adapter you should be able to check if the position is equal to the length of your list of items, and set a different background. Or you could use a footer. – athor Oct 19 '12 at 08:49