Android Tutorial Expandable list based on CustomListView

Discussion in 'Tutorials & Examples' started by Erel, Jul 9, 2017.

  1. Erel

    Erel Administrator Staff Member Licensed User

    expander.gif


    This example uses a slightly modified version of CustomListView to create an expandable list.

    Each item in the list is made of two panels. One for the title with the arrow and the other is the expanded panel.
    Note that the expanded items height can be different for different items.

    The example depends on AnimationPlus and StringUtils libraries.
     

    Attached Files:

    Last edited: Jul 10, 2017
  2. LucaMs

    LucaMs Expert Licensed User

    Very useful, thank you.

    OT: what is that player?
     
  3. Erel

    Erel Administrator Staff Member Licensed User

    asales, MarcoRome and LucaMs like this.
  4. LucaMs

    LucaMs Expert Licensed User

  5. tucano2000

    tucano2000 Active Member Licensed User

    Excellent. Very useful.

    I found the library to work with the example here => https://www.b4x.com/android/forum/threads/lib-animationplus.21313/


    I have a project with intent to use this for the 2 Android and iOS platforms. It might be possible to port to iOS as well.
    It seems like the difficulty will be that library that does the animation and especially the customview in design that does not exist for b4i.
     
    Last edited: Jul 9, 2017
  6. Erel

    Erel Administrator Staff Member Licensed User

    B4i CustomListView is very similar and it is also implemented as a custom view.

    You can use this code to create a rotation animation: https://www.b4x.com/android/forum/threads/animations.46156/#post-338075
     
  7. Erel

    Erel Administrator Staff Member Licensed User

    An updated version was uploaded. The collapsing animation was improved.
     
    BillMeyer and DonManfred like this.
  8. sseaand

    sseaand Member Licensed User

    Please tell me why when hide the panel buttons seen in the background? How to fix it?
    [​IMG]
     
  9. Erel

    Erel Administrator Staff Member Licensed User

    It happens because there are gaps between the items. Decreasing the dividers height will make it less prominent.

    Another option which can work with the layout you posted is to set the divider height to 0 and add a thin panel as the divider to the items layout. Set the panel's background color to grey.
     
  10. sseaand

    sseaand Member Licensed User

    where the divider size is set?
     
  11. Erel

    Erel Administrator Staff Member Licensed User

  12. Noelkman

    Noelkman Member Licensed User

    Hi there,
    a while ago I had started something like this but now there it is. Great!
    Situation: I have added a listview in the item container but it instead of scrolling that listview the expanable list is scrolling.
    Question: Is this not possible?
     
  13. Noelkman

    Noelkman Member Licensed User

    Looks like it's already answered here
    Thanks.
     
Loading...