Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Implement view like view pager

Hi I want to implement view like viewpager, which I want to put in List such that each element can be swiped,

Please refer Below diagram enter image description here

Here View 1 and View 3 will be not visible on swiping right view1 will be visible just like view pager.

I tried using viewFlicker but it don't show hidden view on swipe.

To implement this I thought to use Viewpager source, Viewpager.java its basically ViewGroup but view Group I cant add to ListView. I tried swipeListView that also didn't help.

Could any one help me how to implement it

like image 992
Sharanabasu Angadi Avatar asked Nov 11 '22 06:11

Sharanabasu Angadi


1 Answers

I would like to suggest few things do check it out if it works for you :)

  1. Create normal view pager as you have done.eg view 1 , 2, and 3.
  2. Then, add fragment in view 2 which will consist of custom listview.
  3. Then, use getItemViewType and getViewTypeCount methods while using listview base adapter for creating different view in same listview.
  4. Then, Add view pager as one of the view layout in that listview as an item of listview.

I hope you can get little idea. :)

like image 137
Harshal Benake Avatar answered Nov 15 '22 07:11

Harshal Benake