Android Question TabStripViewPager hide tab page programmatically.

Discussion in 'Android Questions' started by vfafou, Apr 20, 2017.

  1. vfafou

    vfafou Active Member Licensed User

    I'm about to use TabStripViewPager for a new project that requires eventually hiding of a specific tab page.
    I didn't find how could I do that with JavaObject.
    If it is not implemented, I would like to have it because it's a perfect tab page lib.
    Thank you in advance!
    Livio F and desof like this.
  2. Erel

    Erel Administrator Staff Member Licensed User

    It requires TabStripViewPager v1.10. You can use this code to add or remove pages:
    Sub InsertPage (ts As TabStrip, Index As Int, Page As Panel, Title As String)
    Dim jo As JavaObject = ts
    "pages").RunMethod("add"Array(Index, Page))
    "titles").RunMethod("add"Array(Index, Title))
    End Sub

    'Return the removed page
    Sub RemovePage (ts As TabStrip, Index As Int) As Panel
    If ts.CurrentPage >= Index Then ts.ScrollTo(0False)
    Dim jo As JavaObject = ts
    Dim p As Panel = jo.GetFieldJO("pages").RunMethod("remove"Array(Index))
       RefreshTabStrip (ts)
    Return p
    End Sub

    Sub RefreshTabStrip(ts As TabStrip)
    Dim jo As JavaObject = ts
    End Sub
    vfafou and Mahares like this.
  3. vfafou

    vfafou Active Member Licensed User

    Thank you Erel!
    It seems that you've done the update of the lib just for me!!!
    You're very kind and you just take care of your ecosystem persons!
    Thank you, thank you, thank you!!!;););)
  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