package com.tencent.mm.plugin.wenote.ui.nativenote;

import android.app.ProgressDialog;
import android.content.Context;
import android.content.Intent;
import android.os.Bundle;
import android.os.Handler;
import android.support.v7.app.AppCompatActivity;
import android.support.v7.widget.LinearLayoutManager;
import android.support.v7.widget.RecyclerView;
import android.support.v7.widget.RecyclerView.m;
import android.support.v7.widget.av;
import android.view.LayoutInflater;
import android.view.MenuItem;
import android.view.MenuItem.OnMenuItemClickListener;
import android.view.View;
import android.view.View.MeasureSpec;
import android.view.View.OnTouchListener;
import android.view.ViewTreeObserver.OnGlobalLayoutListener;
import android.widget.ImageButton;
import android.widget.LinearLayout;
import android.widget.PopupWindow;
import android.widget.RelativeLayout;
import android.widget.TextView;
import android.widget.Toast;
import com.tencent.matrix.trace.core.AppMethodBeat;
import com.tencent.mm.ai.f;
import com.tencent.mm.g.a.gh;
import com.tencent.mm.g.a.nt;
import com.tencent.mm.m.b;
import com.tencent.mm.model.aw;
import com.tencent.mm.plugin.fav.a.ae;
import com.tencent.mm.plugin.fav.ui.detail.BaseFavDetailReportUI;
import com.tencent.mm.plugin.wenote.model.a.d;
import com.tencent.mm.plugin.wenote.model.a.h;
import com.tencent.mm.plugin.wenote.model.a.i;
import com.tencent.mm.plugin.wenote.model.a.j;
import com.tencent.mm.plugin.wenote.model.a.l;
import com.tencent.mm.plugin.wenote.model.a.o;
import com.tencent.mm.plugin.wenote.model.a.q;
import com.tencent.mm.plugin.wenote.model.a.w;
import com.tencent.mm.plugin.wenote.model.nativenote.b.a;
import com.tencent.mm.plugin.wenote.model.nativenote.c.e;
import com.tencent.mm.plugin.wenote.model.nativenote.c.e$10;
import com.tencent.mm.plugin.wenote.model.nativenote.c.e.11;
import com.tencent.mm.plugin.wenote.model.nativenote.c.e.12;
import com.tencent.mm.plugin.wenote.model.nativenote.c.e.13;
import com.tencent.mm.plugin.wenote.model.nativenote.c.e.2;
import com.tencent.mm.plugin.wenote.model.nativenote.c.e.3;
import com.tencent.mm.plugin.wenote.model.nativenote.c.e.4;
import com.tencent.mm.plugin.wenote.model.nativenote.c.e.5;
import com.tencent.mm.plugin.wenote.model.nativenote.manager.WXRTEditText;
import com.tencent.mm.plugin.wenote.model.nativenote.manager.g;
import com.tencent.mm.plugin.wenote.model.nativenote.manager.k;
import com.tencent.mm.plugin.wenote.ui.nativenote.a.c;
import com.tencent.mm.plugin.wenote.ui.nativenote.c.1;
import com.tencent.mm.plugin.wenote.ui.nativenote.c.6;
import com.tencent.mm.plugin.wenote.ui.nativenote.c.7;
import com.tencent.mm.plugin.wenote.ui.nativenote.c.8;
import com.tencent.mm.plugin.wenote.ui.nativenote.c.9;
import com.tencent.mm.protocal.protobuf.aar;
import com.tencent.mm.protocal.protobuf.abf;
import com.tencent.mm.sdk.platformtools.ab;
import com.tencent.mm.sdk.platformtools.ak;
import com.tencent.mm.sdk.platformtools.al;
import com.tencent.mm.sdk.platformtools.bo;
import com.tencent.mm.storage.ac;
import com.tencent.mm.storage.bi;
import com.tencent.mm.ui.base.p;
import com.tencent.ttpic.baseutils.ApiHelper$VERSION_CODES;
import com.tencent.ttpic.baseutils.IOUtils;
import com.tencent.ytcommon.BuildConfig;
import java.util.ArrayList;
import java.util.Iterator;

public class NoteEditorUI extends BaseFavDetailReportUI implements f, a, g.a, a {
    private static final long mky = ((long) b.Nc());
    private View WL = null;
    private int aaF = 0;
    OnGlobalLayoutListener aeL = new OnGlobalLayoutListener() {
        public final void onGlobalLayout() {
            AppMethodBeat.i(27041);
            long currentTimeMillis = System.currentTimeMillis();
            ab.i("MicroMsg.Note.NoteEditorUI", "startnoteeditorui, onGlobalLayout, current time is %d,from oncreate to dataloading, cost %d", new Object[]{Long.valueOf(currentTimeMillis), Long.valueOf(currentTimeMillis - NoteEditorUI.this.uTh)});
            al RS = aw.RS();
            1 1 = new 1(this);
            if (NoteEditorUI.this.uQI == 1) {
                currentTimeMillis = 100;
            } else {
                currentTimeMillis = 0;
            }
            RS.m(1, currentTimeMillis);
            NoteEditorUI.this.aiB.getViewTreeObserver().removeGlobalOnLayoutListener(NoteEditorUI.this.aeL);
            AppMethodBeat.o(27041);
        }
    };
    private RecyclerView aiB;
    private long cvx = -1;
    private ProgressDialog ehJ = null;
    long fDy = -1;
    private ak fbD;
    private float hkg = 0.0f;
    private float hkh = 0.0f;
    private String lZg;
    private String lsy = BuildConfig.FLAVOR;
    private p lzK = null;
    protected com.tencent.mm.ui.widget.snackbar.a.b mUw = new 16(this);
    boolean uMY = false;
    boolean uNq = false;
    private int uQI;
    private k uSJ;
    private c uSK;
    private LinearLayout uSL;
    private c uSM = null;
    private RelativeLayout uSN = null;
    private g uSO = null;
    private boolean uSP = false;
    boolean uSQ = false;
    private boolean uSR = false;
    private String uSS = BuildConfig.FLAVOR;
    private com.tencent.mm.plugin.wenote.ui.nativenote.a.a uST;
    private boolean uSU = false;
    private boolean uSV = false;
    private a uSW;
    private aar uSX;
    private boolean uSY = false;
    private final Object uSZ = new Object();
    private LinearLayout uTa = null;
    private String uTb = BuildConfig.FLAVOR;
    private int uTc = 0;
    private int uTd = 0;
    private int uTe = 0;
    private String[] uTf = null;
    private boolean uTg = true;
    private long uTh = 0;
    private boolean uTi = false;
    private String uTj;
    boolean uTk = false;
    private boolean uTl = false;
    private boolean uTm = false;
    private boolean uTn = true;
    private int uTo = 0;
    private m uTp = null;
    OnTouchListener uTq = new 36(this);
    private boolean uTr = false;
    private int uTs = -1;
    private boolean uTt = false;

    public void onWindowFocusChanged(boolean z) {
        super.onWindowFocusChanged(z);
        AppMethodBeat.at(this, z);
    }

    public NoteEditorUI() {
        AppMethodBeat.i(27053);
        AppMethodBeat.o(27053);
    }

    static /* synthetic */ boolean K(NoteEditorUI noteEditorUI) {
        AppMethodBeat.i(27108);
        boolean dfK = noteEditorUI.dfK();
        AppMethodBeat.o(27108);
        return dfK;
    }

    static /* synthetic */ void L(NoteEditorUI noteEditorUI) {
        AppMethodBeat.i(27109);
        noteEditorUI.goBack();
        AppMethodBeat.o(27109);
    }

    static /* synthetic */ void g(NoteEditorUI noteEditorUI) {
        AppMethodBeat.i(27106);
        noteEditorUI.bpD();
        AppMethodBeat.o(27106);
    }

    private boolean c(q qVar) {
        if (qVar == null) {
            return false;
        }
        if (qVar.uOr != (this.uQI == 1)) {
            return false;
        }
        if ((this.uQI == 1 && qVar.uOt == this.cvx) || (this.uQI == 2 && qVar.uOs == this.fDy)) {
            return true;
        }
        return false;
    }

    public void onBackPressed() {
        AppMethodBeat.i(27055);
        if (dfK()) {
            goBack();
            super.onBackPressed();
            AppMethodBeat.o(27055);
            return;
        }
        AppMethodBeat.o(27055);
    }

    public final int getLayoutId() {
        return 2130970314;
    }

    private boolean dfK() {
        AppMethodBeat.i(27057);
        if (this.uSM == null || !this.uSM.uTV) {
            AppMethodBeat.o(27057);
            return true;
        }
        ddY();
        AppMethodBeat.o(27057);
        return false;
    }

    private void goBack() {
        AppMethodBeat.i(27058);
        if (this.uQI == 2 && this.uSJ.uQJ) {
            if (!(this.uSQ || this.uMY)) {
                if (dfQ()) {
                    AppMethodBeat.o(27058);
                    return;
                } else {
                    this.uSQ = true;
                    this.uSR = true;
                }
            }
            dfL();
            finish();
            AppMethodBeat.o(27058);
            return;
        }
        AppMethodBeat.o(27058);
    }

    public final void dfL() {
        AppMethodBeat.i(27059);
        this.uSM.a(this);
        String deu = com.tencent.mm.plugin.wenote.model.nativenote.manager.c.dem().deu();
        if (ahr(deu)) {
            gh ghVar = new gh();
            ghVar.cAH.type = 12;
            ghVar.cAH.cvv = this.fDy;
            com.tencent.mm.sdk.b.a.xxA.m(ghVar);
            AppMethodBeat.o(27059);
        } else if (this.uNq || this.uMY) {
            ab.i("MicroMsg.Note.NoteEditorUI", "leave noteeditorui, do savewnnotefavitem");
            ahp(deu);
            AppMethodBeat.o(27059);
        } else {
            if (this.uSQ) {
                ab.i("MicroMsg.Note.NoteEditorUI", "leave noteeditorui, do updateWNNoteFavitem");
                ahq(deu);
            }
            AppMethodBeat.o(27059);
        }
    }

    private void ahp(final String str) {
        AppMethodBeat.i(27060);
        aw.RS().aa(new Runnable() {
            public final void run() {
                AppMethodBeat.i(27044);
                NoteEditorUI.this.i(str, true, false);
                AppMethodBeat.o(27044);
            }
        });
        AppMethodBeat.o(27060);
    }

    private void ahq(String str) {
        AppMethodBeat.i(27061);
        aw.RS().aa(new 35(this, str));
        AppMethodBeat.o(27061);
    }

    public void onDestroy() {
        AppMethodBeat.i(27062);
        super.onDestroy();
        if (this.uTn) {
            if (this.aiB != null) {
                this.aiB.b(this.uTp);
            }
            e dfb = e.dfb();
            ab.i("NoteSelectManager", "onDestroy");
            e.mHasInit = false;
            if (dfb.uRD != null) {
                dfb.uRD.stopTimer();
            }
            if (dfb.uRE != null) {
                dfb.uRE.stopTimer();
            }
            if (dfb.uRw != null) {
                dfb.uRw.dismiss();
            }
            if (dfb.uRx != null) {
                dfb.uRx.dismiss();
            }
            if (dfb.uRy != null) {
                dfb.uRy.dismiss();
            }
            if (dfb.uRz != null) {
                dfb.uRz.dismiss();
            }
            e.uRg = null;
        }
        aw.Rg().b(921, this);
        if (this.uSJ != null) {
            k kVar = this.uSJ;
            kVar.uQL.stopTimer();
            kVar.uQB = -1;
            if (k.uQx == kVar) {
                k.uQx = null;
            }
        }
        if (com.tencent.mm.plugin.wenote.model.c.ddG().uMN != null) {
            com.tencent.mm.plugin.wenote.model.c.ddG().uMN.uMT.clear();
            com.tencent.mm.plugin.wenote.model.c.ddG().uMN.uMS.clear();
            com.tencent.mm.plugin.wenote.model.c.ddG().uMN.uMR.clear();
        }
        com.tencent.mm.plugin.wenote.ui.nativenote.voiceview.a dfY = com.tencent.mm.plugin.wenote.ui.nativenote.voiceview.a.dfY();
        dfY.stopPlay();
        dfY.mfW = null;
        dfY.mfS = null;
        dfY.callbacks.clear();
        com.tencent.mm.plugin.wenote.ui.nativenote.voiceview.a.uVh = null;
        if (com.tencent.mm.plugin.wenote.model.k.ddO() != null) {
            com.tencent.mm.plugin.wenote.model.k.ddO();
            com.tencent.mm.plugin.wenote.model.k.destroy();
        }
        com.tencent.mm.plugin.wenote.model.nativenote.manager.c dem = com.tencent.mm.plugin.wenote.model.nativenote.manager.c.dem();
        dem.uPa = null;
        if (dem.iPr != null) {
            Iterator it = dem.iPr.iterator();
            while (it.hasNext()) {
                com.tencent.mm.plugin.wenote.model.a.c cVar = (com.tencent.mm.plugin.wenote.model.a.c) it.next();
                cVar.uNY = null;
                cVar.uNW = null;
                cVar.uNX = null;
            }
        }
        AppMethodBeat.o(27062);
    }

    public final void deh() {
        AppMethodBeat.i(27063);
        if (this.uSM != null) {
            this.uSM.a(null);
        }
        AppMethodBeat.o(27063);
    }

    public final void JX(int i) {
        AppMethodBeat.i(27064);
        Handler handler = getWindow().getDecorView().getHandler();
        if (handler == null) {
            AppMethodBeat.o(27064);
            return;
        }
        handler.postDelayed(new 2(this, i), 0);
        AppMethodBeat.o(27064);
    }

    public final void JZ(int i) {
        AppMethodBeat.i(27065);
        try {
            this.uSK.ci(i);
            AppMethodBeat.o(27065);
        } catch (Exception e) {
            ab.e("MicroMsg.Note.NoteEditorUI", "onNotifyItemRemoved error,positionStart:%d", new Object[]{Integer.valueOf(i)});
            AppMethodBeat.o(27065);
        }
    }

    public final void JY(int i) {
        AppMethodBeat.i(27066);
        try {
            this.uSK.ch(i);
            AppMethodBeat.o(27066);
        } catch (Exception e) {
            ab.printErrStackTrace("MicroMsg.Note.NoteEditorUI", e, BuildConfig.FLAVOR, new Object[0]);
            ab.e("MicroMsg.Note.NoteEditorUI", "onNotifyItemInserted error,positionStart:%d", new Object[]{Integer.valueOf(i)});
            AppMethodBeat.o(27066);
        }
    }

    public final void gC(int i, int i2) {
        AppMethodBeat.i(27067);
        try {
            this.uSK.at(i, i2);
            AppMethodBeat.o(27067);
        } catch (Exception e) {
            ab.printErrStackTrace("MicroMsg.Note.NoteEditorUI", e, BuildConfig.FLAVOR, new Object[0]);
            ab.e("MicroMsg.Note.NoteEditorUI", "onNotifyitemRangeInsert error,positionStart:%d,count:%d", new Object[]{Integer.valueOf(i), Integer.valueOf(i2)});
            AppMethodBeat.o(27067);
        }
    }

    public final void gD(int i, int i2) {
        AppMethodBeat.i(27068);
        try {
            this.uSK.ar(i, i2);
            AppMethodBeat.o(27068);
        } catch (Exception e) {
            ab.e("MicroMsg.Note.NoteEditorUI", "onNotifyItemRangeChanged error,positionStart:%d,count:%d", new Object[]{Integer.valueOf(i), Integer.valueOf(i2)});
            AppMethodBeat.o(27068);
        }
    }

    public final void dfM() {
        AppMethodBeat.i(27069);
        try {
            this.uSK.aop.notifyChanged();
            AppMethodBeat.o(27069);
        } catch (Exception e) {
            ab.printErrStackTrace("MicroMsg.Note.NoteEditorUI", e, BuildConfig.FLAVOR, new Object[0]);
            ab.i("MicroMsg.Note.NoteEditorUI", "onNotifyDataChanged error");
            AppMethodBeat.o(27069);
        }
    }

    public final void oj(boolean z) {
        AppMethodBeat.i(27070);
        ab.i("MicroMsg.Note.NoteEditorUI", "notifyNoteDataListFresh,force:%B", new Object[]{Boolean.valueOf(z)});
        if (this.uSP || com.tencent.mm.plugin.wenote.model.c.ddG().uMN == null) {
            String str = "MicroMsg.Note.NoteEditorUI";
            String str2 = "notifyNoteDataListFresh,isInitDataList:%B,SubCoreWNNoteMsg.getCore().getWnNoteBase() == null :%B";
            Object[] objArr = new Object[2];
            objArr[0] = Boolean.valueOf(this.uSP);
            objArr[1] = Boolean.valueOf(com.tencent.mm.plugin.wenote.model.c.ddG().uMN == null);
            ab.e(str, str2, objArr);
            AppMethodBeat.o(27070);
            return;
        }
        w wVar;
        if (this.uQI != 1) {
            ab.i("MicroMsg.Note.NoteEditorUI", "notifyNoteDataListFresh,open from fav");
            if (com.tencent.mm.plugin.wenote.model.c.ddG().uMN.uMQ == null) {
                ab.e("MicroMsg.Note.NoteEditorUI", "notifyNoteDataListFresh,SubCoreWNNoteMsg.getCore().getWnNoteBase().mClickedFavItemInfo == null ");
                AppMethodBeat.o(27070);
                return;
            }
            wVar = (w) com.tencent.mm.plugin.wenote.model.c.ddG().uMN.uMR.get(Long.toString(com.tencent.mm.plugin.wenote.model.c.ddG().uMN.uMQ.field_localId));
        } else {
            ab.i("MicroMsg.Note.NoteEditorUI", "notifyNoteDataListFresh,open from Session");
            if (com.tencent.mm.plugin.wenote.model.c.ddG().uMN.uMP == null) {
                ab.e("MicroMsg.Note.NoteEditorUI", "notifyNoteDataListFresh,SubCoreWNNoteMsg.getCore().getWnNoteBase().mWNNoteData == null ");
                AppMethodBeat.o(27070);
                return;
            }
            wVar = (w) com.tencent.mm.plugin.wenote.model.c.ddG().uMN.uMR.get(Long.toString(com.tencent.mm.plugin.wenote.model.c.ddG().uMN.uMP.cvx));
        }
        if (!(wVar == null || this.uMY)) {
            this.uSY = wVar.uOG;
            if (wVar.uOG) {
                c(wVar.uOF, false);
            } else {
                this.uSP = true;
                c(wVar.uOF, true);
                AppMethodBeat.o(27070);
                return;
            }
        }
        AppMethodBeat.o(27070);
    }

    public final synchronized void c(Object obj, final boolean z) {
        int th = 0;
        synchronized (this) {
            AppMethodBeat.i(27071);
            ab.i("MicroMsg.Note.NoteEditorUI", "notifyNoteDataListFresh,setUpNoteData,canDismissLoadingDialog:%B", new Object[]{Boolean.valueOf(z)});
            synchronized (this.uSZ) {
                int i;
                try {
                    com.tencent.mm.plugin.wenote.model.nativenote.manager.c.dem().den();
                    ArrayList arrayList = (ArrayList) obj;
                    if (arrayList == null) {
                        AppMethodBeat.o(th);
                    } else {
                        o oVar;
                        ab.i("MicroMsg.Note.NoteEditorUI", "notifyNoteDataListFresh,setUpNoteData start");
                        if (this.uQI == 2 && !this.uTi) {
                            com.tencent.mm.plugin.wenote.model.a.m mVar = com.tencent.mm.plugin.wenote.model.c.ddG().uMN.uMP;
                            if (mVar == null) {
                                AppMethodBeat.o(27071);
                            } else {
                                com.tencent.mm.plugin.wenote.model.a.e eVar = new com.tencent.mm.plugin.wenote.model.a.e(mVar.uOm);
                                eVar.uNT = false;
                                eVar.uNZ = false;
                                com.tencent.mm.plugin.wenote.model.nativenote.manager.c.dem().a(eVar);
                            }
                        }
                        if (z) {
                            for (i = 0; i < arrayList.size(); i++) {
                                oVar = (o) arrayList.get(i);
                                if (oVar.getType() == 20) {
                                    com.tencent.mm.plugin.wenote.model.a.b bVar = (com.tencent.mm.plugin.wenote.model.a.b) oVar;
                                    if (!this.uTi || !bVar.qxI) {
                                        i iVar = new i();
                                        iVar.uOo = bVar.uOo;
                                        iVar.content = getString(2131297079) + " " + bVar.uOC + IOUtils.LINE_SEPARATOR_UNIX;
                                        arrayList.set(i, iVar);
                                    }
                                }
                            }
                        }
                        Iterator it = arrayList.iterator();
                        while (it.hasNext()) {
                            oVar = (o) it.next();
                            switch (oVar.type) {
                                case -3:
                                case -2:
                                    break;
                                case -1:
                                    com.tencent.mm.plugin.wenote.model.nativenote.manager.c.dem().a((h) oVar);
                                    continue;
                                case 1:
                                    i iVar2 = (i) oVar;
                                    if (bo.isNullOrNil(iVar2.content)) {
                                        iVar2.content = BuildConfig.FLAVOR;
                                    }
                                    iVar2.content = iVar2.content.replaceAll("<font", "<wx-font").replaceAll("<div", "<wx-div").replaceAll("<p", "<wx-p").replaceAll("</font>", "</wx-font>").replaceAll("<ul>", "<wx-ul>").replaceAll("</ul>", "</wx-ul>").replaceAll("<ol>", "<wx-ol>").replaceAll("</ol>", "</wx-ol>").replaceAll("<li>", "<wx-li>").replaceAll("</li>", "</wx-li>").replaceAll("<b>", "<wx-b>").replaceAll("</b>", "</wx-b>").replaceAll("</div>", "</wx-div>").replaceAll("</p>", "</wx-p>");
                                    if (iVar2.content.length() > 100) {
                                        com.tencent.mm.plugin.wenote.model.nativenote.a.a.ahb(iVar2.content);
                                    } else if (com.tencent.mm.plugin.wenote.b.b.ahi(iVar2.content)) {
                                        iVar2.content = iVar2.content.substring(0, iVar2.content.length() - 5);
                                    }
                                    com.tencent.mm.plugin.wenote.model.nativenote.manager.c.dem().a(iVar2);
                                    continue;
                                case 2:
                                    com.tencent.mm.plugin.wenote.model.nativenote.manager.c.dem().a((com.tencent.mm.plugin.wenote.model.a.f) oVar);
                                    continue;
                                case 3:
                                    com.tencent.mm.plugin.wenote.model.nativenote.manager.c.dem().a((com.tencent.mm.plugin.wenote.model.a.g) oVar);
                                    continue;
                                case 4:
                                    com.tencent.mm.plugin.wenote.model.nativenote.manager.c.dem().a((l) oVar);
                                    continue;
                                case 5:
                                    break;
                                case 6:
                                    com.tencent.mm.plugin.wenote.model.nativenote.manager.c.dem().a((com.tencent.mm.plugin.wenote.model.a.k) oVar);
                                    continue;
                                case ApiHelper$VERSION_CODES.KITKAT_WATCH /*20*/:
                                    com.tencent.mm.plugin.wenote.model.nativenote.manager.c.dem().a((com.tencent.mm.plugin.wenote.model.a.b) oVar);
                                    break;
                                default:
                                    com.tencent.mm.plugin.wenote.model.nativenote.manager.c.dem().a((j) oVar);
                                    continue;
                            }
                            com.tencent.mm.plugin.wenote.model.nativenote.manager.c.dem().a((d) oVar);
                        }
                        ab.i("MicroMsg.Note.NoteEditorUI", "notifyNoteDataListFresh,setUpNoteData finish");
                        if (!z) {
                            i = com.tencent.mm.plugin.wenote.model.nativenote.manager.c.dem();
                            synchronized (i) {
                                i.uPf = true;
                            }
                        }
                        al.d(new Runnable() {
                            public final void run() {
                                AppMethodBeat.i(26996);
                                synchronized (NoteEditorUI.this.uSZ) {
                                    try {
                                        NoteEditorUI.this.dfM();
                                        NoteEditorUI.this.uSP = true;
                                        ab.i("MicroMsg.Note.NoteEditorUI", "postToMainThread,isInitDataList = true,canDismissLoadingDialog :%B,mHasFreshedDataByHtml:%B", new Object[]{Boolean.valueOf(z), Boolean.valueOf(NoteEditorUI.this.uSY)});
                                        if (NoteEditorUI.this.lzK != null && z) {
                                            NoteEditorUI.this.lzK.dismiss();
                                        }
                                    } finally {
                                        while (true) {
                                        }
                                        AppMethodBeat.o(26996);
                                    }
                                }
                            }
                        });
                        if (this.uTd > 0 || this.uTe != 0) {
                            this.fbD.postDelayed(new 4(this), 100);
                        }
                        com.tencent.mm.plugin.wenote.model.nativenote.manager.c.dem().des();
                        AppMethodBeat.o(27071);
                    }
                } catch (Throwable th2) {
                    while (true) {
                        th = th2;
                        AppMethodBeat.o(i);
                    }
                } finally {
                    i = 27071;
                    AppMethodBeat.o(27071);
                }
            }
        }
    }

    public final RecyclerView dfN() {
        return this.aiB;
    }

    public final a dfP() {
        return this;
    }

    static {
        AppMethodBeat.i(27111);
        AppMethodBeat.o(27111);
    }

    public void onActivityResult(int i, int i2, Intent intent) {
        AppMethodBeat.i(27072);
        super.onActivityResult(i, i2, intent);
        ab.i("MicroMsg.Note.NoteEditorUI", "onActivityResult reqCode: %d, retCod: %d", new Object[]{Integer.valueOf(i), Integer.valueOf(i2)});
        this.uTs = i;
        if (i2 != -1) {
            this.uTr = false;
            AppMethodBeat.o(27072);
            return;
        }
        int i3;
        this.uTr = true;
        final String stringExtra;
        String str;
        AppCompatActivity appCompatActivity;
        String stringExtra2;
        p b;
        gh ghVar;
        switch (i) {
            case 4096:
                stringExtra = intent == null ? null : intent.getStringExtra("Select_Conv_User");
                final String stringExtra3 = intent == null ? null : intent.getStringExtra("custom_send_text");
                if (!bo.isNullOrNil(stringExtra)) {
                    aw.ZK();
                    final bi jf = com.tencent.mm.model.c.XO().jf(this.cvx);
                    if (jf.field_msgId == this.cvx) {
                        final p b2 = com.tencent.mm.ui.base.h.b(this.mController.ylL, getString(2131299643), false, null);
                        aw.RS().aa(new Runnable() {
                            public final void run() {
                                AppMethodBeat.i(27000);
                                nt ntVar = new nt();
                                ntVar.cJY.type = 4;
                                ntVar.cJY.cKd = jf;
                                ntVar.cJY.toUser = stringExtra;
                                ntVar.cJY.cAN = stringExtra3;
                                com.tencent.mm.sdk.b.a.xxA.m(ntVar);
                                al.d(new 1(this));
                                AppMethodBeat.o(27000);
                            }

                            public final String toString() {
                                AppMethodBeat.i(27001);
                                String str = super.toString() + "|onActivityResult";
                                AppMethodBeat.o(27001);
                                return str;
                            }
                        });
                        i3 = 2;
                        break;
                    }
                    ab.w("MicroMsg.Note.NoteEditorUI", "want to send record msg, but message info is null");
                    AppMethodBeat.o(27072);
                    return;
                }
                ab.w("MicroMsg.Note.NoteEditorUI", "want to send record msg, but toUser is null");
                AppMethodBeat.o(27072);
                return;
            case 4097:
                ab.i("MicroMsg.Note.NoteEditorUI", "onActivityResult back from gallery");
                if (intent.getParcelableExtra("key_req_result") == null) {
                    i3 = 2;
                } else {
                    i3 = 1;
                }
                ArrayList stringArrayListExtra = intent.getStringArrayListExtra("CropImage_OutputPath_List");
                if (stringArrayListExtra == null || stringArrayListExtra.size() <= 0) {
                    ab.i("MicroMsg.Note.NoteEditorUI", "no pic selected");
                } else {
                    com.tencent.mm.plugin.report.service.h.pYm.e(14547, new Object[]{Integer.valueOf(i3)});
                    if (com.tencent.mm.plugin.wenote.model.nativenote.manager.c.dem().gF(0, stringArrayListExtra.size())) {
                        ddW();
                        i3 = 0;
                        break;
                    }
                    AppCompatActivity appCompatActivity2 = this.mController.ylL;
                    getString(2131297061);
                    this.ehJ = com.tencent.mm.ui.base.h.b(appCompatActivity2, getString(2131297086), true, new 8(this));
                    aw.RS().aa(new 9(this, stringArrayListExtra));
                }
                stringArrayListExtra = intent.getStringArrayListExtra("key_select_video_list");
                String stringExtra4 = intent.getStringExtra("K_SEGMENTVIDEOPATH");
                if (!bo.isNullOrNil(stringExtra4) && stringArrayListExtra == null) {
                    stringArrayListExtra = new ArrayList();
                    stringArrayListExtra.add(stringExtra4);
                }
                if (stringArrayListExtra != null && stringArrayListExtra.size() > 0) {
                    com.tencent.mm.plugin.report.service.h.pYm.e(14547, new Object[]{Integer.valueOf(i3)});
                    if (!com.tencent.mm.plugin.wenote.model.nativenote.manager.c.dem().gF(0, stringArrayListExtra.size())) {
                        str = (String) stringArrayListExtra.get(0);
                        com.tencent.mm.plugin.sight.base.a WR = com.tencent.mm.plugin.sight.base.d.WR(str);
                        if (WR != null) {
                            int ckU = WR.ckU();
                            com.tencent.mm.plugin.wenote.model.a.k kVar = new com.tencent.mm.plugin.wenote.model.a.k();
                            kVar.uOp = true;
                            kVar.thumbPath = BuildConfig.FLAVOR;
                            kVar.cHg = BuildConfig.FLAVOR;
                            kVar.duration = ckU;
                            kVar.type = 6;
                            kVar.uOo = com.tencent.mm.plugin.wenote.model.nativenote.manager.c.dem().des();
                            kVar.uOf = com.tencent.mm.vfs.e.cv(str);
                            kVar.mnd = com.tencent.mm.plugin.wenote.model.f.agW(kVar.toString());
                            this.uSX = new aar();
                            this.uSX.akU(kVar.mnd);
                            this.uSX.akR(kVar.uOf);
                            stringExtra4 = com.tencent.mm.plugin.wenote.model.f.c(this.uSX);
                            stringExtra = com.tencent.mm.plugin.wenote.model.f.o(this.uSX);
                            if (!bo.isNullOrNil(str)) {
                                ab.v("MicroMsg.Note.NoteEditorUI", "compressNoteVideo path: %s", new Object[]{str});
                                stringArrayListExtra = new ArrayList();
                                stringArrayListExtra.add(str);
                                com.tencent.mm.plugin.wenote.model.nativenote.manager.d dVar = new com.tencent.mm.plugin.wenote.model.nativenote.manager.d(stringArrayListExtra, stringExtra4, stringExtra, kVar, new 14(this));
                                appCompatActivity = this.mController.ylL;
                                getString(2131297061);
                                this.ehJ = com.tencent.mm.ui.base.h.b(appCompatActivity, getString(2131297086), true, new 15(this, dVar, kVar));
                                com.tencent.mm.sdk.g.d.post(dVar, "NoteEditor_importVideo");
                                i3 = 0;
                                break;
                            }
                            ab.e("MicroMsg.Note.NoteEditorUI", "video is null");
                            i3 = 0;
                            break;
                        }
                        ab.e("MicroMsg.Note.NoteEditorUI", "mediaInfo is null, videoPath is %s", new Object[]{bo.nullAsNil(str)});
                        i3 = 0;
                        break;
                    }
                    ddW();
                    i3 = 0;
                    break;
                }
                ab.i("MicroMsg.Note.NoteEditorUI", "no video selected");
                i3 = 0;
                break;
                break;
            case 4098:
                com.tencent.mm.plugin.report.service.h.pYm.e(14547, new Object[]{Integer.valueOf(4)});
                if (!com.tencent.mm.plugin.wenote.model.nativenote.manager.c.dem().gF(0, 1)) {
                    com.tencent.mm.plugin.wenote.model.a.g gVar = new com.tencent.mm.plugin.wenote.model.a.g();
                    gVar.lat = (double) ((float) intent.getDoubleExtra("kwebmap_slat", 0.0d));
                    gVar.lng = (double) ((float) intent.getDoubleExtra("kwebmap_lng", 0.0d));
                    gVar.scale = (double) intent.getIntExtra("kwebmap_scale", 0);
                    gVar.fBg = bo.bc(intent.getStringExtra("Kwebmap_locaion"), BuildConfig.FLAVOR);
                    gVar.eUu = intent.getStringExtra("kPoiName");
                    gVar.uOo = com.tencent.mm.plugin.wenote.model.nativenote.manager.c.dem().des();
                    gVar.type = 3;
                    gVar.uOp = true;
                    gVar.cHg = BuildConfig.FLAVOR;
                    com.tencent.mm.plugin.wenote.model.nativenote.manager.c.dem().a(gVar, this.uSJ.deW(), false, false, false);
                    i3 = 0;
                    break;
                }
                ddW();
                i3 = 0;
                break;
            case 4099:
                com.tencent.mm.plugin.report.service.h.pYm.e(14547, new Object[]{Integer.valueOf(5)});
                str = intent.getStringExtra("choosed_file_path");
                if (!bo.isNullOrNil(str)) {
                    com.tencent.mm.vfs.b bVar = new com.tencent.mm.vfs.b(str);
                    if (bVar.exists()) {
                        if (bVar.length() < mky) {
                            if (!com.tencent.mm.plugin.wenote.model.nativenote.manager.c.dem().gF(0, 1)) {
                                if (this.ehJ != null) {
                                    this.ehJ.dismiss();
                                    this.ehJ = null;
                                }
                                appCompatActivity = this.mController.ylL;
                                getString(2131297061);
                                this.ehJ = com.tencent.mm.ui.base.h.b(appCompatActivity, getString(2131297086), true, new 10(this));
                                d dVar2 = new d();
                                dVar2.title = bVar.getName();
                                dVar2.content = com.tencent.mm.plugin.wenote.model.f.aC((float) bVar.length());
                                dVar2.hNN = com.tencent.mm.plugin.wenote.model.h.aha(com.tencent.mm.vfs.e.cv(str));
                                dVar2.uOo = com.tencent.mm.plugin.wenote.model.nativenote.manager.c.dem().des();
                                dVar2.type = 5;
                                dVar2.uOp = true;
                                dVar2.uOf = com.tencent.mm.vfs.e.cv(str);
                                dVar2.mnd = com.tencent.mm.plugin.wenote.model.f.agW(dVar2.toString());
                                this.uSX = new aar();
                                this.uSX.akU(dVar2.mnd);
                                this.uSX.akR(dVar2.uOf);
                                dVar2.cHg = com.tencent.mm.plugin.wenote.model.f.o(this.uSX);
                                com.tencent.mm.vfs.e.y(str, dVar2.cHg);
                                com.tencent.mm.plugin.wenote.model.nativenote.manager.c.dem().a(dVar2, this.uSJ.deW(), false, true, false);
                                i3 = 2;
                                break;
                            }
                            ddW();
                            i3 = 2;
                            break;
                        }
                        i3 = 3;
                        break;
                    }
                    i3 = 1;
                    break;
                }
                i3 = 1;
                break;
            case 4101:
                stringExtra2 = intent == null ? null : intent.getStringExtra("Select_Conv_User");
                if (intent == null) {
                    str = null;
                } else {
                    str = intent.getStringExtra("custom_send_text");
                }
                if (!bo.isNullOrNil(stringExtra2)) {
                    b = com.tencent.mm.ui.base.h.b(this.mController.ylL, getString(2131299643), false, null);
                    ghVar = new gh();
                    ghVar.cAH.type = 13;
                    ghVar.cAH.context = this.mController.ylL;
                    ghVar.cAH.toUser = stringExtra2;
                    ghVar.cAH.cAN = str;
                    ghVar.cAH.cvv = this.fDy;
                    ghVar.cAH.cAM = new 7(this, b);
                    com.tencent.mm.sdk.b.a.xxA.m(ghVar);
                    i3 = 2;
                    break;
                }
                ab.w("MicroMsg.Note.NoteEditorUI", "want to send record msg, but toUser is null");
                AppMethodBeat.o(27072);
                return;
            case 4354:
                this.fbD.post(new 11(this));
                i3 = 2;
                break;
            case 4355:
                stringExtra2 = intent == null ? null : intent.getStringExtra("Select_Conv_User");
                if (intent == null) {
                    str = null;
                } else {
                    str = intent.getStringExtra("custom_send_text");
                }
                if (!bo.isNullOrNil(stringExtra2)) {
                    b = com.tencent.mm.ui.base.h.b(this.mController.ylL, getString(2131299643), false, null);
                    ghVar = new gh();
                    ghVar.cAH.type = 13;
                    ghVar.cAH.context = this.mController.ylL;
                    ghVar.cAH.toUser = stringExtra2;
                    ghVar.cAH.cAN = str;
                    ghVar.cAH.cvv = this.fDy;
                    ghVar.cAH.cvC = com.tencent.mm.plugin.wenote.model.c.ddG().uMN.uMZ;
                    ghVar.cAH.cAM = new 13(this, b);
                    com.tencent.mm.sdk.b.a.xxA.m(ghVar);
                    i3 = 2;
                    break;
                }
                ab.w("MicroMsg.Note.NoteEditorUI", "want to send note from sns, but toUser is null");
                AppMethodBeat.o(27072);
                return;
            case 30764:
                Bundle bundleExtra = intent.getBundleExtra("result_data");
                if (bundleExtra != null && bundleExtra.getString("go_next", BuildConfig.FLAVOR).equals("gdpr_auth_location")) {
                    com.tencent.mm.kernel.g.RP().Ry().set(ac.a.xVP, Boolean.TRUE);
                    com.tencent.mm.pluginsdk.permission.b.b(this.mController.ylL, "android.permission.ACCESS_COARSE_LOCATION", 64);
                    break;
                }
        }
        i3 = 2;
        if (i3 == 0) {
            AppMethodBeat.o(27072);
        } else if (1 == i3) {
            com.tencent.mm.ui.base.h.bQ(this.mController.ylL, getString(2131299621));
            AppMethodBeat.o(27072);
        } else {
            if (3 == i3) {
                Toast.makeText(this.mController.ylL, getString(2131299756), 1).show();
            }
            AppMethodBeat.o(27072);
        }
    }

    public final void i(String str, boolean z, boolean z2) {
        AppMethodBeat.i(27073);
        ab.i("MicroMsg.Note.NoteEditorUI", "setEditorExportLogic,htmlstr:%s,isInsert:%B", new Object[]{str, Boolean.valueOf(z)});
        if (z || !str.equals(this.uSS)) {
            abf ahe = com.tencent.mm.plugin.wenote.model.nativenote.manager.c.dem().ahe(str);
            if (ahe == null) {
                ab.e("MicroMsg.Note.NoteEditorUI", "protoitem is null,return");
                AppMethodBeat.o(27073);
                return;
            }
            gh ghVar;
            if (z) {
                ghVar = new gh();
                ghVar.cAH.type = 19;
                ghVar.cAH.cvC = ahe;
                ghVar.cAH.title = str;
                ghVar.cAH.cvv = this.fDy;
                ghVar.cAH.desc = "fav_add_new_note";
                com.tencent.mm.sdk.b.a.xxA.m(ghVar);
            } else {
                ghVar = new gh();
                ghVar.cAH.type = 19;
                ghVar.cAH.cvC = ahe;
                ghVar.cAH.title = str;
                ghVar.cAH.cvv = this.fDy;
                ghVar.cAH.desc = BuildConfig.FLAVOR;
                if (this.uSR) {
                    ghVar.cAH.cAO = -2;
                }
                com.tencent.mm.sdk.b.a.xxA.m(ghVar);
            }
            ab.i("MicroMsg.Note.NoteEditorUI", "write html to file suc");
            int i = 20;
            int i2;
            if (z) {
                while (true) {
                    ghVar = new gh();
                    ghVar.cAH.type = 30;
                    ghVar.cAH.cAO = 6;
                    ghVar.cAH.cvv = this.fDy;
                    com.tencent.mm.sdk.b.a.xxA.m(ghVar);
                    if ((ghVar.cAI.ret == 1 ? 1 : 0) != 0) {
                        this.uMY = false;
                        this.uNq = false;
                        this.uSQ = true;
                        ab.i("MicroMsg.Note.NoteEditorUI", "hasUploadToServer: insert");
                        break;
                    }
                    try {
                        Thread.sleep(1000);
                        if (!z2) {
                            break;
                        }
                        i2 = i - 1;
                        if (i <= 0) {
                            break;
                        }
                        i = i2;
                    } catch (InterruptedException e) {
                    }
                }
            } else {
                do {
                    i2 = i;
                    if (com.tencent.mm.plugin.fav.a.b.g(((ae) com.tencent.mm.kernel.g.M(ae.class)).getFavItemInfoStorage().iE(this.fDy))) {
                        ab.i("MicroMsg.Note.NoteEditorUI", "hasUploadToServer: update, %s", new Object[]{Integer.valueOf(((ae) com.tencent.mm.kernel.g.M(ae.class)).getFavItemInfoStorage().iE(this.fDy).field_itemStatus)});
                        break;
                    }
                    try {
                        Thread.sleep(1000);
                        if (!z2) {
                            break;
                        }
                        i = i2 - 1;
                    } catch (InterruptedException e2) {
                    }
                } while (i2 > 0);
            }
            this.uSS = com.tencent.mm.plugin.wenote.model.nativenote.manager.c.dem().deu();
            ab.i("MicroMsg.Note.NoteEditorUI", "setEditorExportLogic end");
            AppMethodBeat.o(27073);
            return;
        }
        if (!this.uTk && this.uSJ.uQF > 0 && !bo.isNullOrNil(this.uSJ.uQG) && this.uSJ.uQH > 0) {
            gh ghVar2 = new gh();
            ghVar2.cAH.type = 19;
            ghVar2.cAH.cAO = -3;
            ghVar2.cAH.cvv = this.fDy;
            Intent intent = new Intent();
            intent.putExtra("fav_note_item_status", this.uSJ.uQF);
            intent.putExtra("fav_note_xml", this.uSJ.uQG);
            intent.putExtra("fav_note_item_updatetime", this.uSJ.uQH);
            ghVar2.cAH.cAK = intent;
            com.tencent.mm.sdk.b.a.xxA.m(ghVar2);
        }
        AppMethodBeat.o(27073);
    }

    static boolean ahr(String str) {
        AppMethodBeat.i(27074);
        if (bo.isNullOrNil(com.tencent.mm.plugin.wenote.b.b.ahj(str))) {
            AppMethodBeat.o(27074);
            return true;
        }
        AppMethodBeat.o(27074);
        return false;
    }

    public void onResume() {
        AppMethodBeat.i(27075);
        super.onResume();
        if (this.uQI == 2) {
            switch (this.uTs) {
                case -1:
                    if (this.uTt) {
                        g(true, 100);
                        af(1, 0);
                        break;
                    }
                    break;
                case 4097:
                    if (!this.uTr) {
                        g(true, 100);
                        af(1, 0);
                        break;
                    }
                    break;
                case 4098:
                case 4099:
                    g(true, 100);
                    af(1, 0);
                    break;
            }
        }
        this.uTs = -1;
        this.uTr = false;
        AppMethodBeat.o(27075);
    }

    public void onPause() {
        AppMethodBeat.i(27076);
        super.onPause();
        if (this.uSM != null) {
            this.uSM.a(this);
        }
        if (com.tencent.mm.plugin.wenote.ui.nativenote.voiceview.a.dfY().buH()) {
            com.tencent.mm.plugin.wenote.ui.nativenote.voiceview.a.dfY().stopPlay();
        }
        this.uTt = this.uSV;
        g(false, 0);
        q deI = com.tencent.mm.plugin.wenote.model.nativenote.manager.h.deH().deI();
        if (c(deI)) {
            deI.uOu = com.tencent.mm.plugin.wenote.model.nativenote.manager.c.dem().ahf(getString(2131305653));
            deI.uOw = this.aaF;
            deI.uOx = this.uTc;
            com.tencent.mm.plugin.wenote.model.nativenote.manager.h.deH().a(deI);
        }
        AppMethodBeat.o(27076);
    }

    public void onDrag() {
        AppMethodBeat.i(27077);
        super.onDrag();
        if (this.uTn) {
            e.dfb().dfj();
            e.dfb().dfh();
        }
        AppMethodBeat.o(27077);
    }

    public void onCancel() {
        AppMethodBeat.i(27078);
        super.onCancel();
        if (this.uTn) {
            e.dfb().oq(false);
            e.dfb().op(false);
        }
        AppMethodBeat.o(27078);
    }

    public final void ddZ() {
        AppMethodBeat.i(27079);
        com.tencent.mm.ui.base.h.d(this, getString(2131301745), BuildConfig.FLAVOR, getString(2131301744), getString(2131301743), new 17(this), null);
        AppMethodBeat.o(27079);
    }

    public final int dec() {
        AppMethodBeat.i(27081);
        if (this.uSV) {
            int gp = com.tencent.mm.compatible.util.j.gp(this);
            AppMethodBeat.o(27081);
            return gp;
        }
        AppMethodBeat.o(27081);
        return 0;
    }

    public final int ded() {
        AppMethodBeat.i(27082);
        int i = 0;
        if (this.uSL != null && this.uSL.getVisibility() == 0) {
            i = this.uTo + 0;
        }
        if (this.uTa != null && this.uTa.getVisibility() == 0) {
            i += this.uTo;
        }
        AppMethodBeat.o(27082);
        return i;
    }

    public final boolean dee() {
        AppMethodBeat.i(27083);
        if (this.uSJ == null || this.uSJ.deS() == null) {
            AppMethodBeat.o(27083);
            return false;
        }
        AppMethodBeat.o(27083);
        return true;
    }

    public final RecyclerView def() {
        return this.aiB;
    }

    public final void deb() {
        AppMethodBeat.i(27084);
        if (this.uQI == 2 && this.uSJ.uQJ) {
            int deo = com.tencent.mm.plugin.wenote.model.nativenote.manager.c.dem().deo();
            com.tencent.mm.plugin.wenote.model.a.c Ke = com.tencent.mm.plugin.wenote.model.nativenote.manager.c.dem().Ke(deo);
            if (Ke != null) {
                Ke.uNT = false;
                Ke.uNZ = false;
                JX(deo);
            }
            this.fbD.post(new 18(this));
            g(false, 0);
            af(0, 0);
            AppMethodBeat.o(27084);
            return;
        }
        AppMethodBeat.o(27084);
    }

    public final void a(WXRTEditText wXRTEditText, boolean z, int i) {
        AppMethodBeat.i(27085);
        if (this.uQI == 2 && this.uSJ.uQJ) {
            ((com.tencent.mm.plugin.wenote.ui.nativenote.a.a) this.aiB.getLayoutManager()).uUg = z;
            if (this.uSU) {
                ((com.tencent.mm.plugin.wenote.ui.nativenote.a.a) this.aiB.getLayoutManager()).uUg = false;
            }
            if (z) {
                if (!(this.uMY || this.uSQ)) {
                    this.uSS = com.tencent.mm.plugin.wenote.model.nativenote.manager.c.dem().deu();
                    this.uSQ = true;
                }
                if (wXRTEditText == null || wXRTEditText.getEditTextType() != 1) {
                    com.tencent.mm.plugin.wenote.model.nativenote.manager.c.dem().aw(i, false);
                    AppMethodBeat.o(27085);
                    return;
                }
                com.tencent.mm.plugin.wenote.model.nativenote.manager.c.dem().aw(i, true);
                AppMethodBeat.o(27085);
                return;
            }
            com.tencent.mm.plugin.wenote.model.nativenote.manager.c.dem().av(-1, false);
            AppMethodBeat.o(27085);
            return;
        }
        AppMethodBeat.o(27085);
    }

    public final void deg() {
        AppMethodBeat.i(27086);
        if (!(this.uMY || this.uSQ)) {
            this.uSS = com.tencent.mm.plugin.wenote.model.nativenote.manager.c.dem().deu();
            this.uSQ = true;
        }
        AppMethodBeat.o(27086);
    }

    public final void onKeyboardStateChanged() {
        AppMethodBeat.i(27087);
        super.onKeyboardStateChanged();
        this.uSV = this.mController.ymc == 1;
        if (this.uSV) {
            af(1, 0);
        }
        if (this.uTn) {
            this.fbD.postDelayed(new 19(this), 200);
        }
        AppMethodBeat.o(27087);
    }

    public final void g(boolean z, long j) {
        AppMethodBeat.i(27088);
        if (this.uQI == 2 && this.uSJ.uQJ) {
            this.fbD.postDelayed(new 20(this, z), j);
            AppMethodBeat.o(27088);
            return;
        }
        AppMethodBeat.o(27088);
    }

    public final void af(int i, long j) {
        AppMethodBeat.i(27089);
        if (this.uQI == 2 && this.uSJ.uQJ) {
            this.fbD.postDelayed(new 21(this, i), j);
            AppMethodBeat.o(27089);
            return;
        }
        AppMethodBeat.o(27089);
    }

    public final void ddU() {
        AppMethodBeat.i(27090);
        if (!this.uSM.uTV) {
            deb();
            this.fbD.postDelayed(new 22(this, this.mController.ylL), 400);
        }
        AppMethodBeat.o(27090);
    }

    public final void a(WXRTEditText wXRTEditText) {
        AppMethodBeat.i(27091);
        if (wXRTEditText != null) {
            boolean z;
            if (com.tencent.mm.plugin.wenote.model.nativenote.manager.f.iLD == null || com.tencent.mm.plugin.wenote.model.nativenote.manager.f.iLD.size() <= 0) {
                z = false;
            } else {
                z = true;
            }
            if (z) {
                ArrayList deA = com.tencent.mm.plugin.wenote.model.nativenote.manager.f.deA();
                if (com.tencent.mm.plugin.wenote.model.nativenote.manager.c.dem().af(deA)) {
                    ddW();
                    AppMethodBeat.o(27091);
                    return;
                }
                com.tencent.mm.plugin.wenote.model.nativenote.manager.c.dem().a(deA, wXRTEditText, true, true, false, false);
                int recyclerItemPosition = wXRTEditText.getRecyclerItemPosition();
                com.tencent.mm.plugin.wenote.model.nativenote.manager.c.dem().gG(recyclerItemPosition, (deA.size() + recyclerItemPosition) + 1);
                deb();
                if (this.uTn) {
                    e.dfb().dff();
                }
                AppMethodBeat.o(27091);
                return;
            }
        }
        AppMethodBeat.o(27091);
    }

    public final void deG() {
        AppMethodBeat.i(27092);
        int deC = com.tencent.mm.plugin.wenote.model.nativenote.manager.f.deC();
        if (deC == 2) {
            if (com.tencent.mm.plugin.wenote.model.nativenote.manager.f.deB()) {
                ddW();
                AppMethodBeat.o(27092);
                return;
            }
            com.tencent.mm.plugin.wenote.model.nativenote.manager.c.dem().den();
            com.tencent.mm.plugin.wenote.model.nativenote.manager.f.clearData();
            i iVar = new i();
            iVar.content = BuildConfig.FLAVOR;
            iVar.uNT = false;
            iVar.uNZ = false;
            iVar.uNV = 0;
            iVar.uOb = true;
            com.tencent.mm.plugin.wenote.model.nativenote.manager.c.dem().a(iVar);
            dfM();
            AppMethodBeat.o(27092);
        } else if (deC == 3) {
            ArrayList deA = com.tencent.mm.plugin.wenote.model.nativenote.manager.f.deA();
            if (com.tencent.mm.plugin.wenote.model.nativenote.manager.c.dem().af(deA)) {
                ddW();
                AppMethodBeat.o(27092);
                return;
            }
            com.tencent.mm.plugin.wenote.model.nativenote.manager.c.dem().den();
            com.tencent.mm.plugin.wenote.model.nativenote.manager.c.dem().a(deA, null, false, false, false, false);
            deb();
            AppMethodBeat.o(27092);
        } else {
            AppMethodBeat.o(27092);
        }
    }

    public final void deD() {
        AppMethodBeat.i(27093);
        i iVar = new i();
        iVar.content = BuildConfig.FLAVOR;
        iVar.uNT = true;
        iVar.uNZ = false;
        iVar.uNV = 0;
        com.tencent.mm.plugin.wenote.model.nativenote.manager.c.dem().den();
        com.tencent.mm.plugin.wenote.model.nativenote.manager.c.dem().a(iVar);
        dfM();
        g(true, 50);
        af(1, 0);
        AppMethodBeat.o(27093);
    }

    public final void gE(int i, int i2) {
        AppMethodBeat.i(27096);
        this.uSU = Math.abs(i2 - i) > 0;
        AppMethodBeat.o(27096);
    }

    public final void Ka(int i) {
        AppMethodBeat.i(27097);
        if (i < 0 || i >= com.tencent.mm.plugin.wenote.model.nativenote.manager.c.dem().size()) {
            AppMethodBeat.o(27097);
            return;
        }
        this.fbD.post(new 24(this, i));
        AppMethodBeat.o(27097);
    }

    public final void ddV() {
        AppMethodBeat.i(27098);
        this.fbD.post(new 25(this));
        AppMethodBeat.o(27098);
    }

    public final void ddW() {
        AppMethodBeat.i(27099);
        if (this.uMY || this.uSQ) {
            deb();
            if (this.uTn) {
                e.dfb().dff();
            }
            this.fbD.postDelayed(new 26(this), 100);
        }
        AppMethodBeat.o(27099);
    }

    public void onRequestPermissionsResult(int i, String[] strArr, int[] iArr) {
        AppMethodBeat.i(27100);
        if (iArr == null || iArr.length <= 0) {
            ab.i("MicroMsg.Note.NoteEditorUI", "onRequestPermissionsResult grantResults length 0. requestCode[%d], tid[%d]", new Object[]{Integer.valueOf(i), Long.valueOf(Thread.currentThread().getId())});
            AppMethodBeat.o(27100);
            return;
        }
        ab.i("MicroMsg.Note.NoteEditorUI", "onRequestPermissionsResult requestCode[%d],grantResults[%d] tid[%d]", new Object[]{Integer.valueOf(i), Integer.valueOf(iArr[0]), Long.valueOf(Thread.currentThread().getId())});
        switch (i) {
            case 64:
                if (com.tencent.mm.au.b.sO((String) com.tencent.mm.kernel.g.RP().Ry().get(274436, null)) && iArr[0] != 0) {
                    com.tencent.mm.ui.base.h.a(this.mController.ylL, getString(2131301926), getString(2131301936), getString(2131300878), getString(2131297773), false, new 27(this), null);
                    break;
                }
            case 80:
                if (iArr[0] != 0) {
                    ddX();
                    AppMethodBeat.o(27100);
                    return;
                }
                break;
        }
        AppMethodBeat.o(27100);
    }

    public final void ddX() {
        AppMethodBeat.i(27101);
        com.tencent.mm.ui.base.h.a(this, getString(2131301928), getString(2131301936), getString(2131300878), getString(2131297773), false, new 28(this), new 29(this));
        AppMethodBeat.o(27101);
    }

    private boolean dfQ() {
        AppMethodBeat.i(27102);
        gh ghVar = new gh();
        ghVar.cAH.type = 19;
        ghVar.cAH.cvv = this.fDy;
        ghVar.cAH.cAO = -1;
        com.tencent.mm.sdk.b.a.xxA.m(ghVar);
        if (ghVar.cAI.cAY) {
            AppMethodBeat.o(27102);
            return false;
        }
        AppMethodBeat.o(27102);
        return true;
    }

    /* JADX WARNING: Removed duplicated region for block: B:108:0x032c A:{Splitter:B:72:0x023a, ExcHandler: Exception (r2_78 'e' java.lang.Exception)} */
    /* JADX WARNING: Failed to process nested try/catch */
    /* JADX WARNING: Failed to process nested try/catch */
    /* JADX WARNING: Missing block: B:46:0x012b, code skipped:
            r3 = 0;
     */
    /* JADX WARNING: Missing block: B:47:0x012d, code skipped:
            if (r3 < r4) goto L_0x012f;
     */
    /* JADX WARNING: Missing block: B:48:0x012f, code skipped:
            r2 = (android.graphics.Bitmap) r7.get(java.lang.String.valueOf(r3));
     */
    /* JADX WARNING: Missing block: B:52:0x0141, code skipped:
            r2.recycle();
     */
    /* JADX WARNING: Missing block: B:53:0x0144, code skipped:
            r3 = r3 + 1;
     */
    /* JADX WARNING: Missing block: B:54:0x0148, code skipped:
            bpD();
            android.widget.Toast.makeText(r14.mController.ylL, r14.mController.ylL.getString(2131301750), 1).show();
     */
    /* JADX WARNING: Missing block: B:57:?, code skipped:
            com.tencent.matrix.trace.core.AppMethodBeat.o(27103);
     */
    /* JADX WARNING: Missing block: B:93:?, code skipped:
            r3 = com.tencent.mm.plugin.report.service.h.pYm;
            r5 = new java.lang.Object[5];
            r5[0] = java.lang.Integer.valueOf(0);
            r5[1] = java.lang.Integer.valueOf(0);
            r5[2] = java.lang.Integer.valueOf(0);
            r5[3] = java.lang.Integer.valueOf(2);
     */
    /* JADX WARNING: Missing block: B:94:0x02d7, code skipped:
            if (r14.uTi != false) goto L_0x02d9;
     */
    /* JADX WARNING: Missing block: B:95:0x02d9, code skipped:
            r2 = 1;
     */
    /* JADX WARNING: Missing block: B:96:0x02da, code skipped:
            r5[4] = java.lang.Integer.valueOf(r2);
            r3.e(14811, r5);
            com.tencent.mm.sdk.platformtools.ab.e("MicroMsg.Note.NoteEditorUI", "favorite, note, gen long pic , 565 error,errormsg is er:");
            bpD();
            android.widget.Toast.makeText(r14.mController.ylL, r14.mController.ylL.getString(2131301750), 1).show();
            r3 = 0;
     */
    /* JADX WARNING: Missing block: B:97:0x0308, code skipped:
            if (r3 < r6) goto L_0x030a;
     */
    /* JADX WARNING: Missing block: B:98:0x030a, code skipped:
            r2 = (android.graphics.Bitmap) r7.get(java.lang.String.valueOf(r3));
     */
    /* JADX WARNING: Missing block: B:102:0x031c, code skipped:
            r2.recycle();
     */
    /* JADX WARNING: Missing block: B:103:0x031f, code skipped:
            r3 = r3 + 1;
     */
    /* JADX WARNING: Missing block: B:104:0x0323, code skipped:
            r2 = 0;
     */
    /* JADX WARNING: Missing block: B:107:?, code skipped:
            com.tencent.matrix.trace.core.AppMethodBeat.o(27103);
     */
    /* JADX WARNING: Missing block: B:108:0x032c, code skipped:
            r2 = move-exception;
     */
    /* JADX WARNING: Missing block: B:110:?, code skipped:
            com.tencent.mm.sdk.platformtools.ab.e("MicroMsg.Note.NoteEditorUI", "genlongpic fail,error msg Exception");
            com.tencent.mm.sdk.platformtools.ab.printErrStackTrace("MicroMsg.Note.NoteEditorUI", r2, com.tencent.ytcommon.BuildConfig.FLAVOR, new java.lang.Object[0]);
            bpD();
            android.widget.Toast.makeText(r14.mController.ylL, r14.mController.ylL.getString(2131301750), 1).show();
            r3 = com.tencent.mm.plugin.report.service.h.pYm;
            r5 = new java.lang.Object[5];
            r5[0] = java.lang.Integer.valueOf(0);
            r5[1] = java.lang.Integer.valueOf(0);
            r5[2] = java.lang.Integer.valueOf(0);
            r5[3] = java.lang.Integer.valueOf(1);
     */
    /* JADX WARNING: Missing block: B:111:0x0386, code skipped:
            if (r14.uTi != false) goto L_0x0388;
     */
    /* JADX WARNING: Missing block: B:112:0x0388, code skipped:
            r2 = 1;
     */
    /* JADX WARNING: Missing block: B:113:0x0389, code skipped:
            r5[4] = java.lang.Integer.valueOf(r2);
            r3.e(14811, r5);
     */
    /* JADX WARNING: Missing block: B:116:?, code skipped:
            com.tencent.matrix.trace.core.AppMethodBeat.o(27103);
     */
    /* JADX WARNING: Missing block: B:117:0x0399, code skipped:
            r2 = 0;
     */
    public synchronized void onSceneEnd(int r15, int r16, java.lang.String r17, com.tencent.mm.ai.m r18) {
        /*
        r14 = this;
        monitor-enter(r14);
        r2 = 27103; // 0x69df float:3.798E-41 double:1.33907E-319;
        com.tencent.matrix.trace.core.AppMethodBeat.i(r2);	 Catch:{ all -> 0x0021 }
        r2 = r18.getType();	 Catch:{ all -> 0x0021 }
        r3 = 921; // 0x399 float:1.29E-42 double:4.55E-321;
        if (r2 == r3) goto L_0x0015;
    L_0x000e:
        r2 = 27103; // 0x69df float:3.798E-41 double:1.33907E-319;
        com.tencent.matrix.trace.core.AppMethodBeat.o(r2);	 Catch:{ all -> 0x0021 }
    L_0x0013:
        monitor-exit(r14);
        return;
    L_0x0015:
        r0 = r18;
        r2 = r0 instanceof com.tencent.mm.plugin.wenote.model.b;	 Catch:{ all -> 0x0021 }
        if (r2 != 0) goto L_0x0024;
    L_0x001b:
        r2 = 27103; // 0x69df float:3.798E-41 double:1.33907E-319;
        com.tencent.matrix.trace.core.AppMethodBeat.o(r2);	 Catch:{ all -> 0x0021 }
        goto L_0x0013;
    L_0x0021:
        r2 = move-exception;
        monitor-exit(r14);
        throw r2;
    L_0x0024:
        r18 = (com.tencent.mm.plugin.wenote.model.b) r18;	 Catch:{ all -> 0x0021 }
        r0 = r18;
        r2 = r0.uMF;	 Catch:{ all -> 0x0021 }
        r3 = 1;
        if (r2 == r3) goto L_0x0033;
    L_0x002d:
        r2 = 27103; // 0x69df float:3.798E-41 double:1.33907E-319;
        com.tencent.matrix.trace.core.AppMethodBeat.o(r2);	 Catch:{ all -> 0x0021 }
        goto L_0x0013;
    L_0x0033:
        if (r16 != 0) goto L_0x049b;
    L_0x0035:
        r2 = "MicroMsg.Note.NoteEditorUI";
        r3 = "genlong pic , allow";
        com.tencent.mm.sdk.platformtools.ab.i(r2, r3);	 Catch:{ all -> 0x0021 }
        r2 = r14.aiB;	 Catch:{ all -> 0x0021 }
        r5 = r2.getAdapter();	 Catch:{ all -> 0x0021 }
        if (r5 == 0) goto L_0x0447;
    L_0x0046:
        r6 = r5.getItemCount();	 Catch:{ all -> 0x0021 }
        if (r6 > 0) goto L_0x00a5;
    L_0x004c:
        r14.bpD();	 Catch:{ all -> 0x0021 }
        r2 = r14.mController;	 Catch:{ all -> 0x0021 }
        r2 = r2.ylL;	 Catch:{ all -> 0x0021 }
        r3 = r14.mController;	 Catch:{ all -> 0x0021 }
        r3 = r3.ylL;	 Catch:{ all -> 0x0021 }
        r4 = 2131301750; // 0x7f091576 float:1.8221567E38 double:1.0530029756E-314;
        r3 = r3.getString(r4);	 Catch:{ all -> 0x0021 }
        r4 = 1;
        r2 = android.widget.Toast.makeText(r2, r3, r4);	 Catch:{ all -> 0x0021 }
        r2.show();	 Catch:{ all -> 0x0021 }
        r3 = com.tencent.mm.plugin.report.service.h.pYm;	 Catch:{ all -> 0x0021 }
        r4 = 14811; // 0x39db float:2.0755E-41 double:7.3176E-320;
        r2 = 5;
        r5 = new java.lang.Object[r2];	 Catch:{ all -> 0x0021 }
        r2 = 0;
        r6 = 0;
        r6 = java.lang.Integer.valueOf(r6);	 Catch:{ all -> 0x0021 }
        r5[r2] = r6;	 Catch:{ all -> 0x0021 }
        r2 = 1;
        r6 = 0;
        r6 = java.lang.Integer.valueOf(r6);	 Catch:{ all -> 0x0021 }
        r5[r2] = r6;	 Catch:{ all -> 0x0021 }
        r2 = 2;
        r6 = 0;
        r6 = java.lang.Integer.valueOf(r6);	 Catch:{ all -> 0x0021 }
        r5[r2] = r6;	 Catch:{ all -> 0x0021 }
        r2 = 3;
        r6 = 1;
        r6 = java.lang.Integer.valueOf(r6);	 Catch:{ all -> 0x0021 }
        r5[r2] = r6;	 Catch:{ all -> 0x0021 }
        r6 = 4;
        r2 = r14.uTi;	 Catch:{ all -> 0x0021 }
        if (r2 == 0) goto L_0x00a3;
    L_0x0092:
        r2 = 1;
    L_0x0093:
        r2 = java.lang.Integer.valueOf(r2);	 Catch:{ all -> 0x0021 }
        r5[r6] = r2;	 Catch:{ all -> 0x0021 }
        r3.e(r4, r5);	 Catch:{ all -> 0x0021 }
        r2 = 27103; // 0x69df float:3.798E-41 double:1.33907E-319;
        com.tencent.matrix.trace.core.AppMethodBeat.o(r2);	 Catch:{ all -> 0x0021 }
        goto L_0x0013;
    L_0x00a3:
        r2 = 0;
        goto L_0x0093;
    L_0x00a5:
        r2 = 0;
        r3 = java.lang.Runtime.getRuntime();	 Catch:{ Exception -> 0x01bc, Throwable -> 0x03d9 }
        r8 = r3.maxMemory();	 Catch:{ Exception -> 0x01bc, Throwable -> 0x03d9 }
        r10 = 1024; // 0x400 float:1.435E-42 double:5.06E-321;
        r8 = r8 / r10;
        r3 = (int) r8;	 Catch:{ Exception -> 0x01bc, Throwable -> 0x03d9 }
        r3 = r3 / 8;
        r7 = new com.tencent.mm.memory.a.b;	 Catch:{ Exception -> 0x01bc, Throwable -> 0x03d9 }
        r4 = r14.getClass();	 Catch:{ Exception -> 0x01bc, Throwable -> 0x03d9 }
        r7.<init>(r3, r4);	 Catch:{ Exception -> 0x01bc, Throwable -> 0x03d9 }
        r3 = 0;
        r4 = r3;
    L_0x00bf:
        if (r4 >= r6) goto L_0x023a;
    L_0x00c1:
        r3 = r14.aiB;	 Catch:{ Exception -> 0x01bc, Throwable -> 0x03d9 }
        r8 = r5.getItemViewType(r4);	 Catch:{ Exception -> 0x01bc, Throwable -> 0x03d9 }
        r8 = r5.c(r3, r8);	 Catch:{ Exception -> 0x01bc, Throwable -> 0x03d9 }
        r5.a(r8, r4);	 Catch:{ Exception -> 0x01bc, Throwable -> 0x03d9 }
        r3 = r8.apJ;	 Catch:{ Exception -> 0x01bc, Throwable -> 0x03d9 }
        r9 = r14.aiB;	 Catch:{ Exception -> 0x01bc, Throwable -> 0x03d9 }
        r9 = r9.getWidth();	 Catch:{ Exception -> 0x01bc, Throwable -> 0x03d9 }
        r10 = 1073741824; // 0x40000000 float:2.0 double:5.304989477E-315;
        r9 = android.view.View.MeasureSpec.makeMeasureSpec(r9, r10);	 Catch:{ Exception -> 0x01bc, Throwable -> 0x03d9 }
        r10 = 0;
        r11 = 0;
        r10 = android.view.View.MeasureSpec.makeMeasureSpec(r10, r11);	 Catch:{ Exception -> 0x01bc, Throwable -> 0x03d9 }
        r3.measure(r9, r10);	 Catch:{ Exception -> 0x01bc, Throwable -> 0x03d9 }
        r3 = r8.apJ;	 Catch:{ Exception -> 0x01bc, Throwable -> 0x03d9 }
        r9 = 0;
        r10 = 0;
        r11 = r8.apJ;	 Catch:{ Exception -> 0x01bc, Throwable -> 0x03d9 }
        r11 = r11.getMeasuredWidth();	 Catch:{ Exception -> 0x01bc, Throwable -> 0x03d9 }
        r12 = r8.apJ;	 Catch:{ Exception -> 0x01bc, Throwable -> 0x03d9 }
        r12 = r12.getMeasuredHeight();	 Catch:{ Exception -> 0x01bc, Throwable -> 0x03d9 }
        r3.layout(r9, r10, r11, r12);	 Catch:{ Exception -> 0x01bc, Throwable -> 0x03d9 }
        r3 = r8.apJ;	 Catch:{ Exception -> 0x01bc, Throwable -> 0x03d9 }
        r3 = r3.getWidth();	 Catch:{ Exception -> 0x01bc, Throwable -> 0x03d9 }
        r9 = r8.apJ;	 Catch:{ Exception -> 0x01bc, Throwable -> 0x03d9 }
        r9 = r9.getHeight();	 Catch:{ Exception -> 0x01bc, Throwable -> 0x03d9 }
        if (r3 <= 0) goto L_0x0126;
    L_0x0106:
        if (r9 <= 0) goto L_0x0126;
    L_0x0108:
        r10 = android.graphics.Bitmap.Config.ARGB_8888;	 Catch:{ Throwable -> 0x012a, Exception -> 0x01bc }
        r9 = android.graphics.Bitmap.createBitmap(r3, r9, r10);	 Catch:{ Throwable -> 0x012a, Exception -> 0x01bc }
        r3 = new android.graphics.Canvas;	 Catch:{ Exception -> 0x01bc, Throwable -> 0x03d9 }
        r3.<init>(r9);	 Catch:{ Exception -> 0x01bc, Throwable -> 0x03d9 }
        r10 = r8.apJ;	 Catch:{ Exception -> 0x0169, Throwable -> 0x03d9 }
        r10.draw(r3);	 Catch:{ Exception -> 0x0169, Throwable -> 0x03d9 }
    L_0x0118:
        r3 = java.lang.String.valueOf(r4);	 Catch:{ Exception -> 0x01bc, Throwable -> 0x03d9 }
        r7.put(r3, r9);	 Catch:{ Exception -> 0x01bc, Throwable -> 0x03d9 }
        r3 = r8.apJ;	 Catch:{ Exception -> 0x01bc, Throwable -> 0x03d9 }
        r3 = r3.getMeasuredHeight();	 Catch:{ Exception -> 0x01bc, Throwable -> 0x03d9 }
        r2 = r2 + r3;
    L_0x0126:
        r3 = r4 + 1;
        r4 = r3;
        goto L_0x00bf;
    L_0x012a:
        r2 = move-exception;
        r2 = 0;
        r3 = r2;
    L_0x012d:
        if (r3 >= r4) goto L_0x0148;
    L_0x012f:
        r2 = java.lang.String.valueOf(r3);	 Catch:{ Exception -> 0x01bc, Throwable -> 0x03d9 }
        r2 = r7.get(r2);	 Catch:{ Exception -> 0x01bc, Throwable -> 0x03d9 }
        r2 = (android.graphics.Bitmap) r2;	 Catch:{ Exception -> 0x01bc, Throwable -> 0x03d9 }
        if (r2 == 0) goto L_0x0144;
    L_0x013b:
        r5 = r2.isRecycled();	 Catch:{ Exception -> 0x01bc, Throwable -> 0x03d9 }
        if (r5 != 0) goto L_0x0144;
    L_0x0141:
        r2.recycle();	 Catch:{ Exception -> 0x01bc, Throwable -> 0x03d9 }
    L_0x0144:
        r2 = r3 + 1;
        r3 = r2;
        goto L_0x012d;
    L_0x0148:
        r14.bpD();	 Catch:{ Exception -> 0x01bc, Throwable -> 0x03d9 }
        r2 = r14.mController;	 Catch:{ Exception -> 0x01bc, Throwable -> 0x03d9 }
        r2 = r2.ylL;	 Catch:{ Exception -> 0x01bc, Throwable -> 0x03d9 }
        r3 = r14.mController;	 Catch:{ Exception -> 0x01bc, Throwable -> 0x03d9 }
        r3 = r3.ylL;	 Catch:{ Exception -> 0x01bc, Throwable -> 0x03d9 }
        r4 = 2131301750; // 0x7f091576 float:1.8221567E38 double:1.0530029756E-314;
        r3 = r3.getString(r4);	 Catch:{ Exception -> 0x01bc, Throwable -> 0x03d9 }
        r4 = 1;
        r2 = android.widget.Toast.makeText(r2, r3, r4);	 Catch:{ Exception -> 0x01bc, Throwable -> 0x03d9 }
        r2.show();	 Catch:{ Exception -> 0x01bc, Throwable -> 0x03d9 }
        r2 = 27103; // 0x69df float:3.798E-41 double:1.33907E-319;
        com.tencent.matrix.trace.core.AppMethodBeat.o(r2);	 Catch:{ all -> 0x0021 }
        goto L_0x0013;
    L_0x0169:
        r3 = move-exception;
        r14.bpD();	 Catch:{ Exception -> 0x01bc, Throwable -> 0x03d9 }
        r3 = r14.mController;	 Catch:{ Exception -> 0x01bc, Throwable -> 0x03d9 }
        r3 = r3.ylL;	 Catch:{ Exception -> 0x01bc, Throwable -> 0x03d9 }
        r10 = r14.mController;	 Catch:{ Exception -> 0x01bc, Throwable -> 0x03d9 }
        r10 = r10.ylL;	 Catch:{ Exception -> 0x01bc, Throwable -> 0x03d9 }
        r11 = 2131301750; // 0x7f091576 float:1.8221567E38 double:1.0530029756E-314;
        r10 = r10.getString(r11);	 Catch:{ Exception -> 0x01bc, Throwable -> 0x03d9 }
        r11 = 1;
        r3 = android.widget.Toast.makeText(r3, r10, r11);	 Catch:{ Exception -> 0x01bc, Throwable -> 0x03d9 }
        r3.show();	 Catch:{ Exception -> 0x01bc, Throwable -> 0x03d9 }
        r10 = com.tencent.mm.plugin.report.service.h.pYm;	 Catch:{ Exception -> 0x01bc, Throwable -> 0x03d9 }
        r11 = 14811; // 0x39db float:2.0755E-41 double:7.3176E-320;
        r3 = 5;
        r12 = new java.lang.Object[r3];	 Catch:{ Exception -> 0x01bc, Throwable -> 0x03d9 }
        r3 = 0;
        r13 = 0;
        r13 = java.lang.Integer.valueOf(r13);	 Catch:{ Exception -> 0x01bc, Throwable -> 0x03d9 }
        r12[r3] = r13;	 Catch:{ Exception -> 0x01bc, Throwable -> 0x03d9 }
        r3 = 1;
        r13 = 0;
        r13 = java.lang.Integer.valueOf(r13);	 Catch:{ Exception -> 0x01bc, Throwable -> 0x03d9 }
        r12[r3] = r13;	 Catch:{ Exception -> 0x01bc, Throwable -> 0x03d9 }
        r3 = 2;
        r13 = 0;
        r13 = java.lang.Integer.valueOf(r13);	 Catch:{ Exception -> 0x01bc, Throwable -> 0x03d9 }
        r12[r3] = r13;	 Catch:{ Exception -> 0x01bc, Throwable -> 0x03d9 }
        r3 = 3;
        r13 = 1;
        r13 = java.lang.Integer.valueOf(r13);	 Catch:{ Exception -> 0x01bc, Throwable -> 0x03d9 }
        r12[r3] = r13;	 Catch:{ Exception -> 0x01bc, Throwable -> 0x03d9 }
        r13 = 4;
        r3 = r14.uTi;	 Catch:{ Exception -> 0x01bc, Throwable -> 0x03d9 }
        if (r3 == 0) goto L_0x0237;
    L_0x01b0:
        r3 = 1;
    L_0x01b1:
        r3 = java.lang.Integer.valueOf(r3);	 Catch:{ Exception -> 0x01bc, Throwable -> 0x03d9 }
        r12[r13] = r3;	 Catch:{ Exception -> 0x01bc, Throwable -> 0x03d9 }
        r10.e(r11, r12);	 Catch:{ Exception -> 0x01bc, Throwable -> 0x03d9 }
        goto L_0x0118;
    L_0x01bc:
        r2 = move-exception;
        r2 = "MicroMsg.Note.NoteEditorUI";
        r3 = "genlongpic fail,Exception error msg a";
        com.tencent.mm.sdk.platformtools.ab.e(r2, r3);	 Catch:{ all -> 0x0021 }
        r14.bpD();	 Catch:{ all -> 0x0021 }
        r2 = r14.mController;	 Catch:{ all -> 0x0021 }
        r2 = r2.ylL;	 Catch:{ all -> 0x0021 }
        r3 = r14.mController;	 Catch:{ all -> 0x0021 }
        r3 = r3.ylL;	 Catch:{ all -> 0x0021 }
        r4 = 2131301750; // 0x7f091576 float:1.8221567E38 double:1.0530029756E-314;
        r3 = r3.getString(r4);	 Catch:{ all -> 0x0021 }
        r4 = 1;
        r2 = android.widget.Toast.makeText(r2, r3, r4);	 Catch:{ all -> 0x0021 }
        r2.show();	 Catch:{ all -> 0x0021 }
        r3 = com.tencent.mm.plugin.report.service.h.pYm;	 Catch:{ all -> 0x0021 }
        r4 = 14811; // 0x39db float:2.0755E-41 double:7.3176E-320;
        r2 = 5;
        r5 = new java.lang.Object[r2];	 Catch:{ all -> 0x0021 }
        r2 = 0;
        r6 = 0;
        r6 = java.lang.Integer.valueOf(r6);	 Catch:{ all -> 0x0021 }
        r5[r2] = r6;	 Catch:{ all -> 0x0021 }
        r2 = 1;
        r6 = 0;
        r6 = java.lang.Integer.valueOf(r6);	 Catch:{ all -> 0x0021 }
        r5[r2] = r6;	 Catch:{ all -> 0x0021 }
        r2 = 2;
        r6 = 0;
        r6 = java.lang.Integer.valueOf(r6);	 Catch:{ all -> 0x0021 }
        r5[r2] = r6;	 Catch:{ all -> 0x0021 }
        r2 = 3;
        r6 = 2;
        r6 = java.lang.Integer.valueOf(r6);	 Catch:{ all -> 0x0021 }
        r5[r2] = r6;	 Catch:{ all -> 0x0021 }
        r6 = 4;
        r2 = r14.uTi;	 Catch:{ all -> 0x0021 }
        if (r2 == 0) goto L_0x0442;
    L_0x020c:
        r2 = 1;
    L_0x020d:
        r2 = java.lang.Integer.valueOf(r2);	 Catch:{ all -> 0x0021 }
        r5[r6] = r2;	 Catch:{ all -> 0x0021 }
        r3.e(r4, r5);	 Catch:{ all -> 0x0021 }
    L_0x0216:
        r2 = r14.uSJ;	 Catch:{ all -> 0x0021 }
        r0 = r18;
        r3 = r0.uMJ;	 Catch:{ all -> 0x0021 }
        r2.uQI = r3;	 Catch:{ all -> 0x0021 }
        r2 = com.tencent.mm.plugin.wenote.model.nativenote.manager.c.dem();	 Catch:{ all -> 0x0021 }
        r3 = com.tencent.mm.plugin.wenote.model.nativenote.manager.c.dem();	 Catch:{ all -> 0x0021 }
        r3 = r3.size();	 Catch:{ all -> 0x0021 }
        r3 = r3 + -1;
        r4 = 0;
        r2.au(r3, r4);	 Catch:{ all -> 0x0021 }
        r2 = 27103; // 0x69df float:3.798E-41 double:1.33907E-319;
        com.tencent.matrix.trace.core.AppMethodBeat.o(r2);	 Catch:{ all -> 0x0021 }
        goto L_0x0013;
    L_0x0237:
        r3 = 0;
        goto L_0x01b1;
    L_0x023a:
        r3 = r14.mController;	 Catch:{ Exception -> 0x032c, Throwable -> 0x03d9 }
        r3 = r3.ylL;	 Catch:{ Exception -> 0x032c, Throwable -> 0x03d9 }
        r4 = 14;
        r3 = com.tencent.mm.bz.a.fromDPToPix(r3, r4);	 Catch:{ Exception -> 0x032c, Throwable -> 0x03d9 }
        r4 = r14.aiB;	 Catch:{ Throwable -> 0x0291, Exception -> 0x032c }
        r4 = r4.getMeasuredWidth();	 Catch:{ Throwable -> 0x0291, Exception -> 0x032c }
        r4 = r4 + 0;
        r5 = r2 + r3;
        r8 = android.graphics.Bitmap.Config.ARGB_8888;	 Catch:{ Throwable -> 0x0291, Exception -> 0x032c }
        r2 = android.graphics.Bitmap.createBitmap(r4, r5, r8);	 Catch:{ Throwable -> 0x0291, Exception -> 0x032c }
        r5 = r2;
    L_0x0255:
        r8 = new android.graphics.Canvas;	 Catch:{ Exception -> 0x032c, Throwable -> 0x03d9 }
        r8.<init>(r5);	 Catch:{ Exception -> 0x032c, Throwable -> 0x03d9 }
        r2 = -1;
        r8.drawColor(r2);	 Catch:{ Exception -> 0x032c, Throwable -> 0x03d9 }
        r2 = r14.mController;	 Catch:{ Exception -> 0x032c, Throwable -> 0x03d9 }
        r2 = r2.ylL;	 Catch:{ Exception -> 0x032c, Throwable -> 0x03d9 }
        r3 = 8;
        r3 = com.tencent.mm.bz.a.fromDPToPix(r2, r3);	 Catch:{ Exception -> 0x032c, Throwable -> 0x03d9 }
        r2 = 0;
        r4 = r2;
    L_0x026a:
        if (r4 >= r6) goto L_0x039b;
    L_0x026c:
        r2 = java.lang.String.valueOf(r4);	 Catch:{ Exception -> 0x032c, Throwable -> 0x03d9 }
        r2 = r7.get(r2);	 Catch:{ Exception -> 0x032c, Throwable -> 0x03d9 }
        r2 = (android.graphics.Bitmap) r2;	 Catch:{ Exception -> 0x032c, Throwable -> 0x03d9 }
        if (r2 == 0) goto L_0x028c;
    L_0x0278:
        r9 = 0;
        r10 = (float) r3;	 Catch:{ Exception -> 0x032c, Throwable -> 0x03d9 }
        r11 = 0;
        r8.drawBitmap(r2, r9, r10, r11);	 Catch:{ Exception -> 0x032c, Throwable -> 0x03d9 }
        r9 = r2.getHeight();	 Catch:{ Exception -> 0x032c, Throwable -> 0x03d9 }
        r3 = r3 + r9;
        r9 = r2.isRecycled();	 Catch:{ Exception -> 0x032c, Throwable -> 0x03d9 }
        if (r9 != 0) goto L_0x028c;
    L_0x0289:
        r2.recycle();	 Catch:{ Exception -> 0x032c, Throwable -> 0x03d9 }
    L_0x028c:
        r2 = r3;
        r4 = r4 + 1;
        r3 = r2;
        goto L_0x026a;
    L_0x0291:
        r4 = move-exception;
        r4 = "MicroMsg.Note.NoteEditorUI";
        r5 = "favorite, note, gen long pic ,rgb 888  error,errormsg ";
        com.tencent.mm.sdk.platformtools.ab.e(r4, r5);	 Catch:{ Exception -> 0x032c, Throwable -> 0x03d9 }
        r4 = r14.aiB;	 Catch:{ Throwable -> 0x02ac, Exception -> 0x032c }
        r4 = r4.getMeasuredWidth();	 Catch:{ Throwable -> 0x02ac, Exception -> 0x032c }
        r4 = r4 + 0;
        r2 = r2 + r3;
        r3 = android.graphics.Bitmap.Config.RGB_565;	 Catch:{ Throwable -> 0x02ac, Exception -> 0x032c }
        r2 = android.graphics.Bitmap.createBitmap(r4, r2, r3);	 Catch:{ Throwable -> 0x02ac, Exception -> 0x032c }
        r5 = r2;
        goto L_0x0255;
    L_0x02ac:
        r2 = move-exception;
        r3 = com.tencent.mm.plugin.report.service.h.pYm;	 Catch:{ Exception -> 0x032c, Throwable -> 0x03d9 }
        r4 = 14811; // 0x39db float:2.0755E-41 double:7.3176E-320;
        r2 = 5;
        r5 = new java.lang.Object[r2];	 Catch:{ Exception -> 0x032c, Throwable -> 0x03d9 }
        r2 = 0;
        r8 = 0;
        r8 = java.lang.Integer.valueOf(r8);	 Catch:{ Exception -> 0x032c, Throwable -> 0x03d9 }
        r5[r2] = r8;	 Catch:{ Exception -> 0x032c, Throwable -> 0x03d9 }
        r2 = 1;
        r8 = 0;
        r8 = java.lang.Integer.valueOf(r8);	 Catch:{ Exception -> 0x032c, Throwable -> 0x03d9 }
        r5[r2] = r8;	 Catch:{ Exception -> 0x032c, Throwable -> 0x03d9 }
        r2 = 2;
        r8 = 0;
        r8 = java.lang.Integer.valueOf(r8);	 Catch:{ Exception -> 0x032c, Throwable -> 0x03d9 }
        r5[r2] = r8;	 Catch:{ Exception -> 0x032c, Throwable -> 0x03d9 }
        r2 = 3;
        r8 = 2;
        r8 = java.lang.Integer.valueOf(r8);	 Catch:{ Exception -> 0x032c, Throwable -> 0x03d9 }
        r5[r2] = r8;	 Catch:{ Exception -> 0x032c, Throwable -> 0x03d9 }
        r8 = 4;
        r2 = r14.uTi;	 Catch:{ Exception -> 0x032c, Throwable -> 0x03d9 }
        if (r2 == 0) goto L_0x0323;
    L_0x02d9:
        r2 = 1;
    L_0x02da:
        r2 = java.lang.Integer.valueOf(r2);	 Catch:{ Exception -> 0x032c, Throwable -> 0x03d9 }
        r5[r8] = r2;	 Catch:{ Exception -> 0x032c, Throwable -> 0x03d9 }
        r3.e(r4, r5);	 Catch:{ Exception -> 0x032c, Throwable -> 0x03d9 }
        r2 = "MicroMsg.Note.NoteEditorUI";
        r3 = "favorite, note, gen long pic , 565 error,errormsg is er:";
        com.tencent.mm.sdk.platformtools.ab.e(r2, r3);	 Catch:{ Exception -> 0x032c, Throwable -> 0x03d9 }
        r14.bpD();	 Catch:{ Exception -> 0x032c, Throwable -> 0x03d9 }
        r2 = r14.mController;	 Catch:{ Exception -> 0x032c, Throwable -> 0x03d9 }
        r2 = r2.ylL;	 Catch:{ Exception -> 0x032c, Throwable -> 0x03d9 }
        r3 = r14.mController;	 Catch:{ Exception -> 0x032c, Throwable -> 0x03d9 }
        r3 = r3.ylL;	 Catch:{ Exception -> 0x032c, Throwable -> 0x03d9 }
        r4 = 2131301750; // 0x7f091576 float:1.8221567E38 double:1.0530029756E-314;
        r3 = r3.getString(r4);	 Catch:{ Exception -> 0x032c, Throwable -> 0x03d9 }
        r4 = 1;
        r2 = android.widget.Toast.makeText(r2, r3, r4);	 Catch:{ Exception -> 0x032c, Throwable -> 0x03d9 }
        r2.show();	 Catch:{ Exception -> 0x032c, Throwable -> 0x03d9 }
        r2 = 0;
        r3 = r2;
    L_0x0308:
        if (r3 >= r6) goto L_0x0325;
    L_0x030a:
        r2 = java.lang.String.valueOf(r3);	 Catch:{ Exception -> 0x032c, Throwable -> 0x03d9 }
        r2 = r7.get(r2);	 Catch:{ Exception -> 0x032c, Throwable -> 0x03d9 }
        r2 = (android.graphics.Bitmap) r2;	 Catch:{ Exception -> 0x032c, Throwable -> 0x03d9 }
        if (r2 == 0) goto L_0x031f;
    L_0x0316:
        r4 = r2.isRecycled();	 Catch:{ Exception -> 0x032c, Throwable -> 0x03d9 }
        if (r4 != 0) goto L_0x031f;
    L_0x031c:
        r2.recycle();	 Catch:{ Exception -> 0x032c, Throwable -> 0x03d9 }
    L_0x031f:
        r2 = r3 + 1;
        r3 = r2;
        goto L_0x0308;
    L_0x0323:
        r2 = 0;
        goto L_0x02da;
    L_0x0325:
        r2 = 27103; // 0x69df float:3.798E-41 double:1.33907E-319;
        com.tencent.matrix.trace.core.AppMethodBeat.o(r2);	 Catch:{ all -> 0x0021 }
        goto L_0x0013;
    L_0x032c:
        r2 = move-exception;
        r3 = "MicroMsg.Note.NoteEditorUI";
        r4 = "genlongpic fail,error msg Exception";
        com.tencent.mm.sdk.platformtools.ab.e(r3, r4);	 Catch:{ Exception -> 0x01bc, Throwable -> 0x03d9 }
        r3 = "MicroMsg.Note.NoteEditorUI";
        r4 = "";
        r5 = 0;
        r5 = new java.lang.Object[r5];	 Catch:{ Exception -> 0x01bc, Throwable -> 0x03d9 }
        com.tencent.mm.sdk.platformtools.ab.printErrStackTrace(r3, r2, r4, r5);	 Catch:{ Exception -> 0x01bc, Throwable -> 0x03d9 }
        r14.bpD();	 Catch:{ Exception -> 0x01bc, Throwable -> 0x03d9 }
        r2 = r14.mController;	 Catch:{ Exception -> 0x01bc, Throwable -> 0x03d9 }
        r2 = r2.ylL;	 Catch:{ Exception -> 0x01bc, Throwable -> 0x03d9 }
        r3 = r14.mController;	 Catch:{ Exception -> 0x01bc, Throwable -> 0x03d9 }
        r3 = r3.ylL;	 Catch:{ Exception -> 0x01bc, Throwable -> 0x03d9 }
        r4 = 2131301750; // 0x7f091576 float:1.8221567E38 double:1.0530029756E-314;
        r3 = r3.getString(r4);	 Catch:{ Exception -> 0x01bc, Throwable -> 0x03d9 }
        r4 = 1;
        r2 = android.widget.Toast.makeText(r2, r3, r4);	 Catch:{ Exception -> 0x01bc, Throwable -> 0x03d9 }
        r2.show();	 Catch:{ Exception -> 0x01bc, Throwable -> 0x03d9 }
        r3 = com.tencent.mm.plugin.report.service.h.pYm;	 Catch:{ Exception -> 0x01bc, Throwable -> 0x03d9 }
        r4 = 14811; // 0x39db float:2.0755E-41 double:7.3176E-320;
        r2 = 5;
        r5 = new java.lang.Object[r2];	 Catch:{ Exception -> 0x01bc, Throwable -> 0x03d9 }
        r2 = 0;
        r6 = 0;
        r6 = java.lang.Integer.valueOf(r6);	 Catch:{ Exception -> 0x01bc, Throwable -> 0x03d9 }
        r5[r2] = r6;	 Catch:{ Exception -> 0x01bc, Throwable -> 0x03d9 }
        r2 = 1;
        r6 = 0;
        r6 = java.lang.Integer.valueOf(r6);	 Catch:{ Exception -> 0x01bc, Throwable -> 0x03d9 }
        r5[r2] = r6;	 Catch:{ Exception -> 0x01bc, Throwable -> 0x03d9 }
        r2 = 2;
        r6 = 0;
        r6 = java.lang.Integer.valueOf(r6);	 Catch:{ Exception -> 0x01bc, Throwable -> 0x03d9 }
        r5[r2] = r6;	 Catch:{ Exception -> 0x01bc, Throwable -> 0x03d9 }
        r2 = 3;
        r6 = 1;
        r6 = java.lang.Integer.valueOf(r6);	 Catch:{ Exception -> 0x01bc, Throwable -> 0x03d9 }
        r5[r2] = r6;	 Catch:{ Exception -> 0x01bc, Throwable -> 0x03d9 }
        r6 = 4;
        r2 = r14.uTi;	 Catch:{ Exception -> 0x01bc, Throwable -> 0x03d9 }
        if (r2 == 0) goto L_0x0399;
    L_0x0388:
        r2 = 1;
    L_0x0389:
        r2 = java.lang.Integer.valueOf(r2);	 Catch:{ Exception -> 0x01bc, Throwable -> 0x03d9 }
        r5[r6] = r2;	 Catch:{ Exception -> 0x01bc, Throwable -> 0x03d9 }
        r3.e(r4, r5);	 Catch:{ Exception -> 0x01bc, Throwable -> 0x03d9 }
        r2 = 27103; // 0x69df float:3.798E-41 double:1.33907E-319;
        com.tencent.matrix.trace.core.AppMethodBeat.o(r2);	 Catch:{ all -> 0x0021 }
        goto L_0x0013;
    L_0x0399:
        r2 = 0;
        goto L_0x0389;
    L_0x039b:
        r2 = r14.lzK;	 Catch:{ Exception -> 0x01bc, Throwable -> 0x03d9 }
        if (r2 == 0) goto L_0x0435;
    L_0x039f:
        r2 = r14.lzK;	 Catch:{ Exception -> 0x01bc, Throwable -> 0x03d9 }
        r2 = r2.isShowing();	 Catch:{ Exception -> 0x01bc, Throwable -> 0x03d9 }
        if (r2 == 0) goto L_0x0435;
    L_0x03a7:
        r14.bpD();	 Catch:{ Exception -> 0x01bc, Throwable -> 0x03d9 }
        r2 = r14.mController;	 Catch:{ Exception -> 0x01bc, Throwable -> 0x03d9 }
        r2 = r2.ylL;	 Catch:{ Exception -> 0x01bc, Throwable -> 0x03d9 }
        r3 = r14.mController;	 Catch:{ Exception -> 0x01bc, Throwable -> 0x03d9 }
        r3 = r3.ylL;	 Catch:{ Exception -> 0x01bc, Throwable -> 0x03d9 }
        r4 = 2131298807; // 0x7f0909f7 float:1.8215598E38 double:1.0530015216E-314;
        r6 = 1;
        r6 = new java.lang.Object[r6];	 Catch:{ Exception -> 0x01bc, Throwable -> 0x03d9 }
        r7 = 0;
        r8 = com.tencent.mm.sdk.f.a.dlz();	 Catch:{ Exception -> 0x01bc, Throwable -> 0x03d9 }
        r6[r7] = r8;	 Catch:{ Exception -> 0x01bc, Throwable -> 0x03d9 }
        r3 = r3.getString(r4, r6);	 Catch:{ Exception -> 0x01bc, Throwable -> 0x03d9 }
        r4 = 1;
        r2 = android.widget.Toast.makeText(r2, r3, r4);	 Catch:{ Exception -> 0x01bc, Throwable -> 0x03d9 }
        r2.show();	 Catch:{ Exception -> 0x01bc, Throwable -> 0x03d9 }
        r2 = com.tencent.mm.model.aw.RS();	 Catch:{ Exception -> 0x01bc, Throwable -> 0x03d9 }
        r3 = new com.tencent.mm.plugin.wenote.ui.nativenote.NoteEditorUI$30;	 Catch:{ Exception -> 0x01bc, Throwable -> 0x03d9 }
        r3.<init>(r14, r5);	 Catch:{ Exception -> 0x01bc, Throwable -> 0x03d9 }
        r2.aa(r3);	 Catch:{ Exception -> 0x01bc, Throwable -> 0x03d9 }
        goto L_0x0216;
    L_0x03d9:
        r2 = move-exception;
        r2 = "MicroMsg.Note.NoteEditorUI";
        r3 = "genlongpic fail,Throwable error msg throw";
        com.tencent.mm.sdk.platformtools.ab.e(r2, r3);	 Catch:{ all -> 0x0021 }
        r14.bpD();	 Catch:{ all -> 0x0021 }
        r2 = r14.mController;	 Catch:{ all -> 0x0021 }
        r2 = r2.ylL;	 Catch:{ all -> 0x0021 }
        r3 = r14.mController;	 Catch:{ all -> 0x0021 }
        r3 = r3.ylL;	 Catch:{ all -> 0x0021 }
        r4 = 2131301750; // 0x7f091576 float:1.8221567E38 double:1.0530029756E-314;
        r3 = r3.getString(r4);	 Catch:{ all -> 0x0021 }
        r4 = 1;
        r2 = android.widget.Toast.makeText(r2, r3, r4);	 Catch:{ all -> 0x0021 }
        r2.show();	 Catch:{ all -> 0x0021 }
        r3 = com.tencent.mm.plugin.report.service.h.pYm;	 Catch:{ all -> 0x0021 }
        r4 = 14811; // 0x39db float:2.0755E-41 double:7.3176E-320;
        r2 = 5;
        r5 = new java.lang.Object[r2];	 Catch:{ all -> 0x0021 }
        r2 = 0;
        r6 = 0;
        r6 = java.lang.Integer.valueOf(r6);	 Catch:{ all -> 0x0021 }
        r5[r2] = r6;	 Catch:{ all -> 0x0021 }
        r2 = 1;
        r6 = 0;
        r6 = java.lang.Integer.valueOf(r6);	 Catch:{ all -> 0x0021 }
        r5[r2] = r6;	 Catch:{ all -> 0x0021 }
        r2 = 2;
        r6 = 0;
        r6 = java.lang.Integer.valueOf(r6);	 Catch:{ all -> 0x0021 }
        r5[r2] = r6;	 Catch:{ all -> 0x0021 }
        r2 = 3;
        r6 = 2;
        r6 = java.lang.Integer.valueOf(r6);	 Catch:{ all -> 0x0021 }
        r5[r2] = r6;	 Catch:{ all -> 0x0021 }
        r6 = 4;
        r2 = r14.uTi;	 Catch:{ all -> 0x0021 }
        if (r2 == 0) goto L_0x0445;
    L_0x0429:
        r2 = 1;
    L_0x042a:
        r2 = java.lang.Integer.valueOf(r2);	 Catch:{ all -> 0x0021 }
        r5[r6] = r2;	 Catch:{ all -> 0x0021 }
        r3.e(r4, r5);	 Catch:{ all -> 0x0021 }
        goto L_0x0216;
    L_0x0435:
        if (r5 == 0) goto L_0x0216;
    L_0x0437:
        r2 = r5.isRecycled();	 Catch:{ Exception -> 0x01bc, Throwable -> 0x03d9 }
        if (r2 != 0) goto L_0x0216;
    L_0x043d:
        r5.recycle();	 Catch:{ Exception -> 0x01bc, Throwable -> 0x03d9 }
        goto L_0x0216;
    L_0x0442:
        r2 = 0;
        goto L_0x020d;
    L_0x0445:
        r2 = 0;
        goto L_0x042a;
    L_0x0447:
        r3 = com.tencent.mm.plugin.report.service.h.pYm;	 Catch:{ all -> 0x0021 }
        r4 = 14811; // 0x39db float:2.0755E-41 double:7.3176E-320;
        r2 = 5;
        r5 = new java.lang.Object[r2];	 Catch:{ all -> 0x0021 }
        r2 = 0;
        r6 = 0;
        r6 = java.lang.Integer.valueOf(r6);	 Catch:{ all -> 0x0021 }
        r5[r2] = r6;	 Catch:{ all -> 0x0021 }
        r2 = 1;
        r6 = 0;
        r6 = java.lang.Integer.valueOf(r6);	 Catch:{ all -> 0x0021 }
        r5[r2] = r6;	 Catch:{ all -> 0x0021 }
        r2 = 2;
        r6 = 0;
        r6 = java.lang.Integer.valueOf(r6);	 Catch:{ all -> 0x0021 }
        r5[r2] = r6;	 Catch:{ all -> 0x0021 }
        r2 = 3;
        r6 = 1;
        r6 = java.lang.Integer.valueOf(r6);	 Catch:{ all -> 0x0021 }
        r5[r2] = r6;	 Catch:{ all -> 0x0021 }
        r6 = 4;
        r2 = r14.uTi;	 Catch:{ all -> 0x0021 }
        if (r2 == 0) goto L_0x0499;
    L_0x0473:
        r2 = 1;
    L_0x0474:
        r2 = java.lang.Integer.valueOf(r2);	 Catch:{ all -> 0x0021 }
        r5[r6] = r2;	 Catch:{ all -> 0x0021 }
        r3.e(r4, r5);	 Catch:{ all -> 0x0021 }
        r14.bpD();	 Catch:{ all -> 0x0021 }
        r2 = r14.mController;	 Catch:{ all -> 0x0021 }
        r2 = r2.ylL;	 Catch:{ all -> 0x0021 }
        r3 = r14.mController;	 Catch:{ all -> 0x0021 }
        r3 = r3.ylL;	 Catch:{ all -> 0x0021 }
        r4 = 2131301750; // 0x7f091576 float:1.8221567E38 double:1.0530029756E-314;
        r3 = r3.getString(r4);	 Catch:{ all -> 0x0021 }
        r4 = 1;
        r2 = android.widget.Toast.makeText(r2, r3, r4);	 Catch:{ all -> 0x0021 }
        r2.show();	 Catch:{ all -> 0x0021 }
        goto L_0x0216;
    L_0x0499:
        r2 = 0;
        goto L_0x0474;
    L_0x049b:
        r3 = com.tencent.mm.plugin.report.service.h.pYm;	 Catch:{ all -> 0x0021 }
        r4 = 14811; // 0x39db float:2.0755E-41 double:7.3176E-320;
        r2 = 5;
        r5 = new java.lang.Object[r2];	 Catch:{ all -> 0x0021 }
        r2 = 0;
        r6 = 0;
        r6 = java.lang.Integer.valueOf(r6);	 Catch:{ all -> 0x0021 }
        r5[r2] = r6;	 Catch:{ all -> 0x0021 }
        r2 = 1;
        r6 = 0;
        r6 = java.lang.Integer.valueOf(r6);	 Catch:{ all -> 0x0021 }
        r5[r2] = r6;	 Catch:{ all -> 0x0021 }
        r2 = 2;
        r6 = 0;
        r6 = java.lang.Integer.valueOf(r6);	 Catch:{ all -> 0x0021 }
        r5[r2] = r6;	 Catch:{ all -> 0x0021 }
        r2 = 3;
        r6 = 4;
        r6 = java.lang.Integer.valueOf(r6);	 Catch:{ all -> 0x0021 }
        r5[r2] = r6;	 Catch:{ all -> 0x0021 }
        r6 = 4;
        r2 = r14.uTi;	 Catch:{ all -> 0x0021 }
        if (r2 == 0) goto L_0x04f6;
    L_0x04c7:
        r2 = 1;
    L_0x04c8:
        r2 = java.lang.Integer.valueOf(r2);	 Catch:{ all -> 0x0021 }
        r5[r6] = r2;	 Catch:{ all -> 0x0021 }
        r3.e(r4, r5);	 Catch:{ all -> 0x0021 }
        r2 = "MicroMsg.Note.NoteEditorUI";
        r3 = "genlong pic , not allow";
        com.tencent.mm.sdk.platformtools.ab.e(r2, r3);	 Catch:{ all -> 0x0021 }
        r14.bpD();	 Catch:{ all -> 0x0021 }
        r2 = r14.mController;	 Catch:{ all -> 0x0021 }
        r2 = r2.ylL;	 Catch:{ all -> 0x0021 }
        r3 = r14.mController;	 Catch:{ all -> 0x0021 }
        r3 = r3.ylL;	 Catch:{ all -> 0x0021 }
        r4 = 2131301750; // 0x7f091576 float:1.8221567E38 double:1.0530029756E-314;
        r3 = r3.getString(r4);	 Catch:{ all -> 0x0021 }
        r4 = 1;
        r2 = android.widget.Toast.makeText(r2, r3, r4);	 Catch:{ all -> 0x0021 }
        r2.show();	 Catch:{ all -> 0x0021 }
        goto L_0x0216;
    L_0x04f6:
        r2 = 0;
        goto L_0x04c8;
        */
        throw new UnsupportedOperationException("Method not decompiled: com.tencent.mm.plugin.wenote.ui.nativenote.NoteEditorUI.onSceneEnd(int, int, java.lang.String, com.tencent.mm.ai.m):void");
    }

    private void bpD() {
        AppMethodBeat.i(27104);
        if (this.lzK != null) {
            this.lzK.dismiss();
            this.lzK = null;
        }
        AppMethodBeat.o(27104);
    }

    public void onCreate(Bundle bundle) {
        AppMethodBeat.i(27054);
        this.ylm = true;
        this.uQI = getIntent().getIntExtra("note_open_from_scene", 2);
        this.cvx = getIntent().getLongExtra("note_msgid", -1);
        this.uTl = getIntent().getBooleanExtra("record_show_share", false);
        this.fDy = getIntent().getLongExtra("note_fav_localid", -1);
        this.lsy = getIntent().getStringExtra("note_link_sns_localid");
        this.uMY = getIntent().getBooleanExtra("edit_status", false);
        this.uNq = getIntent().getBooleanExtra("need_save", false);
        this.uSQ = this.uNq;
        this.uTb = getIntent().getStringExtra("fav_note_xml");
        this.uTd = getIntent().getIntExtra("fav_note_scroll_to_position", 0);
        this.uTe = getIntent().getIntExtra("fav_note_scroll_to_offset", 0);
        this.lZg = getIntent().getStringExtra("fav_note_thumbpath");
        this.uTg = getIntent().getBooleanExtra("show_share", true);
        this.uTj = getIntent().getStringExtra("fav_note_link_sns_xml");
        String stringExtra = getIntent().getStringExtra("fav_note_link_source_info");
        this.uTm = getIntent().getBooleanExtra("fav_note_out_of_date", false);
        if (!bo.isNullOrNil(stringExtra)) {
            this.uTf = stringExtra.split(";");
        }
        if (getIntent().getIntExtra("note_fav_post_scene", 0) == 6) {
            this.uTi = true;
        }
        com.tencent.mm.plugin.wenote.model.d.uNa = false;
        if (this.uTf == null && this.fDy > 0) {
            gh ghVar = new gh();
            ghVar.cAH.type = 30;
            ghVar.cAH.cAO = 3;
            ghVar.cAH.cvv = this.fDy;
            com.tencent.mm.sdk.b.a.xxA.m(ghVar);
            this.uTf = bo.isNullOrNil(ghVar.cAI.path) ? null : ghVar.cAI.path.split(";");
        }
        if (this.uTf == null || this.uTf.length >= 3) {
            this.fbD = new ak();
            com.tencent.mm.plugin.wenote.model.nativenote.manager.c dem = com.tencent.mm.plugin.wenote.model.nativenote.manager.c.dem();
            dem.iPr = new ArrayList();
            dem.uPa = this;
            dem.uPb = new aar();
            dem.uPc = 0;
            dem.uPd = 0;
            dem.uPe = 0;
            ab.i("MicroMsg.Note.NoteEditorUI", "OnCreate MainActivity, before setContentView");
            com.tencent.mm.pluginsdk.f.m(this);
            super.onCreate(bundle);
            iL(this.fDy);
            ab.i("MicroMsg.Note.NoteEditorUI", "OnCreate MainActivity, after setContentView");
            i iVar = new i();
            iVar.content = BuildConfig.FLAVOR;
            iVar.uNT = true;
            iVar.uNZ = false;
            if (this.uMY) {
                com.tencent.mm.plugin.wenote.model.nativenote.manager.c.dem().a(iVar);
                this.uTi = true;
            }
            this.WL = this.mController.contentView;
            this.WL.getRootView().setBackgroundColor(-1);
            this.aiB = (RecyclerView) findViewById(2131826383);
            this.uSL = (LinearLayout) this.WL.findViewById(2131826382);
            this.uSL.setVisibility(8);
            this.uTa = (LinearLayout) this.uSL.findViewById(2131826424);
            this.uTa.setVisibility(8);
            this.uSN = (RelativeLayout) findViewById(2131826384);
            this.uSN.setOnClickListener(new 1(this));
            this.uSO = new g(this, this.uSN);
            this.uSO.uPC = this;
            this.uST = new com.tencent.mm.plugin.wenote.ui.nativenote.a.a();
            this.uST.uUf = com.tencent.mm.compatible.util.j.db(this)[1];
            this.aiB.setLayoutManager(this.uST);
            this.aiB.setHasFixedSize(true);
            this.uSW = new a(this);
            this.aiB.a(this.uSW);
            this.uSJ = new k(this);
            this.uSJ.cvv = this.fDy;
            this.uSJ.uQI = this.uQI;
            this.uSJ.uQJ = this.uTi;
            if (this.uNq) {
                k kVar = this.uSJ;
                if (kVar.uQB < 0 && kVar.cvv > 0) {
                    kVar.uQL.ae(60000, 60000);
                    kVar.uQB = bo.yz();
                    kVar.uQC = BuildConfig.FLAVOR;
                }
            }
            this.uSK = new c(this.uSJ);
            this.aiB.setAdapter(this.uSK);
            if (this.uQI == 2) {
                this.aiB.setOnTouchListener(this.uTq);
            }
            this.aiB.getItemAnimator().aot = 0;
            this.aiB.getItemAnimator().aow = 0;
            this.aiB.getItemAnimator().aov = 0;
            this.aiB.getItemAnimator().aou = 120;
            ((av) this.aiB.getItemAnimator()).arN = false;
            this.uTo = com.tencent.mm.bz.a.fromDPToPix(this, 48);
            if (this.uTn) {
                ab.i("MicroMsg.Note.NoteEditorUI", "use multiselect");
                boolean z = this.uQI == 2 && this.uTi;
                int color = getResources().getColor(2131690318);
                e dfb = e.dfb();
                ab.i("NoteSelectManager", "onInit start");
                dfb.uRh = z;
                dfb.uRk = 14;
                dfb.uRl = 32;
                dfb.uRm = com.tencent.mm.bz.a.fromDPToPix(this, 21) - dfb.uRl;
                dfb.uRn = com.tencent.mm.bz.a.fromDPToPix(this, 40) + (dfb.uRl * 2);
                dfb.uRo = com.tencent.mm.bz.a.fromDPToPix(this, 240) + (dfb.uRl * 2);
                dfb.uRi = com.tencent.mm.bz.a.fromDPToPix(this, 22);
                dfb.uRj = com.tencent.mm.bz.a.fromDPToPix(this, 1);
                dfb.mScreenHeight = getResources().getDisplayMetrics().heightPixels;
                dfb.mScreenWidth = getResources().getDisplayMetrics().widthPixels;
                dfb.uRs = new int[]{-1, -1};
                dfb.uRt = new int[]{-1, -1};
                dfb.uRu = new int[]{-1, -1};
                dfb.uRv = new int[]{-1, -1};
                com.tencent.mm.plugin.wenote.model.nativenote.c.a aVar = new com.tencent.mm.plugin.wenote.model.nativenote.c.a(this, 2, dfb.uRi, dfb.uRj, color, dfb);
                dfb.uRw = new PopupWindow(aVar, aVar.getViewWidth(), aVar.getViewHeight(), false);
                dfb.uRw.setClippingEnabled(false);
                dfb.uRw.setAnimationStyle(2131493881);
                dfb.uRq = aVar.getOffsetForCursorMid();
                dfb.uRr = com.tencent.mm.bz.a.fromDPToPix(this, 6);
                com.tencent.mm.plugin.wenote.model.nativenote.c.a aVar2 = new com.tencent.mm.plugin.wenote.model.nativenote.c.a(this, 3, dfb.uRi, dfb.uRj, color, dfb);
                dfb.uRx = new PopupWindow(aVar2, aVar2.getViewWidth(), aVar.getViewHeight(), false);
                dfb.uRx.setClippingEnabled(false);
                dfb.uRx.setAnimationStyle(2131493880);
                aVar2 = new com.tencent.mm.plugin.wenote.model.nativenote.c.a(this, 4, dfb.uRi, dfb.uRj, color, dfb);
                dfb.uRy = new PopupWindow(aVar2, aVar2.getViewWidth(), aVar.getViewHeight(), false);
                dfb.uRy.setClippingEnabled(false);
                dfb.uRy.setAnimationStyle(2131493882);
                View inflate = LayoutInflater.from(this).inflate(2130970317, null);
                inflate.measure(MeasureSpec.makeMeasureSpec(0, 0), MeasureSpec.makeMeasureSpec(0, 0));
                dfb.uRz = new PopupWindow(inflate, -2, -2, false);
                dfb.uRz.setBackgroundDrawable(getResources().getDrawable(2130840364));
                dfb.uRz.setClippingEnabled(false);
                dfb.uRz.setAnimationStyle(2131493884);
                dfb.uRF = (TextView) inflate.findViewById(2131826415);
                dfb.uRG = (TextView) inflate.findViewById(2131826416);
                dfb.uRH = (TextView) inflate.findViewById(2131826417);
                dfb.uRI = (TextView) inflate.findViewById(2131826418);
                dfb.uRJ = (TextView) inflate.findViewById(2131826422);
                dfb.uRK = (TextView) inflate.findViewById(2131826419);
                dfb.uRL = (TextView) inflate.findViewById(2131826420);
                dfb.uRM = (TextView) inflate.findViewById(2131826421);
                e.g(dfb.uRF, dfb.uRk);
                e.g(dfb.uRG, dfb.uRk);
                e.g(dfb.uRH, dfb.uRk);
                e.g(dfb.uRI, dfb.uRk);
                e.g(dfb.uRJ, dfb.uRk);
                e.g(dfb.uRK, dfb.uRk);
                e.g(dfb.uRL, dfb.uRk);
                e.g(dfb.uRM, dfb.uRk);
                dfb.uRF.setOnClickListener(new e$10(dfb));
                dfb.uRG.setOnClickListener(new 11(dfb));
                dfb.uRH.setOnClickListener(new 12(dfb));
                dfb.uRI.setOnClickListener(new 13(dfb));
                dfb.uRJ.setOnClickListener(new 2(dfb));
                dfb.uRK.setOnClickListener(new 3(dfb));
                dfb.uRL.setOnClickListener(new 4(dfb));
                dfb.uRM.setOnClickListener(new 5(dfb));
                dfb.uRp = aVar.getViewPadding();
                dfb.uRA = this;
                dfb.uRB = new com.tencent.mm.plugin.wenote.model.nativenote.c.d();
                dfb.uRC = new com.tencent.mm.plugin.wenote.model.nativenote.c.b();
                dfb.mHandler = new ak();
                e.mHasInit = true;
                ab.i("NoteSelectManager", "onInit end");
                this.uTp = new m() {
                    public final void c(RecyclerView recyclerView, int i) {
                        AppMethodBeat.i(27042);
                        super.c(recyclerView, i);
                        switch (i) {
                            case 0:
                                e.dfb().oq(e.dfb().dfi());
                                e.dfb().op(e.dfb().dfg());
                                e.dfb().h(false, 50);
                                break;
                            case 1:
                                e.dfb().dfj();
                                e.dfb().dfh();
                                AppMethodBeat.o(27042);
                                return;
                            case 2:
                                AppMethodBeat.o(27042);
                                return;
                        }
                        AppMethodBeat.o(27042);
                    }

                    public final void a(RecyclerView recyclerView, int i, int i2) {
                        AppMethodBeat.i(27043);
                        super.a(recyclerView, i, i2);
                        if (i2 > 30) {
                            e.dfb().dfj();
                            e.dfb().dfh();
                        }
                        com.tencent.mm.plugin.wenote.model.nativenote.c.d dfd = e.dfb().dfd();
                        if ((NoteEditorUI.this.uSV || (NoteEditorUI.this.uSL != null && NoteEditorUI.this.uSL.getVisibility() == 0)) && dfd.dfa() == 2 && com.tencent.mm.plugin.wenote.model.nativenote.c.f.f(recyclerView, dfd.coc) == null) {
                            NoteEditorUI.this.deb();
                        }
                        AppMethodBeat.o(27043);
                    }
                };
                this.aiB.a(this.uTp);
            }
            if (this.lzK != null) {
                this.lzK.dismiss();
                this.lzK = null;
            }
            if (!(this.uMY || this.uTm)) {
                this.lzK = com.tencent.mm.ui.base.h.b(this.mController.ylL, getString(2131305714), true, new 12(this));
            }
            if (this.uTm) {
                ab.i("MicroMsg.Note.NoteEditorUI", "open msg note,  out of date");
                com.tencent.mm.ui.base.h.b(this.mController.ylL, this.mController.ylL.getString(2131301747), null, true);
            }
            if (this.uTg) {
                addIconOptionMenu(1, 2131304081, 2131230740, new 23(this));
            }
            if (this.uTi) {
                setMMTitle(getString(2131299765));
            } else {
                setMMTitle(getString(2131299766));
            }
            pP(true);
            setBackBtn(new OnMenuItemClickListener() {
                public final boolean onMenuItemClick(MenuItem menuItem) {
                    AppMethodBeat.i(27039);
                    if (NoteEditorUI.K(NoteEditorUI.this)) {
                        NoteEditorUI.L(NoteEditorUI.this);
                        NoteEditorUI.this.finish();
                        AppMethodBeat.o(27039);
                    } else {
                        AppMethodBeat.o(27039);
                    }
                    return true;
                }
            }, 2131230737);
            com.tencent.mm.pluginsdk.f.n(this);
            if (this.uMY) {
                g(true, 300);
                af(1, 0);
            }
            if (this.uQI == 2 && this.uTi) {
                this.uSM = new c();
                c cVar = this.uSM;
                LinearLayout linearLayout = this.uSL;
                cVar.gLe = linearLayout;
                k.deT().uQD = cVar;
                cVar.uTL = (LinearLayout) linearLayout.findViewById(2131826424);
                cVar.uTK = (ImageButton) linearLayout.findViewById(2131826374);
                cVar.uTM = (ImageButton) linearLayout.findViewById(2131826370);
                cVar.uTN = (ImageButton) linearLayout.findViewById(2131826369);
                cVar.uTO = (ImageButton) linearLayout.findViewById(2131826368);
                cVar.uTP = (ImageButton) linearLayout.findViewById(2131826371);
                cVar.uTQ = (LinearLayout) cVar.uTL.findViewById(2131826426);
                cVar.uTR = (LinearLayout) cVar.uTL.findViewById(2131826425);
                cVar.uTS = (LinearLayout) cVar.uTL.findViewById(2131826429);
                cVar.uTT = (LinearLayout) cVar.uTL.findViewById(2131826430);
                cVar.uTU = (LinearLayout) cVar.uTL.findViewById(2131826431);
                cVar.uTK.setOnClickListener(new 1(cVar, this));
                cVar.uTO.setOnClickListener(new 6(cVar, this));
                cVar.uTP.setOnClickListener(new 7(cVar, this, this));
                cVar.uTM.setOnClickListener(new 8(cVar, this));
                cVar.uTN.setOnClickListener(new 9(cVar, this));
                cVar.uTU.setOnClickListener(new c$10(cVar, this));
                cVar.uTQ.setOnClickListener(new c.11(cVar, this));
                cVar.uTR.setOnClickListener(new c.12(cVar, this));
                cVar.uTS.setOnClickListener(new c.13(cVar, this));
                cVar.uTT.setOnClickListener(new c.2(cVar, this));
                getWindow().setSoftInputMode(18);
            } else {
                this.uSL.setVisibility(8);
            }
            this.aiB.getViewTreeObserver().addOnGlobalLayoutListener(this.aeL);
            this.uTh = System.currentTimeMillis();
            ab.i("MicroMsg.Note.NoteEditorUI", "startnoteeditorui, oncreate , currenttime is %d", new Object[]{Long.valueOf(this.uTh)});
            aw.Rg().a(921, this);
            AppMethodBeat.o(27054);
            return;
        }
        AppMethodBeat.o(27054);
    }

    public final void ddY() {
        AppMethodBeat.i(27056);
        com.tencent.mm.ui.base.h.b(this.mController.ylL, getString(2131301751), null, true);
        AppMethodBeat.o(27056);
    }

    public final Context dfO() {
        return this.mController.ylL;
    }

    public final void dea() {
        AppMethodBeat.i(27080);
        Toast.makeText(this.mController.ylL, getString(2131301748), 0).show();
        AppMethodBeat.o(27080);
    }

    public final void deE() {
        AppMethodBeat.i(27094);
        com.tencent.mm.plugin.wenote.model.nativenote.manager.f.c(this.mController.ylL, com.tencent.mm.plugin.wenote.model.nativenote.manager.c.dem().dev());
        AppMethodBeat.o(27094);
    }

    public final void deF() {
        AppMethodBeat.i(27095);
        com.tencent.mm.plugin.wenote.model.nativenote.manager.f.c(this.mController.ylL, com.tencent.mm.plugin.wenote.model.nativenote.manager.c.dem().dev());
        deD();
        AppMethodBeat.o(27095);
    }

    static /* synthetic */ void aa(NoteEditorUI noteEditorUI) {
        AppMethodBeat.i(27110);
        aw.RS().aa(new Runnable() {
            public final void run() {
                AppMethodBeat.i(26998);
                try {
                    int iT = ((LinearLayoutManager) NoteEditorUI.this.aiB.getLayoutManager()).iT();
                    com.tencent.mm.plugin.wenote.model.a.c Ke = com.tencent.mm.plugin.wenote.model.nativenote.manager.c.dem().Ke(iT);
                    if (!(Ke == null || Ke.getType() != 4 || ((l) Ke).uOp)) {
                        NoteEditorUI.this.JX(iT);
                    }
                    AppMethodBeat.o(26998);
                } catch (NullPointerException e) {
                    AppMethodBeat.o(26998);
                }
            }
        });
        AppMethodBeat.o(27110);
    }
}
