B4A Library ListView supporting RichStrings

Discussion in 'Additional libraries, classes and official updates' started by specci48, Apr 7, 2012.

  1. specci48

    specci48 Well-Known Member Licensed User

    Another small lib I want to share.

    The only feature is called ListView2 which acts like an normal ListView (from Core) but supports a CharSequence for all labels.
    So can use normal Strings as text or RichStrings for more color and formats.


    specci48
     

    Attached Files:

    Mashiane, air cover and eps like this.
  2. raphaelcno

    raphaelcno Active Member Licensed User

    Thank you for this library. Do you have a code example showing how you use it?
     
  3. NJDude

    NJDude Expert Licensed User

    The attached project shows how to use it.

    You need to have the Listview2 and RichText lib installed.
     

    Attached Files:

  4. raphaelcno

    raphaelcno Active Member Licensed User

    Thank you very much, it works nice :)

    Actually the libraries are called SPListView and RichString.
    ListView2 is the type name in the SPListView library.
     
  5. mjtaryan

    mjtaryan Active Member Licensed User

    I have encountered a problem with ListView2 that I'very not experienced with ListView from Core. In a ListView2 that needs to be scrolled, the least 1 to 3 items in the list do not come into view when scrolling. Any ideas why and a solution or workaround? I've tried adding some blank items at the end, but that doesn't always work. Thanks
     
  6. Sub7

    Sub7 Active Member Licensed User

    I'm using this lib with richstring but i have a problem:

    ListView1.TwoLinesLayout.ItemHeight = 200dip - Does not works
    ListView1.AddTwoLinesAndBitmap("Hey", "you", icon)

    ListView1.SingleLineLayout.ItemHeight = 200dip - Works
    ListView1.AddSingleLine("Hey")

    Ty
     
  7. eps

    eps Well-Known Member Licensed User

    Do you not need to indicate the Label that you are setting the height of?

    Something like :

    Code:
    ListView1.TwoLinesLayout.Label.Height = 22dip

    ListView1.TwoLinesLayout.SecondLabel.Height = 
    20dip
    HTH
     
  8. Sub7

    Sub7 Active Member Licensed User

    Hi eps, I tried that before but without success!

    Code:
    ListView1.TwoLinesLayout.ItemHeight = 200dip
    ListView1.TwoLinesLayout.Label.Height = 
    100dip
    ListView1.TwoLinesLayout.SecondLabel.Height = 
    100dip
    ListView1.ScrollingBackgroundColor = 
    Colors.black
    ListView1.Color = 
    Colors.Black
    ListView1.AddTwoLinesAndBitmap(header, eventinfo, defaulticon)
     
    Last edited: Nov 8, 2013
  9. Sub7

    Sub7 Active Member Licensed User

    Found that i had a problem with image, thanks, sorry.
     
  10. brunnlechner

    brunnlechner Member Licensed User

    Hallo,
    is it possible to integrate RichStrings for more color and formats in a other ListView like MListView?

    Thank You
    Franz
     
  11. specci48

    specci48 Well-Known Member Licensed User

    It should be possible but this question must be answered by icefairy33, the owner of the mListView library.
    Maybe he adds the RichStrings support for his library if you ask him.

    Specci48
     
  12. TheWind777

    TheWind777 Active Member Licensed User

    I have had extreme problems with my program crashing with Fatal Signal 11 and Error 7 just at the end of the 'End Sub' when I have a subroutine such as this:

    Code:
    sub Globals
     
    Dim lvMenus As ListView2
    end sub

    sub Activity_Create
     lvMenus.Initialize(
    "lvMenus")
    end sub

    Sub lvMenus_ItemClick(Position As Int, Value As Object)
     
     lvMenus.Visible = 
    False
     CallSubDelayed2(
    """Do_Menu_Item", Position)
     
    End Sub
    The crash is random; doesn't always occur. When iz change them from ListView2 to ListView the crash goes away (and, unfortunately, the RichString colors also go away... oh well).

    The ListView is populated with lines of text which form a menu of choices which you click-on. Once the user has clicked on it, the function number is sent via Position to the lvMenus_ItemClick() rountine and then on to a 'Menu Choice' routine which handles the menu choice subs.

    I would suspect that your ListView2 is closing something; but it doesn't close fast-enough, or something?

    Any idea how to get around the problem? I could just throw away the idea of having colored menu items... but they look so nice. Works perfectly except when it crashes.

    Every had anybody complain that they were getting Fatal Signal 11 errors from the library, sometimes? I can absolutely say without a doubt that it is the library which is doing it because whenever I change it to ListView instead of ListView2 the problem goes away (and when I use ListView2 it can crash about 1 out of 3 times).

    Is there something I could delay doing somewhere? I could either set a flag to wait or do a timer that wastes some time... but the crash seems to occur after the End Sub occurs, not before; which I have no control over.
     
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