@
sotik
Here's an updated TabHostExtras for you to try.
I've created a new TabHostExtras method:
GetTagWidget (TabHost1
As TabHost)
As TabWidget
Returns TabHost1's TabWidget.
Allowing you to customize various settings.
The reference for the android TabWidget can be found here:
http://developer.android.com/reference/android/widget/TabWidget.html
The TabWidget contains a TabIndicator for each 'content' Tab in the TabHost.
Each TabIndicator is an icon and a label.
This is the reference for my b4a TabWidget:
TabWidget
Methods:
- BringToFront
- GetChildTabViewAt (TabIndex As Int) As View
Returns the tab indicator view at the given index.
The returned View will be a ViewGroup with 2 child Views:
An ImageView at index 0 and a TextView at Index 1.
- GetTabIcon (TabIndex As Int) As ImageViewWrapper
Get the (icon) ImageView of the tab indicator view at the given index.
- GetTabLabel (TabIndex As Int) As LabelWrapper
Get the (TextView) Label of the tab indicator view at the given index.
- Initialize (arg1 As String)
- Invalidate
- Invalidate2 (arg0 As Rect)
- Invalidate3 (arg0 As Int, arg1 As Int, arg2 As Int, arg3 As Int)
- IsInitialized As Boolean
- RemoveView
- RequestFocus As Boolean
- SendToBack
- SetBackgroundImage (arg0 As Bitmap)
- SetLayout (arg0 As Int, arg1 As Int, arg2 As Int, arg3 As Int)
Properties:
- Background As Drawable
- Color As Int [write only]
- DividerDrawable As Drawable [write only]
Sets the drawable to use as a divider between the tab indicators.
- Enabled As Boolean
Get or Set the enabled state of the TabWidget.
- Height As Int
- Left As Int
- LeftStripDrawable As Drawable [write only]
Sets the drawable to use as the left part of the strip below the tab indicators.
- RightStripDrawable As Drawable [write only]
Sets the drawable to use as the right part of the strip below the tab indicators.
- StripEnabled As Boolean
Get or Set whether the bottom strips on the tab indicators are drawn or not.
- TabCount As Int [read only]
Get the number of tab indicator views.
- Tag As Object
- Top As Int
- Visible As Boolean
- Width As Int
So you can get the various components of the TabWidget and customise as desired - without me having to write endless getter and setter methods for each and every possibility!
That's the theory.
In practice there is one problem...
A TabWidget is meant to be created when the TabHost is created.
If you modify a TabWidget after the TabHost has been created - as this library does - then some modifications may not be reflected in the TabHost.
That is you might change a property but see no change on the device screen.
I see a possible fix for this in the android documentation if anyone experiences this problem i will try the fix.
So to answer your question - you'd get whichever TabIndicator Label you wish to customise and use the various b4a Label methods and properties to change it's appearance.
Can you post again and let me know how well this update works?
If it works as expected i'll make it into a 'proper' update and update post #1.
Thanks.
Martin.