@hanwha-ss1/plugin 0.4.4 → 0.4.6
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
@@ -110,9 +110,10 @@ public class LinkerPlugin extends Plugin{
|
|
|
110
110
|
String url = call.getString("url");
|
|
111
111
|
boolean isExternal = Boolean.TRUE.equals(call.getBoolean("ext"));
|
|
112
112
|
boolean hasClose = Boolean.TRUE.equals(call.getBoolean("isCloseBtn"));
|
|
113
|
+
boolean clear = Boolean.TRUE.equals(call.getBoolean("clear"));
|
|
113
114
|
if(openBrowserImplementation == null) {
|
|
114
115
|
openBrowserImplementation = new OpenBrowser();
|
|
115
116
|
}
|
|
116
|
-
openBrowserImplementation.open(getActivity(), url, isExternal, hasClose);
|
|
117
|
+
openBrowserImplementation.open(getActivity(), url, isExternal, hasClose, clear);
|
|
117
118
|
}
|
|
118
119
|
}
|
|
@@ -84,7 +84,6 @@ public class WebViewActivity extends AppCompatActivity {
|
|
|
84
84
|
webView.getSettings().setDisplayZoomControls(false);
|
|
85
85
|
webView.getSettings().setLoadWithOverviewMode(true);
|
|
86
86
|
webView.getSettings().setUseWideViewPort(true);
|
|
87
|
-
// webView.setWebChromeClient(new ChromeClient((Activity)this));
|
|
88
87
|
webView.setWebChromeClient(new ChromeClient(this) {
|
|
89
88
|
@Override
|
|
90
89
|
public boolean onShowFileChooser(WebView webView, ValueCallback<Uri[]> filePathCallback, FileChooserParams fileChooserParams) {
|
|
@@ -92,9 +91,8 @@ public class WebViewActivity extends AppCompatActivity {
|
|
|
92
91
|
|
|
93
92
|
Intent intent = new Intent(Intent.ACTION_GET_CONTENT);
|
|
94
93
|
intent.addCategory(Intent.CATEGORY_OPENABLE);
|
|
95
|
-
intent.setType("
|
|
94
|
+
intent.setType("*/*");
|
|
96
95
|
|
|
97
|
-
// startActivityForResult(intent, 0);
|
|
98
96
|
startActivityResult.launch(intent);
|
|
99
97
|
return true;
|
|
100
98
|
}
|
|
@@ -105,27 +103,20 @@ public class WebViewActivity extends AppCompatActivity {
|
|
|
105
103
|
public boolean shouldOverrideUrlLoading(WebView view, String url) {
|
|
106
104
|
if(url.startsWith("close://")){
|
|
107
105
|
WebViewActivity.this.finish();
|
|
106
|
+
return true;
|
|
108
107
|
} else if(url.startsWith("tel:")){
|
|
109
108
|
Intent intent = new Intent(Intent.ACTION_DIAL);
|
|
110
109
|
intent.setData(Uri.parse(url));
|
|
111
110
|
startActivity(intent);
|
|
111
|
+
return true;
|
|
112
112
|
} else if(url.startsWith("sms:")){
|
|
113
113
|
Intent intent = new Intent(Intent.ACTION_SENDTO);
|
|
114
114
|
intent.setData(Uri.parse(url));
|
|
115
115
|
startActivity(intent);
|
|
116
|
+
return true;
|
|
117
|
+
} else {
|
|
118
|
+
return super.shouldOverrideUrlLoading(view, url);
|
|
116
119
|
}
|
|
117
|
-
return super.shouldOverrideUrlLoading(view, url);
|
|
118
|
-
}
|
|
119
|
-
});
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
webView.setWebViewClient(new WebViewClient(){
|
|
123
|
-
@Override
|
|
124
|
-
public boolean shouldOverrideUrlLoading(WebView view, String url) {
|
|
125
|
-
if(url.startsWith("close://")){
|
|
126
|
-
WebViewActivity.this.finish();
|
|
127
|
-
}
|
|
128
|
-
return super.shouldOverrideUrlLoading(view, url);
|
|
129
120
|
}
|
|
130
121
|
});
|
|
131
122
|
}
|