Sub Class_Globals
Private Root As B4XView
Private xui As XUI
Private Button1 As Button
Private mainwidth As Double
Private mainheight As Double
End Sub
Public Sub Initialize
B4XPages.GetManager.LogEvents = True
End Sub
Private Sub B4XPage_Created (Root1 As B4XView)
Root = Root1
Root.LoadLayout("MainPage")
mainwidth = Root.Width
mainheight = Root.Height
End Sub
Private Sub B4XPage_Resize (Width As Int, Height As Int)
If Width < (mainwidth - (mainwidth / 4)) Or Height < (mainheight - (mainheight / 4)) Then
Button1.Visible = False
Else
Button1.Visible = True
End If
End Sub
Private Sub Button1_Click
xui.MsgboxAsync("Hello world!", "B4X")
End Sub