67 lines
2.1 KiB
Java
67 lines
2.1 KiB
Java
package com.ubtech.view.widget;
|
|
|
|
import android.content.Context;
|
|
import android.os.Build;
|
|
import android.util.AttributeSet;
|
|
import android.view.LayoutInflater;
|
|
import android.webkit.WebSettings;
|
|
import android.webkit.WebView;
|
|
import android.widget.FrameLayout;
|
|
import com.ubtech.R$id;
|
|
import com.ubtech.R$layout;
|
|
import com.ubtech.view.widget.AWebView;
|
|
|
|
/* loaded from: classes2.dex */
|
|
public class UWebLayout extends FrameLayout {
|
|
private AWebView a;
|
|
|
|
public UWebLayout(Context context) {
|
|
this(context, null);
|
|
}
|
|
|
|
private void a(Context context, AttributeSet attributeSet) {
|
|
LayoutInflater.from(context).inflate(R$layout.lay_webview, this);
|
|
this.a = (AWebView) findViewById(R$id.wv_content);
|
|
if (Build.VERSION.SDK_INT >= 11) {
|
|
this.a.removeJavascriptInterface("searchBoxJavaBridge_");
|
|
this.a.removeJavascriptInterface("accessibility");
|
|
this.a.removeJavascriptInterface("accessibilityTraversal");
|
|
}
|
|
WebSettings settings = this.a.getSettings();
|
|
settings.setJavaScriptEnabled(true);
|
|
settings.setDomStorageEnabled(true);
|
|
settings.setAllowFileAccess(true);
|
|
settings.setSupportZoom(true);
|
|
settings.setCacheMode(-1);
|
|
settings.setBuiltInZoomControls(false);
|
|
settings.setLoadsImagesAutomatically(true);
|
|
settings.setDefaultTextEncodingName("UTF-8");
|
|
settings.setLoadWithOverviewMode(true);
|
|
}
|
|
|
|
public WebView b() {
|
|
return this.a;
|
|
}
|
|
|
|
public void setOnScollChangeListener(AWebView.WebViewScrollChangeListener webViewScrollChangeListener) {
|
|
this.a.setOnScrollChangeListener(webViewScrollChangeListener);
|
|
}
|
|
|
|
public UWebLayout(Context context, AttributeSet attributeSet) {
|
|
this(context, attributeSet, 0);
|
|
}
|
|
|
|
public UWebLayout(Context context, AttributeSet attributeSet, int i) {
|
|
this(context, attributeSet, i, 0);
|
|
}
|
|
|
|
public UWebLayout(Context context, AttributeSet attributeSet, int i, int i2) {
|
|
super(context, attributeSet, i, i2);
|
|
a(context, attributeSet);
|
|
}
|
|
|
|
public WebSettings a() {
|
|
return this.a.getSettings();
|
|
}
|
|
}
|