Skip to content

Commit

Permalink
Merge pull request #2412 from obfusk/webview-assets
Browse files Browse the repository at this point in the history
webview: put webview_includes in assets dir
  • Loading branch information
AndreMiras authored Apr 25, 2021
2 parents c148a75 + b04dd04 commit 8ab7c95
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 @@ -314,7 +314,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 @@ -160,7 +160,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 8ab7c95

Please sign in to comment.