Press on the image to return to the main documentation page.
WebViewXtended
Written by Ren\u00e9 Thalmann
List of types:
WebViewXtender
WebViewXtender
Events:
None
Members:
canZoomIn
(
webView1
As
android
.
webkit
.
WebView
)
As
Boolean
canZoomOut
(
webView1
As
android
.
webkit
.
WebView
)
As
Boolean
clearCache
(
webView1
As
android
.
webkit
.
WebView
,
flag
As
Boolean
)
clearFocus
(
vGivenView
As
android
.
view
.
View
)
getAcceptCookie
(
webView1
As
android
.
webkit
.
WebView
)
As
Boolean
getFaviconFromUrl
(
siteUrl
As
String
,
bmpDefault
As
android
.
graphics
.
Bitmap
)
As
android
.
graphics
.
Bitmap
getFaviconFromUrl2
(
siteUrl
As
String
)
As
android
.
graphics
.
Bitmap
getHost
(
siteUrl
As
String
)
As
String
getJavaScriptEnabled
(
webView1
As
android
.
webkit
.
WebView
)
As
Boolean
getLoadsImagesAutomatically
(
webView1
As
android
.
webkit
.
WebView
)
As
Boolean
getOriginalUrl
(
webView1
As
android
.
webkit
.
WebView
)
As
String
getPluginState
(
webView1
As
android
.
webkit
.
WebView
)
As
String
getProgress
(
webView1
As
android
.
webkit
.
WebView
)
As
Int
getScale
(
webView1
As
android
.
webkit
.
WebView
)
As
Float
getScrollX
(
webView1
As
android
.
webkit
.
WebView
)
As
Int
getScrollY
(
webView1
As
android
.
webkit
.
WebView
)
As
Int
getTitle
(
webView1
As
android
.
webkit
.
WebView
)
As
String
isHorizontalScrollBarEnabled
(
webView1
As
android
.
webkit
.
WebView
)
As
Boolean
isVerticalScrollBarEnabled
(
webView1
As
android
.
webkit
.
WebView
)
As
Boolean
pageDown
(
webView1
As
android
.
webkit
.
WebView
,
flag
As
Boolean
)
pageUp
(
webView1
As
android
.
webkit
.
WebView
,
flag
As
Boolean
)
resumeTimers
(
webView1
As
android
.
webkit
.
WebView
)
scrollBy
(
webView1
As
android
.
webkit
.
WebView
,
x
As
Int
,
y
As
Int
)
scrollTo
(
webView1
As
android
.
webkit
.
WebView
,
x
As
Int
,
y
As
Int
)
setAcceptCookie
(
webView1
As
android
.
webkit
.
WebView
,
flag
As
Boolean
)
setHorizontalScrollBarEnabled
(
webView1
As
android
.
webkit
.
WebView
,
flag
As
Boolean
)
setInitialScale
(
webView1
As
android
.
webkit
.
WebView
,
scaleInPercent
As
Int
)
setJavaScriptEnabled
(
webView1
As
android
.
webkit
.
WebView
,
flag
As
Boolean
)
setLoadsImagesAutomatically
(
webView1
As
android
.
webkit
.
WebView
,
flag
As
Boolean
)
setPluginState
(
webView1
As
android
.
webkit
.
WebView
,
state
As
String
)
setScrollBarStyle
(
webView1
As
android
.
webkit
.
WebView
,
style
As
Int
)
setVerticalScrollBarEnabled
(
webView1
As
android
.
webkit
.
WebView
,
flag
As
Boolean
)
zoomIn
(
webView1
As
android
.
webkit
.
WebView
)
As
Boolean
zoomOut
(
webView1
As
android
.
webkit
.
WebView
)
As
Boolean
Members description:
canZoomIn
(
webView1
As
android
.
webkit
.
WebView
)
As
Boolean
Returns TRUE if the WebView can be zoomed in
Example:
Dim
wvXtender
As
WebViewXtender
Dim
bolZoomIn
as
Boolean
bolZoomIn
=
wvXtender
.
canZoomIn
(
webView1
)
canZoomOut
(
webView1
As
android
.
webkit
.
WebView
)
As
Boolean
Returns TRUE if the WebView can be zoomed out
Example:
Dim
wvXtender
As
WebViewXtender
Dim
bolZoomIn
as
Boolean
bolZoomIn
=
wvXtender
.
canZoomOut
(
webView1
)
clearCache
(
webView1
As
android
.
webkit
.
WebView
,
flag
As
Boolean
)
Clears the cache. Boolean include disk files.
Example:
Dim
wvXtender
As
WebViewXtender
wvXtender
.
clearCache
(
webView1
,
TRUE
)
clearFocus
(
vGivenView
As
android
.
view
.
View
)
Removes the focus of an given view (EditText, Button...)
Example:
Dim
wvXtender
As
WebViewXtender
wvXtender
.
clearFocus
(
WebView1
)
getAcceptCookie
(
webView1
As
android
.
webkit
.
WebView
)
As
Boolean
Get the state of Cookies beeing accepted or not. Returns TRUE if Cookies are accept or FALSE if not.
Example:
Dim
wvXtender
As
WebViewXtender
Dim
bolCK
as
Boolean
bolCK
=
wvXtender
.
getAcceptCookie
(
webView1
)
getFaviconFromUrl
(
siteUrl
As
String
,
bmpDefault
As
android
.
graphics
.
Bitmap
)
As
android
.
graphics
.
Bitmap
Get the favicon...if available and returns a bitmap, else return default bitmap
Example:
Dim
wvXtender
As
WebViewXtender
Dim
bmpFI
As
Bitmap
Dim
strURL
as
String
strURL
=
"http://www.blick.ch"
bmpDefault
.
Initialize
(
File
.
DirAssets
,
"defaultfavicon.png"
)
bmpFI
.
Initialize3
(
wvXtender
.
getFaviconFromUrl
(
strURL
,
bmpDefault
))
OR
after
page
loading
is
finished
:
Sub
webView1_PageFinished
(
Url
As
String
)
bmpFI
.
Initialize3
(
wvXtender
.
getFaviconFromUrl
(
Url
,
bmpDefault
))
Imageview1
.
Bitmap
=
bmpFI
End
Sub
getFaviconFromUrl2
(
siteUrl
As
String
)
As
android
.
graphics
.
Bitmap
Get the favicon of current page...if available and returns a bitmap, else return default bitmap
Example:
Dim
wvXtender
As
WebViewXtender
Dim
bmpFI
As
Bitmap
Dim
strURL
as
String
strURL
=
"http://www.blick.ch"
bmpFI
.
Initialize3
(
wvXtender
.
getFaviconFromUrl
(
strURL
))
OR
after
page
loading
is
finished
:
Sub
webView1_PageFinished
(
Url
As
String
)
bmpFI
.
Initialize3
(
wvXtender
.
getFaviconFromUrl2
(
Url
))
Imageview1
.
Bitmap
=
bmpFI
End
If
End
Sub
getHost
(
siteUrl
As
String
)
As
String
Get the host name of the current page.
Example:
Dim
wvXtender
As
WebViewXtender
Dim
strCurrHost
as
String
Dim
strURL
as
String
strURL
=
"http://www.blick.ch"
strCurrHost
=
wvXtender
.
getHost
(
strURL
)
getJavaScriptEnabled
(
webView1
As
android
.
webkit
.
WebView
)
As
Boolean
Get the state if JavaScript is enabled in the WebView. Returns TRUE if so.
Example:
Dim
wvXtender
As
WebViewXtender
Dim
bolJS
As
Boolean
bolJS
=
wvXtender
.
getJavaScriptEnabled
(
webView1
)
getLoadsImagesAutomatically
(
webView1
As
android
.
webkit
.
WebView
)
As
Boolean
Get the state if images are loaded automatically. Returns TRUE if so.
Example:
Dim
wvXtender
As
WebViewXtender
Dim
bolLoadAuto
As
Boolean
bolLoadAuto
=
wvXtender
.
getLoadsImagesAutomatically
(
webView1
)
getOriginalUrl
(
webView1
As
android
.
webkit
.
WebView
)
As
String
Get the original url for the current page. This is not always the same as the url passed to WebViewClient.onPageStarted because
although the load for that url has begun, the current page may not have changed. Also, there may have been redirects resulting in
a different url to that originally requested.
Example:
Dim
wvXtender
As
WebViewXtender
Dim
strOrigURL
as
String
strOrigURL
=
wvXtender
.
getOriginalUrl
(
webView1
)
getPluginState
(
webView1
As
android
.
webkit
.
WebView
)
As
String
Get the state of the PlugIns. Returns a string with the actual state: OFF, ON or ON_DEMAND.
Example:
Dim
wvXtender
As
WebViewXtender
Dim
strPS
As
String
strPS
=
wvXtender
.
getPluginState
(
webView1
)
getProgress
(
webView1
As
android
.
webkit
.
WebView
)
As
Int
Get the progress for the current page between 0 and 100. May use it with a timer.
Example:
Dim
wvXtender
As
WebViewXtender
Dim
intProgr
as
Int
wvXtender
.
getProgress
(
webView1
)
getScale
(
webView1
As
android
.
webkit
.
WebView
)
As
Float
Returns the current scale of the WebView.
Example:
Dim
wvXtender
As
WebViewXtender
Dim
flScale
as
Float
flScale
=
wvXtender
.
getScale
(
webView1
)
getScrollX
(
webView1
As
android
.
webkit
.
WebView
)
As
Int
Return the scrolled left position of this view. This is the left edge of the displayed part of your view.
You do not need to draw any pixels farther left, since those are outside of the frame of your view on screen
Example:
Dim
wvXtender
As
WebViewXtender
Dim
intLeftEdge
as
int
intLeftEdge
=
wvXtender
.
getScrollX
(
webView1
)
getScrollY
(
webView1
As
android
.
webkit
.
WebView
)
As
Int
Return the scrolled top position of this view. This is the top edge of the displayed part of your view. You do not need
to draw any pixels above it, since those are outside of the frame of your view on screen.
Example:
Dim
wvXtender
As
WebViewXtender
Dim
intTopEdge
as
int
intTopEdge
=
wvXtender
.
getScrollY
(
webView1
)
getTitle
(
webView1
As
android
.
webkit
.
WebView
)
As
String
Get the title for the current page. This is the title of the current page.
Example:
Dim
wvXtender
As
WebViewXtender
Dim
strCurrTitle
as
String
strCurrTitle
=
wvXtender
.
getTitle
(
webView1
)
isHorizontalScrollBarEnabled
(
webView1
As
android
.
webkit
.
WebView
)
As
Boolean
Indicate whether the horizontal scrollbar should be drawn or not. The scrollbar is not drawn by default.
Returns true if the horizontal scrollbar should be painted, false otherwise
Example:
Dim
wvXtender
As
WebViewXtender
Dim
bolEnabled
as
Boolean
bolEnabled
=
wvXtender
.
isHorizontalScrollBarEnabled
(
webView1
)
isVerticalScrollBarEnabled
(
webView1
As
android
.
webkit
.
WebView
)
As
Boolean
Indicate whether the vertical scrollbar should be drawn or not. The scrollbar is not drawn by default.
Returns true if the vertical scrollbar should be painted, false otherwise
Example:
Dim
wvXtender
As
WebViewXtender
Dim
bolEnabled
as
Boolean
bolEnabled
=
wvXtender
.
isVerticalScrollBarEnabled
(
webView1
)
pageDown
(
webView1
As
android
.
webkit
.
WebView
,
flag
As
Boolean
)
Scroll the contents of the view down by half the page size. Boolean TRUE = scrolls to the bottom.
Example:
Dim
wvXtender
As
WebViewXtender
wvXtender
.
pageDown
(
webView1
,
true
)
pageUp
(
webView1
As
android
.
webkit
.
WebView
,
flag
As
Boolean
)
Scroll the contents of the view up by half the view size. Boolean TRUE = scrolls to the top.
Example:
Dim
wvXtender
As
WebViewXtender
wvXtender
.
pageUp
(
webView1
,
false
)
resumeTimers
(
webView1
As
android
.
webkit
.
WebView
)
Resume all layout, parsing, and JavaScript timers for all webviews. This will resume dispatching all timers.
Example:
Dim
wvXtender
As
WebViewXtender
wvXtender
.
resumeTimers
(
webView1
)
scrollBy
(
webView1
As
android
.
webkit
.
WebView
,
x
As
Int
,
y
As
Int
)
Move the scrolled position of your view in given x and y positions as int values.
Example:
Dim
wvXtender
As
WebViewXtender
wvXtender
.
scrollBy
(
webView1
,
20
,
50
)
scrollTo
(
webView1
As
android
.
webkit
.
WebView
,
x
As
Int
,
y
As
Int
)
Set the scrolled position of your view in given x and y positions as int values.
Example:
Dim
wvXtender
As
WebViewXtender
wvXtender
.
scrollTo
(
webView1
,
20
,
50
)
setAcceptCookie
(
webView1
As
android
.
webkit
.
WebView
,
flag
As
Boolean
)
Set the state of Cookies beeing accepted or not. Use TRUE if you want accept Cookies in the WebView or FALSE if not.
Example:
Dim
wvXtender
As
WebViewXtender
wvXtender
.
setAcceptCookie
(
webView1
,
false
)
setHorizontalScrollBarEnabled
(
webView1
As
android
.
webkit
.
WebView
,
flag
As
Boolean
)
Define whether the horizontal scrollbar should be drawn or not. The scrollbar is not drawn by default.
Example:
Dim
wvXtender
As
WebViewXtender
Dim
bolEnabled
as
Boolean
bolEanbled
=
True
wvXtender
.
setHorizontalScrollBarEnabled
(
webView1
,
bolEanbled
)
setInitialScale
(
webView1
As
android
.
webkit
.
WebView
,
scaleInPercent
As
Int
)
Set the initial scale in percent for the WebView. 0 means default. If initial scale is greater than 0, WebView starts with this value as
initial scale. Please note that unlike the scale properties in the viewport meta tag, this method doesn't take the screen density
into account.
Example:
Dim
wvXtender
As
WebViewXtender
wvXtender
.
setInitialScale
(
webView1
,
10
)
setJavaScriptEnabled
(
webView1
As
android
.
webkit
.
WebView
,
flag
As
Boolean
)
Enables or disables JavaScript in the WebView. Use FALSE if you do not want to enable JavaScript or TRUE to enable.
Example:
Dim
wvXtender
As
WebViewXtender
wvXtender
.
setJavaScriptEnabled
(
webView1
,
false
)
setLoadsImagesAutomatically
(
webView1
As
android
.
webkit
.
WebView
,
flag
As
Boolean
)
Set the state if images are loaded automatically. Use FALSE if you do not want to load images in the WebView.
Example:
Dim
wvXtender
As
WebViewXtender
wvXtender
.
setLoadsImagesAutomatically
(
webView1
,
false
)
setPluginState
(
webView1
As
android
.
webkit
.
WebView
,
state
As
String
)
Set the state of PlugIns. Use a string with ON, OFF or ON_DEMAND, depending what you like to have in the WebView.
Example:
Dim
wvXtender
As
WebViewXtender
Dim
strPS
As
String
strPS
=
"OFF"
wvXtender
.
setPluginState
(
webView1
,
strPS
)
You
can
also
write
direct
the
value
without
a
string
variable
:
wvXtender
.
setPluginState
(
webView1
,
"ON_DEMAND"
)
setScrollBarStyle
(
webView1
As
android
.
webkit
.
WebView
,
style
As
Int
)
Specify the style of the scrollbars. The scrollbars can be overlaid or inset. When inset, they add to the padding of the view.
And the scrollbars can be drawn inside the padding area or on the edge of the view. For example, if a view has a background
drawable and you want to draw the scrollbars inside the padding specified by the drawable, you can use SCROLLBARS_INSIDE_OVERLAY
or SCROLLBARS_INSIDE_INSET. If you want them to appear at the edge of the view, ignoring the padding, then you can use
SCROLLBARS_OUTSIDE_OVERLAY or SCROLLBARS_OUTSIDE_INSET.
Allowed int values for style are:
0 = SCROLLBARS_INSIDE_OVERLAY
16777216 = SCROLLBARS_INSIDE_INSET
33554432 = SCROLLBARS_OUTSIDE_OVERLAY
50331648 = SCROLLBARS_OUTSIDE_INSET
Example:
Dim
wvXtender
As
WebViewXtender
Dim
intStyle
as
Int
intStyle
=
16777216
'(iE for SCROLLBARS_INSIDE_INSET)
wvXtender
.
setScrollBarStyle
(
webView1
,
intStyle
)
setVerticalScrollBarEnabled
(
webView1
As
android
.
webkit
.
WebView
,
flag
As
Boolean
)
Define whether the vertical scrollbar should be drawn or not. The scrollbar is not drawn by default.
Example:
Dim
wvXtender
As
WebViewXtender
Dim
bolEnabled
as
Boolean
bolEanbled
=
True
wvXtender
.
setVerticalScrollBarEnabled
(
webView1
,
bolEanbled
)
zoomIn
(
webView1
As
android
.
webkit
.
WebView
)
As
Boolean
Perform zoom in in the webview. Return TRUE if zoom in succeeds. FALSE if no zoom changes.
Example:
Dim
wvXtender
As
WebViewXtender
dim
bolZoomIn
as
Boolean
bolZoomIn
=
wvXtender
.
zoomIn
(
webView1
)
zoomOut
(
webView1
As
android
.
webkit
.
WebView
)
As
Boolean
Perform zoom out in the webview. Return TRUE if zoom out succeeds. FALSE if no zoom changes.
Example:
Dim
wvXtender
As
WebViewXtender
dim
bolZoomOut
as
Boolean
bolZoomOut
=
wvXtender
.
zoomOut
(
webView1
)
Top