B4A Library [B4X] CLVExpandable - Allows expanding or collapsing xCustomListView items

Discussion in 'Additional libraries, classes and official updates' started by Erel, May 26, 2019.

  1. Erel

    Erel Administrator Staff Member Licensed User


    This class replaces the custom CustomListView module (https://www.b4x.com/android/forum/threads/b4x-xui-expandable-list-based-on-xcustomlistview.86449/).
    It works with the standard xCustomListView library.
    It is compatible with B4A, B4i and B4J.


    An expandable item layout should be made of two panels. The first one is the title and the second one is the item's body.
    The title panel should include at least two items where the second item is a view with the arrow (you can easily change this by modifying the code).
    The item layout background must be transparent.
    It is also recommended to remove AutoScaleAll from the item layout.

    The class is included in the attached examples.

    Attached Files:

  2. lerneBasic4Android

    lerneBasic4Android Member Licensed User


    This is great new feature of CLV which I would love to use it in my project!

    But I'm facing a general problem regarding the current implementation of CLVExpandable. It seems not to be compatible with the strategy Erel suggested for lazy loading in https://www.b4x.com/android/forum/t...ew-lazy-loading-virtualization.87930/#content.

    For example in CreateValue() the title and item panels are used to calculate the collapsed height and the expanded height. But when using lazy loading the whole panel does not have any views yet. It creates both views in the moment when an items gets visible.

    Did anyone found a solution to make this great expandable feature usable with lazy loading?

  3. Erel

    Erel Administrator Staff Member Licensed User

    There are many ways to implement lazy loading. One simple way to combine this feature with lazy loading is to create the two panels for each item when you fill the list and later fill the content when the list is scrolled. It will still be much faster and lighter than creating all the content beforehand.
    lerneBasic4Android likes this.
  4. sdleidel

    sdleidel Member Licensed User

    how i can add more then one item ?

  5. Erel

    Erel Administrator Staff Member Licensed User

    The example creates many items.
  6. sdleidel

    sdleidel Member Licensed User

    Hi Erel,
    yes thats right,
    but i would like load more then one layout/item...
    Item#1 : Load the Layout 2x
    Item#3 : Load the Layout 4x...

    ihabsharaf likes this.
  7. Erel

    Erel Administrator Staff Member Licensed User

    Please start a new thread and it will be easier to help if you provide a simple mockup of the layout you want to create.
  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.
    Dismiss Notice