Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Overlapping row in listview

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

like image 990
Bhavesh Jethani Avatar asked Sep 05 '13 11:09

Bhavesh Jethani


2 Answers

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.

like image 159
Zielony Avatar answered Nov 15 '22 00:11

Zielony


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

android:dividerHeight="-100dp"
like image 41
LamaUltramarine Avatar answered Nov 15 '22 00:11

LamaUltramarine