[B4X] [XUI] AS TabStrip (ASViewPager + ASTabMenu)

shrs

New Member
ASTabStrip
Author: Alexander Stolte
Version: 1.00

  • ASTabStrip
    • Functions:
      • AddPage (tab_background_color As Int, tab_text As String, tab_icon As B4XBitmap, tab_tag As Object, pager_layout As B4XView, pager_value As Object) As String
      • Initialize (TabMenu As com.as.tabstrip.astabmenu, ViewPager As com.as.tabstrip.asviewpager) As String
        Initializes the object. You can add parameters to this method if needed.
      • IsInitialized As Boolean
        Tests whether the object has been initialized.
      • RemovePage (index As Int) As String
      • TabMenu_TabClick (index As Int) As String
      • ViewPager_PageChanged (index As Int) As String
Hi Alexander Stolte
One suggestion for improving the library is to have a method that specifies the number of pages in ASTabStrip like:
B4X:
AsTabStrip1.PageCount
A function is also required to delete all pages in the ASTabStrip like:
B4X:
AsTabStrip1.RemoveAllPages
It is also better to have a method to detect the index of the current page like:
B4X:
AsTabStrip1.TopPageIndex
 

Alexander Stolte

Expert
Licensed User
Longtime User
Can create AddPage with new pages (LoadLayout) ? Can give me example for that? thanks before
B4X:
Dim xpnl As B4XView = xui.CreatePanel("")
xpnl.SetLayoutAnimated(0,0,0,Root.Width,Root.Height)
xpnl.LoadLayout("YourLayout")
ASTabStrip1.AddPage(xui.Color_Black,"Test",Null,"",xpnl,"")
 

Alexander Stolte

Expert
Licensed User
Longtime User
Is it possible this tabstrip hold a tabmenuadvanced?
well the bilbiothek is so simple, it only switches the index in the TabMenu when you change the page in the ViewPager and vice versa. Best to open the .B4XLib and look inside, there is hardly any code.
 

Alexander Stolte

Expert
Licensed User
Longtime User
Can be added ASTabMenu and ASViewPager without designer?
No.
What's so bad about the designer? You guys are making way too much work for yourselves...
There are absolutely no advantages to adding views by code, in fact quite the opposite, there is only downside by doing so.
 
Top