Here's is another update to TabHostExtras.
Version 1.2
Added two new methods:
1)
getTabHeight(tabHost1 As TabHost) As Int
This simply returns the current height in pixels of tabHost1 tabs.
2)
setTabGradientDrawable(tabHost1 As TabHost, orientation As String, color1 As Int, color2 As Int, cornerRadius As Float)
This sets a GradientDrawable as the background of all tabs in tabHost1.
See the documentation for the B4A GradientDrawable:
Basic4android - Drawing (Core).
This library method accepts the same
Orientation options as the B4A GradientDrawable.
"TOP_BOTTOM" and "BL_TR" for example are both valid.
color1 and color2 can be passed to the method as B4A
Colors constants.
See the B4A Colors documentation:
Basic4android - Constants (Core).
cornerRadius must be of type Float and defines the corner radius of the GradientDrawable.
Pass zero if you do not require rounded corners.
I've updated the demo code to set a white/blue color GradientDrawable with a "TOP_BOTTOM" orientation and no cornerRadius.
Use of this new method will require that your GradientDrawable doesn't leave the TabIndicator text unreadable either when a tab is selected or not selected.
I suspect that the default TabIndicator text color is based upon the firmware/framework of the device that your app is installed on so watch that you don't create a GradientDrawable which leaves that text unreadable on some devices.
Version 1.2 is attached to my original post in this thread.
Martin.