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

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


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

import android.animation.ValueAnimator;
import android.app.Activity;
import android.content.Context;
import android.content.DialogInterface;
import android.graphics.Bitmap;
import android.graphics.Canvas;
import android.graphics.Color;
import android.graphics.Matrix;
import android.graphics.Paint;
import android.graphics.Point;
import android.graphics.RectF;
import android.graphics.drawable.BitmapDrawable;
import android.os.Bundle;
import android.os.Handler;
import android.os.Message;
import android.text.TextUtils;
import android.view.KeyEvent;
import android.view.MotionEvent;
import android.view.View;
import android.view.ViewConfiguration;
import android.view.ViewGroup;
import android.widget.FrameLayout;
import android.widget.LinearLayout;
import androidx.viewpager.widget.ViewPager;
import com.facebook.common.util.UriUtil;
import com.tencent.common.http.Apn;
import com.tencent.common.threadpool.BrowserExecutorSupplier;
import com.tencent.common.utils.UrlUtils;
import com.tencent.common.wup.IWUPRequestCallBack;
import com.tencent.common.wup.WUPRequestBase;
import com.tencent.common.wup.WUPResponseBase;
import com.tencent.mm.opensdk.modelmsg.WXVideoFileObject;
import com.tencent.mtt.ContextHolder;
import com.tencent.mtt.R;
import com.tencent.mtt.account.base.IAccount;
import com.tencent.mtt.account.base.UserLoginListener;
import com.tencent.mtt.animation.QBViewPropertyAnimator;
import com.tencent.mtt.animator.ViewPropertyAnimatorBase;
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.stat.StatManager;
import com.tencent.mtt.base.ui.widget.QBWebImageView;
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.wrapper.callback.SnapshotSysCallBack;
import com.tencent.mtt.browser.memstat.facade.IMemoryUsageStatService;
import com.tencent.mtt.browser.share.export.socialshare.qqshare.QQShareActivity;
import com.tencent.mtt.browser.window.IWebView;
import com.tencent.mtt.browser.window.PageFrame;
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.compliance.MethodDelegate;
import com.tencent.mtt.external.ar.facade.ICameraImageFetcherCallback;
import com.tencent.mtt.external.explorerone.camera.ExploreBaseServer.MTT.RecordDetail;
import com.tencent.mtt.external.explorerone.camera.ar.inhost.ARManager;
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.CameraSoutiData;
import com.tencent.mtt.external.explorerone.camera.data.share.CameraShareBundleData;
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.newcamera.camera.data.CameraFrameData;
import com.tencent.mtt.external.explorerone.newcamera.framework.ui.indicator.ClipPagerTitleView;
import com.tencent.mtt.external.explorerone.newcamera.framework.ui.indicator.CommonNavigator;
import com.tencent.mtt.external.explorerone.newcamera.framework.ui.indicator.CommonNavigatorAdapter;
import com.tencent.mtt.external.explorerone.newcamera.framework.ui.indicator.IPagerIndicator;
import com.tencent.mtt.external.explorerone.newcamera.framework.ui.indicator.IPagerTitleView;
import com.tencent.mtt.external.explorerone.newcamera.framework.ui.indicator.LinePagerIndicator;
import com.tencent.mtt.external.explorerone.newcamera.framework.ui.indicator.MagicIndicator;
import com.tencent.mtt.external.explorerone.newcamera.framework.ui.indicator.WebPagerAdapter;
import com.tencent.mtt.external.explorerone.newcamera.framework.ui.indicator.badge.BadgePagerTitleView;
import com.tencent.mtt.external.explorerone.newcamera.framework.utils.SearchByImageUtils;
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.facade.IViewPullDownScrollListener;
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.operation.event.EventLog;
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.QBViewGroup;
import com.tencent.mtt.view.common.QBViewResourceManager;
import com.tencent.mtt.view.dialog.alert.MttLoadingDialog;
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.viewpager.BaseViewPager;
import com.tencent.qqlive.module.videoreport.collect.EventCollector;
import java.util.ArrayList;
import java.util.List;
import org.json.JSONException;
import org.json.JSONObject;
import qb.a.e;
import qb.a.f;

public class CameraSoutiResultView extends QBFrameLayout implements Handler.Callback, View.OnClickListener, ICameraPanelResultView {
    private CameraSoutiData E;
    private boolean F;
    private Paint G;
    private ICameraResultViewNewListener H;
    private int I;
    private String J;
    private MttLoadingDialog K;

    MagicIndicator f53442a;

    QBTextView f53443b;

    private boolean f53444c;

    private Paint f53445d;
    private QBImageView e;
    private QBImageView f;
    private QBImageView g;
    private QBTextView h;
    private QBLinearLayout i;
    private DoubleScorllViewWrapper j;
    private QBTextView k;
    private QBTextView l;
    private CameraTimuLoadingView o;
    private CommonNavigator p;
    private QBPopupMenu q;
    private QBWebImageView r;
    private List<WebPagerAdapter.WebDataBundle> s;
    private BaseViewPager t;
    private WebPagerAdapter u;
    private int w;
    private static final int m = MttResources.h(f.T);
    private static final int n = MttResources.s(112);
    private static final int v = MttResources.g(f.U);
    private static final int x = MttResources.g(f.r);
    private static final int y = MttResources.g(f.v);
    private static final int z = MttResources.g(f.f);
    private static final int A = CameraViewUtils.a(0.348f) + x;
    private static final int B = MttResources.g(f.E);
    private static final int C = MttResources.g(f.bN);
    private static final int D = CameraViewUtils.a(0.667f);

    public class AnonymousClass11 implements Runnable {

        final CameraShareBundleData f53448a;

        final Bitmap f53449b;

        final CameraShareTopicData f53450c;

        class AnonymousClass1 implements SnapshotSysCallBack {
            AnonymousClass1() {
            }

            @Override
            public void a(final Bitmap bitmap) {
                CameraSoutiResultView.this.a(new ICameraImageFetcherCallback() {
                    @Override
                    public void a(boolean z, Bitmap bitmap2, String str, int i, int i2) {
                        if (!z || bitmap2 == null) {
                            MttToaster.show(MttResources.l(R.string.sz), 0);
                            return;
                        }
                        AnonymousClass11.this.f53448a.f51642b = CameraSoutiResultView.this.a(bitmap, bitmap2, AnonymousClass11.this.f53449b);
                        AnonymousClass11.this.f53450c.h.l.add(AnonymousClass11.this.f53448a);
                        CameraSoutiResultView.this.post(new Runnable() {
                            @Override
                            public void run() {
                                if (CameraSoutiResultView.this.H != null) {
                                    CameraSoutiResultView.this.H.a(100014, AnonymousClass11.this.f53450c);
                                }
                            }
                        });
                    }
                });
            }
        }

        AnonymousClass11(CameraShareBundleData cameraShareBundleData, Bitmap bitmap, CameraShareTopicData cameraShareTopicData) {
            this.f53448a = cameraShareBundleData;
            this.f53449b = bitmap;
            this.f53450c = cameraShareTopicData;
        }

        @Override
        public void run() {
            if (!CameraSoutiResultView.this.A() || CameraSoutiResultView.this.u == null) {
                int pageFrameWidth = WindowManager.a().x().getPageFrameWidth();
                int pageFrameHeight = WindowManager.a().x().getPageFrameHeight();
                if (CameraSoutiResultView.this.u == null) {
                    return;
                }
                WebPagerAdapter.WebViewWrapper c2 = CameraSoutiResultView.this.u.c();
                if (c2 != null && c2.f52747a != null) {
                    final Bitmap snapshotWholePageUsingBitmap = c2.f52747a.snapshotWholePageUsingBitmap(pageFrameWidth, pageFrameHeight, IWebView.RatioRespect.RESPECT_WIDTH, 4);
                    CameraSoutiResultView.this.a(new ICameraImageFetcherCallback() {
                        @Override
                        public void a(boolean z, Bitmap bitmap, String str, int i, int i2) {
                            if (!z || bitmap == null) {
                                MttToaster.show(MttResources.l(R.string.sz), 0);
                                return;
                            }
                            AnonymousClass11.this.f53448a.f51642b = CameraSoutiResultView.this.a(snapshotWholePageUsingBitmap, bitmap, AnonymousClass11.this.f53449b);
                            AnonymousClass11.this.f53450c.h.l.add(AnonymousClass11.this.f53448a);
                            CameraSoutiResultView.this.post(new Runnable() {
                                @Override
                                public void run() {
                                    if (CameraSoutiResultView.this.H != null) {
                                        CameraSoutiResultView.this.H.a(100015, AnonymousClass11.this.f53450c);
                                    }
                                }
                            });
                        }
                    });
                    return;
                }
            } else {
                WebPagerAdapter.WebViewWrapper c3 = CameraSoutiResultView.this.u.c();
                if (c3 != null && c3.f52747a != null) {
                    c3.f52747a.snapshotWholePageUsingBitmapAsy(CameraTopicSharePagerController.m, 0, IWebView.RatioRespect.RESPECT_WIDTH, 4, new AnonymousClass1());
                    return;
                }
            }
            MttToaster.show(MttResources.l(R.string.sz), 0);
        }
    }

    public class DoubleScorllViewWrapper extends QBViewGroup {

        private float f53478b;

        private float f53479c;

        private int f53480d;
        private int e;
        private float f;
        private float g;
        private int h;
        private int i;
        private float j;
        private int k;
        private int l;
        private boolean m;
        private int n;
        private IViewPullDownScrollListener o;

        public DoubleScorllViewWrapper(Context context) {
            super(context);
            this.e = 0;
            this.i = 0;
            this.j = 0.0f;
            this.k = 0;
            this.l = ViewConfiguration.getTouchSlop();
            this.m = false;
            this.n = 0;
            this.o = null;
        }

        private boolean a(float f, float f2) {
            return f2 > ((float) this.l) && (f == 0.0f || Math.abs(f2) / Math.abs(f) >= 1.0f);
        }

        private boolean b(float f, float f2) {
            return f2 < ((float) (-this.l)) && (f == 0.0f || Math.abs(f2) / Math.abs(f) >= 1.0f);
        }

        public void a(int i) {
            this.k = i;
        }

        @Override
        public boolean onInterceptTouchEvent(MotionEvent motionEvent) {
            int actionMasked = motionEvent.getActionMasked();
            motionEvent.getPointerId(motionEvent.getActionIndex());
            if (actionMasked == 0) {
                this.m = false;
                this.f53478b = motionEvent.getX();
                this.f53479c = motionEvent.getY();
                this.f53480d = (int) motionEvent.getRawY();
                this.e = this.f53480d;
                this.n = (int) CameraSoutiResultView.this.r.getTranslationY();
                this.i = 1;
                this.j = getY();
                this.o = CameraSoutiResultView.this.u.d();
            } else if (actionMasked == 2 && this.o != null) {
                int pointerCount = motionEvent.getPointerCount();
                for (int i = 0; i < pointerCount; i++) {
                    if (this.h == motionEvent.getPointerId(i)) {
                        this.f = motionEvent.getX(i) - this.f53478b;
                        this.g = motionEvent.getY(i) - this.f53479c;
                        int translationY = (int) CameraSoutiResultView.this.r.getTranslationY();
                        if (this.i == 1 && ((b(this.f, this.g) && translationY <= 0 && translationY > (-this.k)) || (a(this.f, this.g) && translationY < 0 && translationY >= (-this.k) && this.o.a(this.g)))) {
                            this.i = 2;
                            this.m = true;
                        }
                    }
                }
            }
            return this.i == 2;
        }

        @Override
        protected void onLayout(boolean z, int i, int i2, int i3, int i4) {
            int i5 = i3 - i;
            int i6 = i4 - i2;
            int childCount = getChildCount();
            if (i5 <= 0 || i6 <= 0 || childCount <= 0) {
                return;
            }
            int paddingLeft = getPaddingLeft();
            int paddingTop = getPaddingTop();
            int childCount2 = getChildCount();
            for (int i7 = 0; i7 < childCount2; i7++) {
                View childAt = getChildAt(i7);
                int i8 = ((ViewGroup.MarginLayoutParams) childAt.getLayoutParams()).topMargin + paddingTop;
                if (childAt.getVisibility() != 8) {
                    childAt.layout(paddingLeft, i8, childAt.getMeasuredWidth() + paddingLeft, childAt.getMeasuredHeight() + i8);
                }
            }
        }

        @Override
        protected void onMeasure(int i, int i2) {
            int childCount = getChildCount();
            for (int i3 = 0; i3 < childCount; i3++) {
                View childAt = getChildAt(i3);
                if (childAt.getVisibility() != 8) {
                    ViewGroup.MarginLayoutParams marginLayoutParams = (ViewGroup.MarginLayoutParams) childAt.getLayoutParams();
                    if (i3 == 1) {
                        childAt.measure(View.MeasureSpec.makeMeasureSpec((View.MeasureSpec.getSize(i) - getPaddingLeft()) - getPaddingRight(), WXVideoFileObject.FILE_SIZE_LIMIT), View.MeasureSpec.makeMeasureSpec((View.MeasureSpec.getSize(i2) - marginLayoutParams.topMargin) + this.k, WXVideoFileObject.FILE_SIZE_LIMIT));
                    } else {
                        childAt.measure(View.MeasureSpec.makeMeasureSpec((View.MeasureSpec.getSize(i) - getPaddingLeft()) - getPaddingRight(), WXVideoFileObject.FILE_SIZE_LIMIT), View.MeasureSpec.makeMeasureSpec(Math.min(View.MeasureSpec.getSize(i2) - getTop(), marginLayoutParams.height), WXVideoFileObject.FILE_SIZE_LIMIT));
                    }
                }
            }
            super.onMeasure(i, i2);
        }

        @Override
        public boolean onTouchEvent(MotionEvent motionEvent) {
            ValueAnimator ofFloat;
            ValueAnimator.AnimatorUpdateListener animatorUpdateListener;
            int action = motionEvent.getAction();
            if (action == 0) {
                return this.m;
            }
            if (action != 1) {
                if (action == 2) {
                    float rawY = motionEvent.getRawY();
                    int i = (int) (rawY - this.f53480d);
                    if (Math.abs(i) > 1.0f) {
                        int i2 = i + this.n;
                        int i3 = this.k;
                        int i4 = i2 < (-i3) ? -i3 : i2;
                        if (i2 > 0) {
                            i4 = 0;
                        }
                        float f = i4;
                        CameraSoutiResultView.this.r.setTranslationY(f);
                        CameraSoutiResultView.this.t.setTranslationY(f);
                    }
                    this.e = (int) rawY;
                }
                return super.onTouchEvent(motionEvent);
            }
            final int translationY = (int) CameraSoutiResultView.this.r.getTranslationY();
            float rawY2 = motionEvent.getRawY();
            if (translationY < 0 && translationY > (-this.k)) {
                if (((int) (rawY2 - this.f53480d)) <= 0) {
                    ofFloat = ValueAnimator.ofFloat(0.0f, 1.0f);
                    animatorUpdateListener = new ValueAnimator.AnimatorUpdateListener() {
                        @Override
                        public void onAnimationUpdate(ValueAnimator valueAnimator) {
                            float floatValue = translationY + (((-DoubleScorllViewWrapper.this.k) - translationY) * ((Float) valueAnimator.getAnimatedValue()).floatValue());
                            CameraSoutiResultView.this.r.setTranslationY(floatValue);
                            CameraSoutiResultView.this.t.setTranslationY(floatValue);
                        }
                    };
                } else {
                    ofFloat = ValueAnimator.ofFloat(0.0f, 1.0f);
                    animatorUpdateListener = new ValueAnimator.AnimatorUpdateListener() {
                        @Override
                        public void onAnimationUpdate(ValueAnimator valueAnimator) {
                            float floatValue = ((Float) valueAnimator.getAnimatedValue()).floatValue();
                            float f2 = translationY + ((0 - r0) * floatValue);
                            CameraSoutiResultView.this.r.setTranslationY(f2);
                            CameraSoutiResultView.this.t.setTranslationY(f2);
                        }
                    };
                }
                ofFloat.addUpdateListener(animatorUpdateListener);
                ofFloat.setDuration(300L);
                ofFloat.start();
            }
            return super.onTouchEvent(motionEvent);
        }
    }

    public CameraSoutiResultView(Context context) {
        this(context, -1);
    }

    public CameraSoutiResultView(Context context, int i) {
        super(context);
        this.f53444c = false;
        this.e = null;
        this.f = null;
        this.g = null;
        this.h = null;
        this.k = null;
        this.l = null;
        this.o = null;
        this.s = null;
        this.u = null;
        this.w = MttResources.g(f.U);
        this.F = false;
        this.I = -1;
        this.J = "";
        if (i != -1) {
            this.w = i;
        }
        this.G = new Paint();
        this.s = new ArrayList();
        setBackgroundNormalIds(0, e.W);
        p();
    }

    public boolean A() {
        WebPagerAdapter.WebViewWrapper c2;
        WebPagerAdapter webPagerAdapter = this.u;
        QBWebView qBWebView = null;
        if (webPagerAdapter != null && webPagerAdapter.c() != null && (c2 = this.u.c()) != null) {
            qBWebView = c2.f52747a;
        }
        if (qBWebView != null) {
            return qBWebView.isX5WebView();
        }
        EventLog.a("摄像头", "搜题结果分享", "分享失败", "获取当前的webview空对象", "cccongzheng");
        return false;
    }

    public Bitmap a(Bitmap bitmap, Bitmap bitmap2, Bitmap bitmap3) {
        Bitmap bitmap4;
        Bitmap bitmap5;
        Bitmap p;
        float g;
        float f;
        float f2;
        Bitmap p2;
        float g2;
        Bitmap bitmap6 = bitmap;
        if (bitmap6 != null) {
            try {
                try {
                    if (!bitmap.isRecycled() && bitmap2 != null && !bitmap2.isRecycled()) {
                        int g3 = MttResources.g(f.f85878b);
                        int a2 = CameraViewUtils.a(0.064f);
                        int i = CameraTopicSharePagerController.f;
                        int i2 = CameraTopicSharePagerController.g;
                        if (this.u != null) {
                            this.u.a();
                        }
                        int i3 = CameraTopicSharePagerController.h - g3;
                        int i4 = CameraTopicSharePagerController.i;
                        int i5 = CameraTopicSharePagerController.j;
                        int height = bitmap.getHeight();
                        try {
                            if (MethodDelegate.getModel().trim().toLowerCase().contains("a0001")) {
                                height = getHeight();
                                bitmap6 = Bitmap.createBitmap(bitmap6, 0, bitmap.getHeight() - height, bitmap.getWidth(), height);
                            } else if (height > getHeight() * 3) {
                                height = getHeight() * 3;
                                bitmap6 = Bitmap.createBitmap(bitmap6, 0, 0, bitmap.getWidth(), height);
                            }
                        } catch (Exception unused) {
                        }
                        int af = DeviceUtils.af();
                        Bitmap createBitmap = Bitmap.createBitmap(af + 2, ((((height + a2) + CameraTopicSharePagerController.l) + CameraTopicSharePagerController.k) - g3) + 2, Bitmap.Config.ARGB_8888);
                        Canvas canvas = new Canvas(createBitmap);
                        canvas.drawColor(-1);
                        Matrix matrix = new Matrix();
                        if (bitmap3 != null) {
                            float width = af / bitmap3.getWidth();
                            matrix.preScale(width, width);
                            bitmap5 = null;
                            try {
                                canvas.drawBitmap(bitmap3, matrix, null);
                            } catch (Exception unused2) {
                                return bitmap5;
                            } catch (OutOfMemoryError unused3) {
                                ((IMemoryUsageStatService) QBContext.getInstance().getService(IMemoryUsageStatService.class)).handleOOMError(0);
                                return bitmap5;
                            }
                        }
                        matrix.reset();
                        int i6 = 1 + i + a2 + i2;
                        matrix.postTranslate(((af - CameraTopicSharePagerController.m) / 2) + 1, i6);
                        canvas.drawBitmap(bitmap6, matrix, null);
                        Bitmap p3 = MttResources.p(R.drawable.aad);
                        matrix.reset();
                        int g4 = MttResources.g(f.ac);
                        float height2 = g4 / p3.getHeight();
                        int i7 = i6 + height + i3;
                        matrix.postTranslate(((af - g4) / 2) + 1, i7);
                        matrix.preScale(height2, height2);
                        try {
                            canvas.drawBitmap(p3, matrix, null);
                            int b2 = CameraViewUtils.b(0.27f);
                            p = MttResources.p(R.drawable.a_z);
                            g = MttResources.g(f.v) / p.getHeight();
                            matrix.reset();
                            matrix.preScale(g, g);
                            f = b2 + 1;
                            f2 = i4 + i7 + g4;
                            matrix.postTranslate(f, f2);
                            try {
                                canvas.drawBitmap(p, matrix, null);
                                p2 = MttResources.p(R.drawable.a_8);
                                g2 = MttResources.g(f.n) / p2.getHeight();
                                matrix.reset();
                                matrix.preScale(g2, g2);
                                matrix.postTranslate((p.getWidth() * g) + f + MttResources.s(4), r4 + i5);
                                bitmap4 = null;
                            } catch (Exception unused4) {
                                return null;
                            } catch (OutOfMemoryError unused5) {
                                bitmap5 = null;
                            }
                        } catch (Exception unused6) {
                            return null;
                        } catch (OutOfMemoryError unused7) {
                            bitmap5 = null;
                        }
                        try {
                            canvas.drawBitmap(p2, matrix, null);
                            float g5 = MttResources.g(f.v) / bitmap2.getHeight();
                            matrix.reset();
                            matrix.preScale(g5, g5);
                            matrix.postTranslate(f + (p.getWidth() * g) + (MttResources.s(4) * 2) + (p2.getWidth() * g2), f2);
                            bitmap5 = null;
                            canvas.drawBitmap(bitmap2, matrix, null);
                            if (bitmap6 != null && !bitmap6.isRecycled()) {
                                bitmap6.recycle();
                            }
                            bitmap4 = createBitmap;
                        } catch (Exception unused8) {
                        } catch (OutOfMemoryError unused9) {
                            bitmap5 = null;
                            ((IMemoryUsageStatService) QBContext.getInstance().getService(IMemoryUsageStatService.class)).handleOOMError(0);
                            return bitmap5;
                        }
                        return bitmap4;
                    }
                } catch (Exception unused10) {
                    return null;
                }
            } catch (OutOfMemoryError unused11) {
                bitmap5 = null;
            }
        }
        bitmap4 = null;
        return bitmap4;
    }

    public void a(int i, float f, int i2, int i3) {
        int i4;
        QBTextView qBTextView;
        int i5;
        this.f53442a.a(i, f, i2);
        if (i3 <= 1 || i < i3 - 2 || (qBTextView = this.h) == null || (i5 = this.I) < i4) {
            return;
        }
        if (i5 != i4) {
            if (i5 == i) {
                return;
            }
            if (f == 0.0f) {
                qBTextView.setTranslationX(f);
                return;
            }
        }
        qBTextView.setTranslationX((1.0f - f) * n);
    }

    public void a(int i, int i2) {
        QBTextView qBTextView;
        QBTextView qBTextView2;
        this.f53442a.a(i);
        WebPagerAdapter.WebDataWrapper a2 = this.u.a();
        if (a2 != null && !a2.h) {
            a2.h = true;
            StatManager.b().c("BZST064_" + (i + 1));
        }
        if (this.u.b() != null) {
            this.l.setTag(Boolean.valueOf(this.u.b().k));
        }
        if (i2 > 1 && i <= i2 - 2 && (qBTextView2 = this.h) != null) {
            qBTextView2.setTranslationX(n);
        } else if (i2 > 1 && i == i2 - 1 && (qBTextView = this.h) != null) {
            qBTextView.setTranslationX(0.0f);
        }
        this.I = i;
    }

    public void a(Bitmap bitmap) {
        CameraShareTopicData cameraShareTopicData = new CameraShareTopicData();
        cameraShareTopicData.h = new CameraPanelShareData();
        cameraShareTopicData.h.l = new ArrayList<>();
        CameraShareBundleData a2 = CameraShareBundleData.a(23);
        setWebUrl(a2);
        a2.e = 1;
        a2.f = "qb://camera/topicshare";
        a2.g = 12;
        postDelayed(new AnonymousClass11(a2, bitmap, cameraShareTopicData), 200L);
    }

    public void a(ICameraImageFetcherCallback iCameraImageFetcherCallback) {
        if (!Apn.isNetworkAvailable()) {
            MttToaster.show(MttResources.l(R.string.st), 0);
            return;
        }
        WebPagerAdapter webPagerAdapter = this.u;
        WebPagerAdapter.WebDataWrapper a2 = webPagerAdapter != null ? webPagerAdapter.a() : null;
        if (a2 == null || TextUtils.isEmpty(a2.f52746d)) {
            MttToaster.show(MttResources.l(R.string.sz), 0);
        } else {
            new CameraImageFetcher(a2.f52746d, iCameraImageFetcherCallback).a();
        }
    }

    public void a(Runnable runnable) {
        BrowserExecutorSupplier.forMainThreadTasks().execute(runnable);
    }

    private void p() {
        this.f53445d = new Paint();
        QBFrameLayout qBFrameLayout = new QBFrameLayout(getContext()) {
            @Override
            public void dispatchDraw(Canvas canvas) {
                super.dispatchDraw(canvas);
                CameraSoutiResultView.this.f53445d.setStyle(Paint.Style.FILL_AND_STROKE);
                CameraSoutiResultView.this.f53445d.setColor(MttResources.c(R.color.jm));
                CameraSoutiResultView.this.f53445d.setStrokeWidth(1);
                canvas.drawLine(0.0f, getMeasuredHeight() - 1, getMeasuredWidth(), getMeasuredHeight() - 1, CameraSoutiResultView.this.f53445d);
            }
        };
        qBFrameLayout.setClickable(true);
        FrameLayout.LayoutParams layoutParams = new FrameLayout.LayoutParams(-1, v);
        layoutParams.gravity = 48;
        layoutParams.topMargin = (!BaseSettings.a().l() || NotchUtil.a(ContextHolder.getAppContext())) ? BaseSettings.a().m() : 0;
        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(y, 0, z, 0);
        layoutParams2.gravity = 16;
        qBFrameLayout.addView(this.e, layoutParams2);
        this.f53442a = new MagicIndicator(getContext());
        qBFrameLayout.addView(this.f53442a, new FrameLayout.LayoutParams(C, v, 49));
        this.f53443b = new QBTextView(getContext().getApplicationContext());
        this.f53443b.setBackgroundNormalIds(0, e.W);
        this.f53443b.setGravity(17);
        FrameLayout.LayoutParams layoutParams3 = new FrameLayout.LayoutParams(C, v, 49);
        this.f53443b.setTextColorNormalIds(R.color.kf);
        this.f53443b.setTextSize(MttResources.h(f.t));
        qBFrameLayout.addView(this.f53443b, layoutParams3);
        this.f53443b.setVisibility(8);
        this.f = new QBImageView(getContext());
        this.f.setImageNormalPressIds(R.drawable.aac, R.color.kn, 0, R.color.k3);
        this.f.setOnClickListener(this);
        this.f.setId(2);
        FrameLayout.LayoutParams layoutParams4 = new FrameLayout.LayoutParams(-2, -2);
        layoutParams4.gravity = 21;
        layoutParams4.rightMargin = MttResources.g(f.aj);
        qBFrameLayout.addView(this.f, layoutParams4);
        CameraViewUtils.a(this.f, 8);
        this.g = new QBImageView(getContext());
        this.g.setImageNormalPressIds(R.drawable.a_e, R.color.kn, 0, R.color.k3);
        this.g.setOnClickListener(this);
        this.g.setId(4);
        FrameLayout.LayoutParams layoutParams5 = new FrameLayout.LayoutParams(-2, -2);
        this.g.setPadding(z, 0, MttResources.g(f.r), 0);
        layoutParams5.gravity = 21;
        qBFrameLayout.addView(this.g, layoutParams5);
        this.j = new DoubleScorllViewWrapper(getContext());
        FrameLayout.LayoutParams layoutParams6 = new FrameLayout.LayoutParams(-1, -1);
        layoutParams6.topMargin = v + ((!BaseSettings.a().l() || NotchUtil.a(ContextHolder.getAppContext())) ? BaseSettings.a().m() : 0);
        layoutParams6.bottomMargin = this.w;
        addView(this.j, layoutParams6);
        DoubleScorllViewWrapper doubleScorllViewWrapper = this.j;
        int i = x;
        doubleScorllViewWrapper.setPadding(i, 0, i, 0);
        this.o = new CameraTimuLoadingView(getContext(), false, false);
        FrameLayout.LayoutParams layoutParams7 = new FrameLayout.LayoutParams(-2, -2);
        layoutParams7.gravity = 17;
        addView(this.o, layoutParams7);
        CameraViewUtils.a(this.o, 8);
        this.r = new QBWebImageView(getContext());
        ViewGroup.MarginLayoutParams marginLayoutParams = new ViewGroup.MarginLayoutParams(-1, A);
        this.r.setPadding(0, MttResources.g(f.j), 0, MttResources.g(f.j));
        this.r.setUseMaskForNightMode(false);
        this.r.setLayoutParams(marginLayoutParams);
        this.j.addView(this.r);
        this.t = new BaseViewPager(getContext());
        this.t.setUseMaskForNightMode(false);
        this.u = new WebPagerAdapter(this.t);
        this.t.setAdapter(this.u);
        ViewGroup.MarginLayoutParams marginLayoutParams2 = new ViewGroup.MarginLayoutParams(-1, A);
        marginLayoutParams2.topMargin = A;
        this.j.addView(this.t, marginLayoutParams2);
        this.i = new QBLinearLayout(getContext()) {
            @Override
            public void dispatchDraw(Canvas canvas) {
                super.dispatchDraw(canvas);
                CameraSoutiResultView.this.f53445d.setStyle(Paint.Style.FILL_AND_STROKE);
                CameraSoutiResultView.this.f53445d.setColor(MttResources.c(R.color.jm));
                float f = 1;
                CameraSoutiResultView.this.f53445d.setStrokeWidth(f);
                canvas.drawLine(0.0f, 0.0f, getMeasuredWidth(), f, CameraSoutiResultView.this.f53445d);
            }
        };
        this.i.setOrientation(0);
        this.i.setClickable(true);
        this.i.setGravity(17);
        FrameLayout.LayoutParams layoutParams8 = new FrameLayout.LayoutParams(-1, this.w);
        layoutParams8.gravity = 80;
        addView(this.i, layoutParams8);
        this.l = new QBTextView(getContext().getApplicationContext()) {
            @Override
            public void onDraw(Canvas canvas) {
                super.onDraw(canvas);
                CameraSoutiResultView.this.G.reset();
                CameraSoutiResultView.this.G.setStyle(Paint.Style.STROKE);
                CameraSoutiResultView.this.G.setStrokeWidth(2.0f);
                CameraSoutiResultView.this.G.setColor(getCurrentTextColor());
                canvas.drawRoundRect(new RectF(2.0f, 2.0f, getWidth() - 2, getHeight() - 2), 8.0f, 8.0f, CameraSoutiResultView.this.G);
            }

            @Override
            public void setTag(final Object obj) {
                super.setTag(obj);
                BrowserExecutorSupplier.forMainThreadTasks().execute(new Runnable() {
                    @Override
                    public void run() {
                        AnonymousClass3 anonymousClass3;
                        String str;
                        if (CameraSoutiResultView.this.u.b() != null) {
                            CameraSoutiResultView.this.u.b().k = ((Boolean) obj).booleanValue();
                        }
                        Object obj2 = obj;
                        if (obj2 instanceof Boolean) {
                            if (((Boolean) obj2).booleanValue()) {
                                setTextColorNormalIds(R.color.kd);
                                anonymousClass3 = AnonymousClass3.this;
                                str = "已添加至笔记";
                            } else {
                                setTextColorNormalIds(R.color.kg);
                                anonymousClass3 = AnonymousClass3.this;
                                str = "添加至笔记";
                            }
                            anonymousClass3.setText(str);
                        }
                    }
                });
            }
        };
        LinearLayout.LayoutParams layoutParams9 = new LinearLayout.LayoutParams(MttResources.g(f.bm), MttResources.g(f.M));
        layoutParams9.rightMargin = MttResources.h(f.t);
        this.l.setGravity(17);
        this.l.setTextColor(MttResources.c(R.color.ha));
        this.l.setTextSize(0, MttResources.h(f.cF));
        this.l.setText("添加至笔记");
        this.l.setTag(false);
        this.l.setId(5);
        this.l.setOnClickListener(this);
        this.i.addView(this.l, layoutParams9);
        this.k = new QBTextView(getContext().getApplicationContext()) {
            @Override
            public void onDraw(Canvas canvas) {
                CameraSoutiResultView.this.G.reset();
                CameraSoutiResultView.this.G.setStyle(Paint.Style.FILL_AND_STROKE);
                CameraSoutiResultView.this.G.setColor(MttResources.c(R.color.kg));
                canvas.drawRoundRect(new RectF(2.0f, 2.0f, getWidth() - 2, getHeight() - 2), 8.0f, 8.0f, CameraSoutiResultView.this.G);
                super.onDraw(canvas);
            }
        };
        LinearLayout.LayoutParams layoutParams10 = new LinearLayout.LayoutParams(MttResources.g(f.bm), MttResources.g(f.M));
        layoutParams10.leftMargin = MttResources.h(f.t);
        this.k.setGravity(17);
        this.k.setTextColorNormalIds(R.color.white);
        this.k.setTextSize(MttResources.h(f.cF));
        this.k.setText("继续拍");
        this.k.setId(3);
        this.k.setOnClickListener(this);
        this.i.addView(this.k, layoutParams10);
        this.J = ARManager.a().n();
        if (TextUtils.isEmpty(this.J) || this.J.equals("0")) {
            return;
        }
        this.h = new QBTextView(getContext().getApplicationContext());
        this.h.setBackgroundNormalIds(R.drawable.aar, R.color.a2o);
        this.h.setTextColorNormalIds(R.color.gu);
        this.h.setTextSize(MttResources.h(f.p));
        this.h.setTypeface(null, 1);
        this.h.setGravity(17);
        this.h.setOnClickListener(this);
        this.h.setText(MttResources.l(R.string.ta));
        this.h.setId(6);
        FrameLayout.LayoutParams layoutParams11 = new FrameLayout.LayoutParams(n, MttResources.s(36));
        layoutParams11.gravity = 85;
        layoutParams11.bottomMargin = MttResources.s(167);
        addView(this.h, layoutParams11);
        this.h.setTranslationX(n);
    }

    private void q() {
        this.p = new CommonNavigator(getContext());
        List<WebPagerAdapter.WebDataBundle> list = this.s;
        int size = list == null ? 0 : list.size();
        ViewGroup.MarginLayoutParams marginLayoutParams = (ViewGroup.MarginLayoutParams) this.f53442a.getLayoutParams();
        int i = B * size;
        int i2 = C;
        if (i > i2) {
            i = i2;
        }
        marginLayoutParams.width = i;
        this.f53442a.setLayoutParams(marginLayoutParams);
        setupAdapter(size);
        this.p.setScrollable(true);
        setupInternalPageChangeListener(size);
        this.f53442a.setNavigator(this.p);
        if (size == 1) {
            r();
            return;
        }
        QBTextView qBTextView = this.h;
        if (qBTextView != null) {
            qBTextView.setTranslationX(n);
        }
    }

    private void r() {
        QBTextView qBTextView = this.h;
        if (qBTextView == null) {
            return;
        }
        qBTextView.setTranslationX(n);
        ViewPropertyAnimatorBase a2 = QBViewPropertyAnimator.a(this.h);
        a2.d();
        a2.d(0.0f);
        a2.a(300L);
        a2.b();
    }

    private boolean s() {
        if (this.F) {
            MttToaster.show("当前没有答案,不能添加到笔记~", 1000);
            return true;
        }
        if (this.o.getVisibility() == 0) {
            return true;
        }
        IAccount iAccount = (IAccount) SDKContext.getInstance().getService(IAccount.class);
        if (!iAccount.getCurrentUserInfo().isLogined()) {
            Bundle bundle = new Bundle();
            bundle.putInt(QQShareActivity.KEY_FROM_WHERE, 28);
            iAccount.callUserLogin(getContext(), bundle, new UserLoginListener() {
                @Override
                public void onLoginFailed(int i, String str) {
                }

                @Override
                public void onLoginSuccess() {
                    BrowserExecutorSupplier.forMainThreadTasks().execute(new Runnable() {
                        @Override
                        public void run() {
                            CameraSoutiResultView.this.l.performClick();
                        }
                    });
                }
            });
            return true;
        }
        if (this.u.b() != null && this.E != null) {
            this.l.setClickable(false);
            if (((Boolean) this.l.getTag()).booleanValue()) {
                this.l.setTag(false);
                ARManager.a().a(this.E.h, this.u.b().j, new IWUPRequestCallBack() {
                    @Override
                    public void onWUPTaskFail(WUPRequestBase wUPRequestBase) {
                        CameraStatConst.b("BZST068");
                        MttToaster.show("添加失败", 1000);
                        CameraSoutiResultView.this.a(new Runnable() {
                            @Override
                            public void run() {
                                if (CameraSoutiResultView.this.l != null) {
                                    CameraSoutiResultView.this.l.setClickable(true);
                                    CameraSoutiResultView.this.l.setTag(true);
                                }
                            }
                        });
                    }

                    @Override
                    public void onWUPTaskSuccess(WUPRequestBase wUPRequestBase, WUPResponseBase wUPResponseBase) {
                        CameraStatConst.b("BZST067");
                        CameraSoutiResultView.this.a(new Runnable() {
                            @Override
                            public void run() {
                                if (CameraSoutiResultView.this.l != null) {
                                    CameraSoutiResultView.this.l.setClickable(true);
                                }
                            }
                        });
                    }
                });
            }
        }
        return false;
    }

    private void setWebUrl(CameraShareBundleData cameraShareBundleData) {
        CameraSoutiData cameraSoutiData = this.E;
        cameraShareBundleData.f51644d = cameraSoutiData != null ? cameraSoutiData.f51617a : "https://xyst.yuanfudao.com/questions/open?coop=QQ_BROWSER";
    }

    private void setupAdapter(final int i) {
        this.p.setAdapter(new CommonNavigatorAdapter() {
            @Override
            public int a() {
                return i;
            }

            @Override
            public IPagerIndicator a(Context context) {
                LinePagerIndicator linePagerIndicator = new LinePagerIndicator(context);
                float f = CameraSoutiResultView.v;
                float s = MttResources.s(1);
                float f2 = f - (2.0f * s);
                linePagerIndicator.setLineHeight(f2);
                linePagerIndicator.setRoundRadius((f2 * 1.0f) / 4.0f);
                linePagerIndicator.setYOffset(s);
                linePagerIndicator.setShowIndicator(true);
                linePagerIndicator.setColors(Integer.valueOf(Color.parseColor("#FF4C9AFA")));
                linePagerIndicator.setShowBackground(true);
                linePagerIndicator.setBgColor(Color.parseColor("#FFF0F0F0"));
                return linePagerIndicator;
            }

            @Override
            public IPagerTitleView a(Context context, final int i2) {
                BadgePagerTitleView badgePagerTitleView = new BadgePagerTitleView(context);
                ClipPagerTitleView clipPagerTitleView = new ClipPagerTitleView(context);
                clipPagerTitleView.setContentDescription(((WebPagerAdapter.WebDataBundle) CameraSoutiResultView.this.s.get(i2)).f52740b);
                clipPagerTitleView.setCliperPagerTextSize(MttResources.h(f.cX));
                clipPagerTitleView.setTextWidth(CameraViewUtils.a(CameraSoutiResultView.this.getContext(), MttResources.h(f.cX), CameraPanelUIUtils.b(0.2f), 0.0f, 1, ((WebPagerAdapter.WebDataBundle) CameraSoutiResultView.this.s.get(i2)).f52740b));
                clipPagerTitleView.setShowRound(false);
                clipPagerTitleView.setRoundRadius(((CameraSoutiResultView.v - (MttResources.s(1) * 2.0f)) * 1.0f) / 4.0f);
                clipPagerTitleView.setText(((WebPagerAdapter.WebDataBundle) CameraSoutiResultView.this.s.get(i2)).f52740b);
                clipPagerTitleView.setTextColor(Color.parseColor("#FF000000"));
                clipPagerTitleView.setClipColor(-1);
                clipPagerTitleView.setOnClickListener(new View.OnClickListener() {
                    @Override
                    public void onClick(View view) {
                        EventCollector.getInstance().onViewClickedBefore(view);
                        CameraSoutiResultView.this.t.setCurrentItem(i2);
                        EventCollector.getInstance().onViewClicked(view);
                    }
                });
                badgePagerTitleView.setInnerPagerTitleView(clipPagerTitleView);
                return badgePagerTitleView;
            }

            @Override
            public float b(Context context, int i2) {
                return super.b(context, i2);
            }
        });
    }

    private void setupInternalPageChangeListener(final int i) {
        this.t.setInternalPageChangeListener(new ViewPager.OnPageChangeListener() {
            @Override
            public void onPageScrollStateChanged(int i2) {
                CameraSoutiResultView.this.f53442a.b(i2);
            }

            @Override
            public void onPageScrolled(int i2, float f, int i3) {
                CameraSoutiResultView.this.a(i2, f, i3, i);
            }

            @Override
            public void onPageSelected(int i2) {
                CameraSoutiResultView.this.a(i2, i);
            }
        });
    }

    private void t() {
        this.q = new QBPopupMenu(getContext());
        this.q.b(17);
        this.q.a(new Point(DeviceUtils.af() - MttResources.s(4), m + ((!BaseSettings.a().l() || NotchUtil.a(ContextHolder.getAppContext())) ? BaseSettings.a().m() : 0)));
        this.q.d(200);
        WebPagerAdapter.WebDataBundle b2 = this.u.b();
        if (b2 == null || !b2.i) {
            this.q.b(1000, MttResources.l(R.string.t8), this);
            this.q.b(1001, MttResources.l(R.string.t9), this);
        } else {
            QBImageTextView qBImageTextView = new QBImageTextView(getContext(), 1);
            qBImageTextView.setText(MttResources.l(R.string.t7));
            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(1003);
            qBImageTextView.setOnClickListener(this);
            this.q.a(qBImageTextView);
            this.q.a(1003, false);
        }
        this.q.b(1002, MttResources.l(R.string.t_), this);
        this.q.show();
        CameraStatConst.b("BZST024");
    }

    private void u() {
        this.q.dismiss();
        WebPagerAdapter.WebDataBundle b2 = this.u.b();
        if (b2 != null) {
            try {
                JSONObject jSONObject = new JSONObject();
                jSONObject.put("type", b2.g);
                jSONObject.put("url", b2.f52739a);
                jSONObject.put("data", b2.f52742d);
                jSONObject.put("from", b2.f);
                jSONObject.put("from_id", b2.e);
                jSONObject.put("icon", b2.f52741c);
                b2.i = true;
                AccountInfo currentUserInfo = ((IAccount) SDKContext.getInstance().getService(IAccount.class)).getCurrentUserInfo();
                CameraDataManager.a().a(this.E.h, this.E.i, currentUserInfo.qbId, null, this.E.j, null, jSONObject.toString(), System.currentTimeMillis() + "", 2, null);
                MttToaster.show(MttResources.l(R.string.r8), 0);
            } catch (JSONException unused) {
            }
        }
        CameraStatConst.b("BZST091");
    }

    private void v() {
        this.q.dismiss();
        WebPagerAdapter.WebDataBundle b2 = this.u.b();
        if (b2 != null) {
            try {
                JSONObject jSONObject = new JSONObject();
                jSONObject.put("type", b2.g);
                jSONObject.put("url", b2.f52739a);
                jSONObject.put("data", b2.f52742d);
                jSONObject.put("from", b2.f);
                jSONObject.put("from_id", b2.e);
                jSONObject.put("icon", b2.f52741c);
                b2.i = true;
                AccountInfo currentUserInfo = ((IAccount) SDKContext.getInstance().getService(IAccount.class)).getCurrentUserInfo();
                CameraDataManager.a().a(this.E.h, this.E.i, currentUserInfo.qbId, null, this.E.j, null, jSONObject.toString(), System.currentTimeMillis() + "", 1, null);
            } catch (JSONException unused) {
            }
        }
        MttToaster.show(MttResources.l(R.string.r8), 0);
        CameraStatConst.b("BZST090");
    }

    private void w() {
        m();
        CameraFrameData cameraFrameData = new CameraFrameData();
        cameraFrameData.a(this.E.g);
        cameraFrameData.f52321d = 1;
        SearchByImageUtils.a(cameraFrameData, new SearchByImageUtils.ISearchImageCallback() {
            @Override
            public void a() {
            }

            @Override
            public void a(String str) {
                StringBuilder sb;
                if (CameraSoutiResultView.this.f53444c && CameraSoutiResultView.this.K != null && CameraSoutiResultView.this.K.isShowing() && !TextUtils.isEmpty(CameraSoutiResultView.this.J)) {
                    if (UrlUtils.isHttpsUrl(str)) {
                        sb = new StringBuilder();
                    } else {
                        str = str.replace(UriUtil.HTTP_SCHEME, UriUtil.HTTPS_SCHEME);
                        sb = new StringBuilder();
                    }
                    sb.append(str);
                    sb.append(CameraSoutiResultView.this.J);
                    CameraPanelUIUtils.a(sb.toString());
                }
                CameraSoutiResultView.this.n();
            }

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

    private void x() {
        PageFrame s = WindowManager.a().s();
        if (s != null) {
            s.back(false);
        }
        CameraStatConst.b("BZST023");
    }

    private void y() {
        ICameraResultViewNewListener iCameraResultViewNewListener = this.H;
        if (iCameraResultViewNewListener != null) {
            iCameraResultViewNewListener.m();
        }
        setVisibility(8);
        CameraStatConst.b("BZST025");
    }

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

    public void a() {
        b();
        d();
        FrameLayout.LayoutParams layoutParams = (FrameLayout.LayoutParams) this.f.getLayoutParams();
        layoutParams.rightMargin = MttResources.g(f.r);
        this.f.setLayoutParams(layoutParams);
    }

    public void a(Object obj) {
        this.F = false;
        this.E = obj instanceof CameraSoutiData ? (CameraSoutiData) obj : new CameraSoutiData();
        this.r.setImageBitmap(this.E.g);
        int height = this.E.g != null ? this.E.g.getHeight() : 0;
        int i = x;
        int i2 = height + i;
        int i3 = A;
        if (i2 <= i3) {
            i3 = height + i;
        }
        this.r.setBackgroundDrawable(new BitmapDrawable(this.E.g));
        this.j.a(i3);
        ViewGroup.MarginLayoutParams marginLayoutParams = (ViewGroup.MarginLayoutParams) this.r.getLayoutParams();
        marginLayoutParams.height = i3;
        this.r.setLayoutParams(marginLayoutParams);
        ViewGroup.MarginLayoutParams marginLayoutParams2 = (ViewGroup.MarginLayoutParams) this.t.getLayoutParams();
        marginLayoutParams2.topMargin = i3;
        this.t.setLayoutParams(marginLayoutParams2);
        CameraViewUtils.a(this.f, this.E.f ? 0 : 8);
        if (!this.E.k) {
            this.l.setTag(false);
            CameraViewUtils.a(this.o, 0);
            CameraViewUtils.a(this.f53442a, 8);
            this.o.a(4);
            this.o.setLoadingColor(MttResources.c(R.color.jv));
            return;
        }
        this.o.a();
        CameraViewUtils.a(this.o, 8);
        CameraViewUtils.a(this.f53442a, 0);
        ArrayList arrayList = new ArrayList();
        if (this.E.l.isEmpty()) {
            this.F = true;
            CameraSoutiData.SoutiItemData soutiItemData = new CameraSoutiData.SoutiItemData();
            CameraSoutiData cameraSoutiData = this.E;
            soutiItemData.f51622b = cameraSoutiData != null ? cameraSoutiData.f51617a : "https://xyst.yuanfudao.com/questions/open?coop=QQ_BROWSER";
            soutiItemData.f = -1;
            this.E.l.add(soutiItemData);
        }
        int i4 = 0;
        while (i4 < this.E.l.size()) {
            CameraSoutiData.SoutiItemData soutiItemData2 = this.E.l.get(i4);
            WebPagerAdapter.WebDataBundle webDataBundle = new WebPagerAdapter.WebDataBundle();
            StringBuilder sb = new StringBuilder();
            int i5 = i4 + 1;
            sb.append(i5);
            sb.append("");
            webDataBundle.f52740b = sb.toString();
            webDataBundle.f52739a = soutiItemData2.f51622b;
            webDataBundle.f52742d = soutiItemData2.f51623c;
            webDataBundle.f52741c = soutiItemData2.e;
            webDataBundle.e = soutiItemData2.f;
            webDataBundle.f = soutiItemData2.f51624d;
            webDataBundle.g = soutiItemData2.f51621a;
            webDataBundle.j = soutiItemData2.g;
            webDataBundle.k = false;
            if (i4 == 0) {
                webDataBundle.h = true;
            }
            arrayList.add(webDataBundle);
            i4 = i5;
        }
        this.s.clear();
        this.s.addAll(arrayList);
        this.u.a(arrayList);
        this.t.setCurrentItem(0);
        q();
        StatManager.b().c("BZST064_1");
        this.u.e();
    }

    public void a(String str) {
        CameraViewUtils.a(this.f53442a, 8);
        CameraViewUtils.a(this.f53443b, 0);
        this.f53443b.setText(str);
    }

    @Override
    public void a(boolean z2) {
    }

    public void b() {
        CameraViewUtils.a(this.g, 8);
    }

    @Override
    public void bB_() {
    }

    public void c() {
        CameraViewUtils.a(this.f, 8);
    }

    public void d() {
        CameraViewUtils.a(this.f, 0);
    }

    @Override
    public void e() {
        if (this.f53444c) {
            return;
        }
        this.f53444c = true;
    }

    @Override
    public void f() {
        if (this.f53444c) {
            this.f53444c = false;
            this.r.setTranslationY(0.0f);
            this.t.setTranslationY(0.0f);
        }
    }

    @Override
    public void g() {
        this.f53444c = false;
        this.t.setCurrentItem(0);
        WebPagerAdapter webPagerAdapter = this.u;
        if (webPagerAdapter != null) {
            webPagerAdapter.f();
            this.u.g();
        }
    }

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

    @Override
    public void h() {
    }

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

    @Override
    public void i() {
    }

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

    public void l() {
        CameraViewUtils.a(this.o, 0);
        CameraViewUtils.a(this.f53442a, 8);
        this.o.a(4);
        this.o.setLoadingColor(MttResources.c(R.color.jv));
    }

    public void m() {
        Activity a2 = ActivityHandler.b().a();
        if (a2 != null) {
            if (this.K == null) {
                this.K = new MttLoadingDialog(a2);
                this.K.setOnKeyListener(new DialogInterface.OnKeyListener() {
                    @Override
                    public boolean onKey(DialogInterface dialogInterface, int i, KeyEvent keyEvent) {
                        if (i != 4 || keyEvent.getAction() != 1) {
                            return false;
                        }
                        CameraSoutiResultView.this.n();
                        return false;
                    }
                });
                this.K.show();
            }
            this.K.a("正在加载中...");
        }
    }

    public void n() {
        MttLoadingDialog mttLoadingDialog = this.K;
        if (mttLoadingDialog != null) {
            mttLoadingDialog.dismiss();
            this.K = null;
        }
    }

    @Override
    public void onClick(View view) {
        String str;
        EventCollector.getInstance().onViewClickedBefore(view);
        if (view != null) {
            int id = view.getId();
            switch (id) {
                case 1:
                    x();
                    break;
                case 2:
                    z();
                    str = "BZST010";
                    CameraStatConst.b(str);
                    break;
                case 3:
                    y();
                    break;
                case 4:
                    if (this.f53444c) {
                        t();
                        break;
                    }
                    break;
                case 5:
                    s();
                    break;
                case 6:
                    w();
                    break;
                default:
                    switch (id) {
                        case 1000:
                            v();
                            break;
                        case 1001:
                            u();
                            break;
                        case 1002:
                            this.q.dismiss();
                            ((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 = "BZST092";
                            CameraStatConst.b(str);
                            break;
                    }
            }
        }
        EventCollector.getInstance().onViewClicked(view);
    }

    public void setBottomBarVisibility(int i) {
        this.i.setVisibility(i);
    }

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

    public void setPreViewImgUrl(String str) {
        this.r.setUrl(str);
    }

    public void setRecordDetailData(ArrayList<RecordDetail> arrayList) {
        this.F = false;
        this.o.a();
        CameraViewUtils.a(this.o, 8);
        CameraViewUtils.a(this.f53442a, 0);
        ArrayList arrayList2 = new ArrayList();
        if (arrayList == null) {
            arrayList = new ArrayList<>();
        }
        if (arrayList.isEmpty()) {
            RecordDetail recordDetail = new RecordDetail();
            recordDetail.iType = 1;
            recordDetail.sData = "\n<!DOCTYPE html><html lang=\"zh-CN\"><head><title>小猿搜题 - 中小学拍照搜题利器</title><link rel=\"icon\" type=\"image/vnd.microsoft.icon\" href=\"https://solar.fbcontent.cn/s/72a9aed0-favicon.ico\"><meta http-equiv=\"content-type\" content=\"text/html; charset=utf-8\"><meta http-equiv=\"X-UA-Compatible\" content=\"IE=Edge, chrome = 1\"><meta name=\"description\" content=\"完全免费的学习利器!用拍照搜题的方式解决中小学作业难题。\"><meta name=\"viewport\" content=\"width=device-width,user-scalable=no,viewport-fit=cover\"><meta name=\"format-detection\" content=\"telephone=no\"><meta http-equiv=\"Cache-Control\" content=\"no-transform\"><meta http-equiv=\"Cache-Control\" content=\"no-siteapp\"><meta name=\"format-detection\" content=\"telephone=no\"><base href=\"https://solar.fbcontent.cn/api/apolo-images/\"><!--[if gte IE 9]><style type=\"text/css\">.gradient {filter: none;}</style><![endif]--><style></style><link href=\"https://solar.fbcontent.cn/s/867b48f0-Share.css\" rel=\"stylesheet\"><style>html {\n  background: #fff;\n}\n.content {\n  border-top: none;\n  padding: 28px 16px 20px 16px;\n  text-align: justify;\n}\n.section-header {\n  font-family: PingFangSC-Medium, sans-serif;\n  font-size: 16px;\n  color: #242424;\n  line-height: 16px;\n  padding: 0;\n  margin-bottom: 16px;\n}\n.section-content {\n  color: #242424 !important;\n  font-weight: normal !important;\n  line-height: 28px;\n  padding: 0;\n  font-size: 17px;\n}\n.section-seperator {\n  height: 0;\n  border-top: none;\n  margin-top: 40px;\n}\n.content-bottom {\n  position: relative;\n  font-family: Regular, sans-serif;\n  font-size: 11px;\n  line-height: 14px;\n  color: #8f8f8f;\n  text-align: center;\n  background: white;\n  padding-bottom: 105px;\n}\n.content-bottom img {\n  width: 13px;\n  top: 2px;\n  position: relative;\n  margin-right: 5px;\n}\n</style><link href=\"https://solar.fbcontent.cn/s/90cd5f40-Modal.css\" rel=\"stylesheet\"></head><body class=\"font-hei\"><div class=\"content-container\"><div id=\"modal-container\"><div class=\"modal-mask\"><div class=\"modal-wrapper\"><div id=\"modal-text-wrapper\" class=\"modal-text-wrapper\"></div><div id=\"modal-controller\" class=\"modal-controller\"></div></div></div></div><script>function createElement(type, content, className, idName) {\n    var elem = document.createElement(type);\n    elem.innerHTML = content;\n    if (className) {\n        elem.classList.add(className);\n    }\n    if (idName) {\n        elem.id = idName;\n    }\n    return elem;\n}\nfunction preventDefault(e) {\n    e.preventDefault();\n    e.stopPropagation();\n}\nwindow.hideModal = function () {\n    var modalContainer = document.getElementById('modal-container');\n    modalContainer.classList.remove('visible');\n    document.body.style.overflow = '';\n    document.body.removeEventListener('touchmove', preventDefault);\n}\nwindow.showModal = function (params) {\n    var modalContainer = document.getElementById('modal-container');\n    var modalTextWrapper = document.getElementById('modal-text-wrapper');\n    var modalController = document.getElementById('modal-controller');\n\n    modalTextWrapper.innerHTML = '';\n    modalController.innerHTML = '';\n    document.body.style.overflow = 'hidden';\n    document.body.addEventListener('touchmove', preventDefault, {passive: false});\n\n    var modalTitleWrapper, modalContentWrapper;\n    var modalCancelButton, modalConfirmButton;\n    if (params) {\n        if (params.title) {\n            modalTitleWrapper = createElement('div', params.title, 'modal-text', 'modal-title');\n            modalTextWrapper.appendChild(modalTitleWrapper);\n        }\n        if (params.content) {\n            modalContentWrapper = createElement('div', '', 'modal-text', 'modal-content');\n            var modalContent = createElement('div', params.content);\n            modalContentWrapper.appendChild(modalContent);\n            modalTextWrapper.appendChild(modalContentWrapper);\n        }\n        if (!params.content && params.contents) {\n            modalContentWrapper = createElement('div', '', 'modal-text', 'modal-content');\n            params.contents.forEach(function (content) {\n                var modalContent = createElement('div', content);\n                modalContentWrapper.appendChild(modalContent);\n            })\n            modalTextWrapper.appendChild(modalContentWrapper);\n        }\n        if (params.cancelText) {\n            modalCancelButton = createElement('div', params.cancelText, 'modal-button', 'modal-cancel');\n            modalCancelButton.onclick = function () {\n                window.hideModal();\n            }\n            modalController.appendChild(modalCancelButton);\n\n        }\n        if (params.confirmText) {\n            modalConfirmButton = createElement('div', params.confirmText, 'modal-button', 'modal-confirm');\n            modalConfirmButton.onclick = function () {\n                params.onConfirm && params.onConfirm();\n                window.hideModal();\n            }\n            modalController.appendChild(modalConfirmButton);\n        }\n        modalContainer.classList.add('visible');\n    }\n}</script><style>.wrap { font-size: 16px; font-family: Regular, sans-serif; line-height: 1.6; margin: 0 auto; min-width: 100%; min-height: 100%; position: absolute; top: 0; left: 0; background: white; }\n.maintain img { width: 70px; }\n.maintain { position: absolute; top: 46%; width: 100%; text-align: center; }\n.word { color: #4a4a4a }</style><div class=\"wrap\"><div class=\"maintain\"><div class=\"word\">心塞塞,没搜到答案</div></div></div></div><script src=\"https://solar.fbcontent.cn/s/d6c1f419-jquery-1.11.1.min.js\"></script><script src=\"https://solar.fbcontent.cn/s/0ca2870a-Share.js\"></script></body></html>";
            arrayList.add(recordDetail);
            c();
            this.F = true;
        }
        int i = 0;
        while (i < arrayList.size()) {
            RecordDetail recordDetail2 = arrayList.get(i);
            WebPagerAdapter.WebDataBundle webDataBundle = new WebPagerAdapter.WebDataBundle();
            StringBuilder sb = new StringBuilder();
            int i2 = i + 1;
            sb.append(i2);
            sb.append("");
            webDataBundle.f52740b = sb.toString();
            if (recordDetail2.iType == 0) {
                webDataBundle.f52739a = recordDetail2.sData;
            } else if (recordDetail2.iType == 1) {
                webDataBundle.f52742d = recordDetail2.sData;
            }
            webDataBundle.f52741c = recordDetail2.sIcon;
            webDataBundle.e = recordDetail2.iFromId;
            webDataBundle.f = recordDetail2.sFrom;
            webDataBundle.g = String.valueOf(recordDetail2.iType);
            webDataBundle.j = recordDetail2.iResultId;
            webDataBundle.k = false;
            if (i == 0) {
                webDataBundle.h = true;
            }
            arrayList2.add(webDataBundle);
            i = i2;
        }
        this.s.clear();
        this.s.addAll(arrayList2);
        this.u.a(arrayList2);
        this.t.setCurrentItem(0);
        q();
        StatManager.b().c("BZST064_1");
        this.u.e();
    }

    @Override
    public void switchSkin() {
    }
}