package com.ss.android.ugc.aweme.compliance.privacy.settings.account.base;

import X.0EB;
import X.1Cn;
import X.C03012Pr;
import X.C15012rV;
import X.C30953c7;
import X.C30983cA;
import X.C31003cC;
import X.C31063cI;
import X.C36873lf;
import X.C39123pI;
import X.Ls2;
import X.M12;
import X.Qeg;
import android.os.Bundle;
import android.util.SparseArray;
import android.view.View;
import androidx.recyclerview.widget.RecyclerView;
import com.bytedance.covode.number.Covode;
import com.ss.android.ugc.aweme.views.WrapLinearLayoutManager;
import java.util.List;
import kotlin.h.b.n;

public abstract class BasePrivacySettingFragment extends BaseFragment {
    public SparseArray LIZ;

    static {
        Covode.recordClassIndex(61486);
    }

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

    public void LIZIZ() {
        SparseArray sparseArray = this.LIZ;
        if (sparseArray != null) {
            sparseArray.clear();
        }
    }

    public abstract List<C15012rV> LIZJ();

    public /* synthetic */ void onDestroyView() {
        super.onDestroyView();
        LIZIZ();
    }

    public void onCreate(Bundle bundle) {
        super.onCreate(bundle);
        C39123pI.LIZ.LIZIZ(true);
    }

    public final void LIZIZ(int i) {
        String string = getString(i);
        n.LIZIZ(string, "");
        M12.LIZ(string);
        C31003cC r0 = new C31003cC();
        r0.LIZ(string);
        ((C30953c7) LIZ(2131371289)).LIZ(r0);
    }

    public final void LIZ(CharSequence charSequence) {
        Qeg LIZ2 = LIZ(2131371418);
        if (LIZ2 == null) {
            return;
        }
        if (charSequence == null || charSequence.length() == 0) {
            LIZ2.setVisibility(8);
            return;
        }
        LIZ2.setVisibility(0);
        LIZ2.setText(charSequence);
    }

    public void onViewCreated(View view, Bundle bundle) {
        M12.LIZ(view);
        BasePrivacySettingFragment.super.onViewCreated(view, bundle);
        C30983cA r1 = new C30983cA();
        r1.LIZ(2131755170);
        r1.LIZ((Ls2<C03012Pr>) new C36873lf(this));
        ((C30953c7) LIZ(2131371289)).LIZ((C31063cI) r1);
        getContext();
        WrapLinearLayoutManager wrapLinearLayoutManager = new WrapLinearLayoutManager(1);
        RecyclerView LIZ2 = LIZ(2131367123);
        n.LIZIZ(LIZ2, "");
        LIZ2.setLayoutManager(wrapLinearLayoutManager);
        RecyclerView LIZ3 = LIZ(2131367123);
        n.LIZIZ(LIZ3, "");
        LIZ3.setItemAnimator((0EB) null);
        List<C15012rV> LIZJ = LIZJ();
        RecyclerView LIZ4 = LIZ(2131367123);
        n.LIZIZ(LIZ4, "");
        LIZ4.setAdapter(new 1Cn(LIZJ));
    }
}
