QQ浏览器 v12.2.3.7053版本的 MD5 值为:8285ab3059e5c8b521a264dfbc5c3685

以下内容为反编译后的 NovelContentBasePage.java 源代码,内容仅作参考


package com.tencent.mtt.external.novel.ui;

import android.app.Activity;
import android.app.Dialog;
import android.content.Context;
import android.content.DialogInterface;
import android.content.Intent;
import android.content.res.Configuration;
import android.graphics.Bitmap;
import android.graphics.Canvas;
import android.graphics.Rect;
import android.graphics.drawable.BitmapDrawable;
import android.graphics.drawable.Drawable;
import android.os.Bundle;
import android.os.Handler;
import android.os.Looper;
import android.os.Message;
import android.text.TextUtils;
import android.view.KeyEvent;
import android.view.MotionEvent;
import android.view.View;
import android.view.ViewGroup;
import android.view.animation.Animation;
import android.view.animation.TranslateAnimation;
import android.widget.FrameLayout;
import android.widget.LinearLayout;
import android.widget.RelativeLayout;
import com.huawei.hms.framework.common.ContainerUtils;
import com.tencent.common.data.MediaFileType;
import com.tencent.common.featuretoggle.FeatureToggle;
import com.tencent.common.http.Apn;
import com.tencent.common.http.QueenConfig;
import com.tencent.common.manifest.AppManifest;
import com.tencent.common.plugin.exports.QBPluginItemInfo;
import com.tencent.common.task.Continuation;
import com.tencent.common.task.QBTask;
import com.tencent.common.threadpool.BrowserExecutorSupplier;
import com.tencent.common.utils.FileUtils;
import com.tencent.common.utils.StringUtils;
import com.tencent.common.utils.TbsMode;
import com.tencent.common.utils.ThreadUtils;
import com.tencent.common.utils.UrlUtils;
import com.tencent.ilive.opensdk.pe.config.PEConst;
import com.tencent.mtt.ContextHolder;
import com.tencent.mtt.QBUIAppEngine;
import com.tencent.mtt.R;
import com.tencent.mtt.WindowComponentExtension;
import com.tencent.mtt.apkplugin.impl.IAPInjectService;
import com.tencent.mtt.base.functionwindow.ActivityHandler;
import com.tencent.mtt.base.functionwindow.KeyEventHandler;
import com.tencent.mtt.base.functionwindow.VolumeKeyEventListener;
import com.tencent.mtt.base.hometab.ICustomTabService;
import com.tencent.mtt.base.skin.MttResources;
import com.tencent.mtt.base.stat.StatManager;
import com.tencent.mtt.base.stat.utils.PlatformStatUtils;
import com.tencent.mtt.base.utils.CommonUtils;
import com.tencent.mtt.base.utils.DeviceUtils;
import com.tencent.mtt.base.utils.NotchUtil;
import com.tencent.mtt.boot.base.IBoot;
import com.tencent.mtt.browser.audiofm.facade.IAudioPlayFacade;
import com.tencent.mtt.browser.audiofm.facade.ITTSLoader;
import com.tencent.mtt.browser.db.user.NovelInfoBean;
import com.tencent.mtt.browser.engine.AppBroadcastObserver;
import com.tencent.mtt.browser.engine.AppBroadcastReceiver;
import com.tencent.mtt.browser.engine.clipboard.ClipboardManager;
import com.tencent.mtt.browser.file.facade.IFileStatService;
import com.tencent.mtt.browser.file.facade.IMoveCallBack;
import com.tencent.mtt.browser.file.facade.ITempFile;
import com.tencent.mtt.browser.homepage.fastcut.DefaultFastCutItem;
import com.tencent.mtt.browser.homepage.fastcut.IFastCutItem;
import com.tencent.mtt.browser.homepage.fastcut.IFastCutManager;
import com.tencent.mtt.browser.jsextension.open.IOpenJsApis;
import com.tencent.mtt.browser.multiwindow.facade.IMultiWindowService;
import com.tencent.mtt.browser.setting.manager.SkinManager;
import com.tencent.mtt.browser.setting.manager.UserSettingManager;
import com.tencent.mtt.browser.share.facade.IShare;
import com.tencent.mtt.browser.share.facade.ShareBundle;
import com.tencent.mtt.browser.window.FastPageManager;
import com.tencent.mtt.browser.window.IPage;
import com.tencent.mtt.browser.window.IWebView;
import com.tencent.mtt.browser.window.WindowManager;
import com.tencent.mtt.browser.window.templayer.BaseNativeGroup;
import com.tencent.mtt.businesscenter.facade.IFrameworkDelegate;
import com.tencent.mtt.external.novel.IFunctionController;
import com.tencent.mtt.external.novel.INovelContentBasePage;
import com.tencent.mtt.external.novel.NovelContentBasePageConst;
import com.tencent.mtt.external.novel.NovelVoiceManager;
import com.tencent.mtt.external.novel.base.MTT.GetWenxueAccountRsp;
import com.tencent.mtt.external.novel.base.MTT.NovelSysConfig;
import com.tencent.mtt.external.novel.base.MTT.OptContentRsp;
import com.tencent.mtt.external.novel.base.MTT.QuanInfo;
import com.tencent.mtt.external.novel.base.engine.NovelAdDataManager;
import com.tencent.mtt.external.novel.base.engine.NovelCallBackData;
import com.tencent.mtt.external.novel.base.engine.NovelDataListener;
import com.tencent.mtt.external.novel.base.engine.NovelExternalSetting;
import com.tencent.mtt.external.novel.base.engine.NovelLocalBookUtils;
import com.tencent.mtt.external.novel.base.engine.NovelReaderPool;
import com.tencent.mtt.external.novel.base.engine.NovelShelfDataManager;
import com.tencent.mtt.external.novel.base.engine.NovelSkinUtils;
import com.tencent.mtt.external.novel.base.engine.NovelUrlUtils;
import com.tencent.mtt.external.novel.base.engine.NovelUserSetting;
import com.tencent.mtt.external.novel.base.model.NovelCacheInfo;
import com.tencent.mtt.external.novel.base.model.NovelChapterInfo;
import com.tencent.mtt.external.novel.base.model.NovelContentInfo;
import com.tencent.mtt.external.novel.base.model.NovelInfo;
import com.tencent.mtt.external.novel.base.tools.NovelEventLogger;
import com.tencent.mtt.external.novel.base.tools.NovelFileUtils;
import com.tencent.mtt.external.novel.base.tools.NovelScreenLockController;
import com.tencent.mtt.external.novel.base.tools.NovelUtils;
import com.tencent.mtt.external.novel.base.ui.AutoDismissView;
import com.tencent.mtt.external.novel.base.ui.NovelAnnotationView;
import com.tencent.mtt.external.novel.base.ui.NovelAutoReadTimeLine;
import com.tencent.mtt.external.novel.base.ui.NovelBaseContainer;
import com.tencent.mtt.external.novel.base.ui.NovelContentAfterPage;
import com.tencent.mtt.external.novel.base.ui.NovelEpubPicMenu;
import com.tencent.mtt.external.novel.base.ui.NovelLoadingView;
import com.tencent.mtt.external.novel.base.ui.NovelProgressBarBase;
import com.tencent.mtt.external.novel.base.ui.NovelSettingPageBase;
import com.tencent.mtt.external.novel.base.ui.NovelTouchTipView;
import com.tencent.mtt.external.novel.base.ui.SelectView;
import com.tencent.mtt.external.novel.engine.NovelAutoReadController;
import com.tencent.mtt.external.novel.engine.NovelCacheManager;
import com.tencent.mtt.external.novel.engine.NovelDataManager;
import com.tencent.mtt.external.novel.engine.NovelManager;
import com.tencent.mtt.external.novel.engine.NovelOpSlotDataManager;
import com.tencent.mtt.external.novel.inhost.base.NovelConstant;
import com.tencent.mtt.external.novel.outhost.NovelInterfaceImpl;
import com.tencent.mtt.external.novel.pirate.NovelADFeedTabManager;
import com.tencent.mtt.external.novel.stat.NovelOfflineReadReport;
import com.tencent.mtt.external.novel.stat.NvQltRpt;
import com.tencent.mtt.external.novel.ui.NovelFastCutUtils;
import com.tencent.mtt.external.novel.voice.NVRDownloadDialog;
import com.tencent.mtt.external.novel.voice.NVRFacade;
import com.tencent.mtt.external.reader.IReader;
import com.tencent.mtt.external.reader.IReaderCallbackListener;
import com.tencent.mtt.external.reader.facade.IReaderFiletypeDetectorService;
import com.tencent.mtt.external.reader.facade.IReaderInstallerService;
import com.tencent.mtt.log.access.Logs;
import com.tencent.mtt.miniprogram.util.WeChatMiniProgramConstant;
import com.tencent.mtt.qbcontext.core.QBContext;
import com.tencent.mtt.resource.QBViewInterface;
import com.tencent.mtt.sdkcontext.SDKContext;
import com.tencent.mtt.search.facade.ISearchEngineService;
import com.tencent.mtt.setting.BaseSettings;
import com.tencent.mtt.setting.PublicSettingManager;
import com.tencent.mtt.support.utils.ViewCompat;
import com.tencent.mtt.ttsplayer.plugin.CheckDownCallBack;
import com.tencent.mtt.ttsplayer.plugin.LoaderListener;
import com.tencent.mtt.ttsplayer.plugin.TTSLoader;
import com.tencent.mtt.view.common.QBTextView;
import com.tencent.mtt.view.common.QBView;
import com.tencent.mtt.view.common.QBViewResourceManager;
import com.tencent.mtt.view.dialog.alert.NewQBAlertDialogBuilder;
import com.tencent.mtt.view.dialog.alert.QBAlertDialog;
import com.tencent.mtt.view.dialog.alert.QBAlertDialogBase;
import com.tencent.mtt.view.dialog.alert.QBLinearDialogClickListener;
import com.tencent.mtt.view.dialog.alert.QBListDialog;
import com.tencent.mtt.view.dialog.alert.QbListDialogBuilder;
import com.tencent.mtt.view.dialog.newui.SimpleDialogBuilder;
import com.tencent.mtt.view.dialog.newui.builder.api.ICommonDialogBuilder;
import com.tencent.mtt.view.dialog.newui.builder.api.base.IDialogBuilderInterface;
import com.tencent.mtt.view.dialog.newui.dialog.DialogBase;
import com.tencent.mtt.view.dialog.newui.view.ViewOnClickListener;
import com.tencent.mtt.view.dialog.popmenu.QBPopupMenu;
import com.tencent.mtt.view.layout.QBFrameLayout;
import com.tencent.mtt.view.layout.QBLinearLayout;
import com.tencent.mtt.view.toast.MttToaster;
import com.tencent.mtt.view.toast.NotificationBar;
import com.tencent.qqlive.module.videoreport.collect.EventCollector;
import com.xiaomi.mipush.sdk.Constants;
import java.io.File;
import java.text.SimpleDateFormat;
import java.util.ArrayList;
import java.util.Date;
import java.util.HashMap;
import java.util.Map;
import java.util.Set;
import java.util.concurrent.Callable;
import qb.a.g;
import qb.a.h;
import qb.qbcontext.BuildConfig;

public abstract class NovelContentBasePage extends NovelSettingPageBase implements VolumeKeyEventListener, AppBroadcastObserver, INovelContentBasePage, NovelDataListener, NovelProgressBarBase.ProgressListener, IReaderCallbackListener {
    private static String bf = "qb://home/feeds?tabId=22&refresh=1";
    private static String bg = "qb://tab/feedschannel?component=FeedsNovelPage&module=novelsingletab&title=小说";
    protected NovelContentTitleBarBase A;
    QBFrameLayout B;
    protected NovelContentBottomBar C;
    protected QBFrameLayout D;
    protected QBFrameLayout E;
    protected QBFrameLayout F;
    protected QBLinearLayout G;
    protected ContainerFrameLayout H;
    protected NovelLoadingView O;
    protected SelectView P;
    protected NovelAnnotationView Q;
    protected NovelEpubPicMenu R;
    public QBLinearLayout S;
    NovelBackPayGuideDlgBase T;
    protected long U;
    protected float V;
    protected long W;

    public NovelInfo f55768a;
    public NovelShelfDataManager.NovelPosInfo aA;
    public boolean aB;
    protected NovelContentInfo aC;
    protected boolean aD;
    protected NovelContentOpBar aE;
    public boolean aF;
    public boolean aG;
    public String aH;
    public boolean aI;
    public boolean aJ;
    public NovelVoiceManager.VoiceStrutHolder aK;
    public boolean aL;
    public Bitmap aM;
    public IFastCutItem aN;
    boolean aO;
    boolean aP;
    NovelAutoReadController aQ;
    boolean aR;
    public QBPopupMenu aS;
    QBListDialog aT;
    String[] aU;
    boolean aV;
    private int aW;
    private int aX;
    private Long aY;
    private Long aZ;
    protected boolean aa;
    protected int ab;
    protected int ac;
    protected int ad;
    protected int ae;
    protected int af;
    protected int ag;
    protected int ah;
    protected int ai;
    protected View aj;
    protected byte ak;
    protected boolean al;
    protected Handler am;
    protected NovelContentAfterPage.Starter an;
    IFunctionController ao;
    protected IReaderFiletypeDetectorService ap;
    protected Map<Integer, Bundle> aq;

    boolean f55769ar;
    public int as;
    boolean at;
    protected String au;
    protected boolean av;
    protected boolean aw;
    protected boolean ax;
    public int ay;
    public String az;

    protected boolean f55770b;
    private long ba;
    private ArrayList<NovelOpSlotDataManager.bookOpSlotInfo> bb;
    private boolean bc;
    private NovelScreenLockController bd;
    private boolean be;

    public int f55771c;

    protected int f55772d;
    protected boolean e;
    protected int f;
    protected int g;
    protected int h;
    protected int n;
    protected boolean o;
    protected String p;
    protected String q;
    protected String r;
    protected int s;
    protected String t;
    protected int u;
    protected boolean v;
    protected PageBarAnimation w;
    protected PageBarAnimation x;
    protected int y;
    public IReader z;

    public static class AnonymousClass35 {

        static final int[] f55816a = new int[IWebView.RatioRespect.values().length];

        static {
            try {
                f55816a[IWebView.RatioRespect.RESPECT_WIDTH.ordinal()] = 1;
            } catch (NoSuchFieldError unused) {
            }
            try {
                f55816a[IWebView.RatioRespect.RESPECT_HEIGHT.ordinal()] = 2;
            } catch (NoSuchFieldError unused2) {
            }
            try {
                f55816a[IWebView.RatioRespect.RESPECT_BOTH.ordinal()] = 3;
            } catch (NoSuchFieldError unused3) {
            }
            try {
                f55816a[IWebView.RatioRespect.RESPECT_NONE.ordinal()] = 4;
            } catch (NoSuchFieldError unused4) {
            }
        }
    }

    public class ContainerFrameLayout extends QBFrameLayout {
        public ContainerFrameLayout(Context context) {
            super(context);
        }

        public void a(Bitmap bitmap, IWebView.RatioRespect ratioRespect, int i) {
            float f;
            QBViewResourceManager qBViewResourceManager;
            float f2;
            float f3;
            if (bitmap == null) {
                return;
            }
            int width = getWidth();
            int height = getHeight();
            int width2 = bitmap.getWidth();
            int height2 = bitmap.getHeight();
            float f4 = 1.0f;
            try {
                if (ratioRespect != null) {
                    int i2 = AnonymousClass35.f55816a[ratioRespect.ordinal()];
                    if (i2 == 1) {
                        f2 = width2;
                        f3 = width;
                    } else if (i2 == 2) {
                        f2 = height2;
                        f3 = height;
                    } else if (i2 == 3) {
                        f4 = width2 / width;
                        f = height2 / height;
                        qBViewResourceManager = getQBViewResourceManager();
                        if (qBViewResourceManager != null) {
                            qBViewResourceManager.r();
                        }
                        setDrawingCacheEnabled(false);
                        setChildrenDrawingCacheEnabled(false);
                        Canvas canvas = new Canvas(bitmap);
                        canvas.scale(f4, f);
                        canvas.translate(0.0f, i);
                        draw(canvas);
                        if (qBViewResourceManager != null) {
                            qBViewResourceManager.s();
                            return;
                        }
                        return;
                    }
                    f4 = f2 / f3;
                    f = f4;
                    qBViewResourceManager = getQBViewResourceManager();
                    if (qBViewResourceManager != null) {
                    }
                    setDrawingCacheEnabled(false);
                    setChildrenDrawingCacheEnabled(false);
                    Canvas canvas2 = new Canvas(bitmap);
                    canvas2.scale(f4, f);
                    canvas2.translate(0.0f, i);
                    draw(canvas2);
                    if (qBViewResourceManager != null) {
                    }
                }
                qBViewResourceManager = getQBViewResourceManager();
                if (qBViewResourceManager != null) {
                }
                setDrawingCacheEnabled(false);
                setChildrenDrawingCacheEnabled(false);
                Canvas canvas22 = new Canvas(bitmap);
                canvas22.scale(f4, f);
                canvas22.translate(0.0f, i);
                draw(canvas22);
                if (qBViewResourceManager != null) {
                }
            } catch (Throwable unused) {
                return;
            }
            f = 1.0f;
        }

        @Override
        public void dispatchDraw(Canvas canvas) {
            super.dispatchDraw(canvas);
        }
    }

    public static class GetSwitchStatus {

        private boolean f55824a;

        private boolean f55825b;

        private boolean f55826c;

        public GetSwitchStatus a(String str) {
            this.f55824a = NovelInfo.a(str);
            this.f55825b = true;
            this.f55826c = ((ICustomTabService) QBContext.getInstance().getService(ICustomTabService.class)).checkTabShowing(117);
            return this;
        }

        public boolean a() {
            return this.f55824a;
        }

        public boolean b() {
            return this.f55825b;
        }

        public boolean c() {
            return this.f55826c;
        }
    }

    public class MoreSelectDialogListener implements DialogInterface.OnDismissListener, QBLinearDialogClickListener {

        public String[] f55827a;

        public boolean f55828b;

        MoreSelectDialogListener() {
        }

        private int a(String str) {
            int i = -1;
            int i2 = 0;
            while (true) {
                String[] strArr = this.f55827a;
                if (i2 >= strArr.length) {
                    return i;
                }
                if (StringUtils.a(strArr[i2], str)) {
                    i = i2;
                }
                i2++;
            }
        }

        @Override
        public void a(int i) {
            String str = NovelContentBasePage.this.aU[i];
            int a2 = a(str);
            NovelContentBasePage.this.al();
            if (!this.f55828b && a2 != -1) {
                a2++;
            }
            if (a2 == 0) {
                StatManager.b().c("AKH316");
                Logs.a("NovelContentTitleBar_Click_Discuss", (Object) IOpenJsApis.TRUE);
                StatManager.b().c("AKH41");
                if (NovelContentBasePage.this.A.b()) {
                    return;
                }
                Bundle bundle = new Bundle();
                String str2 = "";
                QuanInfo n = NovelDataManager.q().n(NovelContentBasePage.this.f55768a.f36399b);
                if (TextUtils.isEmpty("") && n != null) {
                    str2 = n.strUrl;
                }
                if (TextUtils.isEmpty(str2)) {
                    return;
                }
                bundle.putString("book_quan_info_url", str2);
                bundle.putBoolean("book_quan_from_titlebar", true);
                bundle.putString("open_native_page_url", str2);
                ((NovelBaseContainer) NovelContentBasePage.this.getNativeGroup()).a(30, bundle, true, (Object) NovelContentBasePage.this.f55768a);
                return;
            }
            if (a2 == 1) {
                StatManager.b().c("AKH43");
                String a3 = NovelUrlUtils.a(NovelContentBasePage.this.f55768a.f36399b, NovelContentBasePage.this.getNovelContext());
                Bundle bundle2 = new Bundle();
                bundle2.putString("book_url", a3);
                bundle2.putInt("key_storepage_from_where", 2);
                ((NovelBaseContainer) NovelContentBasePage.this.getNativeGroup()).a(23, bundle2, true);
                return;
            }
            if (a2 != 2) {
                if (a2 != 3) {
                    NovelContentBasePage.this.c(str);
                    return;
                }
                return;
            }
            StatManager.b().c("AKH44");
            StatManager.b().c("AKH26");
            ShareBundle shareBundle = new ShareBundle(0);
            shareBundle.f45016d = NovelUrlUtils.a(NovelContentBasePage.this.f55768a.f36399b, NovelContentBasePage.this.getNovelContext());
            shareBundle.f = NovelUrlUtils.a(NovelContentBasePage.this.f55768a.f36399b, NovelContentBasePage.this.getNovelContext());
            shareBundle.m = 100;
            shareBundle.n = 10000;
            shareBundle.D = 11;
            shareBundle.y = 1001;
            shareBundle.f45014b = NovelContentBasePage.this.f55768a.f36400c;
            shareBundle.B = NovelContentBasePage.this;
            ((IShare) QBContext.getInstance().getService(IShare.class)).recordShareScene("8.2");
            ((IFrameworkDelegate) QBContext.getInstance().getService(IFrameworkDelegate.class)).handleMttMessage(57, 0, 0, shareBundle, 0L);
        }

        @Override
        public void onDismiss(DialogInterface dialogInterface) {
            NovelContentBasePage.this.aT = null;
        }
    }

    public class PageBarAnimation extends TranslateAnimation implements Animation.AnimationListener {

        View f55830a;

        boolean f55831b;

        public PageBarAnimation(View view, int i, int i2, boolean z) {
            super(0.0f, 0.0f, i, i2);
            this.f55830a = null;
            this.f55831b = false;
            setDuration(200L);
            setAnimationListener(this);
            this.f55830a = view;
            this.f55831b = z;
        }

        public void a() {
            onAnimationEnd(this);
            setAnimationListener(null);
        }

        @Override
        public void onAnimationEnd(Animation animation) {
            this.f55830a.setVisibility(this.f55831b ? 0 : 4);
            NovelContentBasePage.this.ae = 0;
        }

        @Override
        public void onAnimationRepeat(Animation animation) {
        }

        @Override
        public void onAnimationStart(Animation animation) {
            if (NovelContentBasePage.this.ae == 1) {
                NovelContentBasePage.this.ae = 2;
            }
            if (NovelContentBasePage.this.ae == -1) {
                NovelContentBasePage.this.ae = -2;
            }
        }
    }

    public NovelContentBasePage(Context context, FrameLayout.LayoutParams layoutParams, BaseNativeGroup baseNativeGroup, Bundle bundle) {
        super(context, layoutParams, baseNativeGroup, bundle);
        this.f55768a = new NovelInfo();
        this.f55770b = false;
        this.f55771c = 0;
        this.f55772d = 5;
        this.e = false;
        this.f = 10;
        this.g = 1;
        this.h = 10;
        this.n = 11;
        this.o = false;
        this.p = MttResources.l(R.string.alp);
        this.q = "";
        this.r = "";
        this.s = 0;
        this.t = "";
        this.u = 0;
        this.v = false;
        this.y = -1;
        this.z = null;
        this.A = null;
        this.B = null;
        this.C = null;
        this.D = null;
        this.E = null;
        this.F = null;
        this.G = null;
        this.H = null;
        this.O = null;
        this.P = null;
        this.Q = null;
        this.R = null;
        this.S = null;
        this.T = null;
        this.U = -1L;
        this.V = 1.0f;
        this.W = 0L;
        this.aa = true;
        this.ab = 0;
        this.ac = MttResources.h(R.dimen.vt);
        this.ad = MttResources.h(R.dimen.um);
        this.ae = 0;
        this.ak = (byte) 0;
        this.al = false;
        this.am = null;
        this.an = null;
        this.ao = null;
        this.ap = null;
        this.aq = new HashMap();
        this.f55769ar = true;
        this.as = 0;
        this.at = false;
        this.au = "";
        this.av = false;
        this.aw = false;
        this.ax = true;
        this.ay = 0;
        this.az = "";
        this.aW = -1;
        this.aX = -1;
        this.aY = -1L;
        this.aZ = -1L;
        this.aA = null;
        this.aB = false;
        this.ba = 0L;
        this.aC = null;
        this.bb = null;
        this.aD = false;
        this.aE = null;
        this.bc = false;
        this.aF = false;
        this.aG = false;
        this.aH = "0";
        this.aI = false;
        this.aJ = false;
        this.aL = true;
        this.bd = null;
        this.be = false;
        this.aM = null;
        this.aO = true;
        this.aP = false;
        this.aQ = null;
        this.aR = false;
        this.aT = null;
        this.aU = null;
        this.aV = false;
        ab();
        if (!NovelInterfaceImpl.getInstance().sContext.f54694c.y()) {
            NovelInterfaceImpl.getInstance().sContext.f54694c.s(true);
        }
        getNovelContext().n().g();
        if (bundle != null && bundle.containsKey("open_from_tts_history")) {
            this.be = true;
        }
        if (bundle != null && bundle.containsKey("key_call_native_from")) {
            NovelNativeReaderGuideType.a().a(bundle.getString("key_call_native_from"));
        }
        this.aN = b(bundle);
        setMiniFloatBarVisibility(8);
        NovelDataManager.q().r().a(this.f55768a.f36399b, 0, 0, 0);
        this.am.postDelayed(new Runnable() {
            @Override
            public void run() {
                if (NovelContentBasePage.this.getNovelContext().f54695d.l() == 0) {
                    NovelContentBasePage.this.getNovelContext().j().f54399d.c(NovelContentBasePage.this.f55768a, NovelContentBasePage.this.getCPID());
                }
            }
        }, 100L);
        KeyEventHandler.a(this);
        this.bd = new NovelScreenLockController(ActivityHandler.b().a().getWindow(), getNovelContext());
        if (!Apn.isCharge() || QueenConfig.getInfoProvider().isQueenUser()) {
            a((String) null, true);
        }
    }

    static Dialog a(Context context, String str, ViewOnClickListener viewOnClickListener, ViewOnClickListener viewOnClickListener2) {
        ICommonDialogBuilder a2 = SimpleDialogBuilder.a(context);
        a2.d("添加直达,下次阅读更方便");
        a2.a((CharSequence) "加入直达");
        a2.c("取消");
        a2.a(str);
        a2.a(IDialogBuilderInterface.ImageStyle.MATCH_MARGIN);
        a2.a_(viewOnClickListener);
        a2.c(viewOnClickListener2);
        DialogBase d2 = a2.d();
        d2.show();
        NovelCollectGuidStat.a("guide_exposure", "007808");
        return d2;
    }

    private NovelOpSlotDataManager.bookOpSlotInfo a(NovelOpSlotDataManager.bookOpSlotInfo bookopslotinfo) {
        for (int i = 0; i < this.bb.size() && ((bookopslotinfo = this.bb.get(i)) == null || bookopslotinfo.e != 12); i++) {
        }
        return bookopslotinfo;
    }

    private void a(byte b2) {
        int i = b2 != 7 ? b2 != 8 ? b2 != 9 ? -1 : 51 : 52 : 33;
        IReader iReader = this.z;
        if (iReader == null || i == -1) {
            return;
        }
        iReader.doAction(i, null, null);
    }

    public void a(long j) {
        new NVRDownloadDialog(getContext(), StringUtils.a(j), new NVRDownloadDialog.onDialogClickListener() {
            @Override
            public void a() {
                MttToaster.show("下载中,请稍候", 0);
                NovelContentBasePage.this.a("下载完成", false);
            }

            @Override
            public void b() {
            }
        }).show();
    }

    private void a(Context context) {
        FrameLayout.LayoutParams layoutParams;
        FrameLayout.LayoutParams layoutParams2;
        NovelContentBottomBar novelContentBottomBar;
        this.B = new QBFrameLayout(getContext());
        this.B.setBackgroundNormalIds(0, R.color.novel_common_d4);
        this.B.setVisibility(4);
        FrameLayout.LayoutParams layoutParams3 = new FrameLayout.LayoutParams(-1, -2);
        layoutParams3.gravity = 48;
        this.D.addView(this.B, layoutParams3);
        if (this.aG) {
            this.A = new NovelContentFileTitleBar(getContext(), this, this.f55768a);
            this.A.setBackText(this.p);
            this.A.setChannel(this.az);
            this.A.a(this.f55768a.O, this.f55768a.f36399b, this.f55768a.f36400c, this.f55768a.g());
            this.A.a(NovelContentBasePageConst.s, NovelInterfaceImpl.getInstance().sContext.f54694c.h());
            layoutParams = new FrameLayout.LayoutParams(-1, this.ac);
        } else {
            this.A = new NovelContentTitleBar(getContext(), this, this.f55768a);
            this.A.setBackText(this.p);
            this.A.setChannel(this.az);
            this.A.a(this.f55768a.O, this.f55768a.f36399b, this.f55768a.f36400c, this.f55768a.g());
            this.A.a(NovelContentBasePageConst.s, NovelInterfaceImpl.getInstance().sContext.f54694c.h());
            layoutParams = new FrameLayout.LayoutParams(-1, this.ac);
        }
        layoutParams.gravity = 48;
        this.B.addView(this.A, layoutParams);
        this.A.b(this.aF);
        if (this.aG) {
            layoutParams2 = new FrameLayout.LayoutParams(-1, MttResources.s(56));
            layoutParams2.gravity = 80;
            novelContentBottomBar = new NovelContentBottomBarFile(getContext(), this, this.f55768a);
        } else {
            layoutParams2 = new FrameLayout.LayoutParams(-1, this.ad);
            layoutParams2.gravity = 80;
            novelContentBottomBar = new NovelContentBottomBar(getContext(), this, this.f55768a, this.aF);
        }
        this.C = novelContentBottomBar;
        this.C.setLayoutParams(layoutParams2);
        this.D.addView(this.C);
        this.D.setVisibility(0);
        r();
    }

    private void a(Bundle bundle) {
        Rect rect = new Rect(bundle.getInt("left"), bundle.getInt("top"), bundle.getInt("right"), bundle.getInt("bottom"));
        IReader iReader = this.z;
        if (iReader != null) {
            iReader.doAction(32, bundle, null);
        }
        String string = bundle.getString("selectContent");
        NovelEventLogger.a("callbackAction", "SHOW_SELECTMENU ...select Rect:" + rect + ", content:" + string, "NovelContentBasePage", "callbackAction");
        a(rect, string);
    }

    private void a(Object obj) {
        if (obj instanceof Bundle) {
            Bundle bundle = (Bundle) obj;
            int i = bundle.getInt("PageCount");
            int i2 = bundle.getInt("PageId");
            int i3 = bundle.getInt("ChapterId");
            NovelEventLogger.a("callbackAction", "NOTIFY_CHANGEPAGE: " + i2 + "/" + i + "/" + i3, "NovelContentBasePage", "callbackAction");
            NovelDataManager.q().r().a(this.f55768a.f36399b, i3, i2, i);
            this.aW = i2;
            this.aX = i3;
            if (i2 > 1) {
                O();
            }
        }
        if (this.aQ == null || !p() || q()) {
            return;
        }
        this.aQ.a(17, false);
    }

    public void a(String str) {
        f(this.f55768a.f36399b);
        Bundle bundle = new Bundle();
        bundle.putString("targetUrl", bg + "&ch=" + NovelNativeReaderGuideType.a().b());
        NovelManager.b().a(null, str, MttResources.l(R.string.aol), bundle);
    }

    public void a(String str, boolean z) {
        if (FeatureToggle.a(BuildConfig.FEATURE_TOGGLE_869305839)) {
            c(str, z);
        } else {
            b(str, z);
        }
    }

    private void a(boolean z, int i) {
        this.y = getNovelContext().t().a(this.z, i, z, this.f55768a.f36399b);
        int i2 = this.y;
        this.ah = i2 / 3;
        this.ai = (i2 * 79) / 100;
        this.af = (WindowManager.a().x().getWidth() * 32) / 100;
        this.ag = (WindowManager.a().x().getWidth() * 50) / 100;
    }

    public void a(boolean z, String str, boolean z2) {
        StatManager b2;
        String str2;
        if (z) {
            b2 = StatManager.b();
            str2 = "AKH149";
        } else {
            b2 = StatManager.b();
            str2 = "AKH57";
        }
        b2.c(str2);
        if (!f(str) && z2) {
            NovelManager.b().a(null, MttResources.l(R.string.aom), MttResources.l(R.string.aol), new Bundle());
        }
    }

    static boolean a(NovelInfoBean novelInfoBean) {
        return novelInfoBean.ao.intValue() == 0;
    }

    static boolean a(IFastCutItem iFastCutItem) {
        return ((IFastCutManager) QBContext.getInstance().getService(IFastCutManager.class)).hasExist(iFastCutItem);
    }

    private static boolean a(GetSwitchStatus getSwitchStatus) {
        return getSwitchStatus.c() && getSwitchStatus.b();
    }

    static boolean a(GetSwitchStatus getSwitchStatus, NovelInfoBean novelInfoBean, IFastCutItem iFastCutItem) {
        if (getSwitchStatus.c() && getSwitchStatus.a() && !a(novelInfoBean) && !a(iFastCutItem) && novelInfoBean.M != 1) {
            if (!PublicSettingManager.a().getBoolean("xhomeguid_" + novelInfoBean.f36399b, false)) {
                return true;
            }
        }
        return false;
    }

    static boolean a(GetSwitchStatus getSwitchStatus, IFastCutItem iFastCutItem, NovelInfoBean novelInfoBean) {
        if (!a(getSwitchStatus) || !getSwitchStatus.a() || ((IFastCutManager) QBContext.getInstance().getService(IFastCutManager.class)).hasExist(iFastCutItem)) {
            return false;
        }
        PublicSettingManager a2 = PublicSettingManager.a();
        StringBuilder sb = new StringBuilder();
        sb.append("xhomeguid_");
        sb.append(novelInfoBean.f36399b);
        return !a2.getBoolean(sb.toString(), false);
    }

    private void aa() {
        NovelContentOpBar novelContentOpBar = this.aE;
        if (novelContentOpBar != null) {
            novelContentOpBar.a();
        }
    }

    private void ab() {
        this.am = new Handler(Looper.getMainLooper()) {
            @Override
            public void handleMessage(Message message) {
                NovelContentBasePage novelContentBasePage;
                int i = message.what;
                if (i == 6) {
                    int i2 = message.arg1;
                    int i3 = 1;
                    if (i2 == 1) {
                        novelContentBasePage = NovelContentBasePage.this;
                    } else {
                        if (i2 != 0) {
                            return;
                        }
                        novelContentBasePage = NovelContentBasePage.this;
                        i3 = 0;
                    }
                    novelContentBasePage.a(i3);
                    return;
                }
                if (i == 7) {
                    NovelContentBasePage.this.g();
                    return;
                }
                if (i == 10) {
                    NovelContentBasePage.this.s();
                    return;
                }
                if (i == 12) {
                    if (message.obj instanceof QBViewInterface) {
                        ((QBViewInterface) message.obj).switchSkin();
                    }
                } else if (i == 18) {
                    NovelContentBasePage.this.a(true, (String) message.obj, g.I, false, false, null);
                } else if (i == 27) {
                    ((IMultiWindowService) QBContext.getInstance().getService(IMultiWindowService.class)).syncAllPageFrameNightMode();
                } else if (i == 30) {
                    NovelContentBasePage.this.E();
                } else {
                    if (i != 36) {
                        return;
                    }
                    NovelContentBasePage.this.ac();
                }
            }
        };
    }

    public void ac() {
        if (FeatureToggle.a(BuildConfig.FEATURE_TOGGLE_869305839)) {
            ((ITTSLoader) QBContext.getInstance().getService(ITTSLoader.class)).checkUpdate("key_novel", new ITTSLoader.CheckListener() {
                @Override
                public void onChecked(boolean z, long j) {
                    if (z) {
                        NovelContentBasePage.this.a(j);
                    } else {
                        NovelContentBasePage.this.a((String) null, false);
                    }
                }
            });
        } else {
            TTSLoader.a().a(new CheckDownCallBack() {
                @Override
                public void onChecked(boolean z, long j) {
                    if (z) {
                        NovelContentBasePage.this.a(j);
                    } else {
                        NovelContentBasePage.this.a((String) null, false);
                    }
                }
            });
        }
    }

    private void ad() {
        NovelCollectGuidStat.a("novel_reader_finish");
        NovelCollectGuidStat.a(((IBoot) SDKContext.getInstance().getService(IBoot.class)).isNewInstall() ? "new_novel_reader_finish" : "active_novel_reader_finish");
        NovelEventLogger.a("callbackAction", "NOTIFY_CANDISPLAY ...", "NovelContentBasePage", "callbackAction");
        if (this.ax) {
            this.av = true;
            this.ax = false;
        }
        a(this.ab == 1);
        b((ViewGroup) this.F);
        if (NovelInterfaceImpl.getInstance().sContext.f54694c.b() && !this.aG) {
            this.am.sendEmptyMessageDelayed(10, 500L);
        }
        this.at = false;
        this.H.invalidate();
        g(this.f55768a.g());
        f(200);
        this.am.sendEmptyMessage(30);
    }

    private void ae() {
        if (TextUtils.equals(this.aH, "1")) {
            ad();
            if (this.A == null || this.C == null) {
                a(ContextHolder.getAppContext());
            }
            this.am.removeMessages(36);
            this.am.sendEmptyMessageDelayed(36, 300L);
            this.aH = "0";
        }
        g(this.f55768a.g());
    }

    private void af() {
        if (this.v) {
            if (p()) {
                a(16, false);
            }
            a(false, true, 0, true);
        } else if (!p()) {
            a(true, true, 0, true);
        } else {
            a(15, false);
            a(true, true, 4, true);
        }
    }

    private void ag() {
        StatManager.b().c("AKH26");
        ShareBundle shareBundle = new ShareBundle(0);
        shareBundle.f45016d = NovelUrlUtils.a(this.f55768a.f36399b, getNovelContext());
        shareBundle.f = NovelUrlUtils.a(this.f55768a.f36399b, getNovelContext());
        shareBundle.m = 100;
        shareBundle.n = 10000;
        shareBundle.D = 11;
        shareBundle.y = 1001;
        shareBundle.f45014b = this.f55768a.f36400c;
        shareBundle.B = this;
        ((IFrameworkDelegate) QBContext.getInstance().getService(IFrameworkDelegate.class)).handleMttMessage(57, 0, 0, shareBundle, 0L);
    }

    private void ah() {
        ISearchEngineService iSearchEngineService;
        int i;
        IReader iReader = this.z;
        if (iReader != null) {
            iReader.doAction(33, null, null);
        }
        String extraText = this.P.getExtraText();
        if (TextUtils.isEmpty(extraText)) {
            return;
        }
        if (WindowManager.a().i()) {
            iSearchEngineService = (ISearchEngineService) QBContext.getInstance().getService(ISearchEngineService.class);
            if (iSearchEngineService != null) {
                i = 1;
                iSearchEngineService.doSearch(extraText, 26, i);
            }
            StatManager.b().c("H134");
        }
        iSearchEngineService = (ISearchEngineService) QBContext.getInstance().getService(ISearchEngineService.class);
        if (iSearchEngineService != null) {
            i = 2;
            iSearchEngineService.doSearch(extraText, 26, i);
        }
        StatManager.b().c("H134");
    }

    private void ai() {
        Logs.a("NovelContentTitleBar_Click_Discuss", (Object) IOpenJsApis.TRUE);
        StatManager.b().c("AKH41");
        if (this.A.b()) {
            return;
        }
        Bundle bundle = new Bundle();
        String str = "";
        QuanInfo n = NovelDataManager.q().n(this.f55768a.f36399b);
        if (TextUtils.isEmpty("") && n != null) {
            str = n.strUrl;
        }
        if (TextUtils.isEmpty(str)) {
            return;
        }
        bundle.putString("book_quan_info_url", str);
        bundle.putBoolean("book_quan_from_titlebar", true);
        bundle.putString("open_native_page_url", str);
        ((NovelBaseContainer) getNativeGroup()).a(30, bundle, true, (Object) this.f55768a);
    }

    private void aj() {
        NovelContentBottomBar novelContentBottomBar = this.C;
        if (novelContentBottomBar != null) {
            novelContentBottomBar.a(this.f55768a.f36399b, this.f55768a.g(), NovelInterfaceImpl.getInstance().sContext.f54694c.h());
        }
        this.A.a(NovelContentBasePageConst.s, false);
        StatManager.b().c("H113");
    }

    private void ak() {
        if (!TextUtils.isEmpty(getFromByChannel())) {
            ((IFileStatService) QBContext.getInstance().getService(IFileStatService.class)).statFileKeyEvent("menu", getFromByChannel(), getStartCallName(), null, "NR", QBPluginItemInfo.CONTENT_TXT, null);
        }
        new ReaderMoreView(getContext(), this.f55768a.Y, getNativeGroup(), this).show();
    }

    public void al() {
        QBListDialog qBListDialog = this.aT;
        if (qBListDialog != null) {
            qBListDialog.c();
        }
    }

    public void am() {
        NotificationBar notificationBar = new NotificationBar(MttResources.l(R.string.an_) + ", ", MttResources.l(R.string.aol), 3000);
        notificationBar.a(new View.OnClickListener() {
            @Override
            public void onClick(View view) {
                EventCollector.getInstance().onViewClickedBefore(view);
                NovelStorePage.a(NovelContentBasePage.bf + "&ch=" + NovelNativeReaderGuideType.a().b());
                StatManager.b().c("AKH322");
                EventCollector.getInstance().onViewClicked(view);
            }
        });
        notificationBar.c();
    }

    private void an() {
        NovelADFeedTabManager.getInstance().a(new NovelADFeedTabManager.IFeedTabOptListener() {
            @Override
            public void a(boolean z) {
                if (z) {
                    NovelADFeedTabManager.getInstance().c();
                }
                NovelADFeedTabManager.getInstance().b(this);
            }

            @Override
            public void b(boolean z) {
            }
        });
        QBTask.a(500L).a((Continuation<Void, TContinuationResult>) new Continuation<Void, Object>() {
            @Override
            public Object then(QBTask<Void> qBTask) throws Exception {
                NovelADFeedTabManager.getInstance().a();
                return null;
            }
        }, 6);
    }

    static Dialog b(Context context, String str, ViewOnClickListener viewOnClickListener, ViewOnClickListener viewOnClickListener2) {
        ICommonDialogBuilder a2 = SimpleDialogBuilder.a(context);
        a2.e("加入书架,下次阅读更方便");
        a2.a((CharSequence) "加入书架");
        a2.c("取消");
        a2.a(str);
        a2.a(IDialogBuilderInterface.ImageStyle.MATCH_MARGIN);
        a2.a_(viewOnClickListener);
        a2.c(viewOnClickListener2);
        DialogBase d2 = a2.d();
        d2.show();
        return d2;
    }

    static IFastCutItem b(final Bundle bundle) {
        return new DefaultFastCutItem() {
            @Override
            public String getFastCatIconUrl() {
                return "https://m4.publicimg.browser.qq.com/publicimg/nav/xhome/icon_local_txt.png";
            }

            @Override
            public String getFastCutDeepLink() {
                Bundle bundle2 = bundle;
                if (bundle2 == null || !bundle2.containsKey("book_local_file_path")) {
                    return "";
                }
                return "qb://xhomenovel?path=" + UrlUtils.encode(bundle.getString("book_local_file_path"));
            }

            @Override
            public String getFastCutId() {
                return null;
            }

            @Override
            public int getSourceId() {
                return 26;
            }

            @Override
            public String getTitle() {
                Bundle bundle2 = bundle;
                return (bundle2 == null || !bundle2.containsKey("book_title")) ? "" : bundle.getString("book_title");
            }
        };
    }

    private void b(NovelCallBackData novelCallBackData) {
        if ((novelCallBackData.l == 100 || novelCallBackData.l == 101) && novelCallBackData.f54279a && (novelCallBackData.f54282d instanceof OptContentRsp)) {
            if (novelCallBackData.A) {
                this.aY = this.aZ;
                if (this.aY.longValue() > 1000 || this.aY.longValue() < 0) {
                    return;
                }
                getNovelContext().n().a(true);
            }
        }
    }

    private void b(Object obj) {
        NovelEventLogger.a("callbackAction", "NOTIFY_ISATBEGIN ...", "NovelContentBasePage", "callbackAction");
        if (obj == null) {
            return;
        }
        Bundle bundle = (Bundle) obj;
        int g = this.f55768a.g();
        if (bundle.containsKey("ChapterId")) {
            g = bundle.getInt("ChapterId");
        }
        if (g != 1) {
            bundle.putBoolean("ret", false);
        } else {
            bundle.putBoolean("ret", true);
            MttToaster.show(R.string.ar6, 0);
        }
    }

    private void b(final String str, final boolean z) {
        LoaderListener loaderListener = new LoaderListener() {
            @Override
            public void onFinish(boolean z2) {
                if (!TextUtils.isEmpty(str)) {
                    MttToaster.show(str, 0);
                }
                if (z2) {
                    if (z) {
                        return;
                    }
                    NovelContentBasePage.this.D();
                } else {
                    if (z) {
                        return;
                    }
                    MttToaster.show("插件加载失败", 0);
                }
            }
        };
        TTSLoader a2 = TTSLoader.a();
        if (z) {
            a2.b(loaderListener);
        } else {
            a2.a(loaderListener);
        }
    }

    private void c(NovelCallBackData novelCallBackData) {
        if (novelCallBackData.f54279a && (novelCallBackData.f54282d instanceof GetWenxueAccountRsp)) {
            GetWenxueAccountRsp getWenxueAccountRsp = (GetWenxueAccountRsp) novelCallBackData.f54282d;
            if (this.aX != this.f55768a.g()) {
                this.aW = -1;
            }
            NovelSysConfig l = getNovelContext().l();
            if (getWenxueAccountRsp == null || this.aW > 1 || l == null || !l.bBalanceTipsOn) {
                return;
            }
            this.aZ = Long.valueOf(Math.max(0L, getWenxueAccountRsp.stAccountInfo.lFreeBalance + getWenxueAccountRsp.stAccountInfo.lBalance));
            P();
            this.aY = this.aZ;
        }
    }

    private void c(Object obj) {
        NovelEventLogger.a("callbackAction", "NOTIFY_ISATEND:" + obj, "NovelContentBasePage", "callbackAction");
        if (obj == null) {
            return;
        }
        Bundle bundle = (Bundle) obj;
        int g = this.f55768a.g();
        if (bundle.containsKey("ChapterId")) {
            g = bundle.getInt("ChapterId");
        }
        NovelEventLogger.a("callbackAction", "NOTIFY_ISATEND serialId=" + g + ", mBookInfo=" + this.f55768a, "NovelContentBasePage", "callbackAction");
        String str = this.f55768a.f36399b;
        NovelChapterInfo b2 = NovelDataManager.q().b(str, g);
        NovelEventLogger.a("callbackAction", "NOTIFY_ISATEND chapterInfo=" + b2, "NovelContentBasePage", "callbackAction");
        boolean z = this.f55768a.J == b2.k;
        bundle.putBoolean("ret", z);
        if (z) {
            if (p()) {
                a(14, true);
            }
            if (this.aG) {
                return;
            }
            this.an.a(getReadWords());
            return;
        }
        if (g >= this.f55768a.r) {
            Map<String, Boolean> map = NovelDataManager.q().e;
            if (map.containsKey(str) && map.get(str).booleanValue()) {
                a(1, 0);
            } else {
                NovelDataManager.q().a(this.f55768a, 0);
            }
            this.as = 1;
        }
    }

    private void c(final String str, final boolean z) {
        ITTSLoader.Listener listener = new ITTSLoader.Listener() {
            @Override
            public void onFinish(boolean z2) {
                if (!TextUtils.isEmpty(str)) {
                    MttToaster.show(str, 0);
                }
                if (z2) {
                    if (z) {
                        return;
                    }
                    NovelContentBasePage.this.D();
                } else {
                    if (z) {
                        return;
                    }
                    MttToaster.show("插件加载失败", 0);
                }
            }
        };
        ITTSLoader iTTSLoader = (ITTSLoader) QBContext.getInstance().getService(ITTSLoader.class);
        if (z) {
            iTTSLoader.preload("key_novel", listener);
        } else {
            iTTSLoader.load("key_novel", listener);
        }
    }

    private void d(final String str, final boolean z) {
        NewQBAlertDialogBuilder newQBAlertDialogBuilder = new NewQBAlertDialogBuilder();
        newQBAlertDialogBuilder.a(MttResources.l(R.string.ajo), 1);
        newQBAlertDialogBuilder.b(MttResources.l(h.l), 3);
        if (this.bb == null) {
            this.bb = NovelDataManager.q().u().a(this.f55768a.f36399b, false, 0);
        }
        ArrayList<NovelOpSlotDataManager.bookOpSlotInfo> arrayList = this.bb;
        if (arrayList != null && arrayList.size() > 0) {
            NovelOpSlotDataManager.bookOpSlotInfo a2 = a((NovelOpSlotDataManager.bookOpSlotInfo) null);
            long currentTimeMillis = System.currentTimeMillis();
            if (a2 != null) {
                if (a2.f <= currentTimeMillis) {
                    NovelDataManager.q().u().a(this.f55768a.f36399b);
                } else if (a2 != null && a2.f55077b != null && a2.f55077b.get() != null) {
                    newQBAlertDialogBuilder.a((Drawable) new BitmapDrawable(a2.f55077b.get()), false);
                    StatManager.b().c("AKH148");
                    z = true;
                }
                final QBAlertDialog a3 = newQBAlertDialogBuilder.a();
                a3.a(new View.OnClickListener() {
                    @Override
                    public void onClick(View view) {
                        EventCollector.getInstance().onViewClickedBefore(view);
                        if (view.getId() == 100) {
                            NovelContentBasePage.this.a(z, str, true);
                        }
                        a3.dismiss();
                        NovelContentBasePage.this.getNativeGroup().back(true);
                        EventCollector.getInstance().onViewClicked(view);
                    }
                });
                final long currentTimeMillis2 = System.currentTimeMillis();
                a3.a(new QBAlertDialogBase.HandleBackListener() {
                    @Override
                    public void a() {
                        if (System.currentTimeMillis() - currentTimeMillis2 > 500) {
                            a3.dismiss();
                        }
                    }
                });
                a3.show();
            }
        }
        newQBAlertDialogBuilder.b(MttResources.l(R.string.ajp));
        StatManager.b().c("AKH150");
        final QBAlertDialog a32 = newQBAlertDialogBuilder.a();
        a32.a(new View.OnClickListener() {
            @Override
            public void onClick(View view) {
                EventCollector.getInstance().onViewClickedBefore(view);
                if (view.getId() == 100) {
                    NovelContentBasePage.this.a(z, str, true);
                }
                a32.dismiss();
                NovelContentBasePage.this.getNativeGroup().back(true);
                EventCollector.getInstance().onViewClicked(view);
            }
        });
        final long currentTimeMillis22 = System.currentTimeMillis();
        a32.a(new QBAlertDialogBase.HandleBackListener() {
            @Override
            public void a() {
                if (System.currentTimeMillis() - currentTimeMillis22 > 500) {
                    a32.dismiss();
                }
            }
        });
        a32.show();
    }

    private void d(boolean z) {
        NovelContentTitleBarBase novelContentTitleBarBase;
        NovelContentTitleBarBase novelContentTitleBarBase2 = this.A;
        if (novelContentTitleBarBase2 != null && this.B != null) {
            ViewGroup.MarginLayoutParams marginLayoutParams = (ViewGroup.MarginLayoutParams) novelContentTitleBarBase2.getLayoutParams();
            marginLayoutParams.topMargin = NovelInterfaceImpl.getInstance().sContext.e.e();
            this.A.setLayoutParams(marginLayoutParams);
            ViewGroup.LayoutParams layoutParams = this.B.getLayoutParams();
            layoutParams.height = marginLayoutParams.topMargin + marginLayoutParams.height;
            this.B.setLayoutParams(layoutParams);
        }
        if (!z || (novelContentTitleBarBase = this.A) == null) {
            return;
        }
        novelContentTitleBarBase.setBackText(this.p);
    }

    private void e(boolean z) {
        b(true);
        NovelAutoReadController novelAutoReadController = this.aQ;
        if (novelAutoReadController != null) {
            novelAutoReadController.a(13, z);
            Activity a2 = ActivityHandler.b().a();
            if (a2 != null) {
                a2.getWindow().addFlags(128);
            }
        }
    }

    private boolean e(String str) {
        Map<String, Integer> map = NovelManager.b().f54221b;
        return !map.containsKey(str) || map.get(str).intValue() < 3;
    }

    public boolean f(String str) {
        if (!str.equalsIgnoreCase(this.f55768a.f36399b)) {
            return true;
        }
        NovelInfo novelInfo = new NovelInfo(this.f55768a);
        novelInfo.w = this.f55768a.d();
        novelInfo.s = this.q;
        novelInfo.A = getReadWords();
        novelInfo.ao = 0;
        getNovelContext().j().f54399d.b(novelInfo, 311);
        return false;
    }

    private void g(final String str) {
        NovelCollectGuidStat.a("addbook_popup_show");
        if (!NovelNativeReaderGuideType.a().f55957c) {
            C();
            return;
        }
        NewQBAlertDialogBuilder newQBAlertDialogBuilder = new NewQBAlertDialogBuilder();
        newQBAlertDialogBuilder.a(MttResources.l(R.string.ajk), 1);
        newQBAlertDialogBuilder.b(MttResources.l(h.l), 3);
        newQBAlertDialogBuilder.b(MttResources.l(R.string.ajj));
        final QBAlertDialog a2 = newQBAlertDialogBuilder.a();
        a2.a(new View.OnClickListener() {
            @Override
            public void onClick(View view) {
                EventCollector.getInstance().onViewClickedBefore(view);
                int id = view.getId();
                if (id == 100) {
                    if (NovelContentBasePage.this.f55768a != null) {
                        NovelCollectGuidStat.b("addbook_button_click", NovelContentBasePage.this.f55768a.f36399b);
                    }
                    NovelContentBasePage.this.a(false, str, false);
                    NovelContentBasePage.this.am();
                    StatManager.b().c("AKH321");
                } else if (id == 101 && NovelContentBasePage.this.f55768a != null) {
                    NovelCollectGuidStat.b("cancel_button_click", NovelContentBasePage.this.f55768a.f36399b);
                }
                a2.dismiss();
                NovelContentBasePage.this.getNativeGroup().back(true);
                EventCollector.getInstance().onViewClicked(view);
            }
        });
        a2.show();
        StatManager.b().c("AKH320");
    }

    public boolean A() {
        return false;
    }

    public void B() {
        StatManager.b().c("H112");
        WindowComponentExtension windowComponentExtension = (WindowComponentExtension) AppManifest.getInstance().queryExtension(WindowComponentExtension.class, null);
        if (windowComponentExtension != null) {
            windowComponentExtension.onBottonClick(3);
        }
    }

    public void C() {
        NovelCollectGuidStat.b("addbook_popup_show", this.f55768a.f36399b);
        b(getContext(), "https://m4.publicimg.browser.qq.com/publicimg/nav/novel/novel_collect_guid.png", new ViewOnClickListener() {
            @Override
            public void onClick(View view, DialogBase dialogBase) {
                if (NovelContentBasePage.this.f55768a != null && !TextUtils.isEmpty(NovelContentBasePage.this.f55768a.Y) && NovelContentBasePage.this.f55768a.Y.equals(PublicSettingManager.a().getString("last_open_path_in_wx", ""))) {
                    PublicSettingManager.a().setString("last_open_path_in_wx", "");
                }
                if (NovelContentBasePage.this.f55768a != null) {
                    NovelCollectGuidStat.b("addbook_button_click", NovelContentBasePage.this.f55768a.f36399b);
                }
                NovelContentBasePage novelContentBasePage = NovelContentBasePage.this;
                novelContentBasePage.f(novelContentBasePage.f55768a.f36399b);
                NovelStorePage.a(NovelContentBasePage.bg + "&ch=" + NovelNativeReaderGuideType.a().b());
            }
        }, new ViewOnClickListener() {
            @Override
            public void onClick(View view, DialogBase dialogBase) {
                if (NovelContentBasePage.this.f55768a != null) {
                    NovelCollectGuidStat.b("cancel_button_click", NovelContentBasePage.this.f55768a.f36399b);
                }
                dialogBase.dismiss();
                NovelContentBasePage.this.getNativeGroup().back(true);
            }
        });
    }

    void D() {
        if (this.ao == null) {
            this.ao = new NVRFacade();
            this.ao.a(this);
        }
        this.ao.a();
    }

    public void E() {
        G();
    }

    protected abstract void F();

    protected abstract void G();

    protected abstract void H();

    protected void I() {
        IReaderInstallerService iReaderInstallerService;
        String pluginPath = getPluginPath();
        if (TextUtils.isEmpty(pluginPath) && (iReaderInstallerService = (IReaderInstallerService) QBContext.getInstance().getService(IReaderInstallerService.class)) != null) {
            pluginPath = iReaderInstallerService.getReaderSharePath();
        }
        if (TextUtils.isEmpty(pluginPath)) {
            return;
        }
        if (!pluginPath.endsWith("/")) {
            pluginPath = pluginPath + "/";
        }
        this.z.setLibsPath(pluginPath, NovelFileUtils.c());
    }

    protected abstract boolean J();

    protected abstract void K();

    public abstract void L();

    public abstract void M();

    protected abstract void N();

    public void O() {
        AutoDismissView a2;
        if (this.H == null || (a2 = AutoDismissView.a(getNovelContext(), getContext(), this.H)) == null) {
            return;
        }
        a2.d();
    }

    void P() {
        Long.valueOf(getNovelContext().n().a());
        Object[] a2 = NovelUtils.a(getNovelContext(), this.aY.longValue(), this.aZ.longValue());
        if (getFunctionControllerStatus() == 0 && ((Boolean) a2[0]).booleanValue()) {
            View.OnClickListener onClickListener = new View.OnClickListener() {
                @Override
                public void onClick(View view) {
                    EventCollector.getInstance().onViewClickedBefore(view);
                    NovelContentBasePage.this.m();
                    EventCollector.getInstance().onViewClicked(view);
                }
            };
            AutoDismissView a3 = AutoDismissView.a(getNovelContext(), getContext(), this.H);
            a3.setOnClickListener(onClickListener);
            a3.setToast((String) a2[1]);
            a3.c();
            StatManager.b().c("AKH139");
        }
    }

    public void Q() {
        this.aI = true;
        NovelContentBottomBar novelContentBottomBar = this.C;
        if (novelContentBottomBar != null) {
            novelContentBottomBar.setSettingButtonState(false);
        }
        NovelVoiceManager.a().a(this.f55768a, this.z, this.ao);
    }

    public boolean R() {
        return this.aI;
    }

    public void S() {
        this.aI = false;
        this.ao = null;
        NovelContentBottomBar novelContentBottomBar = this.C;
        if (novelContentBottomBar != null) {
            novelContentBottomBar.setSettingButtonState(true);
        }
    }

    public void T() {
        NovelCollectGuidStat.a("booksh_click");
        if (NovelFastCutUtils.a(this.aN)) {
            ((ITempFile) QBContext.getInstance().getService(ITempFile.class)).movePreviewFileToExtractDir(this.f55768a.Y, new IMoveCallBack() {
                @Override
                public void a(boolean z) {
                    NovelContentBasePage novelContentBasePage;
                    int i;
                    if (z) {
                        String extractFilePath = ((ITempFile) QBContext.getInstance().getService(ITempFile.class)).getExtractFilePath();
                        String str = "qb://xhomenovel?path=" + UrlUtils.encode(extractFilePath);
                        NovelContentBasePage.this.f55768a.Y = extractFilePath;
                        NovelContentBasePage novelContentBasePage2 = NovelContentBasePage.this;
                        novelContentBasePage2.aN = NovelFastCutUtils.a(novelContentBasePage2.aN, str);
                        novelContentBasePage = NovelContentBasePage.this;
                        i = R.string.aon;
                    } else {
                        novelContentBasePage = NovelContentBasePage.this;
                        i = R.string.aom;
                    }
                    novelContentBasePage.a(MttResources.l(i));
                }
            });
            return;
        }
        f(this.f55768a.f36399b);
        Bundle bundle = new Bundle();
        bundle.putString("targetUrl", bg + "&ch=" + NovelNativeReaderGuideType.a().b());
        NovelManager.b().a(null, MttResources.l(R.string.aom), MttResources.l(R.string.aol), bundle);
    }

    public void U() {
        NovelCollectGuidStat.a("shortcut_click", "007808");
        if (NovelFastCutUtils.a(this.aN)) {
            NovelFastCutUtils.a(this.aN, new NovelFastCutUtils.ChangeCallBack() {
                @Override
                public void a(IFastCutItem iFastCutItem) {
                    NovelContentBasePage novelContentBasePage = NovelContentBasePage.this;
                    novelContentBasePage.aN = iFastCutItem;
                    if (novelContentBasePage.f55768a != null) {
                        NovelContentBasePage.this.f55768a.Y = ((ITempFile) QBContext.getInstance().getService(ITempFile.class)).getExtractFilePath();
                    }
                }
            });
        } else {
            ((IFastCutManager) QBContext.getInstance().getService(IFastCutManager.class)).addFastCut(this.aN, true, null);
            ((IFastCutManager) QBContext.getInstance().getService(IFastCutManager.class)).doReportAdd(this.aN, "", "");
        }
    }

    public boolean V() {
        return a((NovelInfoBean) this.f55768a);
    }

    public boolean W() {
        return this.f55770b;
    }

    protected boolean X() {
        return this.f55770b;
    }

    @Override
    public void a() {
        ViewCompat.a((View) this.B, 1.0f);
    }

    @Override
    public void a(float f, int i, int i2) {
    }

    public void a(int i) {
        if (this.E == null || this.O == null) {
            return;
        }
        int a2 = getNovelContext().t().a(this.f55768a.f36399b);
        int h = getNovelContext().t().h(this.g);
        int i2 = this.g;
        this.ab = i;
        if (i == 1) {
            this.O.a(i, MttResources.l(R.string.an7), a2, h, i2);
        } else if (i == 0) {
            this.O.a(i, MttResources.l((NovelInfo.a(this.f55768a.f36399b) || !this.f55768a.c()) ? R.string.anj : R.string.ani), a2, h, i2, NovelLocalBookUtils.h(this.f55768a.f36399b));
        }
        this.E.removeView(this.O);
        RelativeLayout.LayoutParams layoutParams = new RelativeLayout.LayoutParams(-1, -1);
        this.O.setVisibility(0);
        ViewGroup viewGroup = (ViewGroup) this.O.getParent();
        if (viewGroup != null) {
            viewGroup.removeView(this.O);
        }
        this.E.addView(this.O, layoutParams);
        if (i == 1) {
            this.U = System.currentTimeMillis();
        }
    }

    public void a(int i, int i2) {
        Message obtain = Message.obtain();
        obtain.arg1 = i;
        obtain.what = 6;
        this.am.sendMessageDelayed(obtain, i2);
    }

    void a(int i, boolean z) {
        if (this.z == null) {
            return;
        }
        switch (i) {
            case 11:
                setAutoReadSpeed(false);
                return;
            case 12:
                setAutoReadSpeed(true);
                return;
            case 13:
                e(z);
                return;
            case 14:
                b(false);
                NovelAutoReadController novelAutoReadController = this.aQ;
                if (novelAutoReadController != null) {
                    novelAutoReadController.a(i, z);
                    Activity a2 = ActivityHandler.b().a();
                    if (a2 != null) {
                        a2.getWindow().clearFlags(128);
                        return;
                    }
                    return;
                }
                return;
            case 15:
            case 16:
            case 17:
            case 18:
            case 19:
                NovelAutoReadController novelAutoReadController2 = this.aQ;
                if (novelAutoReadController2 != null) {
                    novelAutoReadController2.a(i, z);
                    return;
                }
                return;
            default:
                return;
        }
    }

    protected void a(Intent intent) {
        if (intent == null || this.z == null) {
            return;
        }
        this.V = intent.getIntExtra("level", -1) / intent.getIntExtra("scale", -1);
        this.z.doAction(30, String.valueOf(this.V), null);
    }

    @Override
    public void a(Rect rect) {
        NovelContentBottomBar novelContentBottomBar;
        if (this.A == null || (novelContentBottomBar = this.C) == null || rect == null) {
            return;
        }
        rect.top = 0;
        View menuContainer = novelContentBottomBar.getMenuContainer();
        Rect rect2 = new Rect();
        menuContainer.getDrawingRect(rect2);
        offsetDescendantRectToMyCoords(menuContainer, rect2);
        rect.bottom = rect2.bottom;
    }

    void a(Rect rect, String str) {
        if (this.P == null) {
            this.P = new SelectView(getContext(), MttResources.l(h.e), SelectView.f54828a, MttResources.l(h.u), SelectView.f54829b);
            this.P.setClickLintener(this);
        }
        this.P.a((FrameLayout) this, rect, str, false);
        a((View) this.P, true, (byte) 7);
    }

    @Override
    public void a(Bundle bundle, Object obj) {
        super.a(bundle, obj);
        b((ViewGroup) this.F);
        d(bundle);
        this.at = true;
        NovelContentBottomBar novelContentBottomBar = this.C;
        if (novelContentBottomBar != null) {
            novelContentBottomBar.a(this.f55768a);
        }
    }

    public void a(View view, boolean z, byte b2) {
        if (view == null) {
            return;
        }
        if (z) {
            if (view.getParent() != null && (view.getParent() instanceof ViewGroup)) {
                ((ViewGroup) view.getParent()).removeAllViews();
            }
            addView(view);
        } else {
            removeView(view);
        }
        this.al = z;
        this.ak = b2;
    }

    @Override
    public void a(NovelCallBackData novelCallBackData) {
        if (novelCallBackData.f54280b == 25) {
            c(novelCallBackData);
        }
        if (novelCallBackData.f54280b == 2) {
            b(novelCallBackData);
        }
    }

    public void a(NovelContentInfo novelContentInfo, int i, Boolean bool) {
        NovelCacheInfo a2;
        if (ActivityHandler.b().a() == null || this.z == null) {
            return;
        }
        if (!NovelInfo.a(this.f55768a.f36399b) && this.f55768a.e() > 0) {
            getNovelContext().w().a(this.f55768a, null, false);
        }
        t();
        a(AppBroadcastReceiver.a().f37836d);
        u();
        this.W = System.currentTimeMillis();
        NovelInfo novelInfo = this.f55768a;
        if (novelInfo == null || novelInfo.ab.intValue() != 1 || (a2 = getNovelContext().b().a(this.f55768a.f36399b)) == null || a2.f36289d != 3 || novelContentInfo == null || !novelContentInfo.v) {
            return;
        }
        NovelOfflineReadReport.a().a(1, this.f55768a);
    }

    public void a(QBTextView qBTextView) {
        qBTextView.setVisibility(8);
        NovelCollectGuidStat.a("booksh_click");
        if (NovelFastCutUtils.a(this.aN)) {
            ((ITempFile) QBContext.getInstance().getService(ITempFile.class)).movePreviewFileToExtractDir(this.f55768a.Y, new IMoveCallBack() {
                @Override
                public void a(boolean z) {
                    NovelContentBasePage novelContentBasePage;
                    int i;
                    if (z) {
                        String extractFilePath = ((ITempFile) QBContext.getInstance().getService(ITempFile.class)).getExtractFilePath();
                        String str = "qb://xhomenovel?path=" + ((ITempFile) QBContext.getInstance().getService(ITempFile.class)).getExtractFilePath();
                        NovelContentBasePage.this.f55768a.Y = extractFilePath;
                        NovelContentBasePage novelContentBasePage2 = NovelContentBasePage.this;
                        novelContentBasePage2.aN = NovelFastCutUtils.a(novelContentBasePage2.aN, str);
                        novelContentBasePage = NovelContentBasePage.this;
                        i = R.string.aon;
                    } else {
                        novelContentBasePage = NovelContentBasePage.this;
                        i = R.string.aom;
                    }
                    novelContentBasePage.a(MttResources.l(i));
                }
            });
            return;
        }
        f(this.f55768a.f36399b);
        Bundle bundle = new Bundle();
        bundle.putString("targetUrl", bg + "&ch=" + NovelNativeReaderGuideType.a().b());
        NovelManager.b().a(null, MttResources.l(R.string.aom), MttResources.l(R.string.aol), bundle);
    }

    public void a(QBTextView qBTextView, final NovelContentBasePage novelContentBasePage) {
        NovelCollectGuidStat.a("shortcut_click", "007808");
        qBTextView.setVisibility(8);
        if (NovelFastCutUtils.a(novelContentBasePage.aN)) {
            NovelFastCutUtils.a(novelContentBasePage.aN, new NovelFastCutUtils.ChangeCallBack() {
                @Override
                public void a(IFastCutItem iFastCutItem) {
                    NovelContentBasePage novelContentBasePage2 = novelContentBasePage;
                    novelContentBasePage2.aN = iFastCutItem;
                    if (novelContentBasePage2.f55768a != null) {
                        novelContentBasePage.f55768a.Y = ((ITempFile) QBContext.getInstance().getService(ITempFile.class)).getExtractFilePath();
                    }
                }
            });
        } else {
            ((IFastCutManager) QBContext.getInstance().getService(IFastCutManager.class)).addFastCut(novelContentBasePage.aN, true, new IFastCutManager.OnAddFastCutListener() {
                @Override
                public void onResult(int i) {
                    if (i == 0) {
                        NovelFastCutRepoter.a(novelContentBasePage.aN, WeChatMiniProgramConstant.LOG_TYPE_FLOW_VIDEO, "8");
                    }
                }
            });
        }
    }

    public void a(String str, int i, boolean z) {
        a(true, this, getNovelContext().t().b(this.f55768a.f36399b), this.F, this.p, str, i, z);
    }

    public void a(boolean z) {
        if (z) {
            if (this.U != -1) {
                long currentTimeMillis = System.currentTimeMillis() - this.U;
                this.am.sendEmptyMessageDelayed(7, currentTimeMillis < 500 ? 500 - currentTimeMillis : 0L);
                this.U = -1L;
            }
        } else if (ThreadUtils.isMainThread()) {
            this.O.setVisibility(4);
        }
        this.am.removeMessages(6);
        this.am.sendEmptyMessage(7);
        this.U = -1L;
    }

    public void a(boolean z, String str, int i, boolean z2, boolean z3, Object obj) {
        int i2;
        if (this.f55769ar || z3) {
            a(str, i, z2);
        } else if (z) {
            if (Apn.isNetworkConnected()) {
                i2 = R.string.afx;
                if (obj != null) {
                    MttToaster.show(MttResources.l(R.string.afx) + "(" + obj + ")", 0);
                }
            } else {
                i2 = R.string.akv;
            }
            MttToaster.show(i2, 0);
        }
        a(false);
    }

    public void a(boolean z, boolean z2, int i, boolean z3) {
        if (!z && (this.A == null || this.C == null)) {
            return;
        }
        if (this.A == null || this.C == null) {
            a(ContextHolder.getAppContext());
        }
        if (this.A == null || this.C == null) {
            return;
        }
        int i2 = this.ae;
        if (i2 != 0) {
            if (z == (i2 > 0)) {
                return;
            }
            PageBarAnimation pageBarAnimation = this.w;
            if (pageBarAnimation != null) {
                pageBarAnimation.a();
            }
            PageBarAnimation pageBarAnimation2 = this.x;
            if (pageBarAnimation2 != null) {
                pageBarAnimation2.a();
            }
        }
        this.ae = z ? 1 : -1;
        int n = BaseSettings.a().n();
        if (z) {
            if (!this.v) {
                StatManager.b().c("H23");
            }
            if (i <= 0 || !this.v) {
                d(true);
            }
            this.v = true;
            NovelInterfaceImpl.getInstance().sContext.e.a(false);
            if (i <= 0) {
                this.A.requestFocus();
                this.C.a(1, false, false);
                if (z2) {
                    ViewGroup.MarginLayoutParams marginLayoutParams = (ViewGroup.MarginLayoutParams) this.A.getLayoutParams();
                    this.w = new PageBarAnimation(this.B, -(marginLayoutParams.topMargin + marginLayoutParams.height), 0, true);
                    this.x = new PageBarAnimation(this.C, ((ViewGroup.MarginLayoutParams) this.C.getLayoutParams()).height, 0, true);
                    this.B.startAnimation(this.w);
                    this.C.startAnimation(this.x);
                } else {
                    this.B.setVisibility(0);
                    this.C.setVisibility(0);
                }
                NovelContentTitleBarBase novelContentTitleBarBase = this.A;
                if (novelContentTitleBarBase != null) {
                    novelContentTitleBarBase.a(this.f55768a.O, this.f55768a.f36399b, this.f55768a.f36400c, this.f55768a.g());
                }
                this.C.d();
                NovelContentTitleBarBase novelContentTitleBarBase2 = this.A;
                if (novelContentTitleBarBase2 != null) {
                    novelContentTitleBarBase2.b(this.f55768a);
                }
                if (!z2) {
                    this.ae = 0;
                }
                if (i == 6) {
                    if (z) {
                        setMiniFloatBarVisibility(0);
                    } else {
                        setMiniFloatBarVisibility(8);
                    }
                    IFunctionController iFunctionController = this.ao;
                    if (iFunctionController != null) {
                        iFunctionController.a(z);
                        return;
                    }
                    return;
                }
                return;
            }
            this.C.requestFocus();
            this.C.a(i, true, false);
            QBFrameLayout qBFrameLayout = this.B;
            if (z2) {
                if (qBFrameLayout.getVisibility() == 0) {
                    this.w = new PageBarAnimation(this.B, 0, -n, false);
                    this.B.startAnimation(this.w);
                }
                NovelContentBottomBar novelContentBottomBar = this.C;
                this.x = new PageBarAnimation(novelContentBottomBar, novelContentBottomBar.getHeight(), 0, true);
                this.C.startAnimation(this.x);
            } else {
                qBFrameLayout.setVisibility(4);
                this.C.setVisibility(0);
            }
        } else {
            if (z3) {
                NovelInterfaceImpl.getInstance().sContext.e.a(true);
                d(true);
            }
            this.v = false;
            QBFrameLayout qBFrameLayout2 = this.B;
            if (z2) {
                if (qBFrameLayout2.getVisibility() == 0) {
                    this.w = new PageBarAnimation(this.B, 0, -n, false);
                    this.B.startAnimation(this.w);
                }
                if (this.C.getVisibility() == 0) {
                    NovelContentBottomBar novelContentBottomBar2 = this.C;
                    this.x = new PageBarAnimation(novelContentBottomBar2, 0, novelContentBottomBar2.getHeight(), false);
                    this.C.startAnimation(this.x);
                }
            } else {
                qBFrameLayout2.setVisibility(4);
                this.C.setVisibility(4);
            }
            this.C.e();
        }
        this.A.a();
        if (!z2) {
        }
        if (i == 6) {
        }
    }

    public boolean a(boolean z, boolean z2) {
        if (z) {
            return z2 ? this.n > 1 : this.n < 21;
        }
        NovelAutoReadController novelAutoReadController = this.aQ;
        if (novelAutoReadController != null) {
            return novelAutoReadController.b(z2);
        }
        return false;
    }

    public Object[] a(String[] strArr) {
        return new Object[]{strArr, null};
    }

    @Override
    public void active() {
        NovelCollectGuidStat.b("novel_duration_start", this.f55768a.f36399b);
        ((NovelBaseContainer) getNativeGroup()).a(this.f55768a.f36399b);
        if (!TextUtils.isEmpty(this.az)) {
            ((NovelBaseContainer) getNativeGroup()).b(this.az);
        }
        getNovelContext().g().a(this.mPageAdapter);
        if (((NovelBaseContainer) getNativeGroup()).g) {
            getNovelContext().n().g().a((NovelDataListener) this);
        }
        super.active();
        if (!this.v) {
            setMiniFloatBarVisibility(8);
        }
        if (this.aV) {
            u();
        }
        post(new Runnable() {
            @Override
            public void run() {
                boolean m = NovelContentBasePage.this.getNovelContext().f54695d.m();
                Activity a2 = ActivityHandler.b().a();
                if (!m || a2 == null) {
                    return;
                }
                CommonUtils.a(a2.getWindow(), NovelContentBasePage.this.getNovelContext().f54695d.n());
            }
        });
        this.an.a(this, this.p);
        if (p()) {
            postDelayed(new Runnable() {
                @Override
                public void run() {
                    NovelContentBasePage.this.a(16, false);
                }
            }, 500L);
        }
        IFunctionController iFunctionController = this.ao;
        if (iFunctionController != null) {
            iFunctionController.d();
        }
        getNovelContext().f().a((AppBroadcastObserver) this);
        NovelScreenLockController novelScreenLockController = this.bd;
        if (novelScreenLockController != null) {
            novelScreenLockController.b();
        }
    }

    public int b(int i, int i2) {
        boolean z;
        boolean z2 = QBUIAppEngine.getInstance().getApplicationContext().getResources().getConfiguration().orientation == 1;
        this.f55772d = getNovelContext().f54695d.c();
        this.e = NovelInterfaceImpl.getInstance().sContext.f54694c.s();
        int af = DeviceUtils.af();
        if (this.f55772d == 7) {
            z = i2 < this.ah;
            if (i2 > this.ah * 2) {
                r1 = true;
            }
        } else if (z2) {
            boolean z3 = (i <= this.af && i2 <= this.ai) | (i <= this.ag && this.ai <= i2 && i2 <= this.y);
            boolean z4 = i >= af - this.af && i2 <= this.ai;
            int i3 = this.y;
            int i4 = this.ai;
            if (i >= i3 - i4 && i4 <= i2 && i2 <= i3) {
                r1 = true;
            }
            r1 |= z4;
            z = z3;
        } else {
            boolean z5 = i < (this.af * 4) / 3;
            r1 = i > ((this.af * 4) / 3) * 2;
            z = z5;
        }
        return z ? this.e ? 3 : 1 : r1 ? 3 : 2;
    }

    void b(boolean z) {
        if (!this.aP && z) {
            QBView qBView = new QBView(getContext());
            LinearLayout.LayoutParams layoutParams = new LinearLayout.LayoutParams(-1, -1);
            layoutParams.gravity = 3;
            layoutParams.weight = 1.0f;
            this.G.addView(qBView, layoutParams);
            NovelAutoReadTimeLine novelAutoReadTimeLine = new NovelAutoReadTimeLine(getContext(), NovelInterfaceImpl.getInstance().sContext);
            this.aQ = new NovelAutoReadController(this.z, novelAutoReadTimeLine);
            LinearLayout.LayoutParams layoutParams2 = new LinearLayout.LayoutParams(MttResources.h(R.dimen.v9), -1);
            layoutParams2.gravity = 5;
            this.G.addView(novelAutoReadTimeLine, layoutParams2);
            this.aP = true;
        }
        this.G.setVisibility(z ? 0 : 8);
    }

    public void b(boolean z, boolean z2) {
        IReader iReader = this.z;
        if (iReader != null) {
            iReader.doAction(z ? 17 : 18, Boolean.valueOf(z2), null);
        }
    }

    public boolean b() {
        NovelBackPayGuideDlgBase novelBackPayGuideDlgBase = this.T;
        if (novelBackPayGuideDlgBase != null && novelBackPayGuideDlgBase.isShowing()) {
            return false;
        }
        String str = this.f55768a.f36399b;
        NovelInfo a2 = getNovelContext().j().f54398c.a(this.f55768a, 0);
        if (((a2 != null && a2.ao.intValue() == 1) || this.aF) && e(str)) {
            return true;
        }
        if (a2 == null) {
            return e(str);
        }
        return false;
    }

    public boolean b(int i) {
        return this.v && (i < 0 || this.C.z == i);
    }

    @Override
    public boolean bE_() {
        return true;
    }

    @Override
    public void bG_() {
        ViewCompat.a((View) this.B, 0.0f);
    }

    public void bH_() {
        NovelInterfaceImpl.getInstance().sContext.e.b();
        FrameLayout.LayoutParams layoutParams = (FrameLayout.LayoutParams) this.E.getLayoutParams();
        this.y = getNovelContext().t().a(this.z, 0, getNovelContext().f54694c.n() == 1, this.f55768a.f36399b);
        layoutParams.topMargin = NovelInterfaceImpl.getInstance().sContext.e.f();
        layoutParams.height = this.y;
        this.E.setLayoutParams(layoutParams);
        d(true);
    }

    public void bI_() {
        if (!FeatureToggle.a(qb.novelplugin.BuildConfig.FEATURE_TOGGLE_NATIVE_READER_BACK_866911613) && X()) {
            getNativeGroup().back(true);
            return;
        }
        this.aJ = true;
        String str = this.f55768a.f36399b;
        if (NovelInfo.a(this.f55768a.f36399b)) {
            g(str);
        } else {
            d(str, false);
        }
        Map<String, Integer> map = NovelManager.b().f54221b;
        map.put(str, !map.containsKey(str) ? 1 : Integer.valueOf(map.get(str).intValue() + 1));
    }

    @Override
    public void bK_() {
        ViewCompat.a((View) this.C, 1.0f);
    }

    public void c(int i) {
        a(getNovelContext().f54694c.n() == 1, i);
    }

    public void c(Bundle bundle) {
        F();
        d(bundle);
        this.aK = NovelVoiceManager.a().a(this.f55768a);
        NovelVoiceManager.VoiceStrutHolder voiceStrutHolder = this.aK;
        if (voiceStrutHolder == null || !voiceStrutHolder.a()) {
            this.aK = null;
            NovelVoiceManager.a().b();
        }
        e();
        H();
        aa();
    }

    protected void c(String str) {
    }

    protected abstract void c(boolean z);

    @Override
    public void callbackAction(int i, Object obj, Object obj2) {
        String str;
        IFunctionController iFunctionController = this.ao;
        if (iFunctionController != null) {
            iFunctionController.a(i, obj, obj2);
        }
        if (i == 6) {
            a(obj);
            return;
        }
        if (i != 30) {
            if (i == 35 || i == 59) {
                ae();
                return;
            }
            switch (i) {
                case 11:
                    if (this.v) {
                        NovelEventLogger.a("callbackAction", "NOTIFY_STARTGESTURE mBarShowing:" + this.v, "NovelContentBasePage", "callbackAction");
                    }
                    ((Bundle) obj2).putBoolean("gesture", !this.v);
                    return;
                case 12:
                    ad();
                    return;
                case 13:
                    b(obj);
                    return;
                case 14:
                    c(obj);
                    return;
                default:
                    switch (i) {
                        case 16:
                            NovelEventLogger.a("callbackAction", "SHOW_LOADING ...", "NovelContentBasePage", "callbackAction");
                            a(1, 500);
                            return;
                        case 17:
                            NovelEventLogger.a("callbackAction", "HIDE_LOADING ...", "NovelContentBasePage", "callbackAction");
                            a(true);
                            return;
                        case 18:
                            str = "NOTIFY_CHANGEFONTSIZEEND ...";
                            break;
                        case 19:
                            int intValue = ((Integer) obj2).intValue();
                            NovelEventLogger.a("callbackAction", "NOTIFY_ERRORCODE errorcode:" + intValue, "NovelContentBasePage", "callbackAction");
                            h(intValue);
                            return;
                        case 20:
                            a((Bundle) obj);
                            return;
                        case 21:
                            NovelEventLogger.a("callbackAction", "HIDE_SELECTMENU ...", "NovelContentBasePage", "callbackAction");
                            n();
                            return;
                        case 22:
                            NovelEventLogger.a("callbackAction", "ENTER_SELECTMODE ...", "NovelContentBasePage", "callbackAction");
                            BrowserExecutorSupplier.postForBackgroundTasks(new BrowserExecutorSupplier.BackgroundRunable() {
                                @Override
                                public void doRun() {
                                    DeviceUtils.a(new long[]{10, 20}, true);
                                }
                            });
                            StatManager.b().c("H132");
                            return;
                        case 23:
                            str = "EXIT_SELECTMODE ...";
                            break;
                        default:
                            return;
                    }
                    NovelEventLogger.a("callbackAction", str, "NovelContentBasePage", "callbackAction");
                    return;
            }
        }
    }

    @Override
    public boolean canGoBack() {
        if (this.v || this.al) {
            return true;
        }
        return !(NovelInfo.a(this.f55768a.f36399b) || !b() || this.aJ) || p();
    }

    @Override
    public boolean coverAddressBar() {
        return true;
    }

    @Override
    public void d() {
        ViewCompat.a((View) this.C, 0.0f);
    }

    public void d(Bundle bundle) {
        boolean z;
        String string;
        int i;
        Long valueOf;
        Long valueOf2;
        NovelInfo novelInfo;
        int d2;
        if (bundle == null) {
            return;
        }
        Set<String> keySet = bundle.keySet();
        StringBuilder sb = new StringBuilder();
        for (String str : keySet) {
            if (str.equals("Content")) {
                String str2 = (String) bundle.get(str);
                sb.append(str);
                sb.append(ContainerUtils.KEY_VALUE_DELIMITER);
                sb.append(TextUtils.isEmpty(str2) ? IAPInjectService.EP_NULL : str2.substring(0, Math.min(10, str2.length())));
            } else {
                sb.append(str);
                sb.append(ContainerUtils.KEY_VALUE_DELIMITER);
                sb.append(bundle.get(str));
            }
            sb.append(Constants.ACCEPT_TIME_SEPARATOR_SP);
        }
        NovelUserSetting novelUserSetting = getNovelContext().f54695d;
        if (bundle.containsKey("ch")) {
            this.az = bundle.getString("ch");
        }
        if (TextUtils.isEmpty(this.az) && bundle.containsKey("book_url_channel")) {
            this.az = bundle.getString("book_url_channel");
        }
        if (bundle.containsKey("open_content_from_file")) {
            this.bc = bundle.getBoolean("open_content_from_file");
        }
        boolean z2 = true;
        if (bundle.containsKey("from_out_type")) {
            if (TextUtils.equals(bundle.getString("from_out_type"), "0")) {
                this.aF = true;
                this.aG = false;
            } else {
                this.aG = true;
                this.aF = false;
            }
        }
        if (bundle.containsKey("open_from_tts_history")) {
            this.aH = bundle.getString("open_from_tts_history");
        }
        UserSettingManager.b().setBoolean("open_content_from_wx_qq", this.aG);
        this.f55772d = novelUserSetting.c();
        this.e = NovelInterfaceImpl.getInstance().sContext.f54694c.s();
        this.f = novelUserSetting.d() * 5;
        this.n = novelUserSetting.i();
        this.g = novelUserSetting.e();
        this.h = novelUserSetting.g();
        this.o = NovelInterfaceImpl.getInstance().sContext.f54694c.q();
        boolean l = SkinManager.s().l();
        NovelEventLogger.a(PEConst.DESC.MEDIA_DESC_KEY_RECORD_Init, "init data mSwitchPageOption:" + this.f55772d + ", mLstUserDiscussShow:" + this.o + ", mCacheChapterNum:" + this.f + ", mCurrentFontSize:" + this.n + ", mCurrentSkin:" + this.g + ", mCurrentLineSpace:" + this.h + ",nightMode:" + l, "NovelContentBasePage", "initData");
        if (this.g == 2 && !l) {
            this.g = novelUserSetting.f();
            novelUserSetting.c(this.g);
            novelUserSetting.a(true);
            NovelEventLogger.a(PEConst.DESC.MEDIA_DESC_KEY_RECORD_Init, "NovelLastSkin:" + this.g, "NovelContentBasePage", "initData");
        }
        int i2 = this.g;
        if (i2 != 2 && l) {
            novelUserSetting.e(i2);
            this.g = 2;
            novelUserSetting.c(this.g);
            novelUserSetting.a(true);
        }
        this.f55768a = new NovelInfo();
        if (bundle.containsKey("book_copyright_cp_id")) {
            this.f55768a.O = bundle.getInt("book_copyright_cp_id");
        }
        if (bundle.containsKey("book_id")) {
            String string2 = bundle.getString("book_id");
            NovelDataManager.q().r().a(string2, 0, 0, 0);
            NovelEventLogger.a(PEConst.DESC.MEDIA_DESC_KEY_RECORD_Init, "initData info:" + this.f55768a, "NovelContentBasePage", "initData");
            this.f55768a.f36399b = string2;
            NovelInfo a2 = getNovelContext().j().f54398c.a(this.f55768a, 2);
            if (a2 == null) {
                z = true;
                if (this.f55768a != null) {
                    if (bundle.containsKey("book_max_free_num") && this.f55768a.W <= 0) {
                        long j = bundle.getLong("book_max_free_num", -1L);
                        if (j > 0) {
                            this.f55768a.W = j;
                        }
                    }
                    if (bundle.containsKey("book_price") && ((this.f55768a.R == null || this.f55768a.R.longValue() <= 0) && (valueOf2 = Long.valueOf(bundle.getLong("book_price"))) != null && valueOf2.longValue() > 0)) {
                        this.f55768a.R = valueOf2;
                    }
                    if (bundle.containsKey("book_letter_price") && ((this.f55768a.S == null || this.f55768a.S.longValue() <= 0) && (valueOf = Long.valueOf(bundle.getLong("book_letter_price"))) != null && valueOf.longValue() > 0)) {
                        this.f55768a.S = valueOf;
                    }
                    if (this.f55768a.R != null && this.f55768a.R.longValue() > 0) {
                        this.f55768a.Q = 2;
                    } else if (this.f55768a.S == null || this.f55768a.S.longValue() <= 0) {
                        this.f55768a.Q = 0;
                    } else {
                        this.f55768a.Q = 1;
                    }
                    if (bundle.containsKey("book_pay_type")) {
                        this.f55768a.Q = bundle.getInt("book_pay_type");
                        NovelEventLogger.a(PEConst.DESC.MEDIA_DESC_KEY_RECORD_Init, "initData payType:" + this.f55768a.Q, "NovelContentBasePage", "initData");
                    }
                    if (bundle.containsKey("book_title")) {
                        this.f55768a.f36400c = bundle.getString("book_title");
                    }
                    if (bundle.containsKey("book_serial_id")) {
                        this.f55768a.d(bundle.getInt("book_serial_id"));
                    }
                    if (bundle.containsKey("book_chapter_id")) {
                        this.f55768a.M = bundle.getInt("book_chapter_id");
                    }
                    if (bundle.containsKey("book_serial_num") && (i = bundle.getInt("book_serial_num")) > 0) {
                        this.f55768a.r = i;
                    }
                    if (bundle.containsKey("book_last_serial_name")) {
                        this.f55768a.K = bundle.getString("book_last_serial_name");
                    }
                    if (bundle.containsKey("book_from_where")) {
                        this.p = bundle.getString("book_from_where");
                    }
                    if (bundle.containsKey("book_author_name")) {
                        this.f55768a.f = bundle.getString("book_author_name");
                    }
                    if (bundle.containsKey("book_is_finish")) {
                        this.f55768a.m = bundle.getInt("book_is_finish");
                    }
                    if (bundle.containsKey("book_last_update_time")) {
                        this.f55768a.n = bundle.getLong("book_last_update_time");
                    }
                }
                if (bundle.containsKey("book_orign_pic_url")) {
                    this.q = bundle.getString("book_orign_pic_url");
                }
                if (bundle.containsKey("book_content_from_channel")) {
                    String string3 = bundle.getString("book_content_from_channel");
                    if (!TextUtils.isEmpty(string3)) {
                        this.r = string3;
                    }
                }
                if (bundle.containsKey("book_thumbnail_url")) {
                    this.t = bundle.getString("book_thumbnail_url");
                }
                this.s = this.f55768a.A;
                if (bundle.containsKey("book_use_words")) {
                    this.u = bundle.getInt("book_use_words");
                }
                if (bundle.containsKey("book_local_file_path")) {
                    this.f55768a.Y = bundle.getString("book_local_file_path");
                }
                if (bundle.containsKey("book_support_type")) {
                    this.f55768a.ab = Integer.valueOf(bundle.getInt("book_support_type"));
                }
                string = bundle.containsKey("book_url_channel") ? bundle.getString("book_url_channel") : null;
                if (!TextUtils.isEmpty(string)) {
                    this.au = "ch=" + string;
                }
                boolean z3 = !bundle.containsKey("book_get_novel_info") ? bundle.getBoolean("book_get_novel_info") : false;
                NovelEventLogger.a(PEConst.DESC.MEDIA_DESC_KEY_RECORD_Init, "addNovelReadHistory:" + z + ", getNovelInfo:" + z3, "NovelContentBasePage", "initData");
                this.f55770b = NovelInfo.a(this.f55768a.f36399b);
                this.f55771c = NovelLocalBookUtils.c(this.f55768a.f36399b);
                if (this.f55771c == 1) {
                    StatManager.b().c("AKH297");
                }
                if (z) {
                    if (z3 || (((this.f55768a.R != null && this.f55768a.R.longValue() > 0) || (this.f55768a.S != null && this.f55768a.S.longValue() > 0)) && this.f55768a.W > 0 && this.f55768a.W < this.f55768a.r)) {
                        z2 = z3;
                    }
                    if (z2) {
                        getNovelContext().k().b(this.f55768a.f36399b, this.f55768a.N, 311);
                    }
                } else {
                    NovelInfo novelInfo2 = this.f55768a;
                    novelInfo2.E = 1;
                    if (novelInfo2.ab.intValue() == 2 || this.f55768a.ab.intValue() == 3) {
                        this.f55768a.ad = 1;
                    }
                    getNovelContext().j().f.a(this.f55768a, 311);
                }
                if (this.f55771c == 0 && !this.f55768a.l()) {
                    NovelCacheManager.b().a(this.f55768a);
                }
                NovelDataManager.q().c(this.f55768a.f36399b);
                this.an = new NovelContentAfterPage.Starter(this.f55768a);
                this.an.a(this, this.p);
                this.aV = false;
                NovelDataManager.q().u().a(this.f55768a.f36399b, false, 0);
                NovelEventLogger.a(PEConst.DESC.MEDIA_DESC_KEY_RECORD_Init, "initData() -> mBookInfo = " + this.f55768a + ", 当前的渠道号=" + NovelInterfaceImpl.getInstance().sContext.f.f55233b + ", 正文上报用的渠道号=" + this.au, "NovelContentBasePage", "initData");
            }
            this.f55768a = a2;
            if (bundle.containsKey("book_serial_id")) {
                d2 = bundle.getInt("book_serial_id");
                novelInfo = this.f55768a;
            } else {
                novelInfo = this.f55768a;
                d2 = a2.d();
            }
            novelInfo.d(d2);
        }
        z = false;
        if (this.f55768a != null) {
        }
        if (bundle.containsKey("book_orign_pic_url")) {
        }
        if (bundle.containsKey("book_content_from_channel")) {
        }
        if (bundle.containsKey("book_thumbnail_url")) {
        }
        this.s = this.f55768a.A;
        if (bundle.containsKey("book_use_words")) {
        }
        if (bundle.containsKey("book_local_file_path")) {
        }
        if (bundle.containsKey("book_support_type")) {
        }
        if (bundle.containsKey("book_url_channel")) {
        }
        if (!TextUtils.isEmpty(string)) {
        }
        if (!bundle.containsKey("book_get_novel_info")) {
        }
        NovelEventLogger.a(PEConst.DESC.MEDIA_DESC_KEY_RECORD_Init, "addNovelReadHistory:" + z + ", getNovelInfo:" + z3, "NovelContentBasePage", "initData");
        this.f55770b = NovelInfo.a(this.f55768a.f36399b);
        this.f55771c = NovelLocalBookUtils.c(this.f55768a.f36399b);
        if (this.f55771c == 1) {
        }
        if (z) {
        }
        if (this.f55771c == 0) {
            NovelCacheManager.b().a(this.f55768a);
        }
        NovelDataManager.q().c(this.f55768a.f36399b);
        this.an = new NovelContentAfterPage.Starter(this.f55768a);
        this.an.a(this, this.p);
        this.aV = false;
        NovelDataManager.q().u().a(this.f55768a.f36399b, false, 0);
        NovelEventLogger.a(PEConst.DESC.MEDIA_DESC_KEY_RECORD_Init, "initData() -> mBookInfo = " + this.f55768a + ", 当前的渠道号=" + NovelInterfaceImpl.getInstance().sContext.f.f55233b + ", 正文上报用的渠道号=" + this.au, "NovelContentBasePage", "initData");
    }

    public void d(String str) {
        String str2 = FileUtils.n() + File.separator + MediaFileType.a((byte) 5) + File.separator + this.j.get("book_title") + ".txt";
        FileUtils.c(str, str2);
        this.j.putString("book_local_file_path", str2);
        this.aN = b(this.j);
        this.f55768a.Y = str2;
    }

    @Override
    public void deactive() {
        super.deactive();
        NovelCollectGuidStat.a("novel_duration_finish", this.f55768a.f36399b, this.f55768a.g(), this.f55768a.r);
        NovelDataManager.q().r().a(this.f55768a.f36399b);
        setMiniFloatBarVisibility(0);
        getNovelContext().f().f();
        NovelScreenLockController novelScreenLockController = this.bd;
        if (novelScreenLockController != null) {
            novelScreenLockController.c();
        }
    }

    @Override
    public void destroy() {
        if (getNovelContext() != null && getNovelContext().f != null) {
            getNovelContext().f.f55234d = "";
        }
        NovelDataManager.q().r().a(this.f55768a.f36399b);
        getNovelContext().w().a(this.f55768a.f36399b);
        getNovelContext().n().b(this);
        getNovelContext().n().g();
        getNovelContext().w().a();
        ((NovelAdDataManager) getNovelContext().u()).a(3);
        KeyEventHandler.b(this);
        NovelContentBottomBar novelContentBottomBar = this.C;
        if (novelContentBottomBar != null) {
            novelContentBottomBar.c();
            this.C = null;
        }
        NovelContentTitleBarBase novelContentTitleBarBase = this.A;
        if (novelContentTitleBarBase != null) {
            novelContentTitleBarBase.c();
            this.A = null;
        }
        NovelAutoReadController novelAutoReadController = this.aQ;
        if (novelAutoReadController != null) {
            novelAutoReadController.d();
        }
        if (!this.aI) {
            K();
            this.ao = null;
        }
        this.am.removeMessages(32);
        this.am.removeCallbacksAndMessages(null);
        AutoDismissView.e();
        super.destroy();
        setMiniFloatBarVisibility(0);
        NovelScreenLockController novelScreenLockController = this.bd;
        if (novelScreenLockController != null) {
            novelScreenLockController.e();
        }
    }

    @Override
    protected void dispatchDraw(Canvas canvas) {
        super.dispatchDraw(canvas);
        if (!this.aV) {
            this.aV = true;
        }
        if (this.av && this.aw) {
            this.av = false;
            this.aw = false;
            this.am.sendEmptyMessage(30);
        }
    }

    @Override
    public boolean dispatchKeyEvent(KeyEvent keyEvent) {
        int keyCode = keyEvent.getKeyCode();
        if (keyCode == 25 || keyCode == 24) {
            if (p()) {
                return false;
            }
            if (NovelInterfaceImpl.getInstance().sContext.f54694c.r()) {
                if (keyEvent.getAction() == 0 || keyEvent.getAction() == 2) {
                    if (keyCode == 24) {
                        return onVolumeUpKeyDown();
                    }
                    if (keyCode == 25) {
                        return onVolumeDownKeyDown();
                    }
                }
                return true;
            }
            if (FastPageManager.a().a(keyEvent, true, new View.OnClickListener() {
                @Override
                public void onClick(View view) {
                    EventCollector.getInstance().onViewClickedBefore(view);
                    NovelContentBasePage.this.getNovelContext().f54694c.m(view.getId() == 100);
                    EventCollector.getInstance().onViewClicked(view);
                }
            })) {
                return true;
            }
        } else {
            if (keyEvent.getAction() == 1 && keyCode == 82) {
                a(!this.v, true, 0, true);
                return true;
            }
            if (keyEvent.getAction() == 0) {
                if (keyCode != 66) {
                    switch (keyCode) {
                        case 19:
                        case 21:
                            if (getFocusedChild() == null) {
                                this.an.a(false, getReadWords());
                                IReader iReader = this.z;
                                if (iReader != null) {
                                    iReader.doAction(18, null, null);
                                }
                                return true;
                            }
                            break;
                        case 20:
                        case 22:
                            if (getFocusedChild() == null) {
                                this.an.a(true, getReadWords());
                                IReader iReader2 = this.z;
                                if (iReader2 != null) {
                                    iReader2.doAction(17, null, null);
                                }
                                return true;
                            }
                            break;
                    }
                }
                if (!super.dispatchKeyEvent(keyEvent)) {
                    a(!this.v, true, 0, true);
                }
                return true;
            }
        }
        return super.dispatchKeyEvent(keyEvent);
    }

    @Override
    public boolean dispatchTouchEvent(MotionEvent motionEvent) {
        if (this.al) {
            return super.dispatchTouchEvent(motionEvent);
        }
        if (!this.aG) {
            this.an.a(motionEvent);
        }
        return super.dispatchTouchEvent(motionEvent);
    }

    protected void e() {
        Context context = getContext();
        this.E = new QBFrameLayout(context);
        this.y = WindowManager.a().x().getHeight();
        addView(this.E, new FrameLayout.LayoutParams(-1, this.y));
        FrameLayout.LayoutParams layoutParams = new FrameLayout.LayoutParams(-1, -1);
        this.H = new ContainerFrameLayout(context);
        this.H.setWillNotDraw(true);
        this.E.addView(this.H, layoutParams);
        this.G = new QBLinearLayout(context);
        this.G.setVisibility(8);
        this.E.addView(this.G, layoutParams);
        if (this instanceof NovelContentPage) {
            this.aE = new NovelContentOpBar(context, getNovelContext(), this.f55768a, (NovelContentPage) this);
            this.aE.setVisibility(8);
            FrameLayout.LayoutParams layoutParams2 = new FrameLayout.LayoutParams(-2, MttResources.s(32));
            layoutParams2.topMargin = NotchUtil.a(context) ? MttResources.s(16) + BaseSettings.a().m() : MttResources.s(16);
            layoutParams2.gravity = 53;
            this.E.addView(this.aE, layoutParams2);
        }
        this.F = new QBFrameLayout(context);
        this.F.setVisibility(8);
        this.E.addView(this.F, layoutParams);
        this.D = new QBFrameLayout(context);
        this.D.setVisibility(8);
        this.D.setClickable(false);
        this.E.addView(this.D, layoutParams);
        this.O = new NovelLoadingView(context, getNovelContext());
        if (this.bc || this.aG || this.aF) {
            a(true, false, 0, true);
        }
        a(0, 0);
    }

    public void e(int i) {
        int i2;
        int i3;
        SkinManager s = SkinManager.s();
        NovelUserSetting novelUserSetting = getNovelContext().f54695d;
        NovelExternalSetting novelExternalSetting = NovelInterfaceImpl.getInstance().sContext.f54694c;
        if (i == NovelContentBasePageConst.f54181a) {
            M();
            return;
        }
        if (i == NovelContentBasePageConst.f54182b) {
            L();
            return;
        }
        int i4 = 2;
        if (i == NovelContentBasePageConst.f54183c) {
            NovelCollectGuidStat.a("catalog_click");
            Bundle bundle = new Bundle();
            bundle.putInt("book_bg_color", NovelInterfaceImpl.getInstance().sContext.t().a(this.g, this.f55768a.f36399b));
            bundle.putInt("book_cur_skin", getCurrentSkin());
            bundle.putInt("book_cur_skin", getCurrentSkin());
            if (this.f55771c == 3 || this.f55768a.l()) {
                i4 = 3;
            } else if (this.f55771c != 2) {
                i4 = 0;
            }
            bundle.putInt("book_file_type", i4);
            bundle.putString("book_from_where", this.p);
            bundle.putBoolean("key_book_pay_state", this.aD);
            ((NovelBaseContainer) getNativeGroup()).a(25, bundle, true, (Object) this.f55768a);
            StatManager.b().c("H25");
            NovelContentBottomBar novelContentBottomBar = this.C;
            if (novelContentBottomBar != null) {
                novelContentBottomBar.a(1, false, false);
                return;
            }
            return;
        }
        if (i == NovelContentBasePageConst.r) {
            Bundle bundle2 = new Bundle();
            bundle2.putString("book_title", this.f55768a.f36400c);
            bundle2.putString("book_author_name", this.f55768a.f);
            bundle2.putString("book_serial_name", this.f55768a.x);
            bundle2.putString("book_id", this.f55768a.f36399b);
            ((NovelBaseContainer) getNativeGroup()).a(27, bundle2, true, (Object) null);
            return;
        }
        if (i != NovelContentBasePageConst.A) {
            if (i == NovelContentBasePageConst.P || i == NovelContentBasePageConst.H) {
                NovelDataManager.q().u().b(this.f55768a.f36399b, false, 0);
                ac();
                return;
            }
            if (i == NovelContentBasePageConst.h || i == NovelContentBasePageConst.O) {
                NovelCollectGuidStat.a("autopageturning_click");
                if (this.aI) {
                    MttToaster.show("请先退出语音阅读才能自动翻页", 0);
                    return;
                } else {
                    StatManager.b().c("AKH2");
                    i2 = 13;
                }
            } else if (i == NovelContentBasePageConst.k) {
                i2 = 14;
            } else {
                if (i == NovelContentBasePageConst.l) {
                    i3 = 18;
                } else {
                    if (i != NovelContentBasePageConst.m) {
                        if (i == NovelContentBasePageConst.i) {
                            a(11, false);
                            return;
                        }
                        if (i == NovelContentBasePageConst.j) {
                            a(12, false);
                            return;
                        }
                        if (i == NovelContentBasePageConst.w) {
                            Bundle bundle3 = new Bundle();
                            bundle3.putString("book_id", this.f55768a.f36399b);
                            bundle3.putInt("book_serial_num", this.f55768a.r);
                            bundle3.putInt("book_serial_id", this.f55768a.g());
                            bundle3.putInt("book_import_src_cp_id", this.f55768a.N);
                            bundle3.putInt("book_pay_auto", this.f55768a.U);
                            if (this.f55770b) {
                                bundle3.putString("key_prefetch_tip", MttResources.l(R.string.as0));
                            }
                            bundle3.putBoolean("key_local_novel", this.f55770b);
                            ((NovelBaseContainer) getNativeGroup()).a(26, bundle3, true, (Object) this.f55768a);
                            return;
                        }
                        if (i == NovelContentBasePageConst.p) {
                            a(false);
                            a(1, 500);
                            return;
                        }
                        if (i == NovelContentBasePageConst.q) {
                            NovelCollectGuidStat.a("multiwindow_click");
                            B();
                            return;
                        }
                        if (i == NovelContentBasePageConst.n) {
                            StatManager.b().c("H42");
                            setFontSize(true);
                            return;
                        }
                        if (i == NovelContentBasePageConst.o) {
                            setFontSize(false);
                            return;
                        }
                        if (i == 1 || i == 6 || i == 7 || i == 3 || i == 4 || i == 5) {
                            NovelCollectGuidStat.a("colourcontrol_click");
                            boolean l = s.l();
                            StatManager.b().c("H45");
                            if (this.g != i) {
                                this.g = i;
                                novelUserSetting.c(this.g);
                                novelUserSetting.e(this.g);
                                novelUserSetting.a(true);
                                if (!l) {
                                    getNovelContext().t().a(this.z, this.f55768a.f36399b);
                                }
                            }
                            if (l) {
                                s.c(PublicSettingManager.a().getString("key_last_skin_name_6_8", "lsjd"));
                                return;
                            }
                            return;
                        }
                        if (i == 8 || i == 9 || i == 10 || i == 11 || i == 12) {
                            if (this.h != i) {
                                this.h = i;
                                novelUserSetting.d(this.h);
                                getNovelContext().t().a(this.z, this.h);
                                return;
                            }
                            return;
                        }
                        if (i != NovelConstant.f55101a) {
                            if (i == NovelContentBasePageConst.e) {
                                NovelCollectGuidStat.a("set_click");
                                a(true, true, 3, true);
                                return;
                            } else if (i == NovelContentBasePageConst.z) {
                                NovelCollectGuidStat.a("landscape_click");
                                getNovelContext().g().a();
                                getNovelContext().g().a(this.mPageAdapter);
                                return;
                            } else {
                                if (i == NovelContentBasePageConst.g) {
                                    a(true, true, 2, true);
                                    return;
                                }
                                return;
                            }
                        }
                        if (System.currentTimeMillis() - this.ba < 500) {
                            return;
                        }
                        NovelCollectGuidStat.a("nightmode_click");
                        if (s.l()) {
                            s.c(PublicSettingManager.a().getString("key_last_skin_name_6_8", "lsjd"));
                            this.g = novelUserSetting.f();
                        } else {
                            s.c("night_mode");
                            novelUserSetting.e(this.g);
                            this.g = 2;
                        }
                        novelUserSetting.c(this.g);
                        novelUserSetting.a(true);
                        this.am.removeMessages(27);
                        this.am.sendEmptyMessageDelayed(27, 500L);
                        this.ba = System.currentTimeMillis();
                        return;
                    }
                    i3 = 19;
                }
                a(i3, false);
            }
            a(i2, true);
        }
        a(false, true, 0, true);
    }

    public void f() {
        IReader iReader = this.z;
        if (iReader != null) {
            iReader.toFinish();
            this.z.setListener(null);
            this.z = null;
        }
    }

    public void f(int i) {
        if (this.z != null) {
            int readWords = getReadWords();
            NovelEventLogger.a("callbackAction", "saveReadInfoToDB get position end:" + readWords, "NovelContentBasePage", "saveReadProgress");
            if (readWords < 0) {
                readWords = 0;
            }
            getNovelContext().j().a(this.f55768a);
            getNovelContext().j().f.a(this.f55768a, i, readWords);
        }
    }

    public void g() {
        if (this.E == null || this.O == null) {
            return;
        }
        if (this.av) {
            this.aw = true;
        }
        this.E.removeView(this.O);
    }

    public void g(int i) {
        NovelInfo novelInfo;
        int i2;
        NovelChapterInfo b2 = NovelDataManager.q().b(this.f55768a.f36399b, i);
        if (b2 != null && this.f55768a.f36399b.equals(b2.f54468a) && i == b2.f54469b) {
            if (!TextUtils.isEmpty(b2.f54470c) && this.f55768a.d() != i) {
                this.f55768a.x = b2.f54470c;
            }
            if (b2.k > 0) {
                novelInfo = this.f55768a;
                i2 = b2.k;
                novelInfo.M = i2;
            }
        } else {
            NovelContentInfo a2 = NovelDataManager.q().a(this.f55768a.f36399b, i);
            if (a2 != null) {
                if (!TextUtils.isEmpty(a2.h)) {
                    this.f55768a.x = a2.h;
                }
                if (a2.f54474c > 0) {
                    novelInfo = this.f55768a;
                    i2 = a2.f54474c;
                    novelInfo.M = i2;
                }
            }
        }
        this.f55768a.b(i);
        this.f55768a.D = 0;
        f(10);
    }

    @Override
    public int getBottomExtraHeight() {
        return MttResources.s(108);
    }

    public String getCallFromRecent() {
        char c2;
        String str = this.az;
        switch (str.hashCode()) {
            case 1420131039:
                if (str.equals("004674")) {
                    c2 = 0;
                    break;
                }
                c2 = 65535;
                break;
            case 1420131040:
                if (str.equals("004675")) {
                    c2 = 1;
                    break;
                }
                c2 = 65535;
                break;
            case 1420131041:
                if (str.equals("004676")) {
                    c2 = 2;
                    break;
                }
                c2 = 65535;
                break;
            default:
                c2 = 65535;
                break;
        }
        if (c2 == 0) {
            return "XT";
        }
        if (c2 == 1) {
            return "docs_recent_all";
        }
        if (c2 != 2) {
            return null;
        }
        return "QQ";
    }

    public String getCallerNameFromRecent() {
        char c2;
        String str = this.az;
        switch (str.hashCode()) {
            case 1420131039:
                if (str.equals("004674")) {
                    c2 = 0;
                    break;
                }
                c2 = 65535;
                break;
            case 1420131040:
                if (str.equals("004675")) {
                    c2 = 1;
                    break;
                }
                c2 = 65535;
                break;
            case 1420131041:
                if (str.equals("004676")) {
                    c2 = 2;
                    break;
                }
                c2 = 65535;
                break;
            default:
                c2 = 65535;
                break;
        }
        if (c2 == 0) {
            return "XT";
        }
        if (c2 == 1) {
            return TbsMode.PR_QB;
        }
        if (c2 != 2) {
            return null;
        }
        return "QQ";
    }

    public int getCurrentLineSpace() {
        return this.h;
    }

    public int getCurrentSkin() {
        return this.g;
    }

    public String getFromByChannel() {
        char c2;
        String str = this.az;
        switch (str.hashCode()) {
            case 1420131039:
                if (str.equals("004674")) {
                    c2 = 1;
                    break;
                }
                c2 = 65535;
                break;
            case 1420131040:
                if (str.equals("004675")) {
                    c2 = 0;
                    break;
                }
                c2 = 65535;
                break;
            case 1420131041:
                if (str.equals("004676")) {
                    c2 = 2;
                    break;
                }
                c2 = 65535;
                break;
            default:
                c2 = 65535;
                break;
        }
        if (c2 == 0) {
            return "TBS";
        }
        if (c2 == 1) {
            return "XT";
        }
        if (c2 != 2) {
            return null;
        }
        return "QQ";
    }

    int getFunctionControllerStatus() {
        IFunctionController iFunctionController = this.ao;
        if (iFunctionController != null) {
            return iFunctionController.j();
        }
        return 0;
    }

    @Override
    public IPage.INSTANT_TYPE getInstType() {
        return IPage.INSTANT_TYPE.SIGLE_TYPE_IN_GLOBAL;
    }

    @Override
    public String getPageTitle() {
        NovelInfo novelInfo = this.f55768a;
        return novelInfo != null ? novelInfo.f36400c : super.getPageTitle();
    }

    protected String getPluginPath() {
        return null;
    }

    public int getReadWords() {
        Bundle bundle = new Bundle();
        IReader iReader = this.z;
        if (iReader != null) {
            iReader.doAction(8, null, bundle);
        }
        return bundle.getInt("Position");
    }

    protected abstract boolean getReaderMode();

    protected abstract int getReaderType();

    public String getStartCallName() {
        char c2;
        String str = this.az;
        switch (str.hashCode()) {
            case 1420131039:
                if (str.equals("004674")) {
                    c2 = 1;
                    break;
                }
                c2 = 65535;
                break;
            case 1420131040:
                if (str.equals("004675")) {
                    c2 = 0;
                    break;
                }
                c2 = 65535;
                break;
            case 1420131041:
                if (str.equals("004676")) {
                    c2 = 2;
                    break;
                }
                c2 = 65535;
                break;
            default:
                c2 = 65535;
                break;
        }
        if (c2 == 0) {
            return "WX";
        }
        if (c2 == 1) {
            return TbsMode.PR_QB;
        }
        if (c2 != 2) {
            return null;
        }
        return "QQ";
    }

    public void h(int i) {
        String str;
        int i2;
        if (i == 0) {
            return;
        }
        if (i == 401) {
            i2 = R.string.aku;
        } else if (i == 402) {
            i2 = R.string.akz;
        } else {
            if (i != 400) {
                str = "";
                this.am.obtainMessage(18, str).sendToTarget();
            }
            i2 = R.string.aky;
        }
        str = MttResources.l(i2);
        this.am.obtainMessage(18, str).sendToTarget();
    }

    @Override
    public void handleMenu() {
        boolean z;
        if (this.ak == 6 && this.al) {
            return;
        }
        int i = 0;
        if (this.al) {
            byte b2 = this.ak;
            if (b2 == 7 || b2 == 8 || b2 == 9) {
                a(this.ak);
                return;
            } else {
                a(this.aj, false, (byte) 0);
                return;
            }
        }
        if (!this.v) {
            StatManager.b().c("H23");
        }
        IFunctionController iFunctionController = this.ao;
        if (iFunctionController == null || !iFunctionController.h()) {
            if (this.v) {
                if (p()) {
                    a(16, false);
                }
                a(false, true, 0, true);
            } else {
                if (p()) {
                    a(15, false);
                    z = !this.v;
                    i = 4;
                } else {
                    z = !this.v;
                }
                a(z, true, i, true);
            }
        }
    }

    public abstract boolean i(int i);

    public abstract void j(int i);

    void m() {
        getNovelContext().y().a(ActivityHandler.b().a(), 0, this, null);
        if (getNovelContext().f54692a == 0) {
            StatManager.b().c("AKH140");
        }
    }

    public void n() {
        a((View) this.P, false, (byte) 0);
    }

    @Override
    public boolean needHandleMenu() {
        return true;
    }

    @Override
    public void notifyScrollThumbRatio(float f) {
    }

    public void o() {
        if (this.z != null) {
            return;
        }
        NvQltRpt nvQltRpt = new NvQltRpt(4, this.f55768a.f36399b + Constants.ACCEPT_TIME_SEPARATOR_SERVER + this.f55768a.g());
        try {
            this.z = NovelReaderPool.a().a(getReaderType(), getPluginPath(), J());
            if (this.z == null) {
                MttToaster.show(R.string.alg, 0);
                nvQltRpt.c("102");
            }
        } catch (Exception e) {
            MttToaster.show(R.string.alg, 0);
            nvQltRpt.c("100").e(e.toString());
        }
    }

    @Override
    protected void onAttachedToWindow() {
        super.onAttachedToWindow();
        this.aR = true;
    }

    @Override
    public boolean onBackPressed() {
        an();
        if (this.al) {
            byte b2 = this.ak;
            if (b2 != 6 && b2 != 10) {
                if (b2 == 7 || b2 == 8 || b2 == 9) {
                    a(this.ak);
                } else if (b2 == 4) {
                    a(this.aj, false, (byte) 0);
                }
            }
            return false;
        }
        if (this.v) {
            if (p()) {
                NovelContentBottomBar novelContentBottomBar = this.C;
                if (novelContentBottomBar == null || novelContentBottomBar.z != 6) {
                    a(16, false);
                    a(false, true, 0, true);
                } else {
                    a(14, false);
                }
                return false;
            }
            a(false, true, 0, true);
        }
        if (p()) {
            a(14, true);
            return true;
        }
        if (!FeatureToggle.a(qb.novelplugin.BuildConfig.FEATURE_TOGGLE_NATIVE_READER_BACK_866911613)) {
            GetSwitchStatus a2 = new GetSwitchStatus().a(this.f55768a.f36399b);
            if (A()) {
                return true;
            }
            if (!a(a2) ? !b() || this.aJ : a2.a() || !b() || this.aJ) {
                QBTask.a(100L).a((Continuation<Void, TContinuationResult>) new Continuation<Void, Object>() {
                    @Override
                    public Object then(QBTask<Void> qBTask) throws Exception {
                        NovelCollectGuidStat.a("systemback_click");
                        NovelContentBasePage.this.bI_();
                        return null;
                    }
                }, 6);
                return true;
            }
            if (a(a2, this.aN, this.f55768a)) {
                PublicSettingManager.a().setBoolean("xhomeguid_" + this.f55768a.f36399b, true);
                w();
                return true;
            }
            if (!this.aF || !this.aL) {
                if (this.aI) {
                    setMiniFloatBarVisibility(0);
                }
                return super.onBackPressed();
            }
            if (this.aI) {
                setMiniFloatBarVisibility(0);
            }
            NovelStorePage.a("qb://home/feeds?tabId=22&ch=004665");
            this.aL = false;
            return true;
        }
        GetSwitchStatus a3 = new GetSwitchStatus().a(this.f55768a.f36399b);
        if (A()) {
            return true;
        }
        if (a(a3, this.f55768a, this.aN)) {
            PublicSettingManager.a().setBoolean("xhomeguid_" + this.f55768a.f36399b, true);
            a(false, true, 0, true);
            C();
            return true;
        }
        if (!a(a3) ? !b() || this.aJ : a3.a() || !b() || this.aJ) {
            QBTask.a(100L).a((Continuation<Void, TContinuationResult>) new Continuation<Void, Object>() {
                @Override
                public Object then(QBTask<Void> qBTask) throws Exception {
                    NovelCollectGuidStat.a("systemback_click");
                    if (NovelInfo.a(NovelContentBasePage.this.f55768a.f36399b)) {
                        NovelContentBasePage.this.getNativeGroup().back(true);
                        return null;
                    }
                    NovelContentBasePage.this.bI_();
                    return null;
                }
            }, 6);
            return true;
        }
        if (!this.aF || !this.aL) {
            if (this.aI) {
                setMiniFloatBarVisibility(0);
            }
            return super.onBackPressed();
        }
        if (this.aI) {
            setMiniFloatBarVisibility(0);
        }
        NovelStorePage.a("qb://home/feeds?tabId=22&ch=004665");
        this.aL = false;
        return true;
    }

    @Override
    public void onBroadcastReceiver(final Intent intent) {
        if (intent == null) {
            return;
        }
        try {
            QBTask.b((Callable) new Callable<Object>() {
                @Override
                public Object call() throws Exception {
                    if (intent.getAction().equals("android.intent.action.TIME_TICK") || intent.getAction().equals("android.intent.action.TIME_SET") || intent.getAction().equals("android.intent.action.TIMEZONE_CHANGED")) {
                        String format = new SimpleDateFormat("HH:mm").format(new Date(System.currentTimeMillis()));
                        if (NovelContentBasePage.this.z != null) {
                            NovelContentBasePage.this.z.doAction(29, format, null);
                        }
                    } else if (intent.getAction().equals("android.intent.action.BATTERY_CHANGED")) {
                        NovelContentBasePage.this.a(intent);
                    }
                    return null;
                }
            });
        } catch (Throwable unused) {
        }
    }

    @Override
    public void onClick(View view) {
        EventCollector.getInstance().onViewClickedBefore(view);
        int id = view.getId();
        if (id == NovelContentBasePageConst.M) {
            if (!W()) {
                ak();
            }
            v();
        } else if (id == NovelContentBasePageConst.f || id == NovelContentBasePageConst.N || id == 302) {
            x();
        } else if (id == NovelContentBasePageConst.s) {
            aj();
        } else if (id == NovelContentBasePageConst.J) {
            if (!W()) {
                Logs.a("NovelContentTitleBar_Click_More", (Object) IOpenJsApis.TRUE);
                StatManager.b().c("AKH42");
                if (this.v) {
                    a(false, false, 0, true);
                }
                y();
            }
            v();
        } else if (id == NovelContentBasePageConst.L) {
            StatManager.b().c("AKH298");
            NovelStorePage.a(NovelUrlUtils.b() + "&ch=004665");
            PlatformStatUtils.a("NOVELBOTTOMBARJUMPURL_1");
        } else if (id == NovelContentBasePageConst.I) {
            ai();
        } else if (id == NovelContentBasePageConst.B) {
            ag();
        } else if (id == 301) {
            N();
        } else if (id == SelectView.f54828a) {
            IReader iReader = this.z;
            if (iReader != null) {
                iReader.doAction(33, null, null);
            }
            ClipboardManager.getInstance().setText(this.P.getExtraText());
            MttToaster.show(MttResources.l(h.A), 0);
            StatManager.b().c("H133");
        } else if (id == SelectView.f54829b) {
            ah();
        } else if (id == NovelContentBasePageConst.q) {
            B();
        } else {
            int i = NovelContentBasePageConst.K;
        }
        EventCollector.getInstance().onViewClicked(view);
    }

    @Override
    protected void onConfigurationChanged(Configuration configuration) {
        super.onConfigurationChanged(configuration);
        bH_();
    }

    @Override
    protected void onDetachedFromWindow() {
        super.onDetachedFromWindow();
        this.aR = false;
    }

    @Override
    public void onScaleBegin(float f) {
    }

    @Override
    public void onScaleEnd(float f) {
    }

    @Override
    public void onScroll(float f) {
    }

    @Override
    public void onScrollBegin(float f) {
        if (this.v) {
            a(false, true, 0, true);
            if (p()) {
                a(16, false);
            }
        }
    }

    @Override
    public void onScrollEnd(float f) {
    }

    @Override
    public void onSingleTap(int i, int i2) {
        BaseNativeGroup nativeGroup = getNativeGroup();
        if (nativeGroup == null || !nativeGroup.isAnimating()) {
            int b2 = b(i, i2);
            IFunctionController iFunctionController = this.ao;
            if (iFunctionController == null || !iFunctionController.a(i, i2, b2)) {
                if (this.v) {
                    if (p()) {
                        a(16, false);
                    }
                    a(false, true, 0, true);
                    return;
                }
                if (b2 != 1) {
                    if (b2 == 2) {
                        af();
                        return;
                    } else if (b2 != 3) {
                        return;
                    }
                }
                if (p() && q()) {
                    a(15, false);
                    a(true, true, 4, true);
                } else {
                    c(b2 == 3);
                    b(b2 == 3, false);
                }
            }
        }
    }

    @Override
    protected void onSizeChanged(int i, int i2, int i3, int i4) {
        if (this.z != null) {
            if (getNovelContext().f54695d.e() == 4 && !SkinManager.s().l()) {
                getNovelContext().t().a(this.z, this.f55768a.f36399b);
            }
            if ((i < i2) == (getNovelContext().f54694c.n() == 1)) {
                c(i2 - getNovelContext().e.f());
            }
            bH_();
            this.z.doAction(27, true, null);
        }
        super.onSizeChanged(i, i2, i3, i4);
    }

    @Override
    public void onStart() {
        super.onStart();
        NovelCollectGuidStat.b("novel_duration_start", this.f55768a.f36399b);
        IFunctionController iFunctionController = this.ao;
        if (iFunctionController != null) {
            iFunctionController.f();
        }
        getNovelContext().n().a((NovelDataListener) this);
        NovelScreenLockController novelScreenLockController = this.bd;
        if (novelScreenLockController != null) {
            novelScreenLockController.b();
        }
    }

    @Override
    public void onStop() {
        super.onStop();
        NovelCollectGuidStat.b("novel_duration_finish", this.f55768a.f36399b);
        IFunctionController iFunctionController = this.ao;
        if (iFunctionController != null) {
            iFunctionController.g();
        }
        NovelScreenLockController novelScreenLockController = this.bd;
        if (novelScreenLockController != null) {
            novelScreenLockController.c();
        }
    }

    @Override
    public boolean onVolumeDownKeyDown() {
        if (!NovelInterfaceImpl.getInstance().sContext.f54694c.r() || this.aI || this.z == null) {
            return false;
        }
        if (!this.al) {
            this.an.a(true, getReadWords());
            this.z.doAction(17, null, null);
            a(false, true, 0, true);
            return true;
        }
        byte b2 = this.ak;
        if (b2 == 7 || b2 == 8 || b2 == 9) {
            a(this.ak);
        } else if (b2 == 6 || b2 == 2 || b2 == 5) {
            a(this.aj, false, (byte) 0);
        }
        return true;
    }

    @Override
    public boolean onVolumeUpKeyDown() {
        if (!NovelInterfaceImpl.getInstance().sContext.f54694c.r() || this.aI || this.z == null) {
            return false;
        }
        if (!this.al) {
            this.an.a(false, getReadWords());
            this.z.doAction(18, null, null);
            a(false, true, 0, true);
            return true;
        }
        byte b2 = this.ak;
        if (b2 == 7 || b2 == 8 || b2 == 9) {
            a(this.ak);
        } else if (b2 == 6 || b2 == 2 || b2 == 5) {
            a(this.aj, false, (byte) 0);
        }
        return true;
    }

    @Override
    @Deprecated
    public void openBookFailed() {
    }

    @Override
    public boolean overrideSnapshot() {
        return true;
    }

    public boolean p() {
        NovelAutoReadController novelAutoReadController = this.aQ;
        return novelAutoReadController != null && novelAutoReadController.a();
    }

    @Override
    public void preDeactive() {
        super.preDeactive();
        getNovelContext().e.c();
        if (p()) {
            a(15, false);
        }
        IFunctionController iFunctionController = this.ao;
        if (iFunctionController != null) {
            iFunctionController.e();
        }
        f(150);
    }

    public boolean q() {
        NovelAutoReadController novelAutoReadController = this.aQ;
        return novelAutoReadController != null && novelAutoReadController.b();
    }

    protected void r() {
    }

    public void s() {
        if (NovelInterfaceImpl.getInstance().sContext.f54694c.b()) {
            if (!NovelNativeReaderGuideType.a().f55956b) {
                a(true, false, 0, true);
                return;
            }
            NovelInterfaceImpl.getInstance().sContext.f54694c.d(false);
            this.aj = new NovelTouchTipView(getContext(), this.y, R.color.w8) {
                @Override
                public boolean onKeyDown(int i, KeyEvent keyEvent) {
                    return true;
                }

                @Override
                public boolean onKeyUp(int i, KeyEvent keyEvent) {
                    return true;
                }

                @Override
                public boolean onTouchEvent(MotionEvent motionEvent) {
                    if (2 == NovelContentBasePage.this.b((int) motionEvent.getRawX(), (int) motionEvent.getRawY())) {
                        NovelContentBasePage novelContentBasePage = NovelContentBasePage.this;
                        novelContentBasePage.a(novelContentBasePage.aj, false, (byte) 0);
                        NovelContentBasePage.this.a(true, false, 0, true);
                        PlatformStatUtils.a("NOVEL_GESTURE_GUIDE_HIDE");
                    }
                    return true;
                }
            };
            this.aj.setLayoutParams(new RelativeLayout.LayoutParams(-1, -1));
            a(this.aj, true, (byte) 6);
            PlatformStatUtils.a("NOVEL_GESTURE_GUIDE_SHOW");
        }
    }

    public void setAutoReadSpeed(boolean z) {
        NovelAutoReadController novelAutoReadController = this.aQ;
        if (novelAutoReadController == null) {
            return;
        }
        NovelContentBottomBar novelContentBottomBar = this.C;
        if (z) {
            novelContentBottomBar.a(false, true, novelAutoReadController.a(z));
        } else {
            novelContentBottomBar.a(false, novelAutoReadController.a(z), true);
        }
        this.C.c(this.aQ.c());
    }

    public void setFontSize(boolean z) {
        if (z) {
            this.n++;
            int i = this.n;
            if (i > 21) {
                this.n = 21;
            } else {
                this.C.a(true, true, i < 21);
            }
        } else {
            this.n--;
            int i2 = this.n;
            if (i2 < 1) {
                this.n = 1;
            } else {
                this.C.a(true, i2 > 1, true);
            }
        }
        getNovelContext().f54695d.g(this.n);
        getNovelContext().f54695d.a(true);
        int s = MttResources.s((this.n * 2) + 13);
        IReader iReader = this.z;
        if (iReader != null) {
            iReader.doAction(9, Integer.valueOf(s), null);
        }
    }

    public void setMiniFloatBarVisibility(int i) {
        IAudioPlayFacade iAudioPlayFacade;
        if ((this.be && i == 8) || (iAudioPlayFacade = (IAudioPlayFacade) QBContext.getInstance().getService(IAudioPlayFacade.class)) == null) {
            return;
        }
        iAudioPlayFacade.setMiniFloatBarVisibility(i);
    }

    @Override
    public void snapshotVisibleUsingBitmap(Bitmap bitmap, IWebView.RatioRespect ratioRespect, int i) {
        this.H.a(bitmap, ratioRespect, -(NovelInterfaceImpl.getInstance().sContext.f54694c.n() == 1 ? 0 : 0 + NovelInterfaceImpl.getInstance().sContext.e.e()));
    }

    @Override
    public IWebView.STATUS_BAR statusBarType() {
        return SkinManager.s().l() ? IWebView.STATUS_BAR.NO_SHOW_LIGHT : IWebView.STATUS_BAR.NO_SHOW_DARK;
    }

    @Override
    public boolean supportNotch() {
        return false;
    }

    @Override
    public void switchSkin() {
        super.switchSkin();
        getNovelContext().t().a(this.z, this.f55768a.f36399b);
        if (!this.aR && getWidth() > 0 && getHeight() > 0) {
            Bitmap createBitmap = Bitmap.createBitmap(getWidth(), getHeight(), Bitmap.Config.RGB_565);
            this.H.a(createBitmap, IWebView.RatioRespect.RESPECT_WIDTH, 0);
            createBitmap.recycle();
        }
        for (View view : new View[]{this.O, this.P, this.Q, this.R}) {
            if (view != null && view.getRootView() != getRootView()) {
                this.am.removeMessages(12, view);
                Handler handler = this.am;
                handler.sendMessageDelayed(handler.obtainMessage(12, view), 700L);
            }
        }
        NovelContentTitleBarBase novelContentTitleBarBase = this.A;
        if (novelContentTitleBarBase != null) {
            this.am.removeMessages(12, novelContentTitleBarBase);
            Handler handler2 = this.am;
            handler2.sendMessageDelayed(handler2.obtainMessage(12, this.A), 100L);
        }
    }

    protected void t() {
        if (this.z == null) {
            return;
        }
        a(NovelInterfaceImpl.getInstance().sContext.f54694c.n() == 1, 0);
        this.z.doAction(2, Boolean.valueOf(getReaderMode()), null);
        I();
        this.z.setActivity(ActivityHandler.b().a());
        this.z.setRootView(this.H);
        this.z.doAction(29, new SimpleDateFormat("HH:mm").format(new Date(System.currentTimeMillis())), null);
        this.z.doAction(9, Integer.valueOf(MttResources.s((this.n * 2) + 13)), null);
        this.z.setListener(this);
    }

    protected void u() {
        NovelSkinUtils t;
        int i;
        if (this.z == null) {
            return;
        }
        this.g = getNovelContext().f54695d.e();
        this.f55772d = getNovelContext().f54695d.c();
        if (this.f55772d == 7 && this.aI) {
            t = getNovelContext().t();
            i = 5;
        } else {
            t = getNovelContext().t();
            i = this.f55772d;
        }
        t.a(i, this.z);
        this.z.doAction(30, "" + this.V, null);
        this.z.doAction(27, true, null);
        if (this.at) {
            return;
        }
        getNovelContext().t().a(this.z);
        getNovelContext().t().a(this.z, this.f55768a.f36399b);
    }

    public void v() {
        QBPopupMenu qBPopupMenu;
        View.OnClickListener onClickListener;
        String str;
        NovelCollectGuidStat.a("more_click");
        boolean z = false;
        this.aS = new QBPopupMenu(getContext(), false, false);
        ICustomTabService iCustomTabService = (ICustomTabService) QBContext.getInstance().getService(ICustomTabService.class);
        if (iCustomTabService != null && iCustomTabService.checkTabShowing(117)) {
            z = true;
        }
        if (z && FeatureToggle.a(qb.novelplugin.BuildConfig.FEATURE_TOGGLE_SELECT_ITEM_866911613)) {
            qBPopupMenu = this.aS;
            onClickListener = new View.OnClickListener() {
                @Override
                public void onClick(View view) {
                    EventCollector.getInstance().onViewClickedBefore(view);
                    NovelContentBasePage.this.aS.dismiss();
                    NovelContentBasePage.this.U();
                    EventCollector.getInstance().onViewClicked(view);
                }
            };
            str = "添加直达";
        } else {
            qBPopupMenu = this.aS;
            onClickListener = new View.OnClickListener() {
                @Override
                public void onClick(View view) {
                    EventCollector.getInstance().onViewClickedBefore(view);
                    NovelContentBasePage.this.aS.dismiss();
                    NovelContentBasePage.this.T();
                    EventCollector.getInstance().onViewClicked(view);
                }
            };
            str = "添加书架";
        }
        qBPopupMenu.b(1001, str, onClickListener);
        this.aS.b(8388661);
        this.aS.c(MttResources.s(32));
        this.aS.show();
    }

    public void w() {
        if (FeatureToggle.a(qb.novelplugin.BuildConfig.FEATURE_TOGGLE_NATIVE_READER_BACK_866911613) || !X()) {
            a(getContext(), "https://m4.publicimg.browser.qq.com/publicimg/nav/novel/noveldirect.png", new ViewOnClickListener() {
                @Override
                public void onClick(View view, DialogBase dialogBase) {
                    NovelCollectGuidStat.a("guide_click", "007808");
                    ((IFastCutManager) QBContext.getInstance().getService(IFastCutManager.class)).doReportAdd(NovelContentBasePage.this.aN, "12", null);
                    dialogBase.dismiss();
                    if (NovelFastCutUtils.a(NovelContentBasePage.this.aN)) {
                        NovelFastCutUtils.a(NovelContentBasePage.this.aN, new NovelFastCutUtils.ChangeCallBack() {
                            @Override
                            public void a(IFastCutItem iFastCutItem) {
                                NovelContentBasePage.this.aN = iFastCutItem;
                                NovelContentBasePage.this.f55768a.Y = ((ITempFile) QBContext.getInstance().getService(ITempFile.class)).getExtractFilePath();
                            }
                        });
                    } else {
                        ((IFastCutManager) QBContext.getInstance().getService(IFastCutManager.class)).addFastCut(NovelContentBasePage.this.aN, true, null);
                    }
                    if (NovelContentBasePage.this.C == null || NovelContentBasePage.this.C.aE == null) {
                        return;
                    }
                    NovelContentBasePage.this.C.aE.setVisibility(8);
                }
            }, new ViewOnClickListener() {
                @Override
                public void onClick(View view, DialogBase dialogBase) {
                    NovelCollectGuidStat.a("guide_refuse", "007808");
                    dialogBase.dismiss();
                    NovelContentBasePage.this.getNativeGroup().back(true);
                }
            });
        } else {
            getNativeGroup().back(true);
        }
    }

    public void x() {
        if (!FeatureToggle.a(qb.novelplugin.BuildConfig.FEATURE_TOGGLE_NATIVE_READER_BACK_866911613)) {
            GetSwitchStatus a2 = new GetSwitchStatus().a(this.f55768a.f36399b);
            if (A()) {
                return;
            }
            if (!a(a2) ? !b() || this.aJ : a2.a() || !b() || this.aJ) {
                a(false, true, 0, true);
                NovelCollectGuidStat.a("novel_reader_topleftback_click");
                bI_();
                return;
            }
            if (a(a2, this.aN, this.f55768a)) {
                PublicSettingManager.a().setBoolean("xhomeguid_" + this.f55768a.f36399b, true);
                a(false, true, 0, true);
                w();
                return;
            }
            if (!this.aF || !this.aL) {
                a(false, true, 0, true);
                getNativeGroup().back(true);
                if (!this.aI) {
                    return;
                }
                setMiniFloatBarVisibility(0);
                return;
            }
            NovelStorePage.a("qb://home/feeds?tabId=22&ch=004665");
            this.aL = false;
        }
        GetSwitchStatus a3 = new GetSwitchStatus().a(this.f55768a.f36399b);
        A();
        if (a(a3, this.f55768a, this.aN)) {
            PublicSettingManager.a().setBoolean("xhomeguid_" + this.f55768a.f36399b, true);
            a(false, true, 0, true);
            C();
            return;
        }
        if (!a(a3) ? !b() || this.aJ : a3.a() || !b() || this.aJ) {
            a(false, true, 0, true);
            NovelCollectGuidStat.a("novel_reader_topleftback_click");
            if (NovelInfo.a(this.f55768a.f36399b)) {
                getNativeGroup().back(true);
                return;
            }
            bI_();
            return;
        }
        if (!this.aF || !this.aL) {
            a(false, true, 0, true);
            getNativeGroup().back(true);
            if (!this.aI) {
                return;
            }
            setMiniFloatBarVisibility(0);
            return;
        }
        NovelStorePage.a("qb://home/feeds?tabId=22&ch=004665");
        this.aL = false;
    }

    void y() {
        if (this.aT == null) {
            QuanInfo n = NovelDataManager.q().n(this.f55768a.f36399b);
            boolean z = (n == null || TextUtils.isEmpty(n.strUrl)) ? false : true;
            String[] m = MttResources.m(z ? R.array.a2 : R.array.a1);
            Object[] a2 = a(m);
            if (a2 == null || (a2[0] == null && (a2[0] instanceof String[]))) {
                this.aU = m;
            } else {
                this.aU = (String[]) a2[0];
            }
            if (this.aU.length < m.length) {
                this.aU = m;
            }
            Bitmap[] bitmapArr = null;
            if (a2.length > 1 && a2[1] != null && (a2[1] instanceof Bitmap[])) {
                bitmapArr = (Bitmap[]) a2[1];
            }
            QbListDialogBuilder qbListDialogBuilder = new QbListDialogBuilder();
            qbListDialogBuilder.a(this.aU);
            qbListDialogBuilder.a(bitmapArr);
            qbListDialogBuilder.a(this.aU.length - 1);
            this.aT = qbListDialogBuilder.a();
            if (this.aT == null) {
                return;
            }
            MoreSelectDialogListener moreSelectDialogListener = new MoreSelectDialogListener();
            moreSelectDialogListener.f55827a = m;
            moreSelectDialogListener.f55828b = z;
            if (z) {
                StatManager.b().c("AKH315");
            }
            this.aT.a((QBLinearDialogClickListener) moreSelectDialogListener);
            this.aT.a((DialogInterface.OnDismissListener) moreSelectDialogListener);
        }
        if (this.aT.d()) {
            return;
        }
        this.aT.b();
    }

    public boolean z() {
        return false;
    }
}