Android Question ASTABMENU animation on click optional ?

DroidLyon

Member
Licensed User
This refers to @AlexanderStoltes impressive ASTabmenu

I have now managed to successfully apply ASTabStrip & ASTabMenu to the b4xDrawer example of B4xPages :). (I've attached zip)

Unfortunately despite looking I can't find a way to turn off the animation when you click on the tab ("it's like a circular wave outwards") . It looks good but may be distracting on some apps and I'd like the option of switching it off if possible ?

Thanks
 

Attachments

  • B4xPages3AndDrawerASTabStrip3.zip
    203.8 KB · Views: 56

DonManfred

Expert
Licensed User
As the librarya is a b4xlib Library you can extract the source of the b4xlib file (it is a ZIP) and check where you need to change it.
 
Upvote 0

DroidLyon

Member
Licensed User
Thanks Manfred

Looking at ASTabMenu.Bas within b4xlib spotted CreateHaloEffect code and call within Tabclick event
B4X:
Private Sub TabClick(xpnl_base As B4XView,withEvent As Boolean,withHalo As Boolean)
    
    Dim tmp_tab As Tabs = xpnl_base.Tag
    CurrenIndex = tmp_tab.index
    If withHalo = True Then CreateHaloEffect(xpnl_base, xpnl_base.Width/2, xpnl_base.Height/2, g_TabClickColor)

Tweaked code, rezipped, moved to additional libraries, (and now trying to work out why it hasn't worked .... :rolleyes:!)

To be continued .... :)
 
Upvote 0

Alexander Stolte

Expert
Licensed User
The lib. is once again a typical case of, now I would have done everything differently and better.
This should be work:
B4X:
ASTabMenu_vertical.EnableSelectedTabTextColor = False
and if you set a tab index then set the 3. parameter to false.
B4X:
SetTab(,,False)
 
Upvote 0

DroidLyon

Member
Licensed User
Thanks Alexander.

Sorry I was away yesterday but yes that works :)

Incidentally my eventual solution the other day was to similarly mess with code by creating a new designer property in ASTabMenu 'HaloEffect' boolean and then in the SetTab sub replace the withhalo variable with the designer property 'HaloEffect' . Then zip into b4xlib etc

see attached

ASTabMenu changes:
'Halo effect
#DesignerProperty: Key: HaloEffect, DisplayName: Halo Effect, FieldType: Boolean, DefaultValue: True,  Description: If True will show Halo effect on tab click

Sub Class_Globals
    Private g_HaloEffect as Boolean

Private Sub ini_props(Props As Map)
g_HaloEffect = Props.Get("HaloEffect")


'sets the selected tab
Public Sub SetTab(index As Int,withClickEvent As Boolean,withHalo As Boolean)

  withhalo = g_HaloEffect

   TabClick(xpnl_tabbase.GetView(index),withClickEvent,withHalo)

End Sub
 

Attachments

  • ASTabMenu.bas
    39.9 KB · Views: 52
Upvote 0
Top