package com.ss.android.ugc.aweme.music.search;

import X.0HH;
import X.2Pr;
import X.37M;
import X.C3251BDb;
import X.C4062BdS;
import X.C4071Bdb;
import X.C4089Bdt;
import X.LsC;
import X.M12;
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.assem.arch.core.Assembler;
import com.bytedance.covode.number.Covode;
import com.bytedance.ies.foundation.fragment.BaseFragment;
import com.ss.android.ugc.aweme.music.model.PinnedMusicList;
import java.io.Serializable;

public final class SearchMusicFragment extends BaseFragment implements C4089Bdt {
    public static final 37M LJ = new 37M((byte) 0);
    public SparseArray LJFF;

    static {
        Covode.recordClassIndex(93965);
    }

    public final View LIZ(int i) {
        if (this.LJFF == null) {
            this.LJFF = new SparseArray();
        }
        View view = (View) this.LJFF.get(i);
        if (view != null) {
            return view;
        }
        View view2 = getView();
        if (view2 == null) {
            return null;
        }
        View findViewById = view2.findViewById(i);
        this.LJFF.put(i, findViewById);
        return findViewById;
    }

    public final void LJI() {
        SparseArray sparseArray = this.LJFF;
        if (sparseArray != null) {
            sparseArray.clear();
        }
    }

    public final /* synthetic */ void onDestroyView() {
        SearchMusicFragment.super.onDestroyView();
        LJI();
    }

    /* JADX WARNING: Removed duplicated region for block: B:13:0x0048  */
    /* Code decompiled incorrectly, please refer to instructions dump. */
    public final /* synthetic */ X.4OI LIZ() {
        /*
            r10 = this;
            X.Bda r2 = new X.Bda
            android.os.Bundle r1 = r10.getArguments()
            r8 = 0
            if (r1 == 0) goto L_0x005f
            java.lang.String r0 = "user_id"
            java.lang.String r3 = r1.getString(r0)
        L_0x000f:
            android.os.Bundle r1 = r10.getArguments()
            if (r1 == 0) goto L_0x005d
            java.lang.String r0 = "sec_user_id"
            java.lang.String r4 = r1.getString(r0)
        L_0x001b:
            r0 = 1
            X.Bdc r0 = X.C4072Bdc.LIZIZ
            com.ss.android.ugc.aweme.experiment.ProfileMusicTabConfig r0 = r0.LIZ()
            boolean r0 = r0.getEnablePin()
            if (r0 == 0) goto L_0x005a
            com.ss.android.ugc.aweme.IAccountUserService r0 = X.46i.LJFF()
            java.lang.String r1 = ""
            kotlin.h.b.n.LIZIZ(r0, r1)
            com.ss.android.ugc.aweme.profile.model.User r0 = r0.getCurUser()
            kotlin.h.b.n.LIZIZ(r0, r1)
            int r1 = r0.getAccountType()
            r0 = 3
            if (r1 == r0) goto L_0x005a
            r0 = 1
            r6 = 1
        L_0x0041:
            r0 = 1
            android.os.Bundle r1 = r10.getArguments()
            if (r1 == 0) goto L_0x004e
            java.lang.String r0 = "pinned_music_list"
            java.io.Serializable r8 = r1.getSerializable(r0)
        L_0x004e:
            com.ss.android.ugc.aweme.music.model.PinnedMusicList r8 = (com.ss.android.ugc.aweme.music.model.PinnedMusicList) r8
            r0 = 64
            r5 = 1
            r7 = 1
            r9 = 64
            r2.<init>(r3, r4, r5, r6, r7, r8, r9)
            return r2
        L_0x005a:
            r0 = 0
            r6 = 0
            goto L_0x0041
        L_0x005d:
            r4 = r8
            goto L_0x001b
        L_0x005f:
            r3 = r8
            goto L_0x000f
        */
        throw new UnsupportedOperationException("Method not decompiled: com.ss.android.ugc.aweme.music.search.SearchMusicFragment.LIZ():X.4OI");
    }

    public final void onCreate(Bundle bundle) {
        SearchMusicFragment.super.onCreate(bundle);
        LIZ(C4071Bdb.LIZ);
    }

    public final void onViewCreated(View view, Bundle bundle) {
        boolean z;
        String str;
        String str2;
        String str3;
        M12.LIZ(view);
        SearchMusicFragment.super.onViewCreated(view, bundle);
        Bundle arguments = getArguments();
        if (arguments != null) {
            z = arguments.getBoolean("is_me", false);
        } else {
            z = false;
        }
        Bundle arguments2 = getArguments();
        Serializable serializable = null;
        if (arguments2 != null) {
            str = arguments2.getString("user_id");
        } else {
            str = null;
        }
        Bundle arguments3 = getArguments();
        if (arguments3 != null) {
            str2 = arguments3.getString("sec_user_id");
        } else {
            str2 = null;
        }
        Bundle arguments4 = getArguments();
        if (arguments4 != null) {
            str3 = arguments4.getString("previous_page");
        } else {
            str3 = null;
        }
        Bundle arguments5 = getArguments();
        if (arguments5 != null) {
            serializable = arguments5.getSerializable("pinned_music_list");
        }
        C3251BDb.LIZ((Fragment) this, (LsC<? super Assembler, 2Pr>) new C4062BdS(this, new SearchMusicArg(z, str, str2, str3, (PinnedMusicList) serializable)));
    }

    public final View onCreateView(LayoutInflater layoutInflater, ViewGroup viewGroup, Bundle bundle) {
        M12.LIZ(layoutInflater);
        return 0HH.LIZ(layoutInflater, 2131560799, viewGroup, false);
    }
}
