WebView¶
Screenshot¶
Example¶
from enamlnative.android.app import AndroidApplication
from enamlnative.widgets.api import *
enamldef ContentView(ScrollView): web_view:
LinearLayout:
orientation = "vertical"
EditText: web_url:
text = "github.com/frmdstryr/enaml-native"
input_type = 'text_uri'
editor_actions = True
editor_action ::
#: When done editing, load the page
action = change['value']
if action['key']==5: # Why 5 now?
url = web_url.text.lower()
if not (url.startswith("http://") or url.startswith("https://")):
url = "https://"+url
web_view.url = url
ProgressBar:
visible << web_view.loading
progress << web_view.progress
TextView:
visible << web_view.error
text_color = '#FF0000'
text << u"Error: {} - {}".format(web_view.error_code, web_view.error_message)
WebView: web_view:
height = 'match_parent'
width = 'match_parent'
#: When url updates, set the text
url = "https://github.com/frmdstryr/enaml-native"
url >> web_url.text
title :: AndroidApplication.instance().show_toast(change['value'])
Declaration¶
- class enamlnative.widgets.web_view.WebView(parent=None, **kwargs)[source]¶
Bases:
enamlnative.widgets.view_group.ViewGroup
A layout that places its children in a rectangular grid.
- error¶
Page load error occurred
- error_code¶
Page error code
- error_message¶
Error message
- javascript_enabled¶
Enable javascript
- title¶
Read only title from the loaded page
- progress¶
Read only loading progress
- loading¶
State
- url¶
Loads the URL (if given)
- source¶
Loads the source (if given)
- reload¶
Reloads the current URL.
- go_back¶
Go back in history
- go_forward¶
Go forward in history
- zoom_in¶
Zoom in
- zoom_out¶
Zoom out
- proxy¶
A reference to the ProxyLabel object.
Android Implementation¶
- class enamlnative.android.android_web_view.AndroidWebView[source]¶
Bases:
enamlnative.android.android_view_group.AndroidViewGroup
,enamlnative.widgets.web_view.ProxyWebView
An Android implementation of an Enaml ProxyWebView.
- widget¶
A reference to the widget created by the proxy.
- client¶
A client for listening to web view events
No iOS implementation found.