Android Code Snippet xCustomListView Loading Tip

Discussion in 'Code Snippets' started by Harris, Feb 24, 2019.

  1. Harris

    Harris Well-Known Member Licensed User

    When loading a large CLV list (items derived from a ResultSet - for example), I find it loads much faster if you set the underlying scroll view visibility to False (before loading the list). Set it back to True after populating the the custom list, as follows:

    ProgressDialogShow2("Updating All Posts...",False)  ' show user the list is being created...   

    Cursor = Starter.SQL1.ExecQuery(qry) ' get a subset of the list to load

    ' empty the existing xCLV (if any)

    ' set the underlying xCLV scroll view visibility to false - IMPORTANT - don't waste cycles painting the screen! = 
    False  ' prevent list update (visibility) from consuming extra time in loop processes

    Do While Cursor.NextRow
    ' Load many different layouts (possibly)
        ' Set attributes of the layout loaded
        ' call many other methods to set these attributes
        ' do whatever....

    ProgressDialogHide ' dismiss the spinning circle and carry on...

    ' set the underlying xCLV scroll view visibility to True  - also IMPORTANT = True
    Seems that even thou the list being loaded is not within the current screen view, it is still consuming clock cycles - effectively slowing down loading the list.

    Hey, I could be wrong, I was once before - once...
    Last edited: Feb 24, 2019
    Jorge M A, prajinpraveen and jimmyF like this.
  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