package com.martsnew.tv.customviews.keyboard;

import A6.k;
import B6.b;
import F5.C0115b;
import O6.l;
import P6.g;
import android.content.Context;
import android.util.AttributeSet;
import android.view.View;
import androidx.recyclerview.widget.GridLayoutManager;
import androidx.recyclerview.widget.RecyclerView;
import java.util.List;
import t5.C1555c;
import t5.InterfaceC1553a;

/* JADX INFO: loaded from: classes.dex */
public final class KeyboardView extends RecyclerView implements InterfaceC1553a {

    /* JADX INFO: renamed from: f1, reason: collision with root package name */
    public static final /* synthetic */ int f11118f1 = 0;

    /* JADX INFO: renamed from: d1, reason: collision with root package name */
    public l f11119d1;

    /* JADX INFO: renamed from: e1, reason: collision with root package name */
    public final k f11120e1;

    /* JADX WARN: 'super' call moved to the top of the method (can break code semantics) */
    public KeyboardView(Context context, AttributeSet attributeSet) {
        super(context, attributeSet, 0);
        g.e(context, "context");
        this.f11120e1 = new k(new C0115b(12, this));
        setLayoutManager(new GridLayoutManager());
        setItemAnimator(null);
        setAdapter(getKeyboardAdapter());
    }

    private final C1555c getKeyboardAdapter() {
        return (C1555c) this.f11120e1.getValue();
    }

    public final void setKeyClickListener(l lVar) {
        g.e(lVar, "listener");
        this.f11119d1 = lVar;
    }

    public final boolean x0() {
        View focusedChild = getFocusedChild();
        b bVar = new b(1, this);
        int i = 0;
        while (true) {
            if (!bVar.hasNext()) {
                i = -1;
                break;
            }
            Object next = bVar.next();
            if (i < 0) {
                B6.l.Z();
                throw null;
            }
            if (g.a(focusedChild, next)) {
                break;
            }
            i++;
        }
        getKeyboardAdapter().getClass();
        return i % 6 == 0;
    }

    public final void y0(List list) {
        g.e(list, "data");
        getKeyboardAdapter().o(list);
    }
}
