Save the height of root before the keyboard is visible and then just check if this height is still the same, if not then you know that the keyboard is open.
Private Sub B4XPage_KeyboardStateChanged (Height As Float)
'...'
Dim EnabledViews As Boolean = (Height = 0)
ASViewPager1.Scroll = EnabledViews
ASTabMenu1.ViewEnable(EnabledViews)
End Sub
But this line it doesn't work when EnabledViews is true:
B4X:
ASTabMenu1.ViewEnable(EnabledViews)
Maybe a problem in this line:
B4X:
Public Sub ViewEnable(enable As Boolean)
For i = 0 To xpnl_tabbase.NumberOfViews -1
#If B4I
Dim tmp_pnl As Panel = xpnl_tabbase.GetView(i)
'tmp_pnl.UserInteractionEnabled = False <-- this line
tmp_pnl.UserInteractionEnabled = enable
#Else
xpnl_tabbase.GetView(i).Enabled = enable
#End If
Next
End Sub