A container view controller that manages a multiselection interface, where the selection determines which child view controller to display.
This view was developed and structured from scratch
i spend a lot of time in creating views, some views i need by my self, but some views not and to create a high quality view cost a lot of time. If you want to support me, then you can do it
here by Paypal or with a
coffee .
View attachment 129807
Examples:
AS_TabMenuAdvanced1.GetTab(2).xTab.BadgeValue = 5 'Sets the Badge Value for the 3. Tab to 5
AS_TabMenuAdvanced1.GetTab(3).xTab.Enabled = False 'Disabled the 4. Tab
AS_TabMenuAdvanced1.Refresh 'Commits the changes
Example Projects
This is a example how to use the AS_TabMenuAdvanced together with the ASPopupMenu. For this example you need the 2 libs. https://www.b4x.com/android/forum/threads/as-tabmenuadvanced.140907/ https://www.b4x.com/android/forum/threads/b4x-xui-as-popup-menu-on-any-view-beta.121832/
www.b4x.com
This is a example how to use the AS_TabMenuAdvanced together with the ASPopupMenuAdvanced. For this example you need the 2 libs. https://www.b4x.com/android/forum/threads/as-tabmenuadvanced.140907/...
www.b4x.com
https://www.b4x.com/android/forum/threads/b4x-xui-as-tabmenuadvanced.140907/
www.b4x.com
ASTabMenuAdvanced
Author: Alexander Stolte
Version: 1.02
ASTabMenuAdvanced_BadgeProperties
Fields:
BackgroundColor As Int
Height As Float
IsInitialized As Boolean
Tests whether the object has been initialized.
TextColor As Int
TextFont As B4XFont
TextPadding As Float
Functions:
Initialize
Initializes the fields to their default value.
ASTabMenuAdvanced_Tab
Fields:
BadgeValue As Int
Enabled As Boolean
IconDisabled As B4XBitmap
IconSelected As B4XBitmap
IconUnselected As B4XBitmap
IsInitialized As Boolean
Tests whether the object has been initialized.
Tag As Object
Text As String
Functions:
Initialize
Initializes the fields to their default value.
ASTabMenuAdvanced_TabIntern
Fields:
IsInitialized As Boolean
Tests whether the object has been initialized.
xBadgeProperties As ASTabMenuAdvanced_BadgeProperties
xTab As ASTabMenuAdvanced_Tab
xTabProperties As ASTabMenuAdvanced_TabProperties
xTabViews As ASTabMenuAdvanced_TabViews
Functions:
Initialize
Initializes the fields to their default value.
ASTabMenuAdvanced_TabProperties
Fields:
BackgroundColor As Int
DisabledColor As Int
IsInitialized As Boolean
Tests whether the object has been initialized.
SelectedColor As Int
TextFont As B4XFont
TextIconPadding As Float
UnselectedColor As Int
Functions:
Initialize
Initializes the fields to their default value.
ASTabMenuAdvanced_TabViews
Fields:
IsInitialized As Boolean
Tests whether the object has been initialized.
xiv_TabIcon As B4XView
xlbl_Badge As B4XView
xlbl_TabText As B4XView
xpnl_TabBackground As B4XView
Functions:
Initialize
Initializes the fields to their default value.
AS_TabMenuAdvanced
Events:
Fields:
mBase As B4XView
Tag As Object
Functions:
AddTab (Text As String , IconSelected As B4XBitmap , IconUnselected As B4XBitmap ) As String
Text - Pass "" if you dont want Text
IconSelected - Pass NULL if you dont want a Icon
IconUnselected - Pass NULL if you dont want a Icon
If you want to change TabProperties then call this before you add the tab
<code>AS_TabMenuAdvanced1.TabProperties.TextColor = xui.Color_White</code>
AddTabAdvanced (xTab As ASTabMenuAdvanced_Tab , xTabProperties As ASTabMenuAdvanced_TabProperties ) As String
Example:
<code>
Dim xTab As ASTabMenuAdvanced_Tab = AS_TabMenuAdvanced1.CreateASTabMenuAdvanced_Tab("Test Item",Null,Null)
Dim xTabProperties As ASTabMenuAdvanced_TabProperties = AS_TabMenuAdvanced1.CreateASTabMenuAdvanced_TabProperties(xui.CreateDefaultFont(15),xui.Color_ARGB(255,32, 33, 37),xui.Color_ARGB(255,45, 136, 121),xui.Color_ARGB(255,255,255,255),xui.Color_ARGB(255,60, 64, 67),0)
AS_TabMenuAdvanced1.AddTabAdvanced(xTab,xTabProperties)</code>
ChangeColorBasedOnAlphaLevel (bmp As B4XBitmap , NewColor As Int ) As B4XBitmap
Class_Globals As String
CreateASTabMenuAdvanced_BadgeProperties (TextColor As Int , TextFont As B4XFont , Height As Float , TextPadding As Float , BackgroundColor As Int ) As ASTabMenuAdvanced_BadgeProperties
CreateASTabMenuAdvanced_Tab (Text As String , IconSelected As B4XBitmap , IconUnselected As B4XBitmap ) As ASTabMenuAdvanced_Tab
CreateASTabMenuAdvanced_TabIntern (xTab As ASTabMenuAdvanced_Tab , xTabProperties As ASTabMenuAdvanced_TabProperties , xBadgeProperties As ASTabMenuAdvanced_BadgeProperties , xTabViews As ASTabMenuAdvanced_TabViews ) As ASTabMenuAdvanced_TabIntern
CreateASTabMenuAdvanced_TabProperties (TextFont As B4XFont , BackgroundColor As Int , SelectedColor As Int , UnselectedColor As Int , DisabledColor As Int , TextIconPadding As Float ) As ASTabMenuAdvanced_TabProperties
CreateASTabMenuAdvanced_TabViews (xpnl_Tab As B4XView , xlbl_TabText As B4XView , xiv_TabIcon As B4XView , xlbl_Badge As B4XView ) As ASTabMenuAdvanced_TabViews
CreateImageView (EventName As String ) As B4XView
CreateLabel (EventName As String ) As B4XView
DesignerCreateView (Base As Object , Lbl As Label , Props As Map ) As String
Base type must be Object
FontToBitmap (text As String , IsMaterialIcons As Boolean , FontSize As Float , color As Int ) As B4XBitmap
Unlike an older "TextToBitmap" sub that you can find in the forum, this code vertically centers the icon. It can also be used in B4J and B4i (only need to change the font line). Sub Activity_Create(FirstTime As Boolean) 'usage example Activity.AddMenuItem3("Android", "Test"...
www.b4x.com
getIndex As Int
GetTab (Index As Int ) As ASTabMenuAdvanced_TabIntern
Example:
<code>
AS_TabMenuAdvanced1.GetTab(0).xTabProperties.SelectedColor = xui.Color_Magenta
AS_TabMenuAdvanced1.Refresh</code>
getTabProperties As ASTabMenuAdvanced_TabProperties
GetTabs As List
Example:
<code>
For Each TabIntern As ASTabMenuAdvanced_TabIntern In AS_TabMenuAdvanced1.GetTabs
Log(TabIntern.xTab.Text)
Next</code>
Initialize (Callback As Object , EventName As String ) As String
IsInitialized As Boolean
Tests whether the object has been initialized.
Refresh As String
RemoveTabAt (Index As Int ) As String
Removes a tab
<code>
AS_TabMenuAdvanced1.RemoveTabAt(2)
AS_TabMenuAdvanced1.Refresh</code>
setIndex (Index As Int ) As String
Properties:
Index As Int
TabProperties As ASTabMenuAdvanced_TabProperties [read only]
Changelog
1.00
1.01
xBadge renamed to xBadgeProperties
1.02
Add GetTabs - Gets a list of tab properties of type ASTabMenuAdvanced_TabIntern
Add RemoveTabAt - Removes a tab
Add Tag Property to Type ASTabMenuAdvanced_Tab
Add new Type ASTabMenuAdvanced_TabViews - contains the control elements of a tab
1.03
Add LeftPadding to ASTabMenuAdvanced_BadgeProperties - You can move the badge to left or right with this property
Add get BadgeProperties - here you can set the global Badge Properties
1.04
The TabClick Event is now always triggered, even if the tab is already selected
The BadgeValue Data Type from Type ASTabMenuAdvanced_Tab is now String
1.05
Add get and set CornerRadius
Add new Type ASTabMenuAdvanced_IndicatorProperties
Add Designer Property Indicator - If True the Indicator is visible
BugFixes
Have Fun