导航菜单

页面标题

页面副标题

Brevistay v5.8.2 - SpclWebFragment.java 源代码

正在查看: Brevistay v5.8.2 应用的 SpclWebFragment.java JAVA 源代码文件

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


package com.brevistay.app.view.main.fragments;

import android.app.Activity;
import android.content.Intent;
import android.os.Bundle;
import android.view.MotionEvent;
import android.view.View;
import android.webkit.WebView;
import android.widget.RelativeLayout;
import androidx.appcompat.app.AppCompatActivity;
import androidx.navigation.NavArgsLazy;
import kotlin.Metadata;
import kotlin.jvm.functions.Function0;
import kotlin.jvm.internal.Intrinsics;
import kotlin.jvm.internal.Reflection;

@Metadata(d1 = {"\u0000.\n\u0002\u0018\u0002\n\u0002\u0018\u0002\n\u0002\b\u0003\n\u0002\u0018\u0002\n\u0002\b\u0005\n\u0002\u0018\u0002\n\u0000\n\u0002\u0018\u0002\n\u0000\n\u0002\u0010\u0002\n\u0000\n\u0002\u0018\u0002\n\u0002\b\u0002\u0018\u00002\u00020\u0001B\u0007¢\u0006\u0004\b\u0002\u0010\u0003J\u0012\u0010\u000e\u001a\u00020\u000f2\b\u0010\u0010\u001a\u0004\u0018\u00010\u0011H\u0015J\b\u0010\u0012\u001a\u00020\u000fH\u0016R\u001b\u0010\u0004\u001a\u00020\u00058BX\u0082\u0084\u0002¢\u0006\f\n\u0004\b\b\u0010\t\u001a\u0004\b\u0006\u0010\u0007R\u000e\u0010\n\u001a\u00020\u000bX\u0082.¢\u0006\u0002\n\u0000R\u000e\u0010\f\u001a\u00020\rX\u0082.¢\u0006\u0002\n\u0000¨\u0006\u0013"}, d2 = {"Lcom/brevistay/app/view/main/fragments/SpclWebFragment;", "Landroidx/appcompat/app/AppCompatActivity;", "<init>", "()V", "args", "Lcom/brevistay/app/view/main/fragments/SpclWebFragmentArgs;", "getArgs", "()Lcom/brevistay/app/view/main/fragments/SpclWebFragmentArgs;", "args$delegate", "Landroidx/navigation/NavArgsLazy;", "webView", "Landroid/webkit/WebView;", "appbar", "Landroid/widget/RelativeLayout;", "onCreate", "", "savedInstanceState", "Landroid/os/Bundle;", "onBackPressed", "app_release"}, k = 1, mv = {2, 1, 0}, xi = 48)
public final class SpclWebFragment extends AppCompatActivity {
    private RelativeLayout appbar;

    private final NavArgsLazy args;
    private WebView webView;

    public SpclWebFragment() {
        final Activity activity = (Activity) this;
        this.args = new NavArgsLazy(Reflection.getOrCreateKotlinClass(SpclWebFragmentArgs.class), new Function0<Bundle>() {
            {
                super(0);
            }

            public final Bundle m275invoke() {
                Bundle bundle;
                Intent intent = activity.getIntent();
                if (intent != null) {
                    Activity activity2 = activity;
                    bundle = intent.getExtras();
                    if (bundle == null) {
                        throw new IllegalStateException("Activity " + activity2 + " has null extras in " + intent);
                    }
                } else {
                    bundle = null;
                }
                if (bundle != null) {
                    return bundle;
                }
                throw new IllegalStateException("Activity " + activity + " has a null Intent");
            }
        });
    }

    private final SpclWebFragmentArgs getArgs() {
        return (SpclWebFragmentArgs) this.args.getValue();
    }

    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(2131558562);
        this.webView = (WebView) findViewById(2131364195);
        this.appbar = (RelativeLayout) findViewById(2131363570);
        WebView webView = this.webView;
        WebView webView2 = null;
        if (webView == null) {
            Intrinsics.throwUninitializedPropertyAccessException("webView");
            webView = null;
        }
        webView.setWebViewClient(new CustomWebViewClient((Activity) this));
        ((WebView) findViewById(2131364195)).loadUrl(getArgs().getUrl());
        WebView webView3 = this.webView;
        if (webView3 == null) {
            Intrinsics.throwUninitializedPropertyAccessException("webView");
            webView3 = null;
        }
        webView3.getSettings().setDomStorageEnabled(true);
        WebView webView4 = this.webView;
        if (webView4 == null) {
            Intrinsics.throwUninitializedPropertyAccessException("webView");
            webView4 = null;
        }
        webView4.getSettings().setJavaScriptEnabled(true);
        WebView webView5 = this.webView;
        if (webView5 == null) {
            Intrinsics.throwUninitializedPropertyAccessException("webView");
            webView5 = null;
        }
        webView5.getSettings().setLoadWithOverviewMode(true);
        WebView webView6 = this.webView;
        if (webView6 == null) {
            Intrinsics.throwUninitializedPropertyAccessException("webView");
            webView6 = null;
        }
        webView6.getSettings().setUseWideViewPort(true);
        WebView webView7 = this.webView;
        if (webView7 == null) {
            Intrinsics.throwUninitializedPropertyAccessException("webView");
            webView7 = null;
        }
        webView7.getSettings().setSupportZoom(false);
        WebView webView8 = this.webView;
        if (webView8 == null) {
            Intrinsics.throwUninitializedPropertyAccessException("webView");
            webView8 = null;
        }
        webView8.getSettings().setBuiltInZoomControls(false);
        WebView webView9 = this.webView;
        if (webView9 == null) {
            Intrinsics.throwUninitializedPropertyAccessException("webView");
            webView9 = null;
        }
        webView9.getSettings().setDisplayZoomControls(false);
        WebView webView10 = this.webView;
        if (webView10 == null) {
            Intrinsics.throwUninitializedPropertyAccessException("webView");
            webView10 = null;
        }
        webView10.getSettings().setTextZoom(100);
        WebView webView11 = this.webView;
        if (webView11 == null) {
            Intrinsics.throwUninitializedPropertyAccessException("webView");
            webView11 = null;
        }
        webView11.getSettings().setAllowUniversalAccessFromFileURLs(true);
        RelativeLayout relativeLayout = this.appbar;
        if (relativeLayout == null) {
            Intrinsics.throwUninitializedPropertyAccessException("appbar");
            relativeLayout = null;
        }
        relativeLayout.setVisibility(8);
        WebView webView12 = this.webView;
        if (webView12 == null) {
            Intrinsics.throwUninitializedPropertyAccessException("webView");
        } else {
            webView2 = webView12;
        }
        webView2.setOnTouchListener(new View.OnTouchListener() {
            @Override
            public final boolean onTouch(View view, MotionEvent motionEvent) {
                boolean onCreate$lambda$0;
                onCreate$lambda$0 = SpclWebFragment.onCreate$lambda$0(view, motionEvent);
                return onCreate$lambda$0;
            }
        });
    }

    public static final boolean onCreate$lambda$0(View view, MotionEvent motionEvent) {
        return motionEvent.getPointerCount() > 1;
    }

    public void onBackPressed() {
        WebView webView = this.webView;
        WebView webView2 = null;
        if (webView == null) {
            Intrinsics.throwUninitializedPropertyAccessException("webView");
            webView = null;
        }
        if (webView.isFocused()) {
            WebView webView3 = this.webView;
            if (webView3 == null) {
                Intrinsics.throwUninitializedPropertyAccessException("webView");
                webView3 = null;
            }
            if (webView3.canGoBack()) {
                WebView webView4 = this.webView;
                if (webView4 == null) {
                    Intrinsics.throwUninitializedPropertyAccessException("webView");
                } else {
                    webView2 = webView4;
                }
                webView2.goBack();
                return;
            }
        }
        super.onBackPressed();
        finish();
    }
}