6

How to create this below view.

1)using listview or

2)inflating custom view in scrollview. This is not only problem.

If list view then how to overlap the rows.

Each row have different color and that will come from api webservice.enter image description here

In listview, at each row i have problem with red part which i have marked in second image. even each row background is different and that same color will appear in below row.

How to do texture effect in listview?

enter image description here

Cœur
  • 37,241
  • 25
  • 195
  • 267
Bhavesh Jethani
  • 3,891
  • 4
  • 24
  • 42

2 Answers2

3

The issue breaks to many things:

  1. How to draw overlapping views? I would try setting negative values for vertical paddings, but it's a wild guess. Also, you can just divide the graphics and draw views as rectangles containing view N and some parts of the N+1th view.

  2. What about non-rectangular hit area? You can manually detect clicks using color picking, shapes, or just simplify the view's clickable area to a rectangle.

  3. What about visibility detection? ListView shows only views, which are visible. I'm not sure, but most likely it won't work with negative paddings or similar hacks.

Personally I would write a custom view with ListView-like adapter and dynamic row loading.

Zielony
  • 16,239
  • 6
  • 34
  • 39
  • if i will create list view then problem with overlapping concept in custom list view. – Bhavesh Jethani Sep 05 '13 at 12:00
  • in 1st option. how to set vertical padding in minues. – Bhavesh Jethani Sep 05 '13 at 12:14
  • http://stackoverflow.com/questions/9685658/add-padding-on-view-programmatically you can set top and bottom paddings – Zielony Sep 05 '13 at 12:35
  • still its not working . i try with bottom margin and with bottom padding in negative but its not working. – Bhavesh Jethani Sep 05 '13 at 15:01
  • Just like I wrote on the beginning, it's a wild guess. Probably you will need to write your own list with overlapping views. This approach is the most time-consuming, but it gives you the most control over the stuff you would like to achieve. – Zielony Sep 05 '13 at 15:25
1

I have try a many ways, and the best and fastest is simple set negative divider to listview like so:

android:dividerHeight="-100dp"
LamaUltramarine
  • 115
  • 1
  • 1
  • 7