package com.google.android.gms.common.internal; import android.R; import android.content.Context; import android.content.res.ColorStateList; import android.content.res.Resources; import android.graphics.PorterDuff; import android.graphics.Typeface; import android.graphics.drawable.Drawable; import android.util.AttributeSet; import android.widget.Button; import com.google.android.gms.common.util.DeviceProperties; import o.Tlu; /* loaded from: classes.dex */ public final class zaaa extends Button { public zaaa(Context context, AttributeSet attributeSet) { super(context, null, R.attr.buttonStyle); } private static final int zab(int i, int i2, int i3, int i4) { if (i == 0) { return i2; } if (i == 1) { return i3; } if (i == 2) { return i4; } StringBuilder sb = new StringBuilder(33); sb.append("Unknown color scheme: "); sb.append(i); throw new IllegalStateException(sb.toString()); } public final void zaa(Resources resources, int i, int i2) { setTypeface(Typeface.DEFAULT_BOLD); setTextSize(14.0f); int i3 = (int) ((resources.getDisplayMetrics().density * 48.0f) + 0.5f); setMinHeight(i3); setMinWidth(i3); int zab = zab(i2, com.google.android.gms.base.R.drawable.common_google_signin_btn_icon_dark, com.google.android.gms.base.R.drawable.common_google_signin_btn_icon_light, com.google.android.gms.base.R.drawable.common_google_signin_btn_icon_light); int zab2 = zab(i2, com.google.android.gms.base.R.drawable.common_google_signin_btn_text_dark, com.google.android.gms.base.R.drawable.common_google_signin_btn_text_light, com.google.android.gms.base.R.drawable.common_google_signin_btn_text_light); if (i == 0 || i == 1) { zab = zab2; } else if (i != 2) { StringBuilder sb = new StringBuilder(32); sb.append("Unknown button size: "); sb.append(i); throw new IllegalStateException(sb.toString()); } Drawable pI_ = Tlu.pI_(resources.getDrawable(zab)); Tlu.pF_(pI_, resources.getColorStateList(com.google.android.gms.base.R.color.common_google_signin_btn_tint)); Tlu.pG_(pI_, PorterDuff.Mode.SRC_ATOP); setBackgroundDrawable(pI_); setTextColor((ColorStateList) Preconditions.checkNotNull(resources.getColorStateList(zab(i2, com.google.android.gms.base.R.color.common_google_signin_btn_text_dark, com.google.android.gms.base.R.color.common_google_signin_btn_text_light, com.google.android.gms.base.R.color.common_google_signin_btn_text_light)))); if (i == 0) { setText(resources.getString(com.google.android.gms.base.R.string.common_signin_button_text)); } else if (i == 1) { setText(resources.getString(com.google.android.gms.base.R.string.common_signin_button_text_long)); } else if (i == 2) { setText((CharSequence) null); } else { StringBuilder sb2 = new StringBuilder(32); sb2.append("Unknown button size: "); sb2.append(i); throw new IllegalStateException(sb2.toString()); } setTransformationMethod(null); if (DeviceProperties.isWearable(getContext())) { setGravity(19); } } }