package u5;

import android.animation.Animator;
import android.animation.TimeInterpolator;
import android.view.View;
import android.view.ViewGroup;
import android.view.animation.AccelerateInterpolator;
import android.view.animation.DecelerateInterpolator;
import androidx.core.view.s0;

/* loaded from: classes.dex */
public class m extends i0 {

    /* renamed from: c0, reason: collision with root package name */
    private static final TimeInterpolator f36890c0 = new DecelerateInterpolator();

    /* renamed from: d0, reason: collision with root package name */
    private static final TimeInterpolator f36891d0 = new AccelerateInterpolator();

    /* renamed from: e0, reason: collision with root package name */
    private static final g f36892e0 = new a();

    /* renamed from: f0, reason: collision with root package name */
    private static final g f36893f0 = new b();

    /* renamed from: g0, reason: collision with root package name */
    private static final g f36894g0 = new c();

    /* renamed from: h0, reason: collision with root package name */
    private static final g f36895h0 = new d();

    /* renamed from: i0, reason: collision with root package name */
    private static final g f36896i0 = new e();

    /* renamed from: j0, reason: collision with root package name */
    private static final g f36897j0 = new f();

    /* renamed from: a0, reason: collision with root package name */
    private g f36898a0 = f36897j0;

    /* renamed from: b0, reason: collision with root package name */
    private int f36899b0 = 80;

    /* loaded from: classes.dex */
    class a extends h {
        a() {
            super(null);
        }

        @Override // u5.m.g
        public float b(ViewGroup viewGroup, View view) {
            return view.getTranslationX() - viewGroup.getWidth();
        }
    }

    /* loaded from: classes.dex */
    class b extends h {
        b() {
            super(null);
        }

        @Override // u5.m.g
        public float b(ViewGroup viewGroup, View view) {
            return s0.z(viewGroup) == 1 ? view.getTranslationX() + viewGroup.getWidth() : view.getTranslationX() - viewGroup.getWidth();
        }
    }

    /* loaded from: classes.dex */
    class c extends i {
        c() {
            super(null);
        }

        @Override // u5.m.g
        public float a(ViewGroup viewGroup, View view) {
            return view.getTranslationY() - viewGroup.getHeight();
        }
    }

    /* loaded from: classes.dex */
    class d extends h {
        d() {
            super(null);
        }

        @Override // u5.m.g
        public float b(ViewGroup viewGroup, View view) {
            return view.getTranslationX() + viewGroup.getWidth();
        }
    }

    /* loaded from: classes.dex */
    class e extends h {
        e() {
            super(null);
        }

        @Override // u5.m.g
        public float b(ViewGroup viewGroup, View view) {
            return s0.z(viewGroup) == 1 ? view.getTranslationX() - viewGroup.getWidth() : view.getTranslationX() + viewGroup.getWidth();
        }
    }

    /* loaded from: classes.dex */
    class f extends i {
        f() {
            super(null);
        }

        @Override // u5.m.g
        public float a(ViewGroup viewGroup, View view) {
            return view.getTranslationY() + viewGroup.getHeight();
        }
    }

    /* JADX INFO: Access modifiers changed from: private */
    /* loaded from: classes.dex */
    public interface g {
        float a(ViewGroup viewGroup, View view);

        float b(ViewGroup viewGroup, View view);
    }

    /* loaded from: classes.dex */
    private static abstract class h implements g {
        private h() {
        }

        /* synthetic */ h(a aVar) {
            this();
        }

        @Override // u5.m.g
        public float a(ViewGroup viewGroup, View view) {
            return view.getTranslationY();
        }
    }

    /* loaded from: classes.dex */
    private static abstract class i implements g {
        private i() {
        }

        /* synthetic */ i(a aVar) {
            this();
        }

        @Override // u5.m.g
        public float b(ViewGroup viewGroup, View view) {
            return view.getTranslationX();
        }
    }

    public m(int i10) {
        r0(i10);
    }

    private void k0(t tVar) {
        int[] iArr = new int[2];
        tVar.f36936b.getLocationOnScreen(iArr);
        tVar.f36935a.put("android:slide:screenPosition", iArr);
    }

    @Override // u5.i0, u5.n
    public void h(t tVar) {
        super.h(tVar);
        k0(tVar);
    }

    @Override // u5.i0, u5.n
    public void k(t tVar) {
        super.k(tVar);
        k0(tVar);
    }

    @Override // u5.i0
    public Animator m0(ViewGroup viewGroup, View view, t tVar, t tVar2) {
        if (tVar2 == null) {
            return null;
        }
        int[] iArr = (int[]) tVar2.f36935a.get("android:slide:screenPosition");
        float translationX = view.getTranslationX();
        float translationY = view.getTranslationY();
        return v.a(view, tVar2, iArr[0], iArr[1], this.f36898a0.b(viewGroup, view), this.f36898a0.a(viewGroup, view), translationX, translationY, f36890c0, this);
    }

    @Override // u5.i0
    public Animator o0(ViewGroup viewGroup, View view, t tVar, t tVar2) {
        if (tVar == null) {
            return null;
        }
        int[] iArr = (int[]) tVar.f36935a.get("android:slide:screenPosition");
        return v.a(view, tVar, iArr[0], iArr[1], view.getTranslationX(), view.getTranslationY(), this.f36898a0.b(viewGroup, view), this.f36898a0.a(viewGroup, view), f36891d0, this);
    }

    public void r0(int i10) {
        if (i10 == 3) {
            this.f36898a0 = f36892e0;
        } else if (i10 == 5) {
            this.f36898a0 = f36895h0;
        } else if (i10 == 48) {
            this.f36898a0 = f36894g0;
        } else if (i10 == 80) {
            this.f36898a0 = f36897j0;
        } else if (i10 == 8388611) {
            this.f36898a0 = f36893f0;
        } else {
            if (i10 != 8388613) {
                throw new IllegalArgumentException("Invalid slide direction");
            }
            this.f36898a0 = f36896i0;
        }
        this.f36899b0 = i10;
        l lVar = new l();
        lVar.j(i10);
        g0(lVar);
    }
}
