package com.scb.phone.view.custom; import android.content.Context; import android.content.res.TypedArray; import android.graphics.drawable.Drawable; import android.util.AttributeSet; import android.view.LayoutInflater; import android.view.View; import android.view.ViewGroup; import android.widget.LinearLayout; import android.widget.TextView; import butterknife.BindView; import butterknife.ButterKnife; import com.scb.phone.R; import o.C14957gcv; import o.C15715hv; import o.nMh; /* loaded from: classes5.dex */ public final class CustomExternalSelector extends LinearLayout { private Integer a; @BindView public View container; private Integer e; @BindView public TextView iconArrow; @BindView public TextView labelTitle; @BindView public TextView mErrorTextView; @BindView public TextView selectedTextView; /* JADX WARN: 'this' call moved to the top of the method (can break code semantics) */ public CustomExternalSelector(Context context) { this(context, null); C14957gcv.e(context, ""); } /* JADX WARN: 'this' call moved to the top of the method (can break code semantics) */ public CustomExternalSelector(Context context, AttributeSet attributeSet) { this(context, attributeSet, 0); C14957gcv.e(context, ""); } /* JADX WARN: 'super' call moved to the top of the method (can break code semantics) */ public CustomExternalSelector(Context context, AttributeSet attributeSet, int i) { super(context, attributeSet, i); C14957gcv.e(context, ""); Object systemService = context.getSystemService("layout_inflater"); C14957gcv.d(systemService, ""); ((LayoutInflater) systemService).inflate(R.layout.2131559023, (ViewGroup) this, true); ButterKnife.c(this); if (attributeSet != null) { TypedArray obtainStyledAttributes = context.obtainStyledAttributes(attributeSet, C15715hv.jbe.CustomExternalSelector, 0, 0); String string = obtainStyledAttributes.getString(2); String string2 = obtainStyledAttributes.getString(0); int resourceId = obtainStyledAttributes.getResourceId(1, R.drawable.ic_expand_more_black_24dp_right); set$default(this, string, string2, null, Integer.valueOf(resourceId), obtainStyledAttributes.getBoolean(3, true), 4, null); obtainStyledAttributes.recycle(); } } public final void setErrorText(String str) { C14957gcv.e(str, ""); TextView textView = this.mErrorTextView; if (textView == null) { C14957gcv.a(""); textView = null; } textView.setText(str); } public final void setTitle(String str) { C14957gcv.e(str, ""); TextView textView = this.labelTitle; if (textView == null) { C14957gcv.a(""); textView = null; } textView.setText(str); } public final void setHint(String str) { C14957gcv.e(str, ""); TextView textView = this.selectedTextView; if (textView == null) { C14957gcv.a(""); textView = null; } textView.setHint(str); } public static /* synthetic */ void set$default(CustomExternalSelector customExternalSelector, String str, String str2, String str3, Integer num, boolean z, int i, Object obj) { if ((i & 1) != 0) { str = null; } if ((i & 2) != 0) { str2 = null; } if ((i & 4) != 0) { str3 = null; } if ((i & 8) != 0) { num = null; } if ((i & 16) != 0) { z = true; } customExternalSelector.set(str, str2, str3, num, z); } public final void set(String str, String str2, String str3, Integer num, boolean z) { Context context; TextView textView = null; if (str != null) { TextView textView2 = this.labelTitle; if (textView2 == null) { C14957gcv.a(""); textView2 = null; } textView2.setText(str); } if (str2 != null) { TextView textView3 = this.selectedTextView; if (textView3 == null) { C14957gcv.a(""); textView3 = null; } textView3.setHint(str2); } if (num != null && (context = getContext()) != null) { C14957gcv.c(context, ""); TextView textView4 = this.iconArrow; if (textView4 == null) { C14957gcv.a(""); textView4 = null; } textView4.setCompoundDrawablesWithIntrinsicBounds(nMh.getDrawable(getContext(), num.intValue()), (Drawable) null, (Drawable) null, (Drawable) null); } if (str3 != null) { TextView textView5 = this.selectedTextView; if (textView5 == null) { C14957gcv.a(""); textView5 = null; } textView5.setText(str3); } TextView textView6 = this.labelTitle; if (textView6 != null) { textView = textView6; } else { C14957gcv.a(""); } textView.setVisibility(z ? 0 : 8); } public final void setSelected(String str) { TextView textView = this.selectedTextView; if (textView == null) { C14957gcv.a(""); textView = null; } textView.setText(str != null ? str : ""); Integer num = str != null ? this.a : this.e; if (num != null) { int intValue = num.intValue(); Context context = getContext(); if (context != null) { C14957gcv.c(context, ""); TextView textView2 = this.iconArrow; if (textView2 == null) { C14957gcv.a(""); textView2 = null; } textView2.setCompoundDrawablesWithIntrinsicBounds(nMh.getDrawable(getContext(), intValue), (Drawable) null, (Drawable) null, (Drawable) null); } } } public static /* synthetic */ void setDynamicIcons$default(CustomExternalSelector customExternalSelector, Integer num, Integer num2, int i, Object obj) { if ((i & 1) != 0) { num = null; } if ((i & 2) != 0) { num2 = null; } customExternalSelector.setDynamicIcons(num, num2); } public final void a(boolean z) { View view = null; if (z) { TextView textView = this.mErrorTextView; if (textView == null) { C14957gcv.a(""); textView = null; } textView.setVisibility(0); View view2 = this.container; if (view2 != null) { view = view2; } else { C14957gcv.a(""); } view.setBackground(nMh.getDrawable(getContext(), R.drawable.shape_red_reounded_reactangle_border)); return; } TextView textView2 = this.mErrorTextView; if (textView2 == null) { C14957gcv.a(""); textView2 = null; } textView2.setVisibility(8); View view3 = this.container; if (view3 != null) { view = view3; } else { C14957gcv.a(""); } view.setBackground(nMh.getDrawable(getContext(), R.drawable.shape_gray_rounded_rectangle)); } public final void setSelectedTextView(TextView textView) { C14957gcv.e(textView, ""); this.selectedTextView = textView; } public final void setMErrorTextView(TextView textView) { C14957gcv.e(textView, ""); this.mErrorTextView = textView; } public final void setLabelTitle(TextView textView) { C14957gcv.e(textView, ""); this.labelTitle = textView; } public final void setIconArrow(TextView textView) { C14957gcv.e(textView, ""); this.iconArrow = textView; } public final void setFilledIconRes(Integer num) { this.a = num; } public final void setEmptyIconRes(Integer num) { this.e = num; } public final void setDynamicIcons(Integer num, Integer num2) { this.e = num; this.a = num2; } public final void setContainer(View view) { C14957gcv.e(view, ""); this.container = view; } }