Skip to content

Commit

Permalink
webview: put webview_includes in assets dir
Browse files Browse the repository at this point in the history
  • Loading branch information
obfusk committed Jan 26, 2021
1 parent fe5d722 commit b04dd04
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
3 changes: 2 additions & 1 deletion pythonforandroid/bootstraps/common/build/build.py
Original file line number Diff line number Diff line change
Expand Up @@ -309,7 +309,8 @@ def make_package(args):
if exists(python_bundle_dir):
tar_dirs.append(python_bundle_dir)
if get_bootstrap_name() == "webview":
tar_dirs.append('webview_includes')
for asset in listdir('webview_includes'):
shutil.copy(join('webview_includes', asset), join(assets_dir, asset))

for asset in args.assets:
asset_src, asset_dest = asset.split(":")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -159,7 +159,7 @@ public void onClick(DialogInterface dialog,int id) {
mWebView = new WebView(PythonActivity.mActivity);
mWebView.getSettings().setJavaScriptEnabled(true);
mWebView.getSettings().setDomStorageEnabled(true);
mWebView.loadUrl("file:///" + app_root_dir + "/_load.html");
mWebView.loadUrl("file:///android_asset/_load.html");

mWebView.setLayoutParams(new LayoutParams(LayoutParams.FILL_PARENT, LayoutParams.FILL_PARENT));
mWebView.setWebViewClient(new WebViewClient() {
Expand Down

0 comments on commit b04dd04

Please sign in to comment.