package o; import android.content.Context; import android.content.res.ColorStateList; import android.graphics.Bitmap; import android.graphics.Canvas; import android.graphics.PorterDuff; import android.graphics.PorterDuffColorFilter; import android.graphics.Shader; import android.graphics.drawable.BitmapDrawable; import android.graphics.drawable.Drawable; import android.graphics.drawable.LayerDrawable; import java.lang.ref.WeakReference; import o.KPD; import o.SYO; /* loaded from: classes.dex */ public final class RXZ { private static RXZ d; private static final PorterDuff.Mode e = PorterDuff.Mode.SRC_IN; private KPD a; public static void a() { synchronized (RXZ.class) { if (d == null) { RXZ rxz = new RXZ(); d = rxz; rxz.a = KPD.d(); KPD kpd = d.a; KPD.HBt hBt = new KPD.HBt() { // from class: o.RXZ.3 private final int[] e = {SYO.RVV.abc_textfield_search_default_mtrl_alpha, SYO.RVV.abc_textfield_default_mtrl_alpha, SYO.RVV.abc_ab_share_pack_mtrl_alpha}; private final int[] a = {SYO.RVV.abc_ic_commit_search_api_mtrl_alpha, SYO.RVV.abc_seekbar_tick_mark_material, SYO.RVV.abc_ic_menu_share_mtrl_alpha, SYO.RVV.abc_ic_menu_copy_mtrl_am_alpha, SYO.RVV.abc_ic_menu_cut_mtrl_alpha, SYO.RVV.abc_ic_menu_selectall_mtrl_alpha, SYO.RVV.abc_ic_menu_paste_mtrl_am_alpha}; private final int[] d = {SYO.RVV.abc_textfield_activated_mtrl_alpha, SYO.RVV.abc_textfield_search_activated_mtrl_alpha, SYO.RVV.abc_cab_background_top_mtrl_alpha, SYO.RVV.abc_text_cursor_material, SYO.RVV.abc_text_select_handle_left_mtrl, SYO.RVV.abc_text_select_handle_middle_mtrl, SYO.RVV.abc_text_select_handle_right_mtrl}; private final int[] b = {SYO.RVV.abc_popup_background_mtrl_mult, SYO.RVV.abc_cab_background_internal_bg, SYO.RVV.abc_menu_hardkey_panel_mtrl_mult}; private final int[] h = {SYO.RVV.abc_tab_indicator_material, SYO.RVV.abc_textfield_search_material}; private final int[] c = {SYO.RVV.abc_btn_check_material, SYO.RVV.abc_btn_radio_material, SYO.RVV.abc_btn_check_material_anim, SYO.RVV.abc_btn_radio_material_anim}; private ColorStateList fU_(Context context) { return fS_(context, nKv.d(context, SYO.IeS.colorButtonNormal)); } private ColorStateList fR_(Context context) { return fS_(context, 0); } private ColorStateList fT_(Context context) { return fS_(context, nKv.d(context, SYO.IeS.colorAccent)); } private ColorStateList fS_(Context context, int i) { int d2 = nKv.d(context, SYO.IeS.colorControlHighlight); int b = nKv.b(context, SYO.IeS.colorButtonNormal); int[] iArr = nKv.e; int[] iArr2 = nKv.d; int a = Rez.a(d2, i); return new ColorStateList(new int[][]{iArr, iArr2, nKv.b, nKv.a}, new int[]{b, a, Rez.a(d2, i), i}); } private ColorStateList fV_(Context context) { int[][] iArr = new int[3]; int[] iArr2 = new int[3]; ColorStateList jJ_ = nKv.jJ_(context, SYO.IeS.colorSwitchThumbNormal); if (jJ_ != null && jJ_.isStateful()) { int[] iArr3 = nKv.e; iArr[0] = iArr3; iArr2[0] = jJ_.getColorForState(iArr3, 0); iArr[1] = nKv.c; iArr2[1] = nKv.d(context, SYO.IeS.colorControlActivated); iArr[2] = nKv.a; iArr2[2] = jJ_.getDefaultColor(); } else { iArr[0] = nKv.e; iArr2[0] = nKv.b(context, SYO.IeS.colorSwitchThumbNormal); iArr[1] = nKv.c; iArr2[1] = nKv.d(context, SYO.IeS.colorControlActivated); iArr[2] = nKv.a; iArr2[2] = nKv.d(context, SYO.IeS.colorSwitchThumbNormal); } return new ColorStateList(iArr, iArr2); } @Override // o.KPD.HBt public Drawable iY_(KPD kpd2, Context context, int i) { if (i == SYO.RVV.abc_cab_background_top_material) { return new LayerDrawable(new Drawable[]{kpd2.iT_(context, SYO.RVV.abc_cab_background_internal_bg), kpd2.iT_(context, SYO.RVV.abc_cab_background_top_mtrl_alpha)}); } if (i == SYO.RVV.abc_ratingbar_material) { return fW_(kpd2, context, SYO.Sts.abc_star_big); } if (i == SYO.RVV.abc_ratingbar_indicator_material) { return fW_(kpd2, context, SYO.Sts.abc_star_medium); } if (i == SYO.RVV.abc_ratingbar_small_material) { return fW_(kpd2, context, SYO.Sts.abc_star_small); } return null; } private LayerDrawable fW_(KPD kpd2, Context context, int i) { BitmapDrawable bitmapDrawable; BitmapDrawable bitmapDrawable2; BitmapDrawable bitmapDrawable3; int dimensionPixelSize = context.getResources().getDimensionPixelSize(i); Drawable iT_ = kpd2.iT_(context, SYO.RVV.abc_star_black_48dp); Drawable iT_2 = kpd2.iT_(context, SYO.RVV.abc_star_half_black_48dp); if ((iT_ instanceof BitmapDrawable) && iT_.getIntrinsicWidth() == dimensionPixelSize && iT_.getIntrinsicHeight() == dimensionPixelSize) { bitmapDrawable = (BitmapDrawable) iT_; bitmapDrawable2 = new BitmapDrawable(bitmapDrawable.getBitmap()); } else { Bitmap createBitmap = Bitmap.createBitmap(dimensionPixelSize, dimensionPixelSize, Bitmap.Config.ARGB_8888); Canvas canvas = new Canvas(createBitmap); iT_.setBounds(0, 0, dimensionPixelSize, dimensionPixelSize); iT_.draw(canvas); bitmapDrawable = new BitmapDrawable(createBitmap); bitmapDrawable2 = new BitmapDrawable(createBitmap); } bitmapDrawable2.setTileModeX(Shader.TileMode.REPEAT); if ((iT_2 instanceof BitmapDrawable) && iT_2.getIntrinsicWidth() == dimensionPixelSize && iT_2.getIntrinsicHeight() == dimensionPixelSize) { bitmapDrawable3 = (BitmapDrawable) iT_2; } else { Bitmap createBitmap2 = Bitmap.createBitmap(dimensionPixelSize, dimensionPixelSize, Bitmap.Config.ARGB_8888); Canvas canvas2 = new Canvas(createBitmap2); iT_2.setBounds(0, 0, dimensionPixelSize, dimensionPixelSize); iT_2.draw(canvas2); bitmapDrawable3 = new BitmapDrawable(createBitmap2); } LayerDrawable layerDrawable = new LayerDrawable(new Drawable[]{bitmapDrawable, bitmapDrawable3, bitmapDrawable2}); layerDrawable.setId(0, android.R.id.background); layerDrawable.setId(1, android.R.id.secondaryProgress); layerDrawable.setId(2, android.R.id.progress); return layerDrawable; } private void fX_(Drawable drawable, int i, PorterDuff.Mode mode) { FIj.b(); Drawable mutate = drawable.mutate(); if (mode == null) { mode = RXZ.e; } mutate.setColorFilter(RXZ.fM_(i, mode)); } @Override // o.KPD.HBt public boolean jb_(Context context, int i, Drawable drawable) { if (i == SYO.RVV.abc_seekbar_track_material) { LayerDrawable layerDrawable = (LayerDrawable) drawable; fX_(layerDrawable.findDrawableByLayerId(android.R.id.background), nKv.d(context, SYO.IeS.colorControlNormal), RXZ.e); fX_(layerDrawable.findDrawableByLayerId(android.R.id.secondaryProgress), nKv.d(context, SYO.IeS.colorControlNormal), RXZ.e); fX_(layerDrawable.findDrawableByLayerId(android.R.id.progress), nKv.d(context, SYO.IeS.colorControlActivated), RXZ.e); return true; } if (i != SYO.RVV.abc_ratingbar_material && i != SYO.RVV.abc_ratingbar_indicator_material && i != SYO.RVV.abc_ratingbar_small_material) { return false; } LayerDrawable layerDrawable2 = (LayerDrawable) drawable; fX_(layerDrawable2.findDrawableByLayerId(android.R.id.background), nKv.b(context, SYO.IeS.colorControlNormal), RXZ.e); fX_(layerDrawable2.findDrawableByLayerId(android.R.id.secondaryProgress), nKv.d(context, SYO.IeS.colorControlActivated), RXZ.e); fX_(layerDrawable2.findDrawableByLayerId(android.R.id.progress), nKv.d(context, SYO.IeS.colorControlActivated), RXZ.e); return true; } private boolean d(int[] iArr, int i) { for (int i2 : iArr) { if (i2 == i) { return true; } } return false; } @Override // o.KPD.HBt public ColorStateList iZ_(Context context, int i) { if (i == SYO.RVV.abc_edit_text_material) { return AgY.dS_(context, SYO.HBt.abc_tint_edittext); } if (i == SYO.RVV.abc_switch_track_mtrl_alpha) { return AgY.dS_(context, SYO.HBt.abc_tint_switch_track); } if (i == SYO.RVV.abc_switch_thumb_material) { return fV_(context); } if (i == SYO.RVV.abc_btn_default_mtrl_shape) { return fU_(context); } if (i == SYO.RVV.abc_btn_borderless_material) { return fR_(context); } if (i == SYO.RVV.abc_btn_colored_material) { return fT_(context); } if (i == SYO.RVV.abc_spinner_mtrl_am_alpha || i == SYO.RVV.abc_spinner_textfield_background_material) { return AgY.dS_(context, SYO.HBt.abc_tint_spinner); } if (d(this.a, i)) { return nKv.jJ_(context, SYO.IeS.colorControlNormal); } if (d(this.h, i)) { return AgY.dS_(context, SYO.HBt.abc_tint_default); } if (d(this.c, i)) { return AgY.dS_(context, SYO.HBt.abc_tint_btn_checkable); } if (i == SYO.RVV.abc_seekbar_thumb_material) { return AgY.dS_(context, SYO.HBt.abc_tint_seek_thumb); } return null; } /* JADX WARN: Removed duplicated region for block: B:12:0x0063 A[RETURN] */ /* JADX WARN: Removed duplicated region for block: B:7:0x004b */ @Override // o.KPD.HBt /* Code decompiled incorrectly, please refer to instructions dump. To view partially-correct add '--show-bad-code' argument */ public boolean jc_(android.content.Context r7, int r8, android.graphics.drawable.Drawable r9) { /* r6 = this; android.graphics.PorterDuff$Mode r0 = o.RXZ.fL_() int[] r1 = r6.e boolean r1 = r6.d(r1, r8) r2 = 0 r3 = -1 r4 = 1 if (r1 == 0) goto L12 int r8 = o.SYO.IeS.colorControlNormal goto L1c L12: int[] r1 = r6.d boolean r1 = r6.d(r1, r8) if (r1 == 0) goto L1e int r8 = o.SYO.IeS.colorControlActivated L1c: r1 = r4 goto L40 L1e: int[] r1 = r6.b boolean r1 = r6.d(r1, r8) if (r1 == 0) goto L29 android.graphics.PorterDuff$Mode r0 = android.graphics.PorterDuff.Mode.MULTIPLY goto L43 L29: int r1 = o.SYO.RVV.abc_list_divider_mtrl_alpha if (r8 != r1) goto L3a r8 = 1109603123(0x42233333, float:40.8) int r8 = java.lang.Math.round(r8) r1 = 16842800(0x1010030, float:2.3693693E-38) r5 = r1 L38: r1 = r4 goto L49 L3a: int r1 = o.SYO.RVV.abc_dialog_material_background if (r8 == r1) goto L43 r8 = r2 r1 = r8 L40: r5 = r8 r8 = r3 goto L49 L43: r1 = 16842801(0x1010031, float:2.3693695E-38) r5 = r1 r8 = r3 goto L38 L49: if (r1 == 0) goto L63 o.FIj.b() android.graphics.drawable.Drawable r9 = r9.mutate() int r7 = o.nKv.d(r7, r5) android.graphics.PorterDuffColorFilter r7 = o.RXZ.fM_(r7, r0) r9.setColorFilter(r7) if (r8 == r3) goto L62 r9.setAlpha(r8) L62: return r4 L63: return r2 */ throw new UnsupportedOperationException("Method not decompiled: o.RXZ.AnonymousClass3.jc_(android.content.Context, int, android.graphics.drawable.Drawable):boolean"); } @Override // o.KPD.HBt public PorterDuff.Mode ja_(int i) { if (i == SYO.RVV.abc_switch_thumb_material) { return PorterDuff.Mode.MULTIPLY; } return null; } }; synchronized (kpd) { kpd.b = hBt; } } } } public static RXZ c() { RXZ rxz; synchronized (RXZ.class) { if (d == null) { a(); } rxz = d; } return rxz; } public final Drawable fO_(Context context, int i) { Drawable iT_; synchronized (this) { iT_ = this.a.iT_(context, i); } return iT_; } /* JADX INFO: Access modifiers changed from: package-private */ public final Drawable fP_(Context context, int i, boolean z) { Drawable iU_; synchronized (this) { iU_ = this.a.iU_(context, i, z); } return iU_; } public final void b(Context context) { synchronized (this) { KPD kpd = this.a; synchronized (kpd) { C0667Ltg> c0667Ltg = kpd.c.get(context); if (c0667Ltg != null) { c0667Ltg.b(); } } } } /* JADX INFO: Access modifiers changed from: package-private */ public final ColorStateList fQ_(Context context, int i) { ColorStateList iV_; synchronized (this) { iV_ = this.a.iV_(context, i); } return iV_; } /* JADX INFO: Access modifiers changed from: package-private */ public static void fN_(Drawable drawable, C16821rXR c16821rXR, int[] iArr) { KPD.iS_(drawable, c16821rXR, iArr); } public static PorterDuffColorFilter fM_(int i, PorterDuff.Mode mode) { PorterDuffColorFilter iQ_; synchronized (RXZ.class) { iQ_ = KPD.iQ_(i, mode); } return iQ_; } }