Sub Process_Globals
'These global variables will be declared once when the application starts.
'These variables can be accessed from all modules.
Private xui As XUI
End Sub
Sub Globals
Private ime1 As IME
Private WebView1 As WebView
Private ActivityParent As JavaObject
End Sub
Sub Activity_Create(FirstTime As Boolean)
WebView1.Initialize("WebView1")
Activity.AddView(WebView1, 0, 0, 100%x, 100%y)
ime1.Initialize("ime1")
ime1.AddHeightChangedEvent
WebView1.LoadUrl("https://www.animesaturn.in/")
Dim jo As JavaObject = Activity
jo.RunMethodJO("getContext", Null).RunMethodJO("getWindow", Null).RunMethod("setSoftInputMode", _
Array As Object(0x20))
ActivityParent = jo.RunMethodJO("getParent", Null)
End Sub
Sub IME1_HeightChanged (NewHeight As Int, OldHeight As Int)
CallSubDelayed(Me, "AfterChange")
End Sub
Sub AfterChange
Dim ajo As Panel = Activity
Dim width As Int = ActivityParent.RunMethod("getMeasuredWidth", Null)
Dim height As Int = ActivityParent.RunMethod("getMeasuredHeight", Null)
If width = 0 Or height = 0 Then Return
ajo.Width = width 'update the "activity" width and height
ajo.Height = height
WebView1.Width = width
WebView1.Height = height
End Sub
Sub Activity_Resume
AfterChange
End Sub