Android Tutorial [B4X] [XUI] Expandable list based on xCustomListView

Discussion in 'Tutorials & Examples' started by Erel, Nov 23, 2017.

Thread Status:
Not open for further replies.
  1. Erel

    Erel Administrator Staff Member Licensed User

    Edit: Better to use CLVExpandable class: https://www.b4x.com/android/forum/t...g-or-collapsing-xcustomlistview-items.106148/

    Compatible with B4A, B4J and B4i.

    [​IMG] [​IMG] [​IMG]


    This example uses a slightly modified version of xCustomListView 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.

    Dependencies:
    B4A: XUI, StringUtils, JavaObject
    B4J: XUI, JavaObject
    B4i: XUI

    Tips:
    - The order of items in the Item layout is important. pnlTitle should be the first item and the ImageView should be the second child:
    [​IMG]


    - The latest version is included in the B4A project. It is based on xCustomListView v1.65.
    The first line in the class:
    Code:
    'xCustomListView v1.65 - modified version to support expandable items
    The class is compatible with all three platforms.
     

    Attached Files:

    Last edited: May 26, 2019
    Procesor, Ohanian, fabricio and 21 others like this.
  2. incendio

    incendio Well-Known Member Licensed User

    Nice.

    Can I use this class with Scroll View in B4A?
     
  3. Erel

    Erel Administrator Staff Member Licensed User

    What do you mean with ScrollView? CustomListView is based on ScrollView.
     
  4. ihabsharaf

    ihabsharaf Member Licensed User

    HI
    can i use
    Expandable list inside
    Expandable list
     
  5. Erel

    Erel Administrator Staff Member Licensed User

    Technically you can. In most cases it is not recommended to put a scrollable view in another scrollable view. Try it.
     
    ihabsharaf likes this.
  6. ihabsharaf

    ihabsharaf Member Licensed User

    i try to use this code

    Code:
    Dim r As Reflector
       r.Target = Cvr
       r.RunMethod2(
    "setVerticalScrollBarEnabled"False"java.lang.boolean")
    but not work with customelistview

    what the method for disable scroll bar in customelistview
     
  7. Erel

    Erel Administrator Staff Member Licensed User

    Please start a new thread for this question.
     
  8. hibrid0

    hibrid0 Active Member Licensed User

    Hi, how can I get the events inside the item?
    I generate member button click event, but get the same click on all buttons.
     
  9. ihabsharaf

    ihabsharaf Member Licensed User

    Code:
    Sub Cmd_Add_Click
    Dim v As button
    v = 
    Sender
    End Sub
     
    hibrid0 likes this.
  10. Erel

    Erel Administrator Staff Member Licensed User

    A new version based on xCustomListView 1.65 was released. It is included in the B4A project.
     
    Ohanian and Alexander Stolte like this.
Thread Status:
Not open for further replies.
Loading...
  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