package com.ss.android.ugc.aweme.choosemusic.activity;

import X.0HH;
import X.2OR;
import X.4Ek;
import X.6CS;
import X.6CT;
import X.7he;
import X.C4720O3v;
import X.C5226ONh;
import X.C5228ONj;
import X.C5928Ofz;
import X.C5929Og0;
import X.CAC;
import X.Crj;
import X.FpW;
import X.FpY;
import X.FrZ;
import X.K0G;
import X.M12;
import X.MEQ;
import X.NB5;
import X.O2P;
import X.O4P;
import X.O4Q;
import X.OO2;
import X.OO4;
import X.OOB;
import X.OOE;
import X.OOG;
import X.OOH;
import X.OSU;
import X.Qeg;
import X.Sx2;
import android.animation.ValueAnimator;
import android.app.Activity;
import android.content.Intent;
import android.os.Bundle;
import android.view.KeyEvent;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.TextView;
import com.bytedance.covode.number.Covode;
import com.ss.android.ugc.aweme.base.opensourcemodified.android.support.design.widget.ViewPagerBottomSheetBehavior;
import com.ss.android.ugc.aweme.base.utils.KeyboardUtils;
import com.ss.android.ugc.aweme.choosemusic.model.ChooseMusicWithSceneViewModel;
import com.ss.android.ugc.aweme.global.config.settings.pojo.IESSettingsProxy;
import com.ss.android.ugc.aweme.out.AVExternalServiceImpl;
import com.ss.android.ugc.aweme.services.performance.IAVPerformance;
import com.ss.android.ugc.aweme.shortvideo.model.MusicModel;
import java.util.Objects;
import kotlin.h.b.n;

public final class e extends C5929Og0 implements 6CS, 6CT {
    public int LIZ;
    public boolean LIZIZ;
    public Qeg LJ;
    public CAC LJFF;
    public final Crj LJI = 7he.LIZ(C5228ONj.LIZ);
    public final Crj LJII = 7he.LIZ(new FpW(this));
    public final Crj LJIIIIZZ = 7he.LIZ(new FpY(this));
    public boolean LJIIIZ;
    public ViewPagerBottomSheetBehavior<View> LJIIJ;

    static {
        Covode.recordClassIndex(55986);
    }

    public final IAVPerformance LIZ() {
        return (IAVPerformance) this.LJI.getValue();
    }

    public final ChooseMusicWithSceneViewModel LIZIZ() {
        return (ChooseMusicWithSceneViewModel) this.LJII.getValue();
    }

    public final float LJJIJIIJI() {
        return ((Number) this.LJIIIIZZ.getValue()).floatValue();
    }

    public final void LJJ() {
        super.LJJ();
        LJJIL();
    }

    private final void LJJIL() {
        if (this.LIZ == 2) {
            OSU.LIZIZ("video_shoot_page");
        } else {
            OSU.LIZIZ("video_edit_page");
        }
    }

    private final boolean LJJIZ() {
        boolean z = false;
        if (this.LJIIIZ) {
            return false;
        }
        try {
            IESSettingsProxy iESSettingsProxy = 2OR.LIZ.LIZIZ;
            n.LIZIZ(iESSettingsProxy, "");
            Boolean enableLocalMusicEntrance = iESSettingsProxy.getEnableLocalMusicEntrance();
            n.LIZIZ(enableLocalMusicEntrance, "");
            z = enableLocalMusicEntrance.booleanValue();
            return z;
        } catch (4Ek e) {
            0HH.LIZ(e);
            return z;
        }
    }

    public final void LJIILL() {
        super.LJIILL();
        Activity LJIJJ = LJIJJ();
        if (!(LJIJJ instanceof NB5)) {
            LJIJJ = null;
        }
        NB5 nb5 = (NB5) LJIJJ;
        if (nb5 != null) {
            nb5.LIZIZ((6CT) this);
            nb5.LIZJ(this);
        }
        IAVPerformance LIZ2 = LIZ();
        Activity LJIJJ2 = LJIJJ();
        n.LIZIZ(LJIJJ2, "");
        LIZ2.leave(LJIJJ2, "music_select");
    }

    public final void LJJI() {
        String str;
        super.LJJI();
        IAVPerformance LIZ2 = LIZ();
        Activity LJIJJ = LJIJJ();
        n.LIZIZ(LJIJJ, "");
        Bundle bundle = this.LJIJ;
        String str2 = null;
        if (bundle != null) {
            str = bundle.getString("creation_id");
        } else {
            str = null;
        }
        Bundle bundle2 = this.LJIJ;
        if (bundle2 != null) {
            str2 = bundle2.getString("shoot_way");
        }
        LIZ2.pause(LJIJJ, "music_select", str, str2);
    }

    public final void LJJIJIL() {
        if (MEQ.LIZ()) {
            O4Q.LIZ();
            C5928Ofz LIZIZ2 = O4P.LIZIZ(this);
            if (LIZIZ2 != null) {
                O2P o2p = new O2P();
                o2p.LIZ = new C4720O3v();
                LIZIZ2.LIZ(o2p.LIZ());
            }
        }
    }

    public final void LJJIJLIJ() {
        if (LIZIZ().LIZIZ) {
            ChooseMusicWithSceneViewModel LIZIZ2 = LIZIZ();
            Intent intent = new Intent();
            AVExternalServiceImpl.LIZ().publishService().setCurMusic((MusicModel) null);
            intent.putExtra("is_cancel_current_choose_music", true);
            LIZIZ2.LIZ(new C5226ONh(-1, intent));
        }
    }

    public final void LJJIJL() {
        View LIZLLL = LIZLLL(2131372279);
        n.LIZIZ(LIZLLL, "");
        TextView textView = (TextView) LIZLLL;
        if (LJJIZ()) {
            CAC cac = this.LJFF;
            if (cac == null) {
                n.LIZ("");
            }
            if (cac.LIZ()) {
                textView.setVisibility(0);
                if (this.LIZIZ) {
                    textView.setAlpha(0.5f);
                    textView.setOnClickListener(Sx2.LIZ(new FrZ(this)));
                    return;
                }
                textView.setOnClickListener(Sx2.LIZ(new OO4(this)));
                return;
            }
        }
        textView.setVisibility(8);
    }

    public final void LJJIJIIJIL() {
        if (!(!n.LIZ(LIZIZ().LIZJ().getValue(), OOH.LIZ))) {
            LIZIZ().LIZ((OOE) OOG.LIZ);
            Qeg qeg = this.LJ;
            if (qeg == null) {
                n.LIZ("");
            }
            KeyboardUtils.LIZJ(qeg);
            View view = this.LJIILJJIL;
            if (view != null) {
                view.setEnabled(false);
            }
            if (!MEQ.LIZ()) {
                ValueAnimator ofFloat = ValueAnimator.ofFloat(new float[]{0.0f, 1.0f});
                ofFloat.setDuration(300);
                ofFloat.addUpdateListener(new OOB(this));
                ofFloat.addListener(new OO2(this));
                ofFloat.start();
            } else if (n.LIZ(LIZIZ().LIZJ().getValue(), OOG.LIZ)) {
                O4Q.LIZ();
                C5928Ofz LIZIZ2 = O4P.LIZIZ(this);
                if (LIZIZ2 != null) {
                    LIZIZ2.LIZJ(this);
                }
            }
        }
    }

    /* JADX WARNING: Code restructure failed: missing block: B:6:0x0015, code lost:
        if (r1 == null) goto L_0x0017;
     */
    /* Code decompiled incorrectly, please refer to instructions dump. */
    public final void dD_() {
        /*
            r10 = this;
            super.dD_()
            android.app.Activity r1 = r10.LJIJJ()
            java.lang.String r3 = ""
            kotlin.h.b.n.LIZIZ(r1, r3)
        L_0x000c:
            r2 = 0
            if (r1 == 0) goto L_0x0127
            boolean r0 = r1 instanceof X.1hK
            if (r0 == 0) goto L_0x011b
            X.1hK r1 = (X.1hK) r1
            if (r1 != 0) goto L_0x001a
        L_0x0017:
            kotlin.h.b.n.LIZIZ()
        L_0x001a:
            X.0AA r7 = r1.getSupportFragmentManager()
            r0 = 2131365159(0x7f0a0d27, float:1.8350175E38)
            androidx.fragment.app.Fragment r6 = r7.LIZ(r0)
            boolean r0 = r6 instanceof com.ss.android.ugc.aweme.choosemusic.fragment.ChooseMusicFragment
            if (r0 != 0) goto L_0x002a
            r6 = r2
        L_0x002a:
            com.ss.android.ugc.aweme.choosemusic.fragment.ChooseMusicFragment r6 = (com.ss.android.ugc.aweme.choosemusic.fragment.ChooseMusicFragment) r6
            r5 = 1
            if (r6 == 0) goto L_0x008c
            com.ss.android.ugc.aweme.choosemusic.fragment.NewMusicTabFragment r4 = r6.LIZIZ
            kotlin.h.b.n.LIZIZ(r4, r3)
            X.0AA r9 = r4.getChildFragmentManager()
            X.0AP r8 = r9.LIZ()
            java.lang.StringBuilder r1 = new java.lang.StringBuilder
            r1.<init>()
            java.lang.String r0 = com.ss.android.ugc.aweme.choosemusic.fragment.BaseNewMusicTabFragment.LIZIZ
            r1.append(r0)
            r0 = 0
            r1.append(r0)
            java.lang.String r0 = r1.toString()
            androidx.fragment.app.Fragment r0 = r9.LIZ(r0)
            if (r0 == 0) goto L_0x0057
            r8.LIZ(r0)
        L_0x0057:
            java.lang.StringBuilder r1 = new java.lang.StringBuilder
            r1.<init>()
            java.lang.String r0 = com.ss.android.ugc.aweme.choosemusic.fragment.BaseNewMusicTabFragment.LIZIZ
            r1.append(r0)
            r1.append(r5)
            java.lang.String r0 = r1.toString()
            androidx.fragment.app.Fragment r0 = r9.LIZ(r0)
            if (r0 == 0) goto L_0x0071
            r8.LIZ(r0)
        L_0x0071:
            r8.LIZJ()
            X.0AA r0 = r6.getChildFragmentManager()
            X.0AP r0 = r0.LIZ()
            r0.LIZ(r4)
            r0.LIZJ()
            X.0AP r0 = r7.LIZ()
            r0.LIZ(r6)
            r0.LIZJ()
        L_0x008c:
            com.ss.android.ugc.aweme.choosemusic.model.ChooseMusicWithSceneViewModel r0 = r10.LIZIZ()
            java.lang.String r4 = r0.LIZLLL
            boolean r0 = android.text.TextUtils.isEmpty(r4)
            if (r0 != 0) goto L_0x0106
            com.ss.android.ugc.aweme.services.IExternalService r0 = com.ss.android.ugc.aweme.out.AVExternalServiceImpl.LIZ()
            com.ss.android.ugc.aweme.services.video.IAVPublishService r0 = r0.publishService()
            com.ss.android.ugc.aweme.shortvideo.model.MusicModel r0 = r0.getCurMusic()
            if (r0 == 0) goto L_0x0119
            long r0 = r0.getId()
            java.lang.Long r0 = java.lang.Long.valueOf(r0)
        L_0x00ae:
            java.lang.String r0 = java.lang.String.valueOf(r0)
            boolean r0 = android.text.TextUtils.equals(r0, r4)
            if (r0 != 0) goto L_0x0106
            X.2UX r4 = new X.2UX
            r4.<init>()
            java.lang.String r0 = "value"
            r4.LIZ(r0, r5)
            com.ss.android.ugc.aweme.choosemusic.model.ChooseMusicWithSceneViewModel r0 = r10.LIZIZ()
            java.lang.String r1 = r0.LJ
            java.lang.String r0 = "mission_id"
            r4.LIZ(r0, r1)
            com.ss.android.ugc.aweme.choosemusic.model.ChooseMusicWithSceneViewModel r0 = r10.LIZIZ()
            java.lang.String r1 = r0.LJFF
            java.lang.String r0 = "page_source"
            r4.LIZ(r0, r1)
            com.ss.android.ugc.aweme.services.IExternalService r0 = com.ss.android.ugc.aweme.out.AVExternalServiceImpl.LIZ()
            com.ss.android.ugc.aweme.services.external.ICommerceToolsService r0 = r0.commerceToolsService()
            boolean r0 = r0.isTcm()
            if (r0 == 0) goto L_0x0116
            java.lang.String r1 = "0"
        L_0x00e8:
            java.lang.String r0 = "creator_type"
            r4.LIZ(r0, r1)
            java.util.Map r1 = r4.LIZ
            java.lang.String r0 = "mission_requirement_modified"
            X.2nK.LIZ(r0, r1)
            com.ss.android.ugc.aweme.choosemusic.model.ChooseMusicWithSceneViewModel r0 = r10.LIZIZ()
            r0.LIZLLL = r2
            com.ss.android.ugc.aweme.choosemusic.model.ChooseMusicWithSceneViewModel r0 = r10.LIZIZ()
            r0.LIZLLL = r2
            com.ss.android.ugc.aweme.choosemusic.model.ChooseMusicWithSceneViewModel r0 = r10.LIZIZ()
            r0.LJFF = r2
        L_0x0106:
            boolean r0 = X.MEQ.LIZ()
            if (r0 == 0) goto L_0x012a
            com.ss.android.ugc.aweme.base.opensourcemodified.android.support.design.widget.ViewPagerBottomSheetBehavior<android.view.View> r0 = r10.LJIIJ
            if (r0 != 0) goto L_0x0113
            kotlin.h.b.n.LIZ(r3)
        L_0x0113:
            r0.LJIIJ = r2
            return
        L_0x0116:
            java.lang.String r1 = "1"
            goto L_0x00e8
        L_0x0119:
            r0 = r2
            goto L_0x00ae
        L_0x011b:
            boolean r0 = r1 instanceof android.content.ContextWrapper
            if (r0 == 0) goto L_0x0127
            android.content.ContextWrapper r1 = (android.content.ContextWrapper) r1
            android.content.Context r1 = r1.getBaseContext()
            goto L_0x000c
        L_0x0127:
            r1 = r2
            goto L_0x0017
        L_0x012a:
            com.ss.android.ugc.aweme.choosemusic.model.ChooseMusicWithSceneViewModel r0 = r10.LIZIZ()
            r0.LJ()
            return
        */
        throw new UnsupportedOperationException("Method not decompiled: com.ss.android.ugc.aweme.choosemusic.activity.e.dD_():void");
    }

    public static final /* synthetic */ Qeg LIZ(e eVar) {
        Qeg qeg = eVar.LJ;
        if (qeg == null) {
            n.LIZ("");
        }
        return qeg;
    }

    /* JADX WARNING: Code restructure failed: missing block: B:33:0x011c, code lost:
        if (r5 == null) goto L_0x011e;
     */
    /* Code decompiled incorrectly, please refer to instructions dump. */
    public final void LIZIZ(android.os.Bundle r21) {
        /*
            r20 = this;
            r2 = r20
            r2 = r2
            r0 = r21
            super.LIZIZ((android.os.Bundle) r0)
            android.os.Bundle r1 = r2.LJIJ
            r5 = 0
            if (r1 == 0) goto L_0x0215
            java.lang.String r0 = "arguments"
            android.os.Bundle r3 = r1.getBundle(r0)
        L_0x0013:
            com.ss.android.ugc.aweme.services.performance.IAVPerformance r4 = r2.LIZ()
            com.ss.android.ugc.aweme.performance.OpenMusicPanelPerformanceMonitor r1 = com.ss.android.ugc.aweme.performance.OpenMusicPanelPerformanceMonitor.LIZ
            java.lang.String r0 = "choose_music_created"
            r4.step((com.ss.android.ugc.aweme.performance.PerformanceMonitor) r1, (java.lang.String) r0)
            com.ss.android.ugc.aweme.services.performance.IAVPerformance r6 = r2.LIZ()
            android.app.Activity r4 = r2.LJIJJ()
            java.lang.String r1 = ""
            kotlin.h.b.n.LIZIZ(r4, r1)
            java.lang.String r0 = "music_select"
            r6.enter(r4, r0)
            r0 = 2131372426(0x7f0a298a, float:1.8364915E38)
            android.view.View r6 = r2.LIZLLL((int) r0)
            kotlin.h.b.n.LIZIZ(r6, r1)
            X.Qeg r6 = (X.Qeg) r6
            android.os.Bundle r4 = r2.LJIJ
            if (r4 == 0) goto L_0x0212
            java.lang.String r0 = "title"
            java.lang.String r0 = r4.getString(r0)
        L_0x0046:
            r6.setText(r0)
            r0 = 33
            r6.setTuxFont(r0)
            r2.LJ = r6
            com.ss.android.ugc.aweme.choosemusic.model.ChooseMusicWithSceneViewModel r4 = r2.LIZIZ()
            if (r3 == 0) goto L_0x020f
            java.lang.String r0 = "mission_music_id"
            java.lang.String r0 = r3.getString(r0)
        L_0x005c:
            r4.LIZLLL = r0
            com.ss.android.ugc.aweme.choosemusic.model.ChooseMusicWithSceneViewModel r4 = r2.LIZIZ()
            if (r3 == 0) goto L_0x020c
            java.lang.String r0 = "enter_from"
            java.lang.String r0 = r3.getString(r0)
        L_0x006a:
            r4.LJFF = r0
            com.ss.android.ugc.aweme.choosemusic.model.ChooseMusicWithSceneViewModel r4 = r2.LIZIZ()
            if (r3 == 0) goto L_0x0209
            java.lang.String r0 = "mission_id"
            java.lang.String r0 = r3.getString(r0)
        L_0x0078:
            r4.LJ = r0
            X.CAC r6 = new X.CAC
            android.app.Activity r4 = r2.LJIJJ()
            kotlin.h.b.n.LIZIZ(r4, r1)
            android.view.View r0 = r2.LJIILJJIL
            kotlin.h.b.n.LIZIZ(r0, r1)
            r6.<init>(r4, r0)
            r2.LJFF = r6
            android.os.Bundle r4 = r2.LJIJ
            r7 = 1
            r6 = 0
            if (r4 == 0) goto L_0x0206
            java.lang.String r0 = "hide_local_music"
            boolean r0 = r4.getBoolean(r0, r6)
            if (r0 != r7) goto L_0x0206
            r0 = 1
        L_0x009c:
            r2.LJIIIZ = r0
            android.os.Bundle r4 = r2.LJIJ
            if (r4 == 0) goto L_0x0203
            java.lang.String r0 = "long_video"
            boolean r0 = r4.getBoolean(r0, r6)
            if (r0 != r7) goto L_0x0203
            r0 = 1
        L_0x00ab:
            r2.LIZIZ = r0
            r2.LJJIJL()
            r0 = 2131362572(0x7f0a030c, float:1.8344928E38)
            android.view.View r4 = r2.LIZLLL((int) r0)
            X.OO3 r0 = new X.OO3
            r0.<init>(r2)
            r4.setOnClickListener(r0)
            r0 = 2131370485(0x7f0a21f5, float:1.8360978E38)
            android.view.View r4 = r2.LIZLLL((int) r0)
            X.0Bf r4 = (X.0Bf) r4
            int r0 = X.3G1.LIZLLL()
            r4.setMinimumHeight(r0)
            r0 = 2131364037(0x7f0a08c5, float:1.83479E38)
            android.view.View r0 = r2.LIZLLL((int) r0)
            com.ss.android.ugc.aweme.base.opensourcemodified.android.support.design.widget.ViewPagerBottomSheetBehavior r8 = com.ss.android.ugc.aweme.base.opensourcemodified.android.support.design.widget.ViewPagerBottomSheetBehavior.LIZIZ(r0)
            X.OO1 r0 = new X.OO1
            r0.<init>(r2)
            r8.LJIIJ = r0
            r8.LIZLLL = r7
            android.app.Activity r0 = r2.LJIJJ()
            int r4 = X.3G1.LIZ(r0)
            android.app.Activity r0 = r2.LJIJJ()
            int r0 = X.3G1.LIZLLL(r0)
            int r4 = r4 + r0
            r8.LIZ(r4)
            kotlin.h.b.n.LIZIZ(r8, r1)
            r2.LJIIJ = r8
            com.ss.android.ugc.aweme.choosemusic.model.ChooseMusicWithSceneViewModel r4 = r2.LIZIZ()
            com.ss.android.ugc.aweme.base.opensourcemodified.android.support.design.widget.ViewPagerBottomSheetBehavior<android.view.View> r0 = r2.LJIIJ
            if (r0 != 0) goto L_0x0107
            kotlin.h.b.n.LIZ(r1)
        L_0x0107:
            X.M12.LIZ(r0)
            r4.LIZJ = r0
            android.app.Activity r4 = r2.LJIJJ()
            kotlin.h.b.n.LIZIZ(r4, r1)
        L_0x0113:
            if (r4 == 0) goto L_0x011e
            boolean r0 = r4 instanceof X.1hK
            if (r0 == 0) goto L_0x01f7
            r5 = r4
            X.1hK r5 = (X.1hK) r5
            if (r5 != 0) goto L_0x0121
        L_0x011e:
            kotlin.h.b.n.LIZIZ()
        L_0x0121:
            X.0AA r4 = r5.getSupportFragmentManager()
            r0 = 2131365159(0x7f0a0d27, float:1.8350175E38)
            androidx.fragment.app.Fragment r0 = r4.LIZ(r0)
            if (r0 != 0) goto L_0x01b7
            android.os.Bundle r5 = r2.LJIJ
            if (r5 == 0) goto L_0x01b7
            java.lang.String r0 = "com.ss.android.ugc.aweme.intent.extra.EXTRA_MUSIC_TYPE"
            int r0 = r5.getInt(r0, r7)
            r2.LIZ = r0
            r2.LJJIL()
            com.ss.android.ugc.aweme.services.IExternalService r0 = com.ss.android.ugc.aweme.out.AVExternalServiceImpl.LIZ()
            com.ss.android.ugc.aweme.services.video.IAVPublishService r7 = r0.publishService()
            int r0 = r2.LIZ
            r7.setMusicChooseType(r0)
            java.lang.String r0 = "challenge"
            java.lang.String r7 = r5.getString(r0)
            java.lang.String r0 = "creation_id"
            java.lang.String r12 = r5.getString(r0)
            java.lang.String r0 = "shoot_way"
            java.lang.String r11 = r5.getString(r0)
            java.lang.String r0 = "music_model"
            java.io.Serializable r8 = r5.getSerializable(r0)
            com.ss.android.ugc.aweme.shortvideo.model.MusicModel r8 = (com.ss.android.ugc.aweme.shortvideo.model.MusicModel) r8
            java.lang.String r0 = "music_allow_clear"
            boolean r9 = r5.getBoolean(r0, r6)
            java.lang.String r0 = "music_allow_cut"
            boolean r13 = r5.getBoolean(r0, r6)
            java.lang.String r0 = "music_is_photomv"
            boolean r10 = r5.getBoolean(r0, r6)
            java.lang.String r0 = "reuse_original_sound_id"
            java.lang.String r14 = r5.getString(r0)
            java.lang.String r0 = "reuse_original_sound_url"
            java.io.Serializable r15 = r5.getSerializable(r0)
            com.ss.android.ugc.aweme.base.model.UrlModel r15 = (com.ss.android.ugc.aweme.base.model.UrlModel) r15
            java.lang.String r0 = "reuse_original_sound_length"
            int r16 = r5.getInt(r0)
            X.OO8 r6 = new X.OO8
            r5 = r6
            r0 = 2131365159(0x7f0a0d27, float:1.8350175E38)
            r17 = r2
            r18 = r3
            r19 = r4
            r6.<init>(r7, r8, r9, r10, r11, r12, r13, r14, r15, r16, r17, r18, r19)
            X.0AP r7 = r4.LIZ()
            com.ss.android.ugc.aweme.choosemusic.fragment.ChooseMusicFragment r6 = r5.invoke()
            r7.LIZ(r0, r6)
            r7.LIZLLL()
            r2 = r2
            X.CAC r6 = r2.LJFF
            if (r6 != 0) goto L_0x01af
            kotlin.h.b.n.LIZ(r1)
        L_0x01af:
            X.OO9 r0 = new X.OO9
            r0.<init>(r5, r2, r3, r4)
            r6.LIZ(r0)
        L_0x01b7:
            com.ss.android.ugc.aweme.choosemusic.model.ChooseMusicWithSceneViewModel r1 = r2.LIZIZ()
            r0 = 1
            r1.LIZ = r0
            com.ss.android.ugc.aweme.choosemusic.model.ChooseMusicWithSceneViewModel r0 = r2.LIZIZ()
            X.1Bn r1 = r0.LIZIZ()
            X.OOC r0 = new X.OOC
            r0.<init>(r2)
            r1.observe(r2, r0)
            boolean r0 = X.MEQ.LIZ()
            if (r0 == 0) goto L_0x01e4
            com.ss.android.ugc.aweme.choosemusic.model.ChooseMusicWithSceneViewModel r0 = r2.LIZIZ()
            X.1Bn r1 = r0.LIZLLL()
            X.ONy r0 = new X.ONy
            r0.<init>(r2)
            r1.observe(r2, r0)
        L_0x01e4:
            X.ONz r1 = new X.ONz
            r1.<init>(r2)
            android.view.View r0 = r2.LJIILJJIL
            if (r0 == 0) goto L_0x01f6
            android.view.ViewTreeObserver r0 = r0.getViewTreeObserver()
            if (r0 == 0) goto L_0x01f6
            r0.addOnPreDrawListener(r1)
        L_0x01f6:
            return
        L_0x01f7:
            boolean r0 = r4 instanceof android.content.ContextWrapper
            if (r0 == 0) goto L_0x011e
            android.content.ContextWrapper r4 = (android.content.ContextWrapper) r4
            android.content.Context r4 = r4.getBaseContext()
            goto L_0x0113
        L_0x0203:
            r0 = 0
            goto L_0x00ab
        L_0x0206:
            r0 = 0
            goto L_0x009c
        L_0x0209:
            r0 = r5
            goto L_0x0078
        L_0x020c:
            r0 = r5
            goto L_0x006a
        L_0x020f:
            r0 = r5
            goto L_0x005c
        L_0x0212:
            r0 = r5
            goto L_0x0046
        L_0x0215:
            r3 = r5
            goto L_0x0013
        */
        throw new UnsupportedOperationException("Method not decompiled: com.ss.android.ugc.aweme.choosemusic.activity.e.LIZIZ(android.os.Bundle):void");
    }

    public final /* synthetic */ View LIZ(LayoutInflater layoutInflater, ViewGroup viewGroup) {
        return LIZ(layoutInflater, viewGroup);
    }

    public final ViewGroup LIZIZ(LayoutInflater layoutInflater, ViewGroup viewGroup) {
        M12.LIZ(layoutInflater, viewGroup);
        Activity LJIJJ = LJIJJ();
        if (!(LJIJJ instanceof NB5)) {
            LJIJJ = null;
        }
        NB5 nb5 = (NB5) LJIJJ;
        if (nb5 != null) {
            nb5.LIZ((6CT) this);
            nb5.LIZIZ((6CS) this);
        }
        View LIZ2 = 0HH.LIZ(layoutInflater, 2131560997, viewGroup, false);
        Objects.requireNonNull(LIZ2, "null cannot be cast to non-null type android.view.ViewGroup");
        return (ViewGroup) LIZ2;
    }

    public final boolean onKeyDown(int i, KeyEvent keyEvent) {
        if (i != 4) {
            return false;
        }
        LJJIJLIJ();
        if (!n.LIZ(LIZIZ().LIZJ().getValue(), OOH.LIZ)) {
            return true;
        }
        LJJIJIIJIL();
        return true;
    }

    public final boolean LIZ(int i, int i2, Intent intent) {
        if (i2 != -1) {
            return true;
        }
        View view = this.LJIILJJIL;
        if (view != null) {
            view.setVisibility(8);
        }
        K0G k0g = (K0G) LIZIZ().LIZ().getValue();
        if (k0g == null) {
            return true;
        }
        LJJIJIL();
        k0g.LIZIZ.invoke(new C5226ONh(i2, intent));
        k0g.LIZ.invoke();
        return true;
    }
}
