package androidx.leanback.widget;

import android.content.Context;
import android.content.res.TypedArray;
import android.graphics.drawable.Drawable;
import android.util.TypedValue;
import com.strmr.ps.R;
import defpackage.bo7;
import defpackage.ca7;
import defpackage.h68;
import defpackage.j7;
import defpackage.xs;
import okhttp3.internal.ws.WebSocketProtocol;

/* JADX INFO: loaded from: classes.dex */
public class bw extends h68 {
    public final ca7 b;
    public Drawable c;
    public bs d;
    public xs e;
    public long f;
    public long g;
    public long h;
    public f i;

    public static class a extends e {
    }

    public static class b extends e {
    }

    public static class c extends e {
    }

    public static class d extends j7 {
    }

    public static abstract class e extends j7 {
        public int f;
        public Drawable[] g;
        public String[] h;

        public final void b(int i) {
            this.f = i;
            Drawable[] drawableArr = this.g;
            if (drawableArr != null) {
                this.b = drawableArr[i];
            }
            String[] strArr = this.h;
            if (strArr != null) {
                this.c = strArr[i];
            }
        }
    }

    public static class f {
        public void a(long j) {
        }

        public void b(long j) {
        }

        public void c(long j) {
        }
    }

    public static class g extends j7 {
    }

    public static class h extends e {
        public h(Context context) {
            super(R.id.lb_control_play_pause);
            this.g = new Drawable[]{bw.c(context, 5), bw.c(context, 3)};
            b(0);
            this.h = new String[]{context.getString(R.string.lb_playback_controls_play), context.getString(R.string.lb_playback_controls_pause)};
            b(0);
            a(85);
            a(WebSocketProtocol.PAYLOAD_SHORT);
            a(127);
        }
    }

    public static class i extends e {
    }

    public static class j extends e {
    }

    public static class k extends e {
    }

    public static class l extends j7 {
    }

    public static class m extends j7 {
    }

    public static abstract class n extends e {
    }

    public static class o extends n {
    }

    public static class p extends n {
    }

    public bw(ca7 ca7Var) {
        this.b = ca7Var;
    }

    public static Drawable c(Context context, int i2) {
        TypedValue typedValue = new TypedValue();
        if (!context.getTheme().resolveAttribute(R.attr.playbackControlsActionIcons, typedValue, false)) {
            return null;
        }
        TypedArray typedArrayObtainStyledAttributes = context.getTheme().obtainStyledAttributes(typedValue.data, bo7.n.i);
        Drawable drawable = typedArrayObtainStyledAttributes.getDrawable(i2);
        typedArrayObtainStyledAttributes.recycle();
        return drawable;
    }

    public final j7 b(bs bsVar, int i2) {
        if (bsVar != this.d && bsVar != this.e) {
            throw new IllegalArgumentException("Invalid adapter");
        }
        for (int i3 = 0; i3 < bsVar.g(); i3++) {
            j7 j7Var = (j7) bsVar.a(i3);
            if (j7Var.e.contains(Integer.valueOf(i2))) {
                return j7Var;
            }
        }
        return null;
    }

    public final void d(long j2) {
        if (this.g != j2) {
            this.g = j2;
            f fVar = this.i;
            if (fVar != null) {
                fVar.b(j2);
            }
        }
    }

    public final void e(long j2) {
        if (this.f != j2) {
            this.f = j2;
            f fVar = this.i;
            if (fVar != null) {
                fVar.c(j2);
            }
        }
    }
}
