导航菜单

页面标题

页面副标题

MedEd v5.3.6 - PDFActivity.java 源代码

正在查看: MedEd v5.3.6 应用的 PDFActivity.java JAVA 源代码文件

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


package com.penpencil.physicswallah.feature.pdf.ui;

import android.content.ActivityNotFoundException;
import android.content.Context;
import android.content.Intent;
import android.os.Bundle;
import android.os.Parcelable;
import android.text.TextUtils;
import android.view.View;
import android.view.Window;
import android.webkit.MimeTypeMap;
import android.widget.ImageView;
import android.widget.TextView;
import android.widget.Toast;
import androidx.appcompat.widget.AppCompatImageView;
import androidx.appcompat.widget.LinearLayoutCompat;
import androidx.cardview.widget.CardView;
import androidx.core.content.FileProvider;
import androidx.lifecycle.I;
import butterknife.BindView;
import butterknife.ButterKnife;
import butterknife.OnClick;
import com.freshchat.consumer.sdk.k.cc.NFCUsV;
import com.google.android.material.card.MaterialCardView;
import com.penpencil.network.localfile.database.entity.LocalFileEntity;
import com.penpencil.network.models.FileDownloadStatus;
import com.penpencil.network.response.FileId;
import com.penpencil.network.response.SolutionVideoId;
import com.penpencil.pdfviewer.PDFView;
import com.penpencil.physicswallah.feature.bookmark.domain.model.PostBookmarkResponse;
import com.penpencil.physicswallah.feature.extras.presentation.c;
import defpackage.CN1;
import java.io.File;
import java.util.concurrent.Executors;
import kotlin.jvm.internal.Intrinsics;

public class PDFActivity extends mR0 {
    public static final int z1 = 0;
    public CN1 Y0;
    public hI Z0;
    public nN1 a1;
    public final Float b1 = Float.valueOf(0.5f);

    @BindView
    AppCompatImageView bookmarkIc;

    @BindView
    CardView bottomViewK8;
    public Float c1;
    public final Float d1;

    @BindView
    MaterialCardView dialogMenu;
    public final Float e1;

    @BindView
    ImageView enterFullScreen;

    @BindView
    ImageView exitFullScreen;

    @BindView
    ImageView exitFullScreenActivity;
    public String f1;
    public String g1;
    public String h1;
    public String i1;
    public String j1;
    public String k1;
    public File l1;

    @BindView
    View line;
    public String m1;

    @BindView
    ImageView menuButton;

    @BindView
    TextView menuOption;
    public String n1;
    public String o1;
    public String p1;

    @BindView
    TextView pdfNameTvK8;

    @BindView
    LinearLayoutCompat pdfPalette;

    @BindView
    PDFView pdfView;
    public String q1;
    public String r1;
    public String s1;

    @BindView
    LinearLayoutCompat solutionsBtn;
    public String t1;

    @BindView
    TextView title;

    @BindView
    CardView topCv;

    @BindView
    CardView topCvK8;
    public String u1;
    public String v1;
    public String w1;
    public Boolean x1;
    public Boolean y1;

    @BindView
    ImageView zoomInDisabled;

    @BindView
    ImageView zoomInEnabled;

    @BindView
    ImageView zoomOutDisabled;

    @BindView
    ImageView zoomOutEnabled;

    public PDFActivity() {
        Float valueOf = Float.valueOf(1.0f);
        this.c1 = valueOf;
        this.d1 = Float.valueOf(3.0f);
        this.e1 = valueOf;
        this.p1 = "";
        this.q1 = "";
        this.r1 = "";
        this.s1 = "";
        this.t1 = "";
        this.u1 = "";
        this.v1 = "";
        this.w1 = "";
        this.x1 = null;
        this.y1 = Boolean.FALSE;
    }

    public static void a1(PDFActivity pDFActivity, PostBookmarkResponse postBookmarkResponse) {
        pDFActivity.getClass();
        if (!postBookmarkResponse.isSuccess() || postBookmarkResponse.getError() != null) {
            if (postBookmarkResponse.isSuccess() || postBookmarkResponse.getError() == null) {
                Toast.makeText((Context) pDFActivity, (CharSequence) pDFActivity.getString(2132020607), 0).show();
                return;
            } else {
                Toast.makeText((Context) pDFActivity, (CharSequence) postBookmarkResponse.getError(), 0).show();
                return;
            }
        }
        boolean isBookMarked = postBookmarkResponse.isBookMarked();
        pDFActivity.x1 = Boolean.valueOf(isBookMarked);
        if (isBookMarked) {
            pDFActivity.bookmarkIc.setImageResource(2131233297);
        } else {
            pDFActivity.bookmarkIc.setImageResource(2131232549);
        }
    }

    public static void e1(Context context, String str, String str2, String str3, String str4, String str5, String str6, LocalFileEntity localFileEntity, SolutionVideoId solutionVideoId) {
        Intent intent = new Intent(context, (Class<?>) PDFActivity.class);
        intent.putExtra("pdfName", str);
        intent.putExtra("dirPath", str2);
        intent.putExtra("pdfId", str3);
        intent.putExtra("pdfUrl", str4);
        intent.putExtra("pdfAction", str5);
        intent.putExtra("pdfTitle", str6);
        if (solutionVideoId != null) {
            intent.putExtra("videoSolution", solutionVideoId.getVideoUrl());
            intent.putExtra("videoSolutionName", solutionVideoId.getName());
        }
        if (localFileEntity != null) {
            intent.putExtra("localFileEntity", (Parcelable) localFileEntity);
        }
        context.startActivity(intent);
    }

    public static void f1(Context context, String str, String str2, String str3, String str4, String str5, LocalFileEntity localFileEntity, Boolean bool, String str6, String str7, String str8, String str9, String str10, String str11, String str12, String str13) {
        Boolean bool2 = Boolean.TRUE;
        Intent intent = new Intent(context, (Class<?>) PDFActivity.class);
        intent.putExtra("pdfName", str);
        intent.putExtra("dirPath", str2);
        intent.putExtra("pdfId", str3);
        intent.putExtra("pdfUrl", str4);
        intent.putExtra("pdfAction", "OPEN");
        intent.putExtra("SOURCE", (String) null);
        intent.putExtra("pdfTitle", str5);
        intent.putExtra("IS_BOOKMARKED", bool);
        intent.putExtra("SHOW_PDF_PALETTE", bool2);
        intent.putExtra("qbgSubjectId", str6);
        intent.putExtra("qbgChapterId", str7);
        intent.putExtra("qbgTopicId", str8);
        intent.putExtra("programId", str9);
        intent.putExtra("subjectId", str10);
        intent.putExtra("chapterId", str11);
        intent.putExtra("topicId", str12);
        intent.putExtra("contentId", str13);
        if (localFileEntity != null) {
            intent.putExtra("localFileEntity", (Parcelable) localFileEntity);
        }
        context.startActivity(intent);
    }

    public final void d1() {
        this.dialogMenu.setVisibility(8);
        File file = this.l1;
        if (file == null) {
            BasePdfActivity basePdfActivity = ((BasePdfActivity) this).K0;
            Toast.makeText((Context) basePdfActivity, (CharSequence) basePdfActivity.getString(2132018186), 0).show();
            return;
        }
        if (!file.exists()) {
            l.o(this, 2132018053);
            W0(this.i1, this.g1, this.f1, this.h1, this.pdfView);
            return;
        }
        File file2 = this.l1;
        MimeTypeMap.getSingleton();
        file2.getName().substring(file2.getName().lastIndexOf(".") + 1);
        try {
            Intent intent = new Intent();
            intent.setAction("android.intent.action.VIEW");
            intent.setFlags(1);
            intent.setDataAndType(FileProvider.getUriForFile(getApplicationContext(), "xyz.penpencil.neetPG.fileProvider", file2), "application/pdf");
            startActivityForResult(intent, 1);
        } catch (ActivityNotFoundException unused) {
            Toast.makeText((Context) this, (CharSequence) "No activity found to open this attachment.", 1).show();
        }
    }

    @OnClick
    public void enterFullScreenClick() {
        this.pdfPalette.setVisibility(8);
        this.exitFullScreen.setVisibility(0);
    }

    @OnClick
    public void exitFullScreenActivityClick() {
        if (this.o1.equals("VIDEO_FRAGMENT")) {
            finish();
        }
    }

    @OnClick
    public void exitFullScreenClick() {
        this.exitFullScreen.setVisibility(8);
        this.pdfPalette.setVisibility(0);
        this.zoomOutDisabled.setVisibility(0);
        this.zoomInEnabled.setVisibility(0);
        this.zoomOutEnabled.setVisibility(8);
        this.zoomInDisabled.setVisibility(8);
        this.c1 = Float.valueOf(1.0f);
        PDFView pDFView = this.pdfView;
        pDFView.k = pDFView.a;
    }

    public final void onCreate(Bundle bundle) {
        super/*com.penpencil.physicswallah.feature.pdf.ui.BasePdfActivity*/.onCreate(bundle);
        setContentView(2131558461);
        ButterKnife.b(this);
        if (this.Z0.a().getTemplateData().getName().equals("k8#")) {
            this.topCv.setVisibility(8);
            this.topCvK8.setVisibility(0);
            this.bottomViewK8.setVisibility(0);
            hi.a = 2131102394;
            Window window = getWindow();
            window.getDecorView().setSystemUiVisibility(8192);
            Object obj = dT.a;
            window.setStatusBarColor(b.a(this, 2131102394));
        }
        String stringExtra = getIntent().getStringExtra("SOURCE");
        this.o1 = stringExtra;
        if (stringExtra == null) {
            this.o1 = "";
        }
        if (getIntent().getBooleanExtra("SHOW_PDF_PALETTE", false)) {
            CardView cardView = ((BasePdfActivity) this).downloadingPdfLayout;
            Intrinsics.checkNotNullParameter(cardView, "<this>");
            LB1.a(N92.l(new bt3(cardView, (iT) null))).f(this, new b(this));
        }
        Intrinsics.checkNotNullParameter(this, "owner");
        Qt3 viewModelStore = getViewModelStore();
        I.c c = Pt3.c(this);
        SW b = Pt3.b(this);
        Intrinsics.checkNotNullParameter(viewModelStore, "store");
        Intrinsics.checkNotNullParameter(c, "factory");
        Ot3 b2 = Yd.b(b, "defaultCreationExtras", viewModelStore, c, b);
        EG b3 = Y0.b(CN1.class, "modelClass", CN1.class, "<this>", CN1.class);
        Intrinsics.checkNotNullParameter(b3, "modelClass");
        this.Y0 = Ot3.b(b2, b3);
        String str = PV1.b;
        a.a(this).f(this, new c(this, 1));
        this.Y0.L.f(this, new uO1(this, 1));
    }

    public final void onStart() {
        super/*rp*/.onStart();
        File file = this.l1;
        if (file == null) {
            return;
        }
        if (file.exists()) {
            this.menuOption.setText(2132021179);
        } else {
            this.menuOption.setText(2132018032);
        }
    }

    @OnClick
    public void onZoomInEnabledClick() {
        float floatValue = this.c1.floatValue();
        Float f = this.d1;
        if (floatValue < f.floatValue()) {
            Float valueOf = Float.valueOf(this.b1.floatValue() + this.c1.floatValue());
            this.c1 = valueOf;
            try {
                try {
                    this.pdfView.v(valueOf.floatValue());
                    this.zoomOutEnabled.setVisibility(0);
                    this.zoomOutDisabled.setVisibility(8);
                    if (!this.c1.equals(f)) {
                        return;
                    }
                } catch (Exception e) {
                    rm2.b("PDF_NAME -> " + getIntent().getStringExtra("pdfName") + "PDF_URL -> " + getIntent().getStringExtra("pdfUrl"), e);
                    this.zoomOutEnabled.setVisibility(0);
                    this.zoomOutDisabled.setVisibility(8);
                    if (!this.c1.equals(f)) {
                        return;
                    }
                }
                this.zoomInDisabled.setVisibility(0);
                this.zoomInEnabled.setVisibility(8);
            } catch (Throwable th) {
                this.zoomOutEnabled.setVisibility(0);
                this.zoomOutDisabled.setVisibility(8);
                if (this.c1.equals(f)) {
                    this.zoomInDisabled.setVisibility(0);
                    this.zoomInEnabled.setVisibility(8);
                }
                throw th;
            }
        }
    }

    @OnClick
    public void onZoomOutEnabledClick() {
        float floatValue = this.c1.floatValue();
        Float f = this.e1;
        if (floatValue > f.floatValue()) {
            Float valueOf = Float.valueOf(this.c1.floatValue() - this.b1.floatValue());
            this.c1 = valueOf;
            try {
                try {
                    this.pdfView.v(valueOf.floatValue());
                    this.zoomInDisabled.setVisibility(8);
                    this.zoomInEnabled.setVisibility(0);
                    if (!this.c1.equals(f)) {
                        return;
                    }
                } catch (Exception e) {
                    rm2.b("PDF_NAME -> " + getIntent().getStringExtra("pdfName") + "PDF_URL -> " + getIntent().getStringExtra("pdfUrl"), e);
                    this.zoomInDisabled.setVisibility(8);
                    this.zoomInEnabled.setVisibility(0);
                    if (!this.c1.equals(f)) {
                        return;
                    }
                }
                this.zoomOutEnabled.setVisibility(8);
                this.zoomOutDisabled.setVisibility(0);
            } catch (Throwable th) {
                this.zoomInDisabled.setVisibility(8);
                this.zoomInEnabled.setVisibility(0);
                if (this.c1.equals(f)) {
                    this.zoomOutEnabled.setVisibility(8);
                    this.zoomOutDisabled.setVisibility(0);
                }
                throw th;
            }
        }
    }

    @OnClick
    public void openCloseDialogMenu(View view) {
        if (this.dialogMenu.isShown()) {
            this.dialogMenu.setVisibility(8);
        } else {
            this.dialogMenu.setVisibility(0);
        }
    }

    @OnClick
    public void pdfBackBtnIvK8(View view) {
        onBackPressed();
    }

    @OnClick
    public void previousActivity(View view) {
        onBackPressed();
    }

    @OnClick
    public void showDownloadBox(View view) {
        d1();
    }

    @OnClick
    public void showDownloadBoxK8(View view) {
        d1();
    }

    public static void Z0(PDFActivity pDFActivity) {
        FileDownloadStatus fileDownloadStatus;
        if (((BasePdfActivity) pDFActivity).U0.booleanValue()) {
            return;
        }
        ((BasePdfActivity) pDFActivity).downloadingPdfLayout.setVisibility(0);
        pDFActivity.f1 = pDFActivity.getIntent().getStringExtra("pdfName");
        pDFActivity.g1 = pDFActivity.getIntent().getStringExtra("dirPath");
        pDFActivity.h1 = pDFActivity.getIntent().getStringExtra("pdfId");
        pDFActivity.i1 = pDFActivity.getIntent().getStringExtra("pdfUrl");
        pDFActivity.y1 = Boolean.valueOf(pDFActivity.getIntent().getBooleanExtra("disableBookMark", false));
        pDFActivity.j1 = pDFActivity.getIntent().getStringExtra("pdfAction");
        pDFActivity.k1 = pDFActivity.getIntent().getStringExtra("pdfTitle");
        pDFActivity.m1 = pDFActivity.getIntent().getStringExtra("videoSolution");
        pDFActivity.n1 = pDFActivity.getIntent().getStringExtra("videoSolutionName");
        pDFActivity.x1 = Boolean.valueOf(pDFActivity.getIntent().getBooleanExtra("IS_BOOKMARKED", false));
        pDFActivity.p1 = pDFActivity.getIntent().getStringExtra(NFCUsV.evxnjoInsvPVubq);
        pDFActivity.q1 = pDFActivity.getIntent().getStringExtra("qbgChapterId");
        pDFActivity.r1 = pDFActivity.getIntent().getStringExtra("qbgTopicId");
        pDFActivity.s1 = pDFActivity.getIntent().getStringExtra("programId");
        pDFActivity.t1 = pDFActivity.getIntent().getStringExtra("subjectId");
        pDFActivity.u1 = pDFActivity.getIntent().getStringExtra("chapterId");
        pDFActivity.v1 = pDFActivity.getIntent().getStringExtra("topicId");
        pDFActivity.w1 = pDFActivity.getIntent().getStringExtra("contentId");
        FileId fileId = new FileId();
        ((BasePdfActivity) pDFActivity).H0 = fileId;
        fileId.setBaseUrl(pDFActivity.i1);
        ((BasePdfActivity) pDFActivity).H0.set_id(pDFActivity.h1);
        ((BasePdfActivity) pDFActivity).H0.setName(pDFActivity.k1);
        String[] split = pDFActivity.f1.split(".pdf");
        if (split.length == 1) {
            ((BasePdfActivity) pDFActivity).H0.setName(pDFActivity.f1);
        } else {
            String str = split[1];
            ((BasePdfActivity) pDFActivity).H0.setKey(str + ".pdf");
        }
        Kv0 a = kw2.a();
        mw2 mw2Var = mw2.a;
        boolean c = a.h.c("disable_bookmark_feature");
        if (TextUtils.isEmpty(pDFActivity.p1) || TextUtils.isEmpty(pDFActivity.r1) || TextUtils.isEmpty(pDFActivity.q1) || pDFActivity.y1.booleanValue() || c) {
            pDFActivity.bookmarkIc.setVisibility(8);
        } else {
            pDFActivity.bookmarkIc.setVisibility(0);
        }
        Boolean bool = pDFActivity.x1;
        if (bool != null) {
            if (bool.booleanValue()) {
                pDFActivity.bookmarkIc.setImageResource(2131233297);
            } else {
                pDFActivity.bookmarkIc.setImageResource(2131232549);
            }
        }
        pDFActivity.bookmarkIc.setOnClickListener(new dY2(pDFActivity, 3));
        if (TextUtils.isEmpty(pDFActivity.m1)) {
            pDFActivity.line.setVisibility(8);
            pDFActivity.solutionsBtn.setVisibility(8);
        } else {
            pDFActivity.line.setVisibility(0);
            pDFActivity.solutionsBtn.setVisibility(0);
            pDFActivity.solutionsBtn.setOnClickListener(new wK0(pDFActivity, 7));
        }
        String str2 = pDFActivity.f1;
        if (str2.contains("_##_")) {
            String str3 = pDFActivity.f1;
            str2 = str3.substring(str3.indexOf("_##_") + 4);
        }
        pDFActivity.pdfNameTvK8.setText(str2.replace(".pdf", ""));
        pDFActivity.title.setText(str2.replace(".pdf", ""));
        pDFActivity.dialogMenu.setVisibility(8);
        if (pDFActivity.j1.equals("DOWNLOAD") || pDFActivity.j1.equals("PRINT")) {
            pDFActivity.menuButton.setVisibility(0);
        } else {
            pDFActivity.menuButton.setVisibility(8);
        }
        File file = new File(pDFActivity.g1 + "/" + pDFActivity.f1);
        pDFActivity.l1 = file;
        if (!file.exists()) {
            String str4 = PV1.b;
            if (!a.e(pDFActivity)) {
                l.p(pDFActivity, pDFActivity.getString(2132019607));
                return;
            }
            String str5 = pDFActivity.i1;
            String str6 = pDFActivity.h1;
            if (TextUtils.isEmpty(str5)) {
                pDFActivity.runOnUiThread(new nn2(pDFActivity, 3));
            } else {
                Executors.newSingleThreadExecutor().execute(new Qi2(4, pDFActivity, str5, str6));
            }
            pDFActivity.menuOption.setText(2132018032);
            return;
        }
        if (TextUtils.isEmpty(pDFActivity.h1)) {
            fileDownloadStatus = null;
        } else {
            rt0 rt0Var = rt0.y;
            fileDownloadStatus = a.a().w(pDFActivity.h1);
        }
        if (fileDownloadStatus != null && (fileDownloadStatus.getStatus() == zd0.a || fileDownloadStatus.getStatus() == zd0.d)) {
            rt0 rt0Var2 = rt0.y;
            a.a().n(pDFActivity.h1, ((BasePdfActivity) pDFActivity).V0);
        }
        if (!pDFActivity.l1.exists() || ((BasePdfActivity) pDFActivity).O0) {
            pDFActivity.W0(pDFActivity.i1, pDFActivity.g1, pDFActivity.f1, pDFActivity.h1, pDFActivity.pdfView);
            return;
        }
        ((BasePdfActivity) pDFActivity).downloadingPdfLayout.setVisibility(8);
        ((BasePdfActivity) pDFActivity).U0 = Boolean.TRUE;
        Toast.makeText((Context) pDFActivity, 2132018368, 0).show();
        if (pDFActivity.j1.equals("DOWNLOAD")) {
            pDFActivity.menuButton.setVisibility(8);
        }
        pDFActivity.X0(pDFActivity.l1, pDFActivity.pdfView);
    }
}