From b23c8a4835286ae2bae0cde07bfd0e8519d1a568 Mon Sep 17 00:00:00 2001
From: Jakey <6077782@qq.com>
Date: Fri, 3 Jan 2020 20:23:25 +0800
Subject: [PATCH] fix android
---
.../.idea/codeStyles/Project.xml | 116 ++++++++++++++++++
Android-WebView-JavaScript/.idea/gradle.xml | 4 +
Android-WebView-JavaScript/.idea/misc.xml | 34 ++---
Android-WebView-JavaScript/.idea/vcs.xml | 6 +
Android-WebView-JavaScript/app/build.gradle | 6 +-
.../app/src/main/assets/JSWebView.html | 9 +-
.../MainActivity.java | 2 +-
Android-WebView-JavaScript/build.gradle | 4 +-
.../gradle/wrapper/gradle-wrapper.properties | 4 +-
.../WKWebView/JSWKWebView.html | 2 +-
10 files changed, 158 insertions(+), 29 deletions(-)
create mode 100644 Android-WebView-JavaScript/.idea/codeStyles/Project.xml
create mode 100644 Android-WebView-JavaScript/.idea/vcs.xml
diff --git a/Android-WebView-JavaScript/.idea/codeStyles/Project.xml b/Android-WebView-JavaScript/.idea/codeStyles/Project.xml
new file mode 100644
index 0000000..681f41a
--- /dev/null
+++ b/Android-WebView-JavaScript/.idea/codeStyles/Project.xml
@@ -0,0 +1,116 @@
+
+
+
+
+
+
+
+
+
+
+
+
+ xmlns:android
+
+ ^$
+
+
+
+
+
+
+
+
+ xmlns:.*
+
+ ^$
+
+
+ BY_NAME
+
+
+
+
+
+
+ .*:id
+
+ http://schemas.android.com/apk/res/android
+
+
+
+
+
+
+
+
+ .*:name
+
+ http://schemas.android.com/apk/res/android
+
+
+
+
+
+
+
+
+ name
+
+ ^$
+
+
+
+
+
+
+
+
+ style
+
+ ^$
+
+
+
+
+
+
+
+
+ .*
+
+ ^$
+
+
+ BY_NAME
+
+
+
+
+
+
+ .*
+
+ http://schemas.android.com/apk/res/android
+
+
+ ANDROID_ATTRIBUTE_ORDER
+
+
+
+
+
+
+ .*
+
+ .*
+
+
+ BY_NAME
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/Android-WebView-JavaScript/.idea/gradle.xml b/Android-WebView-JavaScript/.idea/gradle.xml
index 7ac24c7..ee635a3 100644
--- a/Android-WebView-JavaScript/.idea/gradle.xml
+++ b/Android-WebView-JavaScript/.idea/gradle.xml
@@ -3,6 +3,9 @@
diff --git a/Android-WebView-JavaScript/.idea/misc.xml b/Android-WebView-JavaScript/.idea/misc.xml
index 5d19981..dd67e70 100644
--- a/Android-WebView-JavaScript/.idea/misc.xml
+++ b/Android-WebView-JavaScript/.idea/misc.xml
@@ -1,43 +1,45 @@
-
-
-
-
+
+
+
+
+
+
+
+
+
-
+
+
+
+
+
+
+
+
-
-
-
-
-
-
-
-
-
-
-
+
diff --git a/Android-WebView-JavaScript/.idea/vcs.xml b/Android-WebView-JavaScript/.idea/vcs.xml
new file mode 100644
index 0000000..6c0b863
--- /dev/null
+++ b/Android-WebView-JavaScript/.idea/vcs.xml
@@ -0,0 +1,6 @@
+
+
+
+
+
+
\ No newline at end of file
diff --git a/Android-WebView-JavaScript/app/build.gradle b/Android-WebView-JavaScript/app/build.gradle
index 029f08e..60cb30e 100644
--- a/Android-WebView-JavaScript/app/build.gradle
+++ b/Android-WebView-JavaScript/app/build.gradle
@@ -1,12 +1,12 @@
apply plugin: 'com.android.application'
android {
- compileSdkVersion 25
+ compileSdkVersion 28
buildToolsVersion "25.0.2"
defaultConfig {
applicationId "org.skyfox.android_webview_javascript"
minSdkVersion 15
- targetSdkVersion 25
+ targetSdkVersion 28
versionCode 1
versionName "1.0"
testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
@@ -24,7 +24,7 @@ dependencies {
androidTestCompile('com.android.support.test.espresso:espresso-core:2.2.2', {
exclude group: 'com.android.support', module: 'support-annotations'
})
- compile 'com.android.support:appcompat-v7:25.2.0'
+ compile 'com.android.support:appcompat-v7:28.0.0'
compile 'com.android.support.constraint:constraint-layout:1.0.2'
testCompile 'junit:junit:4.12'
}
diff --git a/Android-WebView-JavaScript/app/src/main/assets/JSWebView.html b/Android-WebView-JavaScript/app/src/main/assets/JSWebView.html
index e1bf99d..392d343 100755
--- a/Android-WebView-JavaScript/app/src/main/assets/JSWebView.html
+++ b/Android-WebView-JavaScript/app/src/main/assets/JSWebView.html
@@ -15,7 +15,7 @@
window.webkit.messageHandlers[handlerInterface].postMessage(dic);
}else{
//安卓传输不了js json对象
- window[handlerInterface][handlerMethod](JSON.stringify(dic));
+ window[handlerInterface][handlerMethod](parameters);
}
}
function callMobileNative(handlerInterface,handlerMethod,parameters){
@@ -32,9 +32,8 @@
-
-
-
-
+
+
+