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

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


package com.tencent.mtt.browser.homepage.view;

import android.app.Activity;
import android.content.Context;
import android.content.Intent;
import android.graphics.Canvas;
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.View;
import android.view.ViewGroup;
import android.view.ViewParent;
import android.widget.FrameLayout;
import com.tencent.common.manifest.EventEmiter;
import com.tencent.common.manifest.EventMessage;
import com.tencent.common.manifest.annotation.CreateMethod;
import com.tencent.common.manifest.annotation.EventReceiver;
import com.tencent.common.manifest.annotation.EventThreadMode;
import com.tencent.common.threadpool.BrowserExecutorSupplier;
import com.tencent.mm.ui.widget.dialog.MMTipsBar;
import com.tencent.mtt.AppInfoHolder;
import com.tencent.mtt.animation.MockListItemHelper;
import com.tencent.mtt.base.functionwindow.ActivityHandler;
import com.tencent.mtt.base.nativeframework.NativePage;
import com.tencent.mtt.base.stat.StatManager;
import com.tencent.mtt.base.stat.interfaces.IUnitTimeHelper;
import com.tencent.mtt.base.utils.DeviceUtils;
import com.tencent.mtt.base.webview.QBWebView;
import com.tencent.mtt.base.webview.common.QBWebViewClient;
import com.tencent.mtt.browser.engine.AppBroadcastObserver;
import com.tencent.mtt.browser.engine.AppBroadcastReceiver;
import com.tencent.mtt.browser.feeds.data.HomeExternalSetting;
import com.tencent.mtt.browser.feeds.facade.IFeedsService;
import com.tencent.mtt.browser.feeds.rn.view.FeedsHippyPager;
import com.tencent.mtt.browser.feeds.rn.view.FeedsReactQBWaterfallView;
import com.tencent.mtt.browser.feeds.rn.view.FeedsReactViewPager;
import com.tencent.mtt.browser.feeds.rn.view.IFeedsViewPager;
import com.tencent.mtt.browser.feeds.rn.view.VideoFeedsReactEventHub;
import com.tencent.mtt.browser.feeds.view.IFeedsPageView;
import com.tencent.mtt.browser.feeds.view.ISmoothScroll;
import com.tencent.mtt.browser.homepage.facade.SearchBarViewConfig;
import com.tencent.mtt.browser.homepage.view.search.SearchBarView;
import com.tencent.mtt.browser.homepage.view.search.SearchBarViewFactory;
import com.tencent.mtt.browser.window.UrlParams;
import com.tencent.mtt.browser.window.home.view.FrameTabPage;
import com.tencent.mtt.browser.window.home.view.HomePage;
import com.tencent.mtt.businesscenter.facade.IFrameworkDelegate;
import com.tencent.mtt.external.setting.base.ImageLoadManager;
import com.tencent.mtt.external.setting.facade.ISettingService;
import com.tencent.mtt.hippy.common.HippyMap;
import com.tencent.mtt.hippy.modules.Promise;
import com.tencent.mtt.hippy.qb.ModuleParams;
import com.tencent.mtt.hippy.qb.QBHippyEngineManager;
import com.tencent.mtt.hippy.qb.QBHippyWindow;
import com.tencent.mtt.hippy.qb.modules.base.ICircleModule;
import com.tencent.mtt.hippy.qb.portal.HippyEventHubBase;
import com.tencent.mtt.hippy.qb.portal.eventdefine.FeedsHippyEventDefineBase;
import com.tencent.mtt.hippy.qb.portal.eventdefine.HippyEventHubDefineBase;
import com.tencent.mtt.hippy.qb.views.hippypager.HippyPagerSwitch;
import com.tencent.mtt.hippy.qb.views.video.HippyQBVideoViewController;
import com.tencent.mtt.hippy.qb.views.video.HippyQBVideoViewWrapper;
import com.tencent.mtt.hippy.qb.views.waterfall.HippyQBWaterfallViewController;
import com.tencent.mtt.hippy.uimanager.HippyCustomViewCreator;
import com.tencent.mtt.operation.event.EventLog;
import com.tencent.mtt.qbcontext.core.QBContext;
import java.text.SimpleDateFormat;
import java.util.Date;
import java.util.HashMap;
import org.json.JSONException;
import org.json.JSONObject;

public class VideoFeedsTabPage extends FrameTabPage implements ActivityHandler.ApplicationStateListener, AppBroadcastObserver, AdditionViewHost, ModuleParams.CusTomDemotionCallBack, HippyEventHubBase.IEventListener {
    private static boolean e = true;
    private static boolean f;

    QBHippyWindow f40628a;

    VideoFeedsReactEventHub f40629b;

    boolean f40630c;

    boolean f40631d;
    private int g;
    private QBWebView h;
    private boolean i;
    private String j;
    private String k;
    private boolean l;
    private boolean m;
    private IFeedsViewPager n;
    private ISearchBarViewBase o;
    private MockListItemHelper p;
    private Handler q;
    private AdditionView r;
    private long s;
    private IFeedsRNContainerDrawCallback t;

    static class AnonymousClass5 {

        static final int[] f40636a = new int[ActivityHandler.State.values().length];

        static {
            try {
                f40636a[ActivityHandler.State.background.ordinal()] = 1;
            } catch (NoSuchFieldError unused) {
            }
        }
    }

    public class FeedsHippyCustomViewCreator implements HippyCustomViewCreator {
        public FeedsHippyCustomViewCreator() {
        }

        @Override
        public View createCustomView(String str, Context context, HippyMap hippyMap) {
            VideoFeedsTabPage videoFeedsTabPage;
            IFeedsViewPager iFeedsViewPager;
            if (!VideoFeedsTabPage.this.l) {
                VideoFeedsTabPage.this.l = true;
                EventLog.a("VIDEOPORTAL", VideoFeedsTabPage.this.k, "视频portalHippy开始渲染-3", "前端开始渲染", "anyuanzhao", 1);
            }
            if (TextUtils.equals("ListView", str)) {
                VideoFeedsTabPage.this.d();
                return VideoFeedsTabHippyListCreator.a(context, hippyMap, VideoFeedsTabPage.this.n.getView(), VideoFeedsTabPage.this);
            }
            if (TextUtils.equals(HippyQBVideoViewController.CLASS_NAME, str) || TextUtils.equals("TKDVideoView", str)) {
                HippyQBVideoViewWrapper hippyQBVideoViewWrapper = new HippyQBVideoViewWrapper(context);
                hippyQBVideoViewWrapper.setWhere("portal");
                return hippyQBVideoViewWrapper;
            }
            ISmoothScroll iSmoothScroll = null;
            if (TextUtils.equals(HippyQBWaterfallViewController.CLASS_NAME, str) || TextUtils.equals(HippyQBWaterfallViewController.CLASS_NAME_TKD, str)) {
                return new FeedsReactQBWaterfallView(context, iSmoothScroll) {
                    @Override
                    public void onAttachedToWindow() {
                        IFeedsViewPager a2;
                        ISmoothScroll.ScrollableView a3;
                        super.onAttachedToWindow();
                        if (VideoFeedsTabPage.this.n == null || (a2 = VideoFeedsTabPage.a(this)) == null || (a3 = a2.a(a2.getViewFromAdapter(a2.getCurrentPage()))) == null || !(a3 instanceof IFeedsPageView)) {
                            return;
                        }
                        a2.setPage((IFeedsPageView) a3);
                    }
                };
            }
            if (!TextUtils.equals("ViewPager", str)) {
                return null;
            }
            if (HippyPagerSwitch.isNewHippyPagerOn()) {
                videoFeedsTabPage = VideoFeedsTabPage.this;
                iFeedsViewPager = new FeedsHippyPager(context, iSmoothScroll) {
                    @Override
                    protected void dispatchDraw(Canvas canvas) {
                        super.dispatchDraw(canvas);
                        VideoFeedsTabPage.this.f40630c = true;
                    }
                };
            } else {
                videoFeedsTabPage = VideoFeedsTabPage.this;
                iFeedsViewPager = new FeedsReactViewPager(context, iSmoothScroll) {
                    @Override
                    public void dispatchDraw(Canvas canvas) {
                        super.dispatchDraw(canvas);
                        VideoFeedsTabPage.this.f40630c = true;
                    }
                };
            }
            videoFeedsTabPage.n = iFeedsViewPager;
            return VideoFeedsTabPage.this.n.getView();
        }
    }

    public VideoFeedsTabPage(Context context) {
        super(context);
        this.f40628a = null;
        this.g = 0;
        this.i = false;
        this.k = "";
        this.l = false;
        this.m = false;
        this.f40630c = false;
        this.p = new MockListItemHelper(this);
        this.f40631d = false;
        this.s = -1L;
        this.k = SimpleDateFormat.getDateTimeInstance().format(new Date());
        EventLog.a("VIDEOPORTAL", this.k, "视频portal框架构造函数-1", "", "anyuanzhao", 1);
        this.g = hashCode();
        a(context);
        a();
        ActivityHandler.b().a(this);
        EventEmiter.getDefault().register(ISettingService.EVENT_FEEDS_RECOMMEND_STATUS_CHANGED, this);
        this.q = new Handler(Looper.getMainLooper()) {
            @Override
            public void handleMessage(Message message) {
                if (message.what != 7) {
                    return;
                }
                if (VideoFeedsTabPage.this.r != null) {
                    VideoFeedsTabPage.this.c();
                }
                NativePage homePage = VideoFeedsTabPage.this.getHomePage();
                if (homePage != null) {
                    VideoFeedsTabPage videoFeedsTabPage = VideoFeedsTabPage.this;
                    videoFeedsTabPage.r = new AdditionView(videoFeedsTabPage.getContext(), VideoFeedsTabPage.this, null, "commentpage", "commentpage", (HippyMap) message.obj);
                    ((HomePage) homePage).addView(VideoFeedsTabPage.this.r, new FrameLayout.LayoutParams(-1, -1));
                }
            }
        };
    }

    public static IFeedsViewPager a(View view) {
        Object parent;
        if (view == null || (parent = view.getParent()) == null) {
            return null;
        }
        if (parent instanceof IFeedsViewPager) {
            return (IFeedsViewPager) parent;
        }
        if (parent instanceof View) {
            return a((View) parent);
        }
        return null;
    }

    private String a(int i) {
        if (i == 0) {
            return "homepage";
        }
        if (i == 1) {
            return "tab";
        }
        if (i != 2) {
            return null;
        }
        return "startup";
    }

    private void a() {
        QBHippyWindow qBHippyWindow = this.f40628a;
        if (qBHippyWindow != null) {
            qBHippyWindow.destroy();
            if (this.f40628a.getParent() != null) {
                removeView(this.f40628a);
            }
            this.f40628a = null;
        }
        this.f40629b = new VideoFeedsReactEventHub();
        boolean isFeedsRecommendEnabled = ((ISettingService) QBContext.getInstance().getService(ISettingService.class)).isFeedsRecommendEnabled();
        Bundle bundle = new Bundle(9);
        bundle.putString("tabId", "1");
        bundle.putBoolean("isFeedsRecommendEnabled", isFeedsRecommendEnabled);
        bundle.putString("updateMode", String.valueOf(HomeExternalSetting.a()));
        bundle.putString("feedsType", String.valueOf(HomeExternalSetting.b()));
        bundle.putString("abilities", this.f40629b.c());
        bundle.putString("guid", AppInfoHolder.getAppInfoByID(AppInfoHolder.AppInfoID.APP_INFO_GUID));
        bundle.putString("qua2", AppInfoHolder.getAppInfoByID(AppInfoHolder.AppInfoID.APP_INFO_QUA2_3));
        bundle.putString("primaryKey", String.valueOf(this.g));
        bundle.putInt("refreshStyleVer", ((IFeedsService) QBContext.getInstance().getService(IFeedsService.class)).getFeedsHeaderStyle());
        this.f40628a = (QBHippyWindow) QBHippyEngineManager.getInstance().loadModule(new ModuleParams.Builder().setModuleName("videofeeds").setComponentName("videofeeds").setActivity((getContext() == null || !(getContext() instanceof Activity)) ? ActivityHandler.b().a() : (Activity) getContext()).setProps(bundle).setCustomViewCreator(new FeedsHippyCustomViewCreator()).setCusTomDemotionCallBack(this).build());
        this.f40629b.setQBHippyWindow(this.f40628a);
        this.f40629b.registNativeMethod("videofeeds");
        this.f40629b.registerListener(this);
        if (this.f40628a == null) {
            EventLog.a("VIDEOPORTAL", this.k, "构建HippyRoot失败-2", "构建视频portal的native框失败", "anyuanzhao", -1);
            return;
        }
        EventLog.a("VIDEOPORTAL", this.k, "构建HippyRoot-2", "构建视频portal的native框", "anyuanzhao", 1);
        FrameLayout.LayoutParams layoutParams = new FrameLayout.LayoutParams(-1, -1);
        layoutParams.setMargins(0, SearchBarView.f40980a, 0, 0);
        addView(this.f40628a, layoutParams);
        b();
    }

    private void a(Context context) {
        SearchBarViewConfig searchBarViewConfig = new SearchBarViewConfig();
        searchBarViewConfig.c("18");
        searchBarViewConfig.a("video_page");
        searchBarViewConfig.b("006");
        searchBarViewConfig.d("018015");
        searchBarViewConfig.e(getUrl());
        this.o = SearchBarViewFactory.a(context, false, searchBarViewConfig, getUrl());
        addView(this.o.getView(), new FrameLayout.LayoutParams(-1, SearchBarView.f40980a));
    }

    private void b() {
        this.f40629b.a(this.g, "1", FeedsHippyEventDefineBase.TYPE_ON_INSTANTIATED, null, null);
    }

    public void d() {
        this.m = true;
        this.i = true;
        if (TextUtils.isEmpty(this.j)) {
            return;
        }
        BrowserExecutorSupplier.forMainThreadTasks().execute(new Runnable() {
            @Override
            public void run() {
                Bundle bundle = new Bundle();
                bundle.putString("url", VideoFeedsTabPage.this.j);
                if (VideoFeedsTabPage.this.f40629b != null) {
                    VideoFeedsTabPage.this.f40629b.b(VideoFeedsTabPage.this.getHashCode(), "1", FeedsHippyEventDefineBase.TYPE_ON_LOAD_URL, null, bundle);
                }
                VideoFeedsTabPage.this.j = "";
            }
        });
    }

    public NativePage getHomePage() {
        ViewParent parent = getParent();
        while (parent != null && !(parent instanceof HomePage)) {
            parent = parent.getParent();
        }
        if (parent != null) {
            return (NativePage) parent;
        }
        return null;
    }

    @Override
    public void a(String str, HippyMap hippyMap) {
        QBHippyWindow qBHippyWindow = this.f40628a;
        if (qBHippyWindow != null) {
            qBHippyWindow.sendEvent(str, hippyMap);
        }
    }

    @Override
    public void a(HashMap<String, String> hashMap) {
    }

    public void a(boolean z) {
        if (z) {
            a();
        }
    }

    @Override
    public void active() {
        boolean z;
        boolean z2;
        QBWebView qBWebView;
        ISearchBarViewBase iSearchBarViewBase;
        AdditionView additionView;
        super.active();
        if (e) {
            e = false;
            f = false;
            z = true;
        } else {
            if (f) {
                f = false;
                z = false;
                z2 = true;
                boolean z3 = !z || z2;
                this.f40631d = true;
                AppBroadcastReceiver.a().a(this);
                qBWebView = this.h;
                if (qBWebView == null) {
                    qBWebView.active();
                } else {
                    this.f40629b.a(this.g, "1", HippyEventHubDefineBase.TYPE_ON_ACTIVE, a(z3 ? 2 : 0), null);
                }
                IUnitTimeHelper unitTimeHelper = getUnitTimeHelper();
                unitTimeHelper.a("videoportal");
                unitTimeHelper.g(getUrl());
                StatManager.b().a(unitTimeHelper, 0);
                iSearchBarViewBase = this.o;
                if (iSearchBarViewBase != null) {
                    iSearchBarViewBase.a(z, z2);
                }
                additionView = this.r;
                if (additionView == null) {
                    additionView.f();
                    return;
                }
                return;
            }
            z = false;
        }
        z2 = false;
        if (z) {
        }
        this.f40631d = true;
        AppBroadcastReceiver.a().a(this);
        qBWebView = this.h;
        if (qBWebView == null) {
        }
        IUnitTimeHelper unitTimeHelper2 = getUnitTimeHelper();
        unitTimeHelper2.a("videoportal");
        unitTimeHelper2.g(getUrl());
        StatManager.b().a(unitTimeHelper2, 0);
        iSearchBarViewBase = this.o;
        if (iSearchBarViewBase != null) {
        }
        additionView = this.r;
        if (additionView == null) {
        }
    }

    @Override
    public void c() {
        AdditionView additionView = this.r;
        if (additionView != null && additionView.getParent() != null) {
            ((ViewGroup) this.r.getParent()).removeView(this.r);
        }
        AdditionView additionView2 = this.r;
        if (additionView2 != null) {
            additionView2.h();
        }
        this.r = null;
    }

    @Override
    public void deActive() {
        super.deActive();
        if (this.f40631d) {
            this.f40631d = false;
            QBWebView qBWebView = this.h;
            if (qBWebView != null) {
                qBWebView.deactive();
            } else {
                this.f40629b.a(this.g, "1", HippyEventHubDefineBase.TYPE_ON_DEACTIVE, "homepage", null);
            }
            AppBroadcastReceiver.a().b(this);
            IUnitTimeHelper unitTimeHelper = getUnitTimeHelper();
            unitTimeHelper.a("videoportal");
            unitTimeHelper.g(getUrl());
            StatManager.b().c(unitTimeHelper, 0);
            ISearchBarViewBase iSearchBarViewBase = this.o;
            if (iSearchBarViewBase != null) {
                iSearchBarViewBase.a();
            }
            AdditionView additionView = this.r;
            if (additionView != null) {
                additionView.g();
            }
        }
    }

    @Override
    public void destroy() {
        super.destroy();
        this.f40629b.a(this.g, "1", HippyEventHubDefineBase.TYPE_ON_DESTROY, null, null);
        QBHippyEngineManager.getInstance().destroyModule(this.f40628a);
        AppBroadcastReceiver.a().b(this);
        EventEmiter.getDefault().unregister(ISettingService.EVENT_FEEDS_RECOMMEND_STATUS_CHANGED, this);
        QBWebView qBWebView = this.h;
        if (qBWebView != null) {
            qBWebView.destroy();
        }
        ActivityHandler.b().b(this);
        ISearchBarViewBase iSearchBarViewBase = this.o;
        if (iSearchBarViewBase != null) {
            iSearchBarViewBase.b();
        }
        AdditionView additionView = this.r;
        if (additionView != null) {
            additionView.h();
        }
    }

    @Override
    public void dispatchDraw(Canvas canvas) {
        IFeedsViewPager iFeedsViewPager;
        super.dispatchDraw(canvas);
        if ((getChildCount() == 1 || (iFeedsViewPager = this.n) == null || iFeedsViewPager.getView().getWidth() == 0 || !this.f40630c) && this.h == null) {
            this.p.a(canvas, true, SearchBarView.f40980a + DeviceUtils.Z());
        }
    }

    @Override
    public View getCusTomDemotionView() {
        EventLog.a("VIDEOPORTAL", this.k, "视频portal加载失败,用H5-3", "可能是内核加载失败", "anyuanzhao", -1);
        if (this.h == null) {
            this.h = new QBWebView(getContext());
            this.h.setQBWebViewClient(new QBWebViewClient() {
                @Override
                public boolean shouldOverrideUrlLoading(QBWebView qBWebView, String str) {
                    if (TextUtils.equals(str, "https://qbrnweb.html5.qq.com")) {
                        VideoFeedsTabPage.this.h.loadUrl("https://qbrnweb.html5.qq.com");
                    } else {
                        ((IFrameworkDelegate) QBContext.getInstance().getService(IFrameworkDelegate.class)).doLoad(new UrlParams("https://qbrnweb.html5.qq.com").b(1).c(60));
                    }
                    return true;
                }
            });
        }
        this.h.loadUrl("https://qbrnweb.html5.qq.com");
        return this.h;
    }

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

    @Override
    public String getPageTitle() {
        return "视频";
    }

    @Override
    public View getPageView() {
        return this;
    }

    public ISearchBarViewBase getSearchBar() {
        return this.o;
    }

    @Override
    public String getUrl() {
        return "qb://tab/video";
    }

    @Override
    public void loadUrl(String str) {
        if (this.i) {
            Bundle bundle = new Bundle();
            bundle.putString("url", str);
            this.f40629b.b(getHashCode(), "1", FeedsHippyEventDefineBase.TYPE_ON_LOAD_URL, null, bundle);
        } else {
            this.j = str;
        }
        EventLog.a("拉新承接", "获取数据", "视频portal加载url", str, "anyuanzhao", 1);
    }

    @Override
    public void onApplicationState(ActivityHandler.State state) {
        if (AnonymousClass5.f40636a[state.ordinal()] != 1) {
            return;
        }
        f = true;
    }

    @Override
    public void onBroadcastReceiver(Intent intent) {
        if (TextUtils.equals(intent.getAction(), "android.intent.action.SCREEN_OFF")) {
            this.f40629b.a(this.g, "1", FeedsHippyEventDefineBase.TYPE_ON_SCREEN_OFF, null, null);
        }
    }

    @Override
    public void onEnterIntoMultiwindow() {
        deActive();
    }

    @EventReceiver(createMethod = CreateMethod.NONE, eventName = ISettingService.EVENT_FEEDS_RECOMMEND_STATUS_CHANGED, threadMode = EventThreadMode.MAINTHREAD)
    public void onFeedsRecommendStatusChanged(EventMessage eventMessage) {
        a(true);
    }

    @Override
    public void onImageLoadConfigChanged() {
        QBHippyWindow qBHippyWindow = this.f40628a;
        if (qBHippyWindow != null) {
            qBHippyWindow.onNoPicModeChanged();
        }
        QBWebView qBWebView = this.h;
        if (qBWebView != null) {
            qBWebView.getQBSettings().m(ImageLoadManager.getInstance().getImageLoadsAutomatcily());
            this.h.getQBSettings().n(ImageLoadManager.getInstance().a());
        }
    }

    @Override
    public boolean onKeyDown(int i, KeyEvent keyEvent) {
        AdditionView additionView;
        if (i != 4 || (additionView = this.r) == null) {
            return false;
        }
        if (additionView.c()) {
            return true;
        }
        c();
        return true;
    }

    @Override
    public void onLeaveFromMultiwindow() {
        active();
    }

    @Override
    public boolean onReactEvent(String str, HippyMap hippyMap, Promise promise) {
        if (hippyMap.containsKey(ICircleModule.CIRCLE_ARGUMENTS)) {
            if (!TextUtils.equals(String.valueOf(this.g), hippyMap.getMap(ICircleModule.CIRCLE_ARGUMENTS).getString("primaryKey"))) {
                return true;
            }
        }
        if (hippyMap.containsKey("primaryKey")) {
            if (!TextUtils.equals(String.valueOf(this.g), hippyMap.getString("primaryKey"))) {
                return true;
            }
        }
        if (!FeedsHippyEventDefineBase.ABILITY_CALL_COMMENT.name.equalsIgnoreCase(str)) {
            if (FeedsHippyEventDefineBase.ABILITY_CLOSE_COMMENT_MODAL.name.equalsIgnoreCase(str)) {
                this.q.post(new Runnable() {
                    @Override
                    public void run() {
                        VideoFeedsTabPage.this.c();
                    }
                });
                return true;
            }
            if (!FeedsHippyEventDefineBase.ABILITY_COMMENTLIST_SEND_MSG.name.equalsIgnoreCase(str)) {
                return false;
            }
            a(HippyEventHubDefineBase.EVENT_COMMON_LIST_SEND_MSG, hippyMap);
            try {
                JSONObject jSONObject = new JSONObject();
                jSONObject.put("success", true);
                promise.resolve(jSONObject);
            } catch (JSONException unused) {
            }
            return true;
        }
        long currentTimeMillis = System.currentTimeMillis();
        if (currentTimeMillis - this.s < MMTipsBar.DURATION_SHORT) {
            return true;
        }
        this.s = currentTimeMillis;
        Message obtainMessage = this.q.obtainMessage(7);
        obtainMessage.obj = hippyMap;
        obtainMessage.sendToTarget();
        try {
            JSONObject jSONObject2 = new JSONObject();
            jSONObject2.put("success", true);
            promise.resolve(jSONObject2);
        } catch (JSONException unused2) {
        }
        return true;
    }

    @Override
    public void onStart() {
        super.onStart();
        active();
    }

    @Override
    public void onStop() {
        super.onStop();
        deActive();
    }

    @Override
    public void reload(int i) {
        QBWebView qBWebView;
        if (i == 1) {
            qBWebView = this.h;
            if (qBWebView == null) {
                Bundle bundle = new Bundle();
                bundle.putInt("reloadType", 1);
                this.f40629b.a(this.g, "1", "reload", null, bundle);
                return;
            }
        } else {
            qBWebView = this.h;
            if (qBWebView == null) {
                this.f40629b.a(this.g, "1", "reload", null, null);
                return;
            }
        }
        qBWebView.reload();
    }

    public void setFeedsDrawCallback(IFeedsRNContainerDrawCallback iFeedsRNContainerDrawCallback) {
        this.t = iFeedsRNContainerDrawCallback;
    }

    @Override
    public void switchSkin() {
        super.switchSkin();
        QBHippyWindow qBHippyWindow = this.f40628a;
        if (qBHippyWindow != null) {
            qBHippyWindow.onSkinChanged();
        }
        QBWebView qBWebView = this.h;
        if (qBWebView != null) {
            qBWebView.switchSkin();
        }
    }

    @Override
    public void toPage(String str) {
        Bundle bundle = new Bundle();
        bundle.putString("toPageUrl", str);
        this.f40629b.a(this.g, "1", HippyEventHubDefineBase.TYPE_ON_TOPAGE, "homepage", bundle);
    }
}