导航菜单

页面标题

页面副标题

大众借. v4.1.2 - MT7ACT.java 源代码

正在查看: 大众借. v4.1.2 应用的 MT7ACT.java JAVA 源代码文件

本页面展示 JAVA 反编译生成的源代码文件,支持语法高亮显示。 仅供安全研究与技术分析使用,严禁用于任何非法用途。请遵守相关法律法规。


package com.shiliuj.ui.activitys;

import android.content.Intent;
import android.graphics.Color;
import android.net.Uri;
import android.net.http.SslError;
import android.os.Bundle;
import android.util.Log;
import android.view.KeyEvent;
import android.view.View;
import android.view.ViewGroup;
import android.webkit.SslErrorHandler;
import android.webkit.WebResourceRequest;
import android.webkit.WebView;
import android.widget.LinearLayout;
import androidx.core.content.ContextCompat;
import butterknife.BindView;
import butterknife.ButterKnife;
import butterknife.Unbinder;
import com.base.commonlibrary.base.baseapp.AppActivityManager;
import com.base.commonlibrary.baseview.BaseAgentWebActivity;
import com.base.commonlibrary.utils.LogUtil;
import com.base.commonlibrary.views.LoadingTip;
import com.base.commonlibrary.views.TitleLayout;
import com.gyf.barlibrary.ImmersionBar;
import com.just.agentweb.MiddlewareWebChromeBase;
import com.just.agentweb.MiddlewareWebClientBase;
import com.shiliuj.mjyp.BMAG01ACT;
import com.shiliuj.mjyp.app.utils.AppUtils;
import com.shiliuj.ui.bean.MyBorrowBean;
import com.shiliuj.ui.bean.PostponeBean;

public class MT7ACT extends BaseAgentWebActivity {
    Unbinder bind;

    @BindView(2131296443)
    LinearLayout container;
    private ImmersionBar mImmersionBar;
    private MyBorrowBean myBorrow;
    private PostponeBean postponeBean;
    private String title;

    @BindView(2131296998)
    TitleLayout titleView;

    protected boolean canLoadMore() {
        return false;
    }

    protected int getIndicatorHeight() {
        return 1;
    }

    public int getLayoutId() {
        return 2131492894;
    }

    public void initPresenter() {
    }

    protected void loadMore() {
    }

    protected void refresh() {
    }

    public void bindView() {
        this.bind = ButterKnife.bind(this);
        ImmersionBar with = ImmersionBar.with(this);
        this.mImmersionBar = with;
        with.statusBarDarkFont(true, 0.5f);
        this.mImmersionBar.init();
    }

    protected void onDestroy() {
        this.bind.unbind();
        if (this.mAgentWeb != null) {
            this.mAgentWeb.clearWebCache();
        }
        ImmersionBar immersionBar = this.mImmersionBar;
        if (immersionBar != null) {
            immersionBar.destroy();
        }
        super.onDestroy();
    }

    public void initView(Bundle bundle) {
        this.titleView.setOnBackButtonClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View view) {
                if (MT7ACT.this.mAgentWeb == null || MT7ACT.this.mAgentWeb.back()) {
                    return;
                }
                MT7ACT.this.mRxManager.post("OrderStatus", "订单");
                MT7ACT.this.finish();
            }
        });
        this.titleView.setRightButton(2131558488, new View.OnClickListener() {
            @Override
            public void onClick(View view) {
                MT7ACT.this.finish();
            }
        });
    }

    protected ViewGroup getAgentWebParent() {
        return (ViewGroup) findViewById(2131296443);
    }

    protected BaseAgentWebActivity.ErrorLayoutEntity getErrorLayoutEntity() {
        BaseAgentWebActivity.ErrorLayoutEntity errorLayoutEntity = super.getErrorLayoutEntity();
        errorLayoutEntity.setLayoutRes(2131492949);
        errorLayoutEntity.setReloadId(2131296518);
        return errorLayoutEntity;
    }

    public boolean onKeyDown(int i, KeyEvent keyEvent) {
        if (this.mAgentWeb == null || !this.mAgentWeb.handleKeyEvent(i, keyEvent)) {
            return super.onKeyDown(i, keyEvent);
        }
        return true;
    }

    protected int getIndicatorColor() {
        return Color.parseColor("#ff0000");
    }

    protected String getUrl() {
        Bundle extras = getIntent().getExtras();
        if (extras == null) {
            return "";
        }
        String string = extras.getString("url");
        this.title = extras.getString("title");
        if (getResources().getString(2131689909).equals(this.title)) {
            this.myBorrow = extras.getSerializable("myBorrow");
        } else {
            this.postponeBean = extras.getSerializable("myBorrow");
        }
        this.titleView.setTitle(this.title);
        LogUtil.d("payUrl", "--》》" + string);
        return string;
    }

    protected MiddlewareWebChromeBase getMiddleWareWebChrome() {
        return new MiddlewareWebChromeBase() {
            public void onReceivedTitle(WebView webView, String str) {
                super.onReceivedTitle(webView, str);
                if (MT7ACT.this.titleView != null) {
                    MT7ACT.this.titleView.setTitle(str);
                }
            }
        };
    }

    protected MiddlewareWebClientBase getMiddleWareWebClient() {
        return new MiddlewareWebClientBase() {
            public boolean shouldOverrideUrlLoading(WebView webView, WebResourceRequest webResourceRequest) {
                String uri = webResourceRequest.getUrl().toString();
                Log.e("vv", "===>>> (1)shouldOverrideUrlLoading:" + uri);
                if (!uri.startsWith("http")) {
                    Log.i("vv", "处理自定义scheme");
                    try {
                        Intent intent = new Intent("android.intent.action.VIEW", Uri.parse(uri));
                        intent.setFlags(805306368);
                        MT7ACT.this.startActivity(intent);
                    } catch (Exception e) {
                        e.printStackTrace();
                    }
                    return true;
                }
                if (uri == null || !uri.contains("https://nice800.com")) {
                    return false;
                }
                AppActivityManager.getAppManager().returnToActivity(BMAG01ACT.class);
                MT7ACT.this.finish();
                return true;
            }

            public boolean shouldOverrideUrlLoading(WebView webView, String str) {
                Log.e("vv", "===>>> (1)shouldOverrideUrlLoading:" + str);
                if (!str.startsWith("http")) {
                    Log.i("vv", "处理自定义scheme");
                    try {
                        Intent intent = new Intent("android.intent.action.VIEW", Uri.parse(str));
                        intent.setFlags(805306368);
                        MT7ACT.this.startActivity(intent);
                    } catch (Exception e) {
                        e.printStackTrace();
                    }
                    return true;
                }
                if (str == null || !str.contains("https://nice800.com")) {
                    return false;
                }
                AppActivityManager.getAppManager().returnToActivity(BMAG01ACT.class);
                MT7ACT.this.finish();
                return true;
            }

            public void onReceivedSslError(WebView webView, SslErrorHandler sslErrorHandler, SslError sslError) {
                sslErrorHandler.proceed();
            }
        };
    }

    protected void onResume() {
        super.onResume();
        booleanWifiOrVpn();
    }

    private void booleanWifiOrVpn() {
        if (AppUtils.INSTANCE.isWifiProxy() || AppUtils.INSTANCE.isVpnUsed()) {
            if (this.loadTip != null) {
                this.loadTip.setOnKnowListener(new LoadingTip.onKnowListener() {
                    public void know() {
                        MT7ACT.this.finish();
                    }
                });
                this.loadTip.setBackgroundColor(ContextCompat.getColor(this.mContext, 2131099932));
                this.loadTip.setLoadingTip(LoadingTip.LoadStatus.know);
                return;
            }
            return;
        }
        if (this.loadTip != null) {
            this.loadTip.setLoadingTip(LoadingTip.LoadStatus.finish);
        }
    }
}