From b04dd042869f3f15380989af4cea258c5215517c Mon Sep 17 00:00:00 2001 From: "Felix C. Stegerman" Date: Tue, 26 Jan 2021 17:40:21 +0100 Subject: [PATCH] webview: put webview_includes in assets dir --- pythonforandroid/bootstraps/common/build/build.py | 3 ++- .../build/src/main/java/org/kivy/android/PythonActivity.java | 2 +- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/pythonforandroid/bootstraps/common/build/build.py b/pythonforandroid/bootstraps/common/build/build.py index 92e8db81d2..acda6a2b32 100644 --- a/pythonforandroid/bootstraps/common/build/build.py +++ b/pythonforandroid/bootstraps/common/build/build.py @@ -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(":") diff --git a/pythonforandroid/bootstraps/webview/build/src/main/java/org/kivy/android/PythonActivity.java b/pythonforandroid/bootstraps/webview/build/src/main/java/org/kivy/android/PythonActivity.java index eb7f1c219b..beb229c1cb 100644 --- a/pythonforandroid/bootstraps/webview/build/src/main/java/org/kivy/android/PythonActivity.java +++ b/pythonforandroid/bootstraps/webview/build/src/main/java/org/kivy/android/PythonActivity.java @@ -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() {