package com.google.android.exoplayer2.ui; import android.content.Context; import android.graphics.Canvas; import android.util.AttributeSet; import android.view.View; import androidx.annotation.Nullable; import com.amazonaws.handlers.HandlerChainFactory$$ExternalSyntheticThrowCCEIfNotNull0; import com.google.android.exoplayer2.ui.SubtitleView; import java.util.ArrayList; import java.util.Collections; import java.util.List; /* loaded from: classes2.dex */ final class CanvasSubtitleOutput extends View implements SubtitleView.Output { public float bottomPaddingFraction; public List cues; public final List painters; public CaptionStyleCompat style; public float textSize; public int textSizeType; public CanvasSubtitleOutput(Context context) { this(context, null); } public CanvasSubtitleOutput(Context context, @Nullable AttributeSet attributeSet) { super(context, attributeSet); this.painters = new ArrayList(); this.cues = Collections.emptyList(); this.textSizeType = 0; this.textSize = 0.0533f; this.style = CaptionStyleCompat.DEFAULT; this.bottomPaddingFraction = 0.08f; } @Override // com.google.android.exoplayer2.ui.SubtitleView.Output public void update(List list, CaptionStyleCompat captionStyleCompat, float f, int i, float f2) { this.cues = list; this.style = captionStyleCompat; this.textSize = f; this.textSizeType = i; this.bottomPaddingFraction = f2; while (this.painters.size() < list.size()) { this.painters.add(new SubtitlePainter(getContext())); } invalidate(); } @Override // android.view.View public void dispatchDraw(Canvas canvas) { List list = this.cues; if (list.isEmpty()) { return; } int height = getHeight(); int paddingLeft = getPaddingLeft(); int paddingTop = getPaddingTop(); int width = getWidth() - getPaddingRight(); int paddingBottom = height - getPaddingBottom(); if (paddingBottom <= paddingTop || width <= paddingLeft) { return; } if (SubtitleViewUtils.resolveTextSize(this.textSizeType, this.textSize, height, paddingBottom - paddingTop) > 0.0f && list.size() > 0) { HandlerChainFactory$$ExternalSyntheticThrowCCEIfNotNull0.m(list.get(0)); throw null; } } }