package ඓ.ᨨ.K.ඓ.㸾.㸾;

import android.graphics.Rect;
import android.view.View;
import androidx.recyclerview.widget.RecyclerView;

/* renamed from: ඓ.ᨨ.K.ඓ.㸾.㸾.ʬ  reason: contains not printable characters */
/* compiled from: MediaGridInset */
public class C0798 extends RecyclerView.AbstractC0232 {

    /* renamed from: ʬ  reason: contains not printable characters */
    public boolean f3997;

    /* renamed from: ῲ  reason: contains not printable characters */
    public int f3998;

    /* renamed from: K  reason: contains not printable characters */
    public int f3999;

    public C0798(int i, int i2, boolean z) {
        this.f3999 = i;
        this.f3998 = i2;
        this.f3997 = z;
    }

    @Override // androidx.recyclerview.widget.RecyclerView.AbstractC0232
    public void getItemOffsets(Rect rect, View view, RecyclerView recyclerView, RecyclerView.C0248 r6) {
        int childAdapterPosition = recyclerView.getChildAdapterPosition(view);
        int i = this.f3999;
        int i2 = childAdapterPosition % i;
        if (this.f3997) {
            int i3 = this.f3998;
            rect.left = i3 - ((i2 * i3) / i);
            rect.right = ((i2 + 1) * i3) / i;
            if (childAdapterPosition < i) {
                rect.top = i3;
            }
            rect.bottom = this.f3998;
            return;
        }
        int i4 = this.f3998;
        rect.left = (i2 * i4) / i;
        rect.right = i4 - (((i2 + 1) * i4) / i);
        if (childAdapterPosition >= i) {
            rect.top = i4;
        }
    }
}
