Sub Process_Globals
End Sub
Sub Globals
Private wvMini As WebView
Private wvFullScreen As WebView
Private pnlFullScreen As Panel
End Sub
Sub Activity_Create(FirstTime As Boolean)
Activity.LoadLayout("Main")
wvMini.Initialize("wvMini")
Activity.AddView(wvMini, 10dip, 10dip, 300dip, 50dip)
pnlFullScreen.Initialize("")
pnlFullScreen.Color = Colors.ARGB(200, 0, 0, 0)
Activity.AddView(pnlFullScreen, 0, 0, 100%x, 100%y)
wvFullScreen.Initialize("wvFullScreen")
pnlFullScreen.AddView(wvFullScreen, 0, 0, 100%x, 100%y)
pnlFullScreen.Visible = False
Dim html As String = "<html><body><marquee behavior='scroll' direction='left'>" & _
"<a href=
"<a href=
"<a href='https://www.example.com/news3'>News 3</a>" & _
"</marquee></body></html>"
wvMini.LoadHtml(html)
End Sub
Sub wvMini_OverrideUrl (Url As String) As Boolean
Log("Intercepted URL: " & Url)
ShowFullScreenWebView(Url)
Return True
End Sub
Sub ShowFullScreenWebView(Url As String)
wvFullScreen.LoadUrl(Url)
pnlFullScreen.Visible = True
End Sub
Sub Activity_KeyPress (KeyCode As Int) As Boolean
If KeyCode = KeyCodes.KEYCODE_BACK Then
If pnlFullScreen.Visible Then
pnlFullScreen.Visible = False
Return True
End If
End If
Return False
End Sub