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

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


package com.tencent.mtt.external.explorerone.newcamera.scan.topic.ui;

import android.content.Context;
import android.graphics.Bitmap;
import android.graphics.Canvas;
import android.graphics.Matrix;
import android.graphics.Paint;
import android.graphics.Point;
import android.os.Bundle;
import android.os.Handler;
import android.os.Message;
import android.text.TextUtils;
import android.view.View;
import android.view.ViewGroup;
import android.widget.FrameLayout;
import android.widget.ImageView;
import android.widget.LinearLayout;
import com.tencent.common.utils.bitmap.BitmapUtils;
import com.tencent.common.utils.bitmap.QImageParams;
import com.tencent.mtt.ContextHolder;
import com.tencent.mtt.R;
import com.tencent.mtt.account.base.IAccount;
import com.tencent.mtt.base.account.AccountInfo;
import com.tencent.mtt.base.functionwindow.ActivityHandler;
import com.tencent.mtt.base.skin.MttResources;
import com.tencent.mtt.base.utils.DeviceUtils;
import com.tencent.mtt.base.utils.NotchUtil;
import com.tencent.mtt.base.webview.QBWebView;
import com.tencent.mtt.base.webview.common.QBWebSettings;
import com.tencent.mtt.base.wrapper.callback.SnapshotSysCallBack;
import com.tencent.mtt.browser.StatusBarColorManager;
import com.tencent.mtt.browser.WebEngine;
import com.tencent.mtt.browser.memstat.facade.IMemoryUsageStatService;
import com.tencent.mtt.browser.window.IWebView;
import com.tencent.mtt.browser.window.UrlParams;
import com.tencent.mtt.browser.window.WindowManager;
import com.tencent.mtt.businesscenter.facade.IFrameworkDelegate;
import com.tencent.mtt.external.ar.facade.ICameraImageFetcherCallback;
import com.tencent.mtt.external.explorerone.camera.ar.inhost.utils.CameraImageFetcher;
import com.tencent.mtt.external.explorerone.camera.data.CameraPanelShareData;
import com.tencent.mtt.external.explorerone.camera.data.CameraSusuanData;
import com.tencent.mtt.external.explorerone.camera.data.share.CameraShareBundleData;
import com.tencent.mtt.external.explorerone.camera.gdi.GdiPaint;
import com.tencent.mtt.external.explorerone.camera.manager.CameraDataManager;
import com.tencent.mtt.external.explorerone.camera.utils.CameraPanelUIUtils;
import com.tencent.mtt.external.explorerone.camera.utils.CameraStatConst;
import com.tencent.mtt.external.explorerone.camera.utils.CameraViewUtils;
import com.tencent.mtt.external.explorerone.camera.utils.NewCameraDataReporter;
import com.tencent.mtt.external.explorerone.newcamera.camera.data.CameraFrameData;
import com.tencent.mtt.external.explorerone.newcamera.scan.framework.base.ui.panel.ICameraPanelResultView;
import com.tencent.mtt.external.explorerone.newcamera.scan.framework.base.ui.panel.ICameraResultViewNewListener;
import com.tencent.mtt.external.explorerone.newcamera.scan.topic.share.CameraShareTopicData;
import com.tencent.mtt.external.explorerone.newcamera.scan.topic.share.CameraTopicSharePagerController;
import com.tencent.mtt.hippy.qb.views.base.IWebViewController;
import com.tencent.mtt.qbcontext.core.QBContext;
import com.tencent.mtt.resource.UIResourceDimen;
import com.tencent.mtt.sdkcontext.SDKContext;
import com.tencent.mtt.setting.BaseSettings;
import com.tencent.mtt.view.common.QBImageTextView;
import com.tencent.mtt.view.common.QBImageView;
import com.tencent.mtt.view.common.QBTextView;
import com.tencent.mtt.view.common.QBViewResourceManager;
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.qqlive.module.videoreport.collect.EventCollector;
import java.util.ArrayList;
import qb.a.e;
import qb.a.f;

public class CameraSuSuanNativeView extends QBFrameLayout implements Handler.Callback, View.OnClickListener, ICameraPanelResultView {
    private static final int q = MttResources.g(f.r);
    private static final int r = MttResources.g(f.v);
    private static final int s = MttResources.g(f.f);
    private static final int t = MttResources.h(f.T);
    private static final int u = CameraViewUtils.a(0.627f);
    private static final int w = MttResources.g(f.U);
    private static final int x;
    private Bitmap A;

    boolean f53485a;

    private boolean f53486b;

    private Paint f53487c;

    private QBTextView f53488d;
    private QBImageView e;
    private QBImageView f;
    private QBImageView g;
    private QBLinearLayout h;
    private QBTextView i;
    private QBTextView j;
    private QBWebView k;
    private QBImageView l;
    private QBPopupMenu m;
    private QBTextView n;
    private ICameraResultViewNewListener o;
    private Bitmap p;
    private CameraSusuanData v;
    private int y;
    private Bitmap z;

    public class AnonymousClass3 implements Runnable {

        final CameraShareBundleData f53491a;

        final Bitmap f53492b;

        final CameraShareTopicData f53493c;

        AnonymousClass3(CameraShareBundleData cameraShareBundleData, Bitmap bitmap, CameraShareTopicData cameraShareTopicData) {
            this.f53491a = cameraShareBundleData;
            this.f53492b = bitmap;
            this.f53493c = cameraShareTopicData;
        }

        @Override
        public void run() {
            if (WebEngine.e().o()) {
                CameraSuSuanNativeView.this.k.snapshotWholePageUsingBitmapAsy(CameraTopicSharePagerController.m, 0, IWebView.RatioRespect.RESPECT_WIDTH, 4, new SnapshotSysCallBack() {
                    @Override
                    public void a(Bitmap bitmap) {
                        AnonymousClass3.this.f53491a.f51642b = CameraSuSuanNativeView.this.a(bitmap, AnonymousClass3.this.f53492b);
                        AnonymousClass3.this.f53493c.h.l.add(AnonymousClass3.this.f53491a);
                        CameraSuSuanNativeView.this.post(new Runnable() {
                            @Override
                            public void run() {
                                if (CameraSuSuanNativeView.this.o != null) {
                                    CameraSuSuanNativeView.this.o.a(100018, AnonymousClass3.this.f53493c);
                                }
                            }
                        });
                    }
                });
                return;
            }
            Bitmap snapshotWholePageUsingBitmap = CameraSuSuanNativeView.this.k.snapshotWholePageUsingBitmap(WindowManager.a().x().getPageFrameWidth(), WindowManager.a().x().getPageFrameHeight(), IWebView.RatioRespect.RESPECT_WIDTH, 4);
            this.f53491a.f51642b = CameraSuSuanNativeView.this.a(snapshotWholePageUsingBitmap, this.f53492b);
            this.f53493c.h.l.add(this.f53491a);
            if (CameraSuSuanNativeView.this.o != null) {
                CameraSuSuanNativeView.this.o.a(100019, this.f53493c);
            }
        }
    }

    static {
        x = (!BaseSettings.a().l() || NotchUtil.a(ContextHolder.getAppContext())) ? BaseSettings.a().m() : 0;
    }

    public CameraSuSuanNativeView(Context context) {
        super(context);
        this.f53486b = false;
        this.f53488d = null;
        this.e = null;
        this.f = null;
        this.g = null;
        this.h = null;
        this.i = null;
        this.j = null;
        this.k = null;
        this.l = null;
        this.n = null;
        this.y = MttResources.c(R.color.gq);
        this.z = MttResources.p(R.drawable.aa9);
        this.A = MttResources.p(R.drawable.aa8);
        this.f53485a = false;
        setBackgroundNormalIds(0, e.W);
        c();
    }

    public Bitmap a(Bitmap bitmap, Bitmap bitmap2) {
        ?? r1;
        Bitmap bitmap3 = null;
        if (bitmap != null) {
            try {
            } catch (Exception unused) {
            } catch (OutOfMemoryError unused2) {
                r1 = 0;
            }
            if (!bitmap.isRecycled()) {
                int a2 = CameraViewUtils.a(0.064f);
                int i = CameraTopicSharePagerController.f;
                int i2 = CameraTopicSharePagerController.g;
                int i3 = CameraTopicSharePagerController.h;
                int i4 = CameraTopicSharePagerController.i;
                int i5 = CameraTopicSharePagerController.j;
                int af = DeviceUtils.af();
                Bitmap createBitmap = Bitmap.createBitmap(af + 2, bitmap.getHeight() + a2 + CameraTopicSharePagerController.l + CameraTopicSharePagerController.k + 2, Bitmap.Config.ARGB_8888);
                Canvas canvas = new Canvas(createBitmap);
                canvas.drawColor(-1);
                Matrix matrix = new Matrix();
                if (bitmap2 != null) {
                    float width = af / bitmap2.getWidth();
                    matrix.preScale(width, width);
                    canvas.drawBitmap(bitmap2, matrix, null);
                }
                matrix.reset();
                matrix.postTranslate(((af - CameraTopicSharePagerController.m) / 2) + 1, i + 1 + a2 + i2);
                canvas.drawBitmap(bitmap, matrix, null);
                Bitmap p = MttResources.p(R.drawable.aad);
                matrix.reset();
                float g = MttResources.g(f.ac) / p.getHeight();
                matrix.postTranslate(((af - r3) / 2) + 1, bitmap.getHeight() + r4 + i3);
                matrix.preScale(g, g);
                canvas.drawBitmap(p, matrix, null);
                r1 = CameraViewUtils.b(0.27f);
                int b2 = CameraViewUtils.b(0.527f);
                int b3 = CameraViewUtils.b(0.484f);
                Bitmap p2 = MttResources.p(R.drawable.a_z);
                Bitmap p3 = MttResources.p(R.drawable.aa0);
                try {
                    try {
                        if (this.v.g == 1) {
                            int b4 = (CameraViewUtils.b(1.0f) - p2.getWidth()) / 2;
                            float g2 = MttResources.g(f.v) / p2.getHeight();
                            matrix.reset();
                            matrix.preScale(g2, g2);
                            matrix.postTranslate(b4 + 1, r4 + bitmap.getHeight() + i3 + r3 + i4);
                            canvas.drawBitmap(p2, matrix, null);
                            r1 = 0;
                        } else {
                            float g3 = MttResources.g(f.v) / p2.getHeight();
                            matrix.reset();
                            matrix.preScale(g3, g3);
                            matrix.postTranslate(r1 + 1, bitmap.getHeight() + r4 + i3 + r3 + i4);
                            canvas.drawBitmap(p2, matrix, null);
                            Bitmap p4 = MttResources.p(R.drawable.a_8);
                            float g4 = MttResources.g(f.n) / p4.getHeight();
                            matrix.reset();
                            matrix.preScale(g4, g4);
                            matrix.postTranslate(b3 + 1, bitmap.getHeight() + r4 + i3 + r3 + i5);
                            try {
                                canvas.drawBitmap(p4, matrix, null);
                                matrix.reset();
                                matrix.preScale(g3, g3);
                                matrix.postTranslate(b2 + 1, r4 + bitmap.getHeight() + i3 + r3 + i4);
                                r1 = 0;
                                canvas.drawBitmap(p3, matrix, null);
                            } catch (Exception unused3) {
                                return null;
                            } catch (OutOfMemoryError unused4) {
                                r1 = 0;
                                ((IMemoryUsageStatService) QBContext.getInstance().getService(IMemoryUsageStatService.class)).handleOOMError(0);
                                return r1;
                            }
                        }
                        if (bitmap != null && !bitmap.isRecycled()) {
                            bitmap.recycle();
                        }
                        bitmap3 = createBitmap;
                        return bitmap3;
                    } catch (Exception unused5) {
                        return r1;
                    } catch (OutOfMemoryError unused6) {
                    }
                } catch (Exception unused7) {
                    return null;
                } catch (OutOfMemoryError unused8) {
                    r1 = 0;
                }
            }
        }
        bitmap3 = null;
        return bitmap3;
    }

    public void a(final Bitmap bitmap) {
        final CameraShareTopicData cameraShareTopicData = new CameraShareTopicData();
        cameraShareTopicData.h = new CameraPanelShareData();
        cameraShareTopicData.h.l = new ArrayList<>();
        final CameraShareBundleData a2 = CameraShareBundleData.a(23);
        a2.f51644d = this.v.f51625a;
        a2.e = 1;
        a2.f = "qb://camera/topicshare";
        a2.g = 13;
        if (this.v.g == 0) {
            postDelayed(new AnonymousClass3(a2, bitmap, cameraShareTopicData), 200L);
        } else {
            post(new Runnable() {
                @Override
                public void run() {
                    if (CameraSuSuanNativeView.this.p == null || CameraSuSuanNativeView.this.p.isRecycled()) {
                        return;
                    }
                    a2.f51642b = CameraSuSuanNativeView.this.a(BitmapUtils.a(CameraSuSuanNativeView.this.p, CameraTopicSharePagerController.m, (int) ((CameraTopicSharePagerController.m / CameraSuSuanNativeView.this.p.getWidth()) * CameraSuSuanNativeView.this.p.getHeight()), 1, false), bitmap);
                    cameraShareTopicData.h.l.add(a2);
                    if (CameraSuSuanNativeView.this.o != null) {
                        CameraSuSuanNativeView.this.o.a(100019, cameraShareTopicData);
                    }
                }
            });
        }
    }

    private void a(IWebView.STATUS_BAR status_bar) {
        if (ActivityHandler.b().n() != null) {
            StatusBarColorManager.getInstance().a(ActivityHandler.b().n().getWindow(), status_bar);
        }
    }

    private void a(CameraFrameData cameraFrameData) {
        Bitmap a2;
        if (cameraFrameData != null && (a2 = BitmapUtils.a(cameraFrameData.l, (QImageParams) null)) != null && !a2.isRecycled()) {
            try {
                Bitmap createBitmap = Bitmap.createBitmap(DeviceUtils.af(), a2.getHeight(), Bitmap.Config.ARGB_8888);
                Canvas canvas = new Canvas(createBitmap);
                int af = (DeviceUtils.af() - a2.getWidth()) / 2;
                Matrix matrix = new Matrix();
                matrix.postTranslate(af < 0 ? 0.0f : af, 0.0f);
                canvas.drawBitmap(a2, matrix, null);
                this.f53487c.setColor(this.y);
                this.f53487c.setStyle(Paint.Style.STROKE);
                this.f53487c.setStrokeWidth(MttResources.s(1));
                GdiPaint.a(canvas, this.f53487c, this.A, this.z, this.v.m, 1.0f, af, 0);
                this.l.setImageBitmap(createBitmap);
                this.p = createBitmap;
            } catch (OutOfMemoryError unused) {
            }
        }
    }

    private void c() {
        this.f53487c = new Paint();
        QBFrameLayout qBFrameLayout = new QBFrameLayout(getContext()) {
            @Override
            public void dispatchDraw(Canvas canvas) {
                super.dispatchDraw(canvas);
                CameraSuSuanNativeView.this.f53487c.setStyle(Paint.Style.FILL_AND_STROKE);
                CameraSuSuanNativeView.this.f53487c.setColor(MttResources.c(R.color.jm));
                CameraSuSuanNativeView.this.f53487c.setStrokeWidth(1);
                canvas.drawLine(0.0f, getMeasuredHeight() - 1, getMeasuredWidth(), getMeasuredHeight() - 1, CameraSuSuanNativeView.this.f53487c);
            }
        };
        FrameLayout.LayoutParams layoutParams = new FrameLayout.LayoutParams(-1, w);
        layoutParams.gravity = 48;
        if (DeviceUtils.K() <= 18) {
            layoutParams.topMargin = 0;
        } else {
            layoutParams.topMargin = x;
        }
        qBFrameLayout.setClickable(true);
        addView(qBFrameLayout, layoutParams);
        this.e = new QBImageView(getContext());
        this.e.setImageNormalPressIds(R.drawable.a_7, R.color.jr, 0, e.ag);
        this.e.setOnClickListener(this);
        this.e.setId(1);
        FrameLayout.LayoutParams layoutParams2 = new FrameLayout.LayoutParams(-2, -2, 3);
        this.e.setPadding(r, 0, s, 0);
        layoutParams2.gravity = 16;
        qBFrameLayout.addView(this.e, layoutParams2);
        this.f53488d = new QBTextView(getContext().getApplicationContext());
        this.f53488d.setTextColor(MttResources.c(R.color.jr));
        this.f53488d.setTextSize(MttResources.h(f.da));
        this.f53488d.setGravity(17);
        this.f53488d.setText(MttResources.l(R.string.tj));
        this.f53488d.setSingleLine(true);
        this.f53488d.setEllipsize(TextUtils.TruncateAt.END);
        FrameLayout.LayoutParams layoutParams3 = new FrameLayout.LayoutParams(-2, -2);
        layoutParams3.gravity = 17;
        qBFrameLayout.addView(this.f53488d, layoutParams3);
        this.g = new QBImageView(getContext());
        this.g.setImageNormalPressIds(R.drawable.aac, R.color.kn, 0, R.color.k3);
        this.g.setOnClickListener(this);
        this.g.setId(2);
        FrameLayout.LayoutParams layoutParams4 = new FrameLayout.LayoutParams(-2, -2);
        layoutParams4.rightMargin = MttResources.g(f.aj);
        layoutParams4.gravity = 21;
        qBFrameLayout.addView(this.g, layoutParams4);
        this.f = new QBImageView(getContext());
        this.f.setOnClickListener(this);
        this.f.setImageNormalPressIds(R.drawable.a_e, R.color.kn, 0, R.color.k3);
        this.f.setId(4);
        FrameLayout.LayoutParams layoutParams5 = new FrameLayout.LayoutParams(-2, -2);
        this.f.setPadding(s, 0, MttResources.g(f.r), 0);
        layoutParams5.gravity = 21;
        qBFrameLayout.addView(this.f, layoutParams5);
        QBFrameLayout qBFrameLayout2 = new QBFrameLayout(getContext());
        LinearLayout.LayoutParams layoutParams6 = new LinearLayout.LayoutParams(-1, -1);
        layoutParams6.topMargin = w + x;
        addView(qBFrameLayout2, layoutParams6);
        int i = q;
        qBFrameLayout2.setPadding(i, 0, i, 0);
        this.h = new QBLinearLayout(getContext());
        this.h.setOrientation(0);
        this.h.setGravity(17);
        FrameLayout.LayoutParams layoutParams7 = new FrameLayout.LayoutParams(-2, -2);
        layoutParams7.gravity = 81;
        layoutParams7.bottomMargin = CameraViewUtils.a(0.837f);
        qBFrameLayout2.addView(this.h, layoutParams7);
        this.i = new QBTextView(getContext().getApplicationContext());
        this.i.setTextSize(MttResources.h(f.cZ));
        this.i.setGravity(17);
        this.i.setSingleLine(true);
        this.i.setEllipsize(TextUtils.TruncateAt.END);
        this.h.addView(this.i, new LinearLayout.LayoutParams(-2, -2));
        this.j = new QBTextView(getContext().getApplicationContext());
        this.j.setTextSize(MttResources.h(f.cZ));
        this.j.setTextColor(MttResources.c(R.color.gv));
        this.j.setGravity(17);
        this.j.setSingleLine(true);
        this.j.setEllipsize(TextUtils.TruncateAt.END);
        this.h.addView(this.j, new LinearLayout.LayoutParams(-2, -2));
        CameraViewUtils.a(this.h, 4);
        this.l = new QBImageView(getContext());
        this.l.setScaleType(ImageView.ScaleType.CENTER_INSIDE);
        FrameLayout.LayoutParams layoutParams8 = new FrameLayout.LayoutParams(-1, u);
        layoutParams8.gravity = 81;
        layoutParams8.bottomMargin = CameraViewUtils.a(0.184f);
        addView(this.l, layoutParams8);
        this.l.setVisibility(8);
        this.k = new QBWebView(getContext());
        this.k.addDefaultJavaScriptInterface();
        QBWebView qBWebView = this.k;
        qBWebView.mCanHorizontalScroll = false;
        qBWebView.setWebCoreNightModeEnabled(false);
        if (this.k.getSettingsExtension() != null) {
            this.k.getSettingsExtension().c(true);
        }
        QBWebView qBWebView2 = this.k;
        if (qBWebView2 != null) {
            qBWebView2.setVerticalScrollBarEnabled(false);
            qBWebView2.setHorizontalScrollBarEnabled(false);
            qBWebView2.setBackgroundColor(0);
        }
        this.k.setVerticalScrollBarEnabled(false);
        this.k.setHorizontalScrollBarEnabled(false);
        this.k.getQBSettings().m(true);
        this.k.getQBSettings().n(false);
        this.k.setWebViewType(6);
        this.k.setBackgroundColor(0);
        QBWebSettings qBSettings = this.k.getQBSettings();
        if (qBSettings != null) {
            qBSettings.a(false);
            qBSettings.o(true);
        }
        FrameLayout.LayoutParams layoutParams9 = new FrameLayout.LayoutParams(-1, u);
        layoutParams9.gravity = 81;
        layoutParams9.bottomMargin = CameraViewUtils.a(0.184f);
        qBFrameLayout2.addView(this.k, layoutParams9);
        this.k.setVisibility(8);
        this.n = new QBTextView(getContext().getApplicationContext());
        FrameLayout.LayoutParams layoutParams10 = new FrameLayout.LayoutParams(MttResources.g(f.bu), MttResources.g(f.Q));
        layoutParams10.gravity = 81;
        layoutParams10.bottomMargin = MttResources.h(f.O);
        this.n.setGravity(17);
        this.n.setBackgroundNormalIds(R.drawable.a_x, R.color.kg);
        this.n.setTextColorNormalIds(R.color.white);
        this.n.setTextSize(MttResources.h(f.cF));
        this.n.setText("继续拍");
        this.n.setId(3);
        this.n.setOnClickListener(this);
        qBFrameLayout2.addView(this.n, layoutParams10);
    }

    private void d() {
        ICameraResultViewNewListener iCameraResultViewNewListener = this.o;
        if (iCameraResultViewNewListener != null) {
            iCameraResultViewNewListener.m();
        }
        setVisibility(8);
        CameraStatConst.b("BZST046");
    }

    private void l() {
        CameraSusuanData cameraSusuanData = this.v;
        if (cameraSusuanData != null && cameraSusuanData.e()) {
            CameraStatConst.b("BZST007");
        }
        CameraStatConst.b("BZST048");
        ICameraResultViewNewListener iCameraResultViewNewListener = this.o;
        if (iCameraResultViewNewListener != null) {
            iCameraResultViewNewListener.m();
        }
        setVisibility(8);
    }

    private void m() {
        new CameraImageFetcher("https://res.imtt.qq.com/res_mtt/camera/camera_share_susuan_bg.jpg", new ICameraImageFetcherCallback() {
            @Override
            public void a(boolean z, Bitmap bitmap, String str, int i, int i2) {
                if (!z || bitmap == null) {
                    MttToaster.show("分享失败,请检查网络连接再重试", 0);
                } else {
                    CameraSuSuanNativeView.this.a(bitmap);
                }
            }
        }).a();
    }

    public IWebView.STATUS_BAR a() {
        return this.f53485a ? IWebView.STATUS_BAR.NO_SHOW_DARK : IWebView.STATUS_BAR.NO_SHOW_LIGHT;
    }

    public void a(Object obj, CameraFrameData cameraFrameData) {
        String str;
        if (obj instanceof CameraSusuanData) {
            this.v = (CameraSusuanData) obj;
            str = this.v.f51625a;
            a(IWebView.STATUS_BAR.NO_SHOW_DARK);
            this.f53485a = true;
        } else {
            this.v = new CameraSusuanData();
            a(IWebView.STATUS_BAR.NO_SHOW_LIGHT);
            this.f53485a = false;
            str = IWebViewController.BLANK_URL;
        }
        b(this.v.f51628d == 0);
        if (this.v.g == 1 && this.f53485a) {
            CameraPanelUIUtils.a(this.k, 8);
            CameraPanelUIUtils.a(this.l, 0);
            a(cameraFrameData);
        } else {
            CameraPanelUIUtils.a(this.k, 0);
            CameraPanelUIUtils.a(this.l, 8);
            this.l.setImageDrawable(null);
        }
        this.k.loadUrl(str);
    }

    @Override
    public void a(boolean z) {
    }

    public void b() {
        a(IWebView.STATUS_BAR.NO_SHOW_LIGHT);
        f();
    }

    protected void b(boolean z) {
        String str;
        if (z) {
            if (this.v.f51627c == 0) {
                this.i.setTextColor(MttResources.c(R.color.a2m));
                this.j.setTextColor(MttResources.c(R.color.gv));
                this.i.setText(this.v.e);
                this.j.setText(this.v.f);
                str = "BZST005";
            } else {
                this.i.setTextColor(MttResources.c(R.color.a2n));
                this.j.setTextColor(MttResources.c(R.color.gv));
                this.i.setText(this.v.e);
                this.j.setText(this.v.f);
                str = "BZST004";
            }
            CameraStatConst.b(str);
            ViewGroup.MarginLayoutParams marginLayoutParams = (ViewGroup.MarginLayoutParams) this.k.getLayoutParams();
            marginLayoutParams.height = u;
            marginLayoutParams.bottomMargin = CameraViewUtils.a(0.184f);
            CameraViewUtils.a(this.h, 0);
        } else {
            this.i.setTextColor(MttResources.c(R.color.a2n));
            this.j.setTextColor(MttResources.c(R.color.a2n));
            CameraPanelUIUtils.a(this.i, this.v.e);
            CameraPanelUIUtils.a(this.j, this.v.f);
            if (TextUtils.isEmpty(this.v.e) && TextUtils.isEmpty(this.v.f)) {
                CameraViewUtils.a(this.h, 8);
                ViewGroup.MarginLayoutParams marginLayoutParams2 = (ViewGroup.MarginLayoutParams) this.k.getLayoutParams();
                marginLayoutParams2.height = (CameraViewUtils.a(0.816f) - w) - x;
                marginLayoutParams2.bottomMargin = CameraViewUtils.a(0.184f);
            } else {
                CameraViewUtils.a(this.h, 0);
            }
            CameraStatConst.b("BZST006");
        }
        CameraViewUtils.a(this.g, this.v.h ? 0 : 8);
    }

    @Override
    public void bB_() {
    }

    @Override
    public void e() {
        if (this.f53486b) {
            return;
        }
        this.f53486b = true;
        QBWebView qBWebView = this.k;
        if (qBWebView != null) {
            qBWebView.active();
        }
        NewCameraDataReporter.a("expose", "", this.f53485a ? "1" : "0");
    }

    @Override
    public void f() {
        if (this.f53486b) {
            this.f53486b = false;
            QBWebView qBWebView = this.k;
            if (qBWebView != null) {
                qBWebView.deactive();
            }
        }
    }

    @Override
    public void g() {
        f();
        QBWebView qBWebView = this.k;
        if (qBWebView != null) {
            qBWebView.destroy();
        }
    }

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

    @Override
    public void h() {
    }

    @Override
    public boolean handleMessage(Message message) {
        return false;
    }

    @Override
    public void i() {
    }

    @Override
    public boolean k() {
        return getVisibility() == 0;
    }

    @Override
    public void onClick(View view) {
        String str;
        EventCollector.getInstance().onViewClickedBefore(view);
        if (view != null) {
            switch (view.getId()) {
                case 1:
                    d();
                    break;
                case 2:
                    m();
                    str = "BZST049";
                    CameraStatConst.b(str);
                    break;
                case 3:
                    l();
                    break;
                case 4:
                    this.m = new QBPopupMenu(getContext());
                    this.m.b(17);
                    this.m.a(new Point(DeviceUtils.af() - MttResources.s(4), t + ((!BaseSettings.a().l() || NotchUtil.a(ContextHolder.getAppContext())) ? BaseSettings.a().m() : 0)));
                    this.m.d(200);
                    CameraSusuanData cameraSusuanData = this.v;
                    if (cameraSusuanData == null || !cameraSusuanData.l) {
                        this.m.b(5, MttResources.l(R.string.te), this);
                    } else {
                        QBImageTextView qBImageTextView = new QBImageTextView(getContext(), 1);
                        qBImageTextView.setText(MttResources.l(R.string.td));
                        qBImageTextView.setLayoutParams(new ViewGroup.LayoutParams(-1, UIResourceDimen.a(48.0f)));
                        qBImageTextView.setGravity(19);
                        qBImageTextView.setTextSize(UIResourceDimen.a(16.0f));
                        qBImageTextView.setTextColorNormalPressDisableIds(R.color.ki, R.color.ki, QBViewResourceManager.D, 80);
                        qBImageTextView.setFocusable(true);
                        qBImageTextView.setClickable(true);
                        qBImageTextView.setId(7);
                        qBImageTextView.setOnClickListener(this);
                        this.m.a(qBImageTextView);
                        this.m.a(7, false);
                    }
                    this.m.b(6, MttResources.l(R.string.tf), this);
                    this.m.show();
                    str = "BZSS001";
                    CameraStatConst.b(str);
                    break;
                case 5:
                    this.m.dismiss();
                    CameraSusuanData cameraSusuanData2 = this.v;
                    if (cameraSusuanData2 != null) {
                        cameraSusuanData2.l = true;
                        AccountInfo currentUserInfo = ((IAccount) SDKContext.getInstance().getService(IAccount.class)).getCurrentUserInfo();
                        CameraDataManager.a().a(this.v.i, this.v.j, currentUserInfo.qbId, null, this.v.k, null, null, System.currentTimeMillis() + "", 3, null);
                        MttToaster.show(MttResources.l(R.string.r8), 0);
                        str = "BZSS002";
                        CameraStatConst.b(str);
                        break;
                    }
                    break;
                case 6:
                    ((IFrameworkDelegate) QBContext.getInstance().getService(IFrameworkDelegate.class)).doLoad(new UrlParams("https://bbs.mb.qq.com/mobilefb/fbTree?serviceId=69&levelinfos=45dfe293-9d4a-46d6-8b47-7a5b07046b74&tname=%E6%89%AB%E4%B8%80%E6%89%AB").f(132).b(1).c(4).a((Bundle) null));
                    str = "BZSS003";
                    CameraStatConst.b(str);
                    break;
            }
        }
        EventCollector.getInstance().onViewClicked(view);
    }

    @Override
    public void setICameraPanelViewListener(ICameraResultViewNewListener iCameraResultViewNewListener) {
        this.o = iCameraResultViewNewListener;
    }
}