云顶彩票 v1.0.0版本的 MD5 值为:63ba5d5275adbaa5b51a7abfd0af75f7
以下内容为反编译后的 BaseAgentWebFragment.java 源代码,内容仅作参考
package com.just.library;
import android.content.Intent;
import android.os.Bundle;
import android.view.View;
import android.view.ViewGroup;
import android.webkit.WebChromeClient;
import android.webkit.WebView;
import android.webkit.WebViewClient;
import androidx.fragment.app.Fragment;
import com.just.library.AgentWeb;
import com.just.library.ChromeClientCallbackManager;
public abstract class BaseAgentWebFragment extends Fragment {
protected AgentWeb mAgentWeb;
protected abstract ViewGroup getAgentWebParent();
protected DownLoadResultListener getDownLoadResultListener() {
return null;
}
protected int getIndicatorColor() {
return -1;
}
protected int getIndicatorHeight() {
return -1;
}
protected PermissionInterceptor getPermissionInterceptor() {
return null;
}
protected String getUrl() {
return "https://github.com/Justson/AgentWeb";
}
protected WebChromeClient getWebChromeClient() {
return null;
}
protected IWebLayout getWebLayout() {
return null;
}
protected WebView getWebView() {
return null;
}
protected WebViewClient getWebViewClient() {
return null;
}
protected void setTitle(WebView webView, String str) {
}
@Override
public void onViewCreated(View view, Bundle bundle) {
super.onViewCreated(view, bundle);
this.mAgentWeb = AgentWeb.with(this).setAgentWebParent(getAgentWebParent(), new ViewGroup.LayoutParams(-1, -1)).setIndicatorColorWithHeight(getIndicatorColor(), getIndicatorHeight()).setWebView(getWebView()).setWebLayout(getWebLayout()).setAgentWebWebSettings(getAgentWebSettings()).setWebViewClient(getWebViewClient()).setPermissionInterceptor(getPermissionInterceptor()).setWebChromeClient(getWebChromeClient()).setReceivedTitleCallback(getReceivedTitleCallback()).setSecurityType(AgentWeb.SecurityType.strict).addDownLoadResultListener(getDownLoadResultListener()).createAgentWeb().ready().go(getUrl());
}
@Override
public void onPause() {
AgentWeb agentWeb = this.mAgentWeb;
if (agentWeb != null) {
agentWeb.getWebLifeCycle().onPause();
}
super.onPause();
}
@Override
public void onResume() {
AgentWeb agentWeb = this.mAgentWeb;
if (agentWeb != null) {
agentWeb.getWebLifeCycle().onResume();
}
super.onResume();
}
private ChromeClientCallbackManager.ReceivedTitleCallback getReceivedTitleCallback() {
return new ChromeClientCallbackManager.ReceivedTitleCallback() {
@Override
public void onReceivedTitle(WebView webView, String str) {
BaseAgentWebFragment.this.setTitle(webView, str);
}
};
}
@Override
public void onActivityResult(int i, int i2, Intent intent) {
AgentWeb agentWeb = this.mAgentWeb;
if (agentWeb != null) {
agentWeb.uploadFileResult(i, i2, intent);
}
super.onActivityResult(i, i2, intent);
}
@Override
public void onDestroy() {
AgentWeb agentWeb = this.mAgentWeb;
if (agentWeb != null) {
agentWeb.getWebLifeCycle().onDestroy();
}
super.onDestroy();
}
protected AgentWebSettings getAgentWebSettings() {
return WebDefaultSettingsManager.getInstance();
}
}