ub Process_Globals
End Sub
Sub Globals
Dim bar As StdActionBar
Private vp As StdViewPager
Private timer1 As Timer
Dim isNum As Boolean
Dim st As Int
End Sub
Sub Activity_Create(FirstTime As Boolean)
bar.Initialize("bar")
bar.AddTab("1")
bar.AddTab("2")
bar.AddTab("3")
bar.NavigationMode = bar.NAVIGATION_MODE_TABS
Dim height As Int = CalculateHeight(True, True)
vp.Initialize("vp",3, 100%x, height)
Activity.AddView(vp.AsView, 0, 0, 100%x, height)
timer1.Initialize("timer1",1000)
timer1.Enabled=True
isNum = True
End Sub
Sub bar_TabChanged(Index As Int, STab As StdTab)
st = Index
End Sub
Sub timer1_tick
bar.RemoveTabs
If isNum = True Then
bar.AddTab("ABC")
bar.AddTab("DEF")
bar.AddTab("GHJ")
Else
bar.AddTab("1")
bar.AddTab("2")
bar.AddTab("3")
End If
isNum = Not(isNum)
bar.SelectedIndex = st
End Sub
Sub CalculateHeight (TabsMode As Boolean, SplitEnabled As Boolean) As Int
If 100%x >= 480dip Then
Return 100%y
Else
Dim fix As Int
If TabsMode Then fix = 48dip
If SplitEnabled Then fix = fix + 48dip
Return 100%y - fix
End If
End Sub