调整客服WebView

新增客服url判断链接
This commit is contained in:
zlzw 2024-01-24 14:43:31 +08:00
parent 30b2884c46
commit 5a32047c6d
3 changed files with 13 additions and 7 deletions

View File

@ -383,6 +383,12 @@ public abstract class AbsActivity extends AppCompatActivity {
}
}
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");
}
}

View File

@ -9,6 +9,8 @@ import android.view.ViewTreeObserver;
import android.view.inputmethod.InputMethodManager;
import android.widget.FrameLayout;
import com.yunbao.common.activity.AbsActivity;
/**
* 修复全屏WebView输入法遮挡输入框的问题
* <a href="https://github.com/madebycm/AndroidBug5497Workaround/tree/master">GitHub</a>
@ -72,7 +74,7 @@ public class AndroidBug5497Workaround {
int heightDifference = usableHeightSansKeyboard - usableHeightNow;
if (heightDifference > (usableHeightSansKeyboard / 4)) {
// keyboard probably just became visible
frameLayoutParams.height = usableHeightSansKeyboard - heightDifference;
frameLayoutParams.height = usableHeightSansKeyboard - heightDifference - AbsActivity.getCurrentNavigationBarHeight((Activity) mChildOfContent.getContext());
} else {
// keyboard probably just became hidden
frameLayoutParams.height = usableHeightSansKeyboard;

View File

@ -81,9 +81,8 @@ public class CustomerServiceWebViewActivity extends AbsActivity {
if (getNavigationBarHeight(mContext) != 0) {
params.bottomMargin = getNavigationBarHeight(mContext);
}*/
AndroidBug5497Workaround.assistActivity(rootView);
//mWebView.setLayoutParams(params);
mWebView.setOverScrollMode(View.OVER_SCROLL_NEVER);
// mWebView.setOverScrollMode(View.OVER_SCROLL_IF_CONTENT_SCROLLS);
mWebView.setWebViewClient(new WebViewClient() {
@Override
public boolean shouldOverrideUrlLoading(WebView view, String url) {
@ -172,13 +171,12 @@ public class CustomerServiceWebViewActivity extends AbsActivity {
String appCachePath = mContext.getCacheDir().getAbsolutePath();
// mWebView.getSettings().setAppCachePath(appCachePath);
mWebView.getSettings().setAllowFileAccess(true);
mWebView.getSettings().setUseWideViewPort(true); // 关键点
//mWebView.getSettings().setUseWideViewPort(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);
AndroidBug5497Workaround.assistActivity(mWebView);
}
private void openImageChooserActivity(ValueCallback<Uri> valueCallback) {