package com.bytedance.ies.uikit.base;

import X.C4648LnL;
import X.JIO;
import X.SUV;
import android.os.Bundle;
import android.view.View;
import androidx.fragment.app.Fragment;
import com.bytedance.covode.number.Covode;
import java.util.Iterator;

public abstract class AbsFragment extends Fragment implements SUV {
    public C4648LnL<JIO> LIZ = new C4648LnL<>();
    public boolean LJFF;
    public boolean LJI;
    public boolean LJII;
    public boolean LJIIIIZZ = true;

    static {
        Covode.recordClassIndex(31157);
    }

    public boolean aq_() {
        return this.LJI;
    }

    public void onDestroyView() {
        AbsFragment.super.onDestroyView();
        this.LJI = false;
    }

    public void onPause() {
        AbsFragment.super.onPause();
        if (!this.LIZ.LIZ.isEmpty()) {
            Iterator<JIO> it = this.LIZ.iterator();
            while (it.hasNext()) {
                it.next();
            }
        }
    }

    public void onDestroy() {
        AbsFragment.super.onDestroy();
        this.LJI = false;
        this.LJII = true;
        if (!this.LIZ.LIZ.isEmpty()) {
            Iterator<JIO> it = this.LIZ.iterator();
            while (it.hasNext()) {
                JIO next = it.next();
                if (next != null) {
                    next.LIZ();
                }
            }
            this.LIZ.LIZ.clear();
        }
    }

    public void onResume() {
        AbsFragment.super.onResume();
        this.LJFF = true;
        if (!this.LIZ.LIZ.isEmpty()) {
            Iterator<JIO> it = this.LIZ.iterator();
            while (it.hasNext()) {
                it.next();
            }
        }
    }

    public void onStop() {
        AbsFragment.super.onStop();
        this.LJFF = false;
        if (!this.LIZ.LIZ.isEmpty()) {
            Iterator<JIO> it = this.LIZ.iterator();
            while (it.hasNext()) {
                it.next();
            }
        }
    }

    public void onCreate(Bundle bundle) {
        AbsFragment.super.onCreate(bundle);
        this.LJFF = false;
        this.LJI = false;
        this.LJII = false;
    }

    public void onSaveInstanceState(Bundle bundle) {
        if (bundle != null) {
            bundle.putBoolean("WORKAROUND_FOR_BUG_19917_KEY", true);
        }
        AbsFragment.super.onSaveInstanceState(bundle);
    }

    public void onViewCreated(View view, Bundle bundle) {
        AbsFragment.super.onViewCreated(view, bundle);
        this.LJI = true;
    }
}
