--
You received this message because you are subscribed to the Google Groups "Blockly" group.
To unsubscribe from this group and stop receiving emails from it, send an email to blockly+u...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/blockly/a51b4bcd-f63f-455a-b4a5-fe6c674c5f62n%40googlegroups.com.
override fun onCreateView(
inflater: LayoutInflater, container: ViewGroup?,
savedInstanceState: Bundle?
): View? {
_binding = ExecuteFragmentBinding.inflate(inflater, container, false)
WebView.setWebContentsDebuggingEnabled(true)
mWebView = binding.webView
mWebView.webChromeClient = WebChromeClient()
val webSettings = mWebView.settings
webSettings.javaScriptEnabled = true
mWebView.loadUrl("file:///android_asset/blockly/webviewPlay.html")
viewModel.workspaceDom.observe(
viewLifecycleOwner,
Observer { newDom ->
createWorkspaceFromDom((newDom))
})
<!DOCTYPE html>
<!-- HTML file to host Blockly in a mobile WebView. -->
<html>
<head>
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
<style type="text/css">
html,
body,
#blocklyDiv {
border: 0;
height: 100%;
margin: 0;
padding: 0;
width: 100%;
}
</style>
<script src="blockly_compressed.js"></script>
<script src="kidlang_compressed.js"></script>
<script src="blocks_compressed.js"></script>
<!-- TODO: Select msg file based on locale. -->
<script src="msg/js/en.js"></script>
<script src="toolbox_standard.js"></script>
</head>
<body>
<div id="blocklyDiv"></div>
<script src="workspace_play.js"></script>
</body>
</html>
//Initializing toolbox...
var toolbox = document.getElementById("toolbox");
//... and options for workspace
var options = {
trashcan: false,
toolbox: toolbox,
collapse: true,
comments: true,
disable: true,
maxBlocks: Infinity,
maxInstances: {
'flow_def_proc_a': 1,
'flow_def_proc_b': 1,
'flow_def_proc_c': 1
},
trashcan: true,
horizontalLayout: false,
toolboxPosition: 'start',
css: true,
media: './media/',
rtl: false,
readOnly: true,
move:{
scrollbars: {
horizontal: true,
vertical: false},
drag: true,
wheel: false},
sounds: true,
oneBasedIndex: true
};
//Inject workspace
var workspacePlayground = Blockly.inject('blocklyDiv', options);
function textToWorkspace(text){
var xml = Blockly.Xml.textToDom(text);
Blockly.Xml.domToWorkspace(xml, workspacePlayground);
}
You received this message because you are subscribed to a topic in the Google Groups "Blockly" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/blockly/vPhS8svw7MY/unsubscribe.
To unsubscribe from this group and all its topics, send an email to blockly+u...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/blockly/CAPrP5Rpp-BLWi4EpvXr0jLFhkfvOaHnzb_3DGoW3y2u9rRVBJA%40mail.gmail.com.
tools:viewBindingIgnore="trueTo view this discussion on the web visit https://groups.google.com/d/msgid/blockly/CACtr8%2BNZ7LanpkLPxjvwB7eETCnnQ0bjQ5wjEyAZ0YhzJ0OTfw%40mail.gmail.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/blockly/CACtr8%2BNZ7LanpkLPxjvwB7eETCnnQ0bjQ5wjEyAZ0YhzJ0OTfw%40mail.gmail.com.

To view this discussion on the web visit https://groups.google.com/d/msgid/blockly/49db0ab5-786b-48b6-9f73-cef2215c950fn%40googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/blockly/49db0ab5-786b-48b6-9f73-cef2215c950fn%40googlegroups.com.