3 level expandable list view with swipe feature
Asked Answered
T

1

0

I am creating 3 level expandable list with swipe functionality at 3rd level.

I am facing an issue with swiping feature at 3rd level swipelistview, when caching is used.

For swiping, I am using "47deg/android-swipelistview" https://github.com/47deg/android-swipelistview/ library. For creating 3 level expandable list, I used code from http://mylifewithandroid.blogspot.in/2011/02/3-level-expandable-lists.html. I used cache concept at 3 places: 1. 2nd level expandable list, 2. 3rd level swipelistview 3. swipelistview nodes. This way, it gave good performance while scrolling/expanding/collapsing the expandable list.

But at that time, swiping functionality stop working. If I stop using cache at swipelistview node level (inside getview() function of adapter of swipelistview), swiping feature works properly.

My question is, if I create new view everytime at getview() of swipelistview class or reuse convertedview, swiping feature continues to work. But if I create node first time only for every child and next time on the getview request, I sent already prepared node, why swiping feature stops working.

P.S. When I say, swiping feature stops working, GUI is not updated properly.

I have sample project available with me, in case anyone needs it. or if anyone requires specific portion of the code, I can also provide the same.

Thinnish answered 17/9, 2013 at 18:40 Comment(2)
Hey... how you solve you problem?, cand you send me your code with the solution?Collection
Have u solved ur problem I have also same problem stackoverflow.com/questions/18765638/… If u have solved ur problem please help me.Benenson
T
0

In order to get it working, I implemented it with following approach. I am not sure, this is the best way or not.

  • We used getViewTypeCount() and getItemViewType() functions in listview base adapter to return different view type for each row. This way, it does not try to use same view while using in getView() facility.

  • Similarly for ExpandableListViewAdapter, we used getChildTypeCount() and getChildType() to return different type.

This way, I was able to achieve what I was looking for. I am sure, this is not the most optimize way as it does not allow, reusablity of components, but it works in my case, as my app does not need thousands of components in list.

Thinnish answered 28/11, 2013 at 13:32 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.