package com.ss.android.ugc.aweme.feed.caption.edit;

import X.0EQ;
import X.1CX;
import X.2UX;
import X.2cN;
import X.2nK;
import X.3SI;
import X.4wQ;
import X.7TD;
import X.7cy;
import X.7he;
import X.8Fb;
import X.8YM;
import X.8gF;
import X.C3121SMb;
import X.C3122SMc;
import X.C3123SMd;
import X.C3124SMe;
import X.C3132SMm;
import X.C3136SMq;
import X.C3137SMr;
import X.C3138SMs;
import X.C3139SMt;
import X.C3140SMu;
import X.C3141SMv;
import X.C3142SMw;
import X.C3144SMy;
import X.C3145SMz;
import X.Crj;
import X.Crs;
import X.Crt;
import X.Cru;
import X.Crv;
import X.Crw;
import X.F6S;
import X.FjH;
import X.LeS;
import X.M12;
import X.Mjy;
import X.Mk2;
import X.Mk3;
import X.OQL;
import X.OQZ;
import X.PhE;
import X.PlI;
import X.SMO;
import X.SMX;
import X.SN0;
import X.SNU;
import android.content.Intent;
import android.os.Bundle;
import android.os.SystemClock;
import android.util.SparseArray;
import android.view.View;
import android.view.Window;
import android.widget.FrameLayout;
import androidx.recyclerview.widget.RecyclerView;
import com.bytedance.apm.agent.v2.instrumentation.ActivityAgent;
import com.bytedance.covode.number.Covode;
import com.bytedance.sysoptimizer.EnterTransitionCrashOptimizer;
import com.ss.android.ugc.aweme.feed.model.Aweme;
import com.ss.android.ugc.aweme.feed.model.CaptionItemModel;
import com.ss.android.ugc.aweme.feed.model.CaptionLanguage;
import com.ss.android.ugc.aweme.feed.model.CaptionModel;
import com.ss.android.ugc.aweme.feed.model.Video;
import com.ss.android.ugc.aweme.player.sdk.api.OnUIPlayListener;
import com.ss.android.ugc.playerkit.videoview.VideoViewComponent;
import java.util.Iterator;
import java.util.List;
import kotlin.h.b.n;
import org.json.JSONObject;

public final class TranslatedCaptionEditActivity extends SNU implements SN0, OnUIPlayListener {
    public static final C3145SMz LJIILL = new C3145SMz((byte) 0);
    public HighLightLayoutManager LIZ;
    public C3123SMd LIZIZ;
    public Aweme LIZJ;
    public String LIZLLL;
    public Video LJ;
    public boolean LJFF;
    public boolean LJI;
    public boolean LJII;
    public boolean LJIIIIZZ;
    public boolean LJIIIZ;
    public boolean LJIIJ;
    public float LJIIJJI = 0.004f;
    public int LJIIL;
    public long LJIILIIL = -1;
    public long LJIILJJIL = -1;
    public final Crj LJIILLIIL = 7he.LIZ(new Crw(this));
    public final Crj LJIIZILJ = 7he.LIZ(F6S.LIZ);
    public final Crj LJIJ = 7he.LIZ(new C3141SMv(this));
    public final Crj LJIJI = 7he.LIZ(new C3140SMu(this));
    public final Crj LJIJJ = 7he.LIZ(new C3138SMs(this));
    public final Crj LJIJJLI = 7he.LIZ(new C3136SMq(this));
    public final Crj LJIL = 7he.LIZ(new C3137SMr(this));
    public final Crj LJJ = 7he.LIZ(new C3139SMt(this));
    public final Crj LJJI = 7he.LIZ(new C3144SMy(this));
    public String LJJIFFI;
    public long LJJII = -1;
    public SparseArray LJJIII;

    static {
        Covode.recordClassIndex(78306);
    }

    public final EditCaptionViewModel LIZ() {
        return (EditCaptionViewModel) this.LJIILLIIL.getValue();
    }

    public final VideoViewComponent LIZIZ() {
        return (VideoViewComponent) this.LJIIZILJ.getValue();
    }

    public final FrameLayout LIZJ() {
        return (FrameLayout) this.LJIJI.getValue();
    }

    public final OQZ LIZLLL() {
        return (OQZ) this.LJIJJ.getValue();
    }

    public final View LJ() {
        return (View) this.LJIJJLI.getValue();
    }

    public final RecyclerView LJFF() {
        return (RecyclerView) this.LJIL.getValue();
    }

    public final 3SI LJI() {
        return (3SI) this.LJJI.getValue();
    }

    public final void _$_clearFindViewByIdCache() {
        SparseArray sparseArray = this.LJJIII;
        if (sparseArray != null) {
            sparseArray.clear();
        }
    }

    public final View _$_findCachedViewById(int i) {
        if (this.LJJIII == null) {
            this.LJJIII = new SparseArray();
        }
        View view = (View) this.LJJIII.get(i);
        if (view != null) {
            return view;
        }
        View findViewById = findViewById(i);
        this.LJJIII.put(i, findViewById);
        return findViewById;
    }

    public final OnUIPlayListener getWrapperedListener() {
        return null;
    }

    public final void onBufferedPercent(String str, long j, int i) {
    }

    public final void onBufferedTimeMs(String str, long j) {
    }

    public final void onBuffering(String str, boolean z) {
    }

    public final void onBuffering(String str, boolean z, 7TD r3) {
    }

    public final void onBuffering(boolean z) {
    }

    public final void onCompleteLoaded(String str, boolean z) {
    }

    public final void onDecoderBuffering(String str, boolean z) {
    }

    public final void onDecoderBuffering(String str, boolean z, 7TD r3) {
    }

    public final void onDecoderBuffering(boolean z) {
    }

    /* JADX WARNING: type inference failed for: r0v0, types: [X.SNU, com.ss.android.ugc.aweme.feed.caption.edit.TranslatedCaptionEditActivity, android.app.Activity] */
    public final void onDestroy() {
        8gF.LJ(this);
        super.onDestroy();
    }

    public final void onPausePlay(String str, 7TD r2) {
    }

    public final void onPlayCompleted(String str, int i) {
    }

    public final void onPlayCompletedFirstTime(String str) {
    }

    public final void onPlayCompletedFirstTime(String str, 7TD r2) {
    }

    public final void onPlayFailed(7cy r1) {
    }

    public final void onPlayFailed(String str, 7cy r2) {
    }

    public final void onPlayFailed(String str, 7cy r2, 7TD r3) {
    }

    public final void onPlayPause(String str) {
    }

    public final void onPlayPrepare(String str) {
    }

    public final void onPlayProgressChange(String str, long j, long j2) {
    }

    public final void onPlayRelease(String str) {
    }

    public final void onPlayStop(String str) {
    }

    public final void onPlayStop(String str, JSONObject jSONObject) {
    }

    public final void onPlayStop(String str, JSONObject jSONObject, 7TD r3) {
    }

    public final void onPlayStop(String str, boolean z) {
    }

    public final void onPlayerInternalEvent(String str, int i, JSONObject jSONObject) {
    }

    public final void onPlaying(String str) {
    }

    public final void onPlaying(String str, 7TD r2) {
    }

    public final void onPreRenderSessionMissed(String str) {
    }

    public final void onPreparePlay(String str) {
    }

    public final void onPreparePlay(String str, 7TD r2) {
    }

    public final void onRenderFirstFrame(String str, 8Fb r2) {
    }

    public final void onRenderFirstFrameFromResume(String str) {
    }

    public final void onRenderReady(7TD r1) {
    }

    public final void onResumePlay(String str, 7TD r2) {
    }

    public final void onRetryOnError(7cy r1) {
    }

    public final void onRetryOnError(String str, 7cy r2) {
    }

    public final void onSeekEnd(String str, boolean z) {
    }

    public final void onSeekStart(String str, int i, float f) {
    }

    /* JADX WARNING: type inference failed for: r0v0, types: [X.SNU, com.ss.android.ugc.aweme.feed.caption.edit.TranslatedCaptionEditActivity, android.app.Activity] */
    public final void onStart() {
        8gF.LIZ(this);
        super.onStart();
    }

    public final void onVideoBitrateChanged(String str, 8YM r2, int i) {
    }

    public final void onVideoSizeChanged(String str, int i, int i2) {
    }

    public final void onWindowFocusChanged(boolean z) {
        ActivityAgent.onTrace("com.ss.android.ugc.aweme.feed.caption.edit.TranslatedCaptionEditActivity", "onWindowFocusChanged", true);
        super.onWindowFocusChanged(z);
    }

    public final void LJII() {
        if (this.LJIIIIZZ && this.LJ != null) {
            LIZIZ().LIZ(this.LJ);
            LIZJ().setOnClickListener(new C3142SMw(this));
        }
    }

    /* JADX WARNING: type inference failed for: r6v0, types: [X.SNU, com.ss.android.ugc.aweme.feed.caption.edit.TranslatedCaptionEditActivity, android.app.Activity] */
    public final void onPause() {
        8gF.LIZJ(this);
        super.onPause();
        if (LIZLLL().getVisibility() == 8 && this.LJ != null && LIZIZ().LJI()) {
            LIZ(false);
        }
        this.LJIILIIL += SystemClock.elapsedRealtime() - this.LJIILJJIL;
    }

    /* JADX WARNING: type inference failed for: r5v0, types: [X.SNU, com.ss.android.ugc.aweme.feed.caption.edit.TranslatedCaptionEditActivity, android.app.Activity] */
    public final void onResume() {
        8gF.LIZIZ(this);
        ActivityAgent.onTrace("com.ss.android.ugc.aweme.feed.caption.edit.TranslatedCaptionEditActivity", "onResume", true);
        super.onResume();
        if (LIZLLL().getVisibility() == 8 && this.LJ != null && !LIZIZ().LJI() && !this.LJII) {
            LIZ(false);
        }
        this.LJIILJJIL = SystemClock.elapsedRealtime();
        ActivityAgent.onTrace("com.ss.android.ugc.aweme.feed.caption.edit.TranslatedCaptionEditActivity", "onResume", false);
    }

    /* JADX WARNING: type inference failed for: r1v0, types: [X.SNU, com.ss.android.ugc.aweme.feed.caption.edit.TranslatedCaptionEditActivity, android.app.Activity] */
    public final void onStop() {
        8gF.LIZLLL(this);
        super.onStop();
        if (EnterTransitionCrashOptimizer.getContext() != null) {
            try {
                getWindow().getDecorView().getViewTreeObserver().dispatchOnPreDraw();
            } catch (Throwable unused) {
            }
        }
        try {
            getWindow().getDecorView().getViewTreeObserver().dispatchOnPreDraw();
        } catch (Throwable unused2) {
        }
    }

    public final String LJIIIIZZ() {
        Long l;
        Video video;
        CaptionModel captionModel;
        List captionList;
        Object obj;
        Video video2;
        CaptionModel captionModel2;
        CaptionLanguage originalCaptionLanguage;
        Aweme aweme = this.LIZJ;
        if (aweme == null || (video2 = aweme.getVideo()) == null || (captionModel2 = video2.getCaptionModel()) == null || (originalCaptionLanguage = captionModel2.getOriginalCaptionLanguage()) == null) {
            l = null;
        } else {
            l = Long.valueOf(originalCaptionLanguage.getLanguageId());
        }
        Aweme aweme2 = this.LIZJ;
        if (!(aweme2 == null || (video = aweme2.getVideo()) == null || (captionModel = video.getCaptionModel()) == null || (captionList = captionModel.getCaptionList()) == null)) {
            Iterator it = captionList.iterator();
            while (true) {
                if (!it.hasNext()) {
                    obj = null;
                    break;
                }
                obj = it.next();
                long languageId = ((CaptionItemModel) obj).getLanguageId();
                if (l != null && l.longValue() == languageId) {
                    break;
                }
            }
            CaptionItemModel captionItemModel = (CaptionItemModel) obj;
            if (captionItemModel != null) {
                return captionItemModel.getLanguageName();
            }
        }
        return null;
    }

    public final String LJIIIZ() {
        Long l;
        Video video;
        CaptionModel captionModel;
        List captionList;
        Object obj;
        Video video2;
        CaptionModel captionModel2;
        CaptionLanguage originalCaptionLanguage;
        Aweme aweme = this.LIZJ;
        if (aweme == null || (video2 = aweme.getVideo()) == null || (captionModel2 = video2.getCaptionModel()) == null || (originalCaptionLanguage = captionModel2.getOriginalCaptionLanguage()) == null) {
            l = null;
        } else {
            l = Long.valueOf(originalCaptionLanguage.getLanguageId());
        }
        Aweme aweme2 = this.LIZJ;
        if (!(aweme2 == null || (video = aweme2.getVideo()) == null || (captionModel = video.getCaptionModel()) == null || (captionList = captionModel.getCaptionList()) == null)) {
            Iterator it = captionList.iterator();
            while (true) {
                if (!it.hasNext()) {
                    obj = null;
                    break;
                }
                obj = it.next();
                long languageId = ((CaptionItemModel) obj).getLanguageId();
                if (l != null) {
                    if (l.longValue() != languageId) {
                        break;
                    }
                } else {
                    break;
                }
            }
            CaptionItemModel captionItemModel = (CaptionItemModel) obj;
            if (captionItemModel != null) {
                return captionItemModel.getLanguageName();
            }
        }
        return null;
    }

    public final String LJIIJ() {
        Long l;
        Video video;
        CaptionModel captionModel;
        List captionList;
        Object obj;
        Video video2;
        CaptionModel captionModel2;
        CaptionLanguage originalCaptionLanguage;
        Aweme aweme = this.LIZJ;
        if (aweme == null || (video2 = aweme.getVideo()) == null || (captionModel2 = video2.getCaptionModel()) == null || (originalCaptionLanguage = captionModel2.getOriginalCaptionLanguage()) == null) {
            l = null;
        } else {
            l = Long.valueOf(originalCaptionLanguage.getLanguageId());
        }
        Aweme aweme2 = this.LIZJ;
        if (!(aweme2 == null || (video = aweme2.getVideo()) == null || (captionModel = video.getCaptionModel()) == null || (captionList = captionModel.getCaptionList()) == null)) {
            Iterator it = captionList.iterator();
            while (true) {
                if (!it.hasNext()) {
                    obj = null;
                    break;
                }
                obj = it.next();
                long languageId = ((CaptionItemModel) obj).getLanguageId();
                if (l != null) {
                    if (l.longValue() != languageId) {
                        break;
                    }
                } else {
                    break;
                }
            }
            CaptionItemModel captionItemModel = (CaptionItemModel) obj;
            if (captionItemModel != null) {
                return captionItemModel.getClaSubtitleId();
            }
        }
        return null;
    }

    public final void onPausePlay(String str) {
        LIZIZ().LJIIIIZZ();
    }

    public final void onRenderFirstFrame(8Fb r2) {
        M12.LIZ(r2);
        LIZ(true);
    }

    public final void onResumePlay(String str) {
        LIZIZ().LJII();
    }

    public static final /* synthetic */ C3123SMd LIZ(TranslatedCaptionEditActivity translatedCaptionEditActivity) {
        C3123SMd sMd = translatedCaptionEditActivity.LIZIZ;
        if (sMd == null) {
            n.LIZ("");
        }
        return sMd;
    }

    public final void onPlayCompleted(String str) {
        if (this.LJIIIZ) {
            LIZIZ().LIZIZ();
            this.LJI = true;
            this.LJII = true;
            LJ().setVisibility(0);
            C3123SMd sMd = this.LIZIZ;
            if (sMd == null) {
                n.LIZ("");
            }
            sMd.LIZIZ();
        }
    }

    public final void LIZ(int i) {
        EditCaptionViewModel LIZ2;
        EditCaptionItem editCaptionItem;
        List srcSubtitleItem;
        CaptionData captionData;
        C3123SMd sMd = this.LIZIZ;
        if (sMd == null) {
            n.LIZ("");
        }
        if (!(sMd.LIZ == i || (LIZ2 = LIZ()) == null || (editCaptionItem = LIZ2.LIZ) == null || (srcSubtitleItem = editCaptionItem.getSrcSubtitleItem()) == null || (captionData = (CaptionData) srcSubtitleItem.get(i)) == null)) {
            LIZIZ().LIZ((((float) captionData.getStartTime()) * 100.0f) / ((float) LIZIZ().LJFF()));
            this.LJIIL = captionData.getEndTime();
        }
        if (this.LJIIIZ) {
            C3123SMd sMd2 = this.LIZIZ;
            if (sMd2 == null) {
                n.LIZ("");
            }
            if (sMd2.LIZ == i) {
                return;
            }
        }
        LIZIZ().LIZIZ();
        this.LJI = true;
        this.LJII = true;
        this.LJIIIZ = true;
        LJ().setVisibility(0);
        C3123SMd sMd3 = this.LIZIZ;
        if (sMd3 == null) {
            n.LIZ("");
        }
        sMd3.LIZ(i);
    }

    public final void LIZIZ(int i) {
        EditCaptionItem editCaptionItem;
        List srcSubtitleItem;
        CaptionData captionData;
        EditCaptionViewModel LIZ2 = LIZ();
        if (!(LIZ2 == null || (editCaptionItem = LIZ2.LIZ) == null || (srcSubtitleItem = editCaptionItem.getSrcSubtitleItem()) == null || (captionData = (CaptionData) srcSubtitleItem.get(i)) == null)) {
            LIZIZ().LIZ((((float) captionData.getStartTime()) * 100.0f) / ((float) LIZIZ().LJFF()));
            this.LJIIL = captionData.getEndTime();
        }
        this.LJIIIZ = true;
        LIZIZ().LIZ();
        this.LJI = false;
        this.LJII = false;
        LJ().setVisibility(8);
    }

    public final void LIZ(boolean z) {
        if (this.LJI) {
            if (!LIZIZ().LJI() && this.LJ != null) {
                this.LJIIIZ = false;
                C3123SMd sMd = this.LIZIZ;
                if (sMd == null) {
                    n.LIZ("");
                }
                sMd.LIZ();
                LIZIZ().LIZ();
                this.LJI = false;
                this.LJII = false;
                LJ().setVisibility(8);
            }
        } else if (LIZIZ().LJI()) {
            LIZIZ().LIZIZ();
            if (this.LJIIIZ) {
                C3123SMd sMd2 = this.LIZIZ;
                if (sMd2 == null) {
                    n.LIZ("");
                }
                sMd2.LIZIZ();
            }
            this.LJI = true;
            if (z) {
                this.LJII = true;
                LJ().setVisibility(0);
            }
        }
    }

    public final void LIZIZ(boolean z) {
        Video video;
        2UX r4 = new 2UX();
        r4.LIZ("enter_from", LIZ(getIntent(), "enter_from"));
        r4.LIZ("enter_method", LIZ(getIntent(), "enter_method"));
        r4.LIZ("group_id", 4wQ.LJ(this.LIZJ));
        r4.LIZ("author_id", 4wQ.LIZ(this.LIZJ));
        Aweme aweme = this.LIZJ;
        int i = 1;
        if (aweme == null || (video = aweme.getVideo()) == null || !video.isLongVideo()) {
            i = 0;
        }
        r4.LIZ("is_long", i);
        r4.LIZ("video_lang", LJIIIIZZ());
        r4.LIZ("transl_lang", LJIIIZ());
        r4.LIZ("load_time", SystemClock.elapsedRealtime() - this.LJJII);
        r4.LIZ("is_popup", z ? 1 : 0);
        2nK.LIZ("transl_caption_loaded", r4.LIZ);
        this.LJJII = -1;
    }

    public final void onPlayProgressChange(float f) {
        List srcSubtitleItem;
        EditCaptionViewModel LIZ2;
        EditCaptionItem editCaptionItem;
        List srcSubtitleItem2;
        CaptionData captionData;
        int i = 0;
        if (!this.LJIIIZ) {
            long LJ2 = LIZIZ().LJ();
            EditCaptionItem editCaptionItem2 = LIZ().LIZ;
            if (editCaptionItem2 != null && (srcSubtitleItem = editCaptionItem2.getSrcSubtitleItem()) != null) {
                for (Object next : srcSubtitleItem) {
                    int i2 = i + 1;
                    if (i < 0) {
                        LeS.LIZIZ();
                    }
                    CaptionData captionData2 = (CaptionData) next;
                    if (((long) captionData2.getStartTime()) > LJ2 || LJ2 >= ((long) captionData2.getEndTime())) {
                        i = i2;
                    } else if (i >= 0) {
                        C3123SMd sMd = this.LIZIZ;
                        if (sMd == null) {
                            n.LIZ("");
                        }
                        if (sMd.LIZ != i) {
                            C3123SMd sMd2 = this.LIZIZ;
                            if (sMd2 == null) {
                                n.LIZ("");
                            }
                            if (i < sMd2.getItemCount()) {
                                C3123SMd sMd3 = this.LIZIZ;
                                if (sMd3 == null) {
                                    n.LIZ("");
                                }
                                if (!(i != sMd3.LIZ - 1 || (LIZ2 = LIZ()) == null || (editCaptionItem = LIZ2.LIZ) == null || (srcSubtitleItem2 = editCaptionItem.getSrcSubtitleItem()) == null || (captionData = (CaptionData) srcSubtitleItem2.get(i)) == null)) {
                                    if (((long) captionData.getEndTime()) - LIZIZ().LJ() <= 100) {
                                        return;
                                    }
                                }
                                if (i == 0) {
                                    this.LJIIJJI = 0.004f;
                                } else {
                                    this.LJIIJJI = 400.0f;
                                }
                                HighLightLayoutManager highLightLayoutManager = this.LIZ;
                                if (highLightLayoutManager == null) {
                                    n.LIZ("");
                                }
                                highLightLayoutManager.LIZ(LJFF(), new 0EQ(), i);
                                C3123SMd sMd4 = this.LIZIZ;
                                if (sMd4 == null) {
                                    n.LIZ("");
                                }
                                sMd4.LIZ(i);
                                return;
                            }
                            return;
                        }
                        return;
                    } else {
                        return;
                    }
                }
            }
        } else if ((((float) LIZIZ().LJFF()) * f) / 100.0f >= ((float) this.LJIIL)) {
            LIZIZ().LIZIZ();
            this.LJI = true;
            this.LJII = true;
            LJ().setVisibility(0);
            C3123SMd sMd5 = this.LIZIZ;
            if (sMd5 == null) {
                n.LIZ("");
            }
            sMd5.LIZIZ();
        }
    }

    /* JADX WARNING: type inference failed for: r8v0, types: [X.SNU, com.ss.android.ugc.aweme.feed.caption.edit.TranslatedCaptionEditActivity, android.app.Activity] */
    public final void onCreate(Bundle bundle) {
        2cN r1;
        8gF.LIZ(this, bundle);
        ActivityAgent.onTrace("com.ss.android.ugc.aweme.feed.caption.edit.TranslatedCaptionEditActivity", "onCreate", true);
        super.onCreate(bundle);
        this.LJJII = SystemClock.elapsedRealtime();
        this.LJIILJJIL = SystemClock.elapsedRealtime();
        setContentView(2131559257);
        try {
            this.LIZLLL = LIZ(getIntent(), "subtitle_id");
            this.LJJIFFI = LIZ(getIntent(), "enter_from");
        } catch (Exception unused) {
        }
        Window window = getWindow();
        n.LIZIZ(window, "");
        window.setNavigationBarColor(-16777216);
        LIZLLL().setBuilder(FjH.LIZ(this));
        2UX r2 = new 2UX();
        r2.LIZ("enter_from", LIZ(getIntent(), "enter_from"));
        r2.LIZ("enter_method", LIZ(getIntent(), "enter_method"));
        r2.LIZ("group_id", LIZ(getIntent(), "group_id"));
        r2.LIZ("author_id", LIZ(getIntent(), "author_id"));
        r2.LIZ("is_long", getIntent().getIntExtra("is_long", 0));
        r2.LIZ("video_lang", LIZ(getIntent(), "video_lang"));
        r2.LIZ("transl_lang", LIZ(getIntent(), "transl_lang"));
        2nK.LIZ("enter_edit_transl_page", r2.LIZ);
        LIZLLL().setVisibility(0);
        LIZLLL().LJFF();
        EditCaptionViewModel LIZ2 = LIZ();
        String str = this.LIZLLL;
        if (str == null || str.length() == 0) {
            r1 = CaptionEditApi.LIZIZ.LIZ().LIZIZ(PhE.LIZIZ(PlI.LIZJ)).LIZ(Mk2.LIZ(Mk3.LIZ)).LIZ(new Cru(LIZ2), new Crt(LIZ2));
            n.LIZIZ(r1, "");
        } else {
            r1 = CaptionEditApi.LIZIZ.LIZ(str).LIZIZ(PhE.LIZIZ(PlI.LIZJ)).LIZ(Mk2.LIZ(Mk3.LIZ)).LIZ(new Crv(LIZ2), new Crs(LIZ2));
            n.LIZIZ(r1, "");
        }
        new Mjy().LIZ(r1);
        LIZ().LIZ().observe(this, new C3124SMe(this));
        LIZ().LIZIZ().observe(this, new C3121SMb(this));
        LIZ().LIZJ().observe(this, new SMO(this));
        LIZ().LIZLLL().observe(this, new SMX(this));
        this.LIZIZ = new C3123SMd(LIZ(), this);
        this.LIZ = new HighLightLayoutManager(this);
        RecyclerView LJFF2 = LJFF();
        HighLightLayoutManager highLightLayoutManager = this.LIZ;
        if (highLightLayoutManager == null) {
            n.LIZ("");
        }
        LJFF2.setLayoutManager(highLightLayoutManager);
        C3123SMd sMd = this.LIZIZ;
        if (sMd == null) {
            n.LIZ("");
        }
        LJFF2.setAdapter(sMd);
        1CX itemAnimator = LJFF2.getItemAnimator();
        if (itemAnimator != null) {
            itemAnimator.LJIIL = false;
            ((FrameLayout) this.LJIJ.getValue()).setOnClickListener(new C3132SMm(this));
            ((OQL) this.LJJ.getValue()).setOnTitleBarClickListener(new C3122SMc(this));
            ActivityAgent.onTrace("com.ss.android.ugc.aweme.feed.caption.edit.TranslatedCaptionEditActivity", "onCreate", false);
            return;
        }
        NullPointerException nullPointerException = new NullPointerException("null cannot be cast to non-null type androidx.recyclerview.widget.SimpleItemAnimator");
        ActivityAgent.onTrace("com.ss.android.ugc.aweme.feed.caption.edit.TranslatedCaptionEditActivity", "onCreate", false);
        throw nullPointerException;
    }

    public static String LIZ(Intent intent, String str) {
        try {
            return intent.getStringExtra(str);
        } catch (Exception unused) {
            return null;
        }
    }
}
