package com.ss.android.ugc.aweme.fragments;

import X.0HH;
import X.3F7;
import X.4tR;
import X.7he;
import X.Ak5;
import X.AqM;
import X.BDb;
import X.C0295Crj;
import X.C6205FMr;
import X.FN7;
import X.FNA;
import X.M12;
import X.NzN;
import android.content.Intent;
import android.os.Bundle;
import android.util.SparseArray;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import androidx.fragment.app.Fragment;
import com.bytedance.covode.number.Covode;
import com.ss.android.ugc.aweme.out.AVExternalServiceImpl;
import com.ss.android.ugc.aweme.services.video.IAVPublishService;
import com.ss.android.ugc.aweme.viewmodel.BaseVideoListVM;
import kotlin.h.b.n;

public final class MentionVideoListFragment extends Fragment {
    public static C6205FMr LJIIIIZZ;
    public static boolean LJIIIZ;
    public static final FN7 LJIIJ = new FN7((byte) 0);
    public int LIZ;
    public String LIZIZ;
    public String LIZJ;
    public ViewGroup LIZLLL;
    public NzN LJ;
    public boolean LJFF;
    public BaseVideoListVM<AqM, Ak5, Long> LJI;
    public final C0295Crj LJII = 7he.LIZ(FNA.LIZ);
    public SparseArray LJIIJJI;
    public final IAVPublishService LJIIL = AVExternalServiceImpl.LIZ().publishService();

    static {
        Covode.recordClassIndex(81044);
    }

    public final /* synthetic */ void onDestroyView() {
        MentionVideoListFragment.super.onDestroyView();
        SparseArray sparseArray = this.LJIIJJI;
        if (sparseArray != null) {
            sparseArray.clear();
        }
    }

    public final void onDestroy() {
        MentionVideoListFragment.super.onDestroy();
        if (LJIIIZ) {
            LJIIIZ = false;
        }
        if (LJIIIIZZ != null) {
            LJIIIIZZ = null;
        }
    }

    public static final /* synthetic */ ViewGroup LIZ(MentionVideoListFragment mentionVideoListFragment) {
        ViewGroup viewGroup = mentionVideoListFragment.LIZLLL;
        if (viewGroup == null) {
            n.LIZ("");
        }
        return viewGroup;
    }

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

    public final void onViewCreated(View view, Bundle bundle) {
        String str;
        M12.LIZ(view);
        MentionVideoListFragment.super.onViewCreated(view, bundle);
        if (getArguments() != null) {
            Bundle arguments = getArguments();
            if (arguments == null) {
                n.LIZIZ();
            }
            this.LIZ = arguments.getInt("page_type");
            Bundle arguments2 = getArguments();
            if (arguments2 == null) {
                n.LIZIZ();
            }
            this.LIZIZ = arguments2.getString("music_id");
            Bundle arguments3 = getArguments();
            if (arguments3 == null) {
                n.LIZIZ();
            }
            this.LIZJ = arguments3.getString("music_title");
        }
        if (!(this.LIZ != 8 || (str = this.LIZJ) == null || str.length() == 0)) {
            ViewGroup viewGroup = this.LIZLLL;
            if (viewGroup == null) {
                n.LIZ("");
            }
            int i = 4;
            viewGroup.setVisibility(4);
            NzN nzN = this.LJ;
            if (nzN == null) {
                n.LIZ("");
            }
            String str2 = this.LIZJ;
            boolean LIZ2 = true ^ 3F7.LIZ();
            nzN.setLayoutDirection(LIZ2 ^ true ? 1 : 0);
            if (LIZ2) {
                i = 3;
            }
            nzN.setTextDirection(i);
            nzN.setText(str2);
        }
        BDb.LIZ(this, new 4tR(this));
    }

    public final View onCreateView(LayoutInflater layoutInflater, ViewGroup viewGroup, Bundle bundle) {
        M12.LIZ(layoutInflater);
        View LIZ2 = 0HH.LIZ(layoutInflater, 2131560608, viewGroup, false);
        View findViewById = LIZ2.findViewById(2131370483);
        n.LIZIZ(findViewById, "");
        this.LIZLLL = (ViewGroup) findViewById;
        NzN findViewById2 = LIZ2.findViewById(2131367836);
        n.LIZIZ(findViewById2, "");
        this.LJ = findViewById2;
        return LIZ2;
    }

    /* JADX WARNING: Code restructure failed: missing block: B:20:0x0054, code lost:
        if (r0 == null) goto L_0x0056;
     */
    /* JADX WARNING: Code restructure failed: missing block: B:29:0x006b, code lost:
        if (r0 == null) goto L_0x006d;
     */
    /* JADX WARNING: Code restructure failed: missing block: B:37:0x0080, code lost:
        if (r0 == null) goto L_0x0082;
     */
    /* JADX WARNING: Code restructure failed: missing block: B:44:0x0095, code lost:
        if (r0 == null) goto L_0x0097;
     */
    /* JADX WARNING: Code restructure failed: missing block: B:51:0x00aa, code lost:
        if (r0 == null) goto L_0x00ac;
     */
    /* JADX WARNING: Code restructure failed: missing block: B:63:0x00cb, code lost:
        if (r0 == null) goto L_0x00cd;
     */
    /* JADX WARNING: Code restructure failed: missing block: B:70:0x00e0, code lost:
        if (r0 == null) goto L_0x00e2;
     */
    /* Code decompiled incorrectly, please refer to instructions dump. */
    public final void onActivityResult(int r15, int r16, android.content.Intent r17) {
        /*
            r14 = this;
            r1 = r16
            r2 = r17
            com.ss.android.ugc.aweme.fragments.MentionVideoListFragment.super.onActivityResult(r15, r1, r2)
            r0 = 9
            if (r15 != r0) goto L_0x00fc
            r0 = -1
            if (r1 != r0) goto L_0x00fc
            java.lang.String r1 = "mention_video_Info_respose"
            r3 = 0
            if (r2 == 0) goto L_0x003c
            java.io.Serializable r0 = r2.getSerializableExtra(r1)
            if (r0 == 0) goto L_0x003c
            java.io.Serializable r3 = r2.getSerializableExtra(r1)
            java.lang.String r0 = "null cannot be cast to non-null type com.ss.android.ugc.aweme.api.VideoInfoFromURLResponse"
            java.util.Objects.requireNonNull(r3, r0)
            X.FRS r3 = (X.FRS) r3
            java.lang.String r0 = "mention_video_enter_method"
            java.lang.String r2 = LIZ(r2, r0)
            java.lang.String r0 = ""
            if (r2 != 0) goto L_0x002f
            r2 = r0
        L_0x002f:
            kotlin.h.b.n.LIZIZ(r2, r0)
            com.ss.android.ugc.aweme.services.video.IAVPublishService r1 = r14.LJIIL
            X.1hK r0 = r14.getActivity()
            r1.returnMentionVideoRespose(r0, r3, r2)
            return
        L_0x003c:
            X.FMr r0 = LJIIIIZZ
            if (r0 == 0) goto L_0x00fc
            com.ss.android.ugc.aweme.services.video.IAVPublishService r2 = r14.LJIIL
            X.1hK r1 = r14.getActivity()
            X.Aq4 r4 = new X.Aq4
            X.FMr r0 = LJIIIIZZ
            if (r0 == 0) goto L_0x010d
            com.ss.android.ugc.aweme.feed.model.Aweme r0 = r0.LIZIZ
            if (r0 == 0) goto L_0x010d
            com.ss.android.ugc.aweme.profile.model.User r0 = r0.getAuthor()
            if (r0 != 0) goto L_0x0059
        L_0x0056:
            kotlin.h.b.n.LIZIZ()
        L_0x0059:
            java.lang.String r5 = r0.getUniqueId()
            if (r5 != 0) goto L_0x0074
            X.FMr r0 = LJIIIIZZ
            if (r0 == 0) goto L_0x010a
            com.ss.android.ugc.aweme.feed.model.Aweme r0 = r0.LIZIZ
            if (r0 == 0) goto L_0x010a
            com.ss.android.ugc.aweme.profile.model.User r0 = r0.getAuthor()
            if (r0 != 0) goto L_0x0070
        L_0x006d:
            kotlin.h.b.n.LIZIZ()
        L_0x0070:
            java.lang.String r5 = r0.getShortId()
        L_0x0074:
            X.FMr r0 = LJIIIIZZ
            if (r0 == 0) goto L_0x0107
            com.ss.android.ugc.aweme.feed.model.Aweme r0 = r0.LIZIZ
            if (r0 == 0) goto L_0x0107
            com.ss.android.ugc.aweme.profile.model.User r0 = r0.getAuthor()
            if (r0 != 0) goto L_0x0085
        L_0x0082:
            kotlin.h.b.n.LIZIZ()
        L_0x0085:
            java.lang.String r6 = r0.getNickname()
            X.FMr r0 = LJIIIIZZ
            if (r0 == 0) goto L_0x0105
            com.ss.android.ugc.aweme.feed.model.Aweme r0 = r0.LIZIZ
            if (r0 == 0) goto L_0x0105
            com.ss.android.ugc.aweme.profile.model.User r0 = r0.getAuthor()
            if (r0 != 0) goto L_0x009a
        L_0x0097:
            kotlin.h.b.n.LIZIZ()
        L_0x009a:
            java.lang.String r7 = r0.getUid()
            X.FMr r0 = LJIIIIZZ
            if (r0 == 0) goto L_0x0103
            com.ss.android.ugc.aweme.feed.model.Aweme r0 = r0.LIZIZ
            if (r0 == 0) goto L_0x0103
            com.ss.android.ugc.aweme.profile.model.User r0 = r0.getAuthor()
            if (r0 != 0) goto L_0x00af
        L_0x00ac:
            kotlin.h.b.n.LIZIZ()
        L_0x00af:
            java.lang.String r8 = r0.getSecUid()
            X.FMr r0 = LJIIIIZZ
            if (r0 == 0) goto L_0x0101
            com.ss.android.ugc.aweme.feed.model.Aweme r0 = r0.LIZIZ
            if (r0 == 0) goto L_0x0101
            java.lang.String r9 = r0.getAid()
        L_0x00bf:
            X.FMr r0 = LJIIIIZZ
            if (r0 == 0) goto L_0x00ff
            com.ss.android.ugc.aweme.feed.model.Aweme r0 = r0.LIZIZ
            if (r0 == 0) goto L_0x00ff
            com.ss.android.ugc.aweme.feed.model.AwemeStatus r0 = r0.getStatus()
            if (r0 != 0) goto L_0x00d0
        L_0x00cd:
            kotlin.h.b.n.LIZIZ()
        L_0x00d0:
            int r10 = r0.getPrivateStatus()
            X.FMr r0 = LJIIIIZZ
            if (r0 == 0) goto L_0x00fd
            com.ss.android.ugc.aweme.feed.model.Aweme r0 = r0.LIZIZ
            if (r0 == 0) goto L_0x00fd
            com.ss.android.ugc.aweme.profile.model.User r0 = r0.getAuthor()
            if (r0 != 0) goto L_0x00e5
        L_0x00e2:
            kotlin.h.b.n.LIZIZ()
        L_0x00e5:
            boolean r11 = r0.isAccuratePrivateAccount()
            X.FMr r0 = LJIIIIZZ
            if (r0 != 0) goto L_0x00f0
            kotlin.h.b.n.LIZIZ()
        L_0x00f0:
            int r12 = r0.LIZ
            java.lang.String r13 = "click_preview"
            r4.<init>(r5, r6, r7, r8, r9, r10, r11, r12, r13)
            r2.setChainInfo(r1, r4)
            LJIIIIZZ = r3
        L_0x00fc:
            return
        L_0x00fd:
            r0 = r3
            goto L_0x00e2
        L_0x00ff:
            r0 = r3
            goto L_0x00cd
        L_0x0101:
            r9 = r3
            goto L_0x00bf
        L_0x0103:
            r0 = r3
            goto L_0x00ac
        L_0x0105:
            r0 = r3
            goto L_0x0097
        L_0x0107:
            r0 = r3
            goto L_0x0082
        L_0x010a:
            r0 = r3
            goto L_0x006d
        L_0x010d:
            r0 = r3
            goto L_0x0056
        */
        throw new UnsupportedOperationException("Method not decompiled: com.ss.android.ugc.aweme.fragments.MentionVideoListFragment.onActivityResult(int, int, android.content.Intent):void");
    }
}
