Android Question TabStrip know empty index tab

Discussion in 'Android Questions' started by scsjc, Nov 4, 2018.

  1. scsjc

    scsjc Well-Known Member Licensed User

    I use this part of class "TabStripViewPagerExtendet" to instert and delete pages :

    Code:
    Public Sub InsertPage (tabstrip As TabStrip, Index As Int, Page As Panel, Title As String)
        
    Dim jo As JavaObject = tabstrip
        jo.GetFieldJO(
    "pages").RunMethod("add"Array(Index, Page))
        jo.GetFieldJO(
    "titles").RunMethod("add"Array(Index, Title))
        RefreshTabStrip(tabstrip)
    End Sub
    Public Sub RemovePage (tabstrip As TabStrip, Index As Int) As Panel
       
    If tabstrip.CurrentPage >= Index Then tabstrip.ScrollTo(0False)
       
    Dim jo As JavaObject = tabstrip
       
    Dim p As Panel = jo.GetFieldJO("pages").RunMethod("remove"Array(Index))
       jo.GetFieldJO(
    "titles").RunMethod("remove"Array(Index))
       RefreshTabStrip (tabstrip)
       
    Return p
    End Sub
    i use a map to know pages deletes and insert pages using a empty index.
    but is possible know a empty index positions ????
     
  2. Erel

    Erel Administrator Staff Member Licensed User

    I never worked with this class. Are you sure that the indices are not being updated automatically after you remove a tab?
     
  3. scsjc

    scsjc Well-Known Member Licensed User

    Yes, im try it

    1 -when you delete a tab, the index is empty...
    2 -can add a new pages to end without errors... ( i pickup the size tab geting a list.size from a "GetAllTabLabels(tabstrip)")
    or can "RE-USE" old index to add (i tryit with a MAP, and respect the old position)
     
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