调整客服WebView
新增客服url判断链接
This commit is contained in:
parent
30b2884c46
commit
5a32047c6d
@ -383,6 +383,12 @@ public abstract class AbsActivity extends AppCompatActivity {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
public boolean isKefu(String url){
|
public boolean isKefu(String url){
|
||||||
|
if(url.contains("kefu")){
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
if(url.contains("https://newkf.yaoulive.com/")){
|
||||||
|
return true;
|
||||||
|
}
|
||||||
return url.startsWith("https://kefu.yaoulive.com");
|
return url.startsWith("https://kefu.yaoulive.com");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -9,6 +9,8 @@ import android.view.ViewTreeObserver;
|
|||||||
import android.view.inputmethod.InputMethodManager;
|
import android.view.inputmethod.InputMethodManager;
|
||||||
import android.widget.FrameLayout;
|
import android.widget.FrameLayout;
|
||||||
|
|
||||||
|
import com.yunbao.common.activity.AbsActivity;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 修复全屏WebView输入法遮挡输入框的问题
|
* 修复全屏WebView输入法遮挡输入框的问题
|
||||||
* <a href="https://github.com/madebycm/AndroidBug5497Workaround/tree/master">GitHub</a>
|
* <a href="https://github.com/madebycm/AndroidBug5497Workaround/tree/master">GitHub</a>
|
||||||
@ -72,7 +74,7 @@ public class AndroidBug5497Workaround {
|
|||||||
int heightDifference = usableHeightSansKeyboard - usableHeightNow;
|
int heightDifference = usableHeightSansKeyboard - usableHeightNow;
|
||||||
if (heightDifference > (usableHeightSansKeyboard / 4)) {
|
if (heightDifference > (usableHeightSansKeyboard / 4)) {
|
||||||
// keyboard probably just became visible
|
// keyboard probably just became visible
|
||||||
frameLayoutParams.height = usableHeightSansKeyboard - heightDifference;
|
frameLayoutParams.height = usableHeightSansKeyboard - heightDifference - AbsActivity.getCurrentNavigationBarHeight((Activity) mChildOfContent.getContext());
|
||||||
} else {
|
} else {
|
||||||
// keyboard probably just became hidden
|
// keyboard probably just became hidden
|
||||||
frameLayoutParams.height = usableHeightSansKeyboard;
|
frameLayoutParams.height = usableHeightSansKeyboard;
|
||||||
|
@ -81,9 +81,8 @@ public class CustomerServiceWebViewActivity extends AbsActivity {
|
|||||||
if (getNavigationBarHeight(mContext) != 0) {
|
if (getNavigationBarHeight(mContext) != 0) {
|
||||||
params.bottomMargin = getNavigationBarHeight(mContext);
|
params.bottomMargin = getNavigationBarHeight(mContext);
|
||||||
}*/
|
}*/
|
||||||
AndroidBug5497Workaround.assistActivity(rootView);
|
|
||||||
//mWebView.setLayoutParams(params);
|
//mWebView.setLayoutParams(params);
|
||||||
mWebView.setOverScrollMode(View.OVER_SCROLL_NEVER);
|
// mWebView.setOverScrollMode(View.OVER_SCROLL_IF_CONTENT_SCROLLS);
|
||||||
mWebView.setWebViewClient(new WebViewClient() {
|
mWebView.setWebViewClient(new WebViewClient() {
|
||||||
@Override
|
@Override
|
||||||
public boolean shouldOverrideUrlLoading(WebView view, String url) {
|
public boolean shouldOverrideUrlLoading(WebView view, String url) {
|
||||||
@ -172,13 +171,12 @@ public class CustomerServiceWebViewActivity extends AbsActivity {
|
|||||||
String appCachePath = mContext.getCacheDir().getAbsolutePath();
|
String appCachePath = mContext.getCacheDir().getAbsolutePath();
|
||||||
// mWebView.getSettings().setAppCachePath(appCachePath);
|
// mWebView.getSettings().setAppCachePath(appCachePath);
|
||||||
mWebView.getSettings().setAllowFileAccess(true);
|
mWebView.getSettings().setAllowFileAccess(true);
|
||||||
mWebView.getSettings().setUseWideViewPort(true); // 关键点
|
//mWebView.getSettings().setUseWideViewPort(true); // 关键点
|
||||||
mWebView.getSettings().setAllowFileAccess(true); // 允许访问文件
|
mWebView.getSettings().setAllowFileAccess(true); // 允许访问文件
|
||||||
|
|
||||||
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP) {
|
|
||||||
mWebView.getSettings().setMixedContentMode(WebSettings.MIXED_CONTENT_ALWAYS_ALLOW);
|
mWebView.getSettings().setMixedContentMode(WebSettings.MIXED_CONTENT_ALWAYS_ALLOW);
|
||||||
}
|
|
||||||
mWebView.loadUrl(url);
|
mWebView.loadUrl(url);
|
||||||
|
AndroidBug5497Workaround.assistActivity(mWebView);
|
||||||
}
|
}
|
||||||
|
|
||||||
private void openImageChooserActivity(ValueCallback<Uri> valueCallback) {
|
private void openImageChooserActivity(ValueCallback<Uri> valueCallback) {
|
||||||
|
Loading…
Reference in New Issue
Block a user