package ῲ.Ԕ.K;

import android.os.Bundle;
import android.os.Parcelable;
import android.view.View;
import android.view.ViewGroup;
import androidx.fragment.app.Fragment;
import androidx.lifecycle.Lifecycle;
import com.facebook.internal.security.CertificateUtil;
import ඓ.ᨨ.K.ඓ.㸾.C0793;
import ඓ.ᨨ.K.ඓ.㸾.ʬ.C0783;
import ῲ.ゎ.K.AbstractC2199;

/* renamed from: ῲ.Ԕ.K.㑃  reason: contains not printable characters */
/* compiled from: FragmentPagerAdapter */
public abstract class AbstractC1536 extends AbstractC2199 {

    /* renamed from: ʬ  reason: contains not printable characters */
    public final AbstractC1531 f5612;

    /* renamed from: ඓ  reason: contains not printable characters */
    public AbstractC1558 f5613 = null;

    /* renamed from: 㴹  reason: contains not printable characters */
    public Fragment f5614 = null;

    /* renamed from: 㸾  reason: contains not printable characters */
    public final int f5615;

    @Deprecated
    public AbstractC1536(AbstractC1531 r2) {
        this.f5612 = r2;
        this.f5615 = 0;
    }

    @Override // ῲ.ゎ.K.AbstractC2199
    /* renamed from: ʬ  reason: contains not printable characters */
    public Parcelable m3947() {
        return null;
    }

    @Override // ῲ.ゎ.K.AbstractC2199
    /* renamed from: ῲ  reason: contains not printable characters */
    public void m3948(ViewGroup viewGroup) {
        if (viewGroup.getId() == -1) {
            throw new IllegalStateException("ViewPager with adapter " + this + " requires a view id");
        }
    }

    @Override // ῲ.ゎ.K.AbstractC2199
    /* renamed from: K  reason: contains not printable characters */
    public Object m3950(ViewGroup viewGroup, int i) {
        if (this.f5613 == null) {
            this.f5613 = this.f5612.m3915();
        }
        long j = (long) i;
        Fragment r2 = this.f5612.m3914(m3946(viewGroup.getId(), j));
        if (r2 != null) {
            this.f5613.m4098(r2);
        } else {
            r2 = new C0793();
            Bundle bundle = new Bundle();
            bundle.putParcelable("args_item", ((C0783) this).f3974.get(i));
            r2.setArguments(bundle);
            this.f5613.m4097(viewGroup.getId(), r2, m3946(viewGroup.getId(), j));
        }
        if (r2 != this.f5614) {
            r2.setMenuVisibility(false);
            if (this.f5615 == 1) {
                this.f5613.m4099(r2, Lifecycle.State.STARTED);
            } else {
                r2.setUserVisibleHint(false);
            }
        }
        return r2;
    }

    @Override // ῲ.ゎ.K.AbstractC2199
    /* renamed from: K  reason: contains not printable characters */
    public void m3951(Parcelable parcelable, ClassLoader classLoader) {
    }

    @Override // ῲ.ゎ.K.AbstractC2199
    /* renamed from: ῲ  reason: contains not printable characters */
    public void m3949(ViewGroup viewGroup, int i, Object obj) {
        Fragment fragment = (Fragment) obj;
        Fragment fragment2 = this.f5614;
        if (fragment != fragment2) {
            if (fragment2 != null) {
                fragment2.setMenuVisibility(false);
                if (this.f5615 == 1) {
                    if (this.f5613 == null) {
                        this.f5613 = this.f5612.m3915();
                    }
                    this.f5613.m4099(this.f5614, Lifecycle.State.STARTED);
                } else {
                    this.f5614.setUserVisibleHint(false);
                }
            }
            fragment.setMenuVisibility(true);
            if (this.f5615 == 1) {
                if (this.f5613 == null) {
                    this.f5613 = this.f5612.m3915();
                }
                this.f5613.m4099(fragment, Lifecycle.State.RESUMED);
            } else {
                fragment.setUserVisibleHint(true);
            }
            this.f5614 = fragment;
        }
    }

    @Override // ῲ.ゎ.K.AbstractC2199
    /* renamed from: K  reason: contains not printable characters */
    public void m3953(ViewGroup viewGroup, int i, Object obj) {
        Fragment fragment = (Fragment) obj;
        if (this.f5613 == null) {
            this.f5613 = this.f5612.m3915();
        }
        this.f5613.m4094(fragment);
        if (fragment == this.f5614) {
            this.f5614 = null;
        }
    }

    @Override // ῲ.ゎ.K.AbstractC2199
    /* renamed from: K  reason: contains not printable characters */
    public void m3952(ViewGroup viewGroup) {
        AbstractC1558 r1 = this.f5613;
        if (r1 != null) {
            r1.m4104();
            this.f5613 = null;
        }
    }

    @Override // ῲ.ゎ.K.AbstractC2199
    /* renamed from: K  reason: contains not printable characters */
    public boolean m3954(View view, Object obj) {
        return ((Fragment) obj).getView() == view;
    }

    /* renamed from: K  reason: contains not printable characters */
    public static String m3946(int i, long j) {
        return "android:switcher:" + i + CertificateUtil.DELIMITER + j;
    }
}
