what-the-bank/sources/com/scb/phone/view/custom/common/CustomTextviewOutlineWithIc...

143 lines
4.2 KiB
Java

package com.scb.phone.view.custom.common;
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.ViewGroup;
import android.widget.ImageView;
import android.widget.TextView;
import androidx.constraintlayout.widget.ConstraintLayout;
import butterknife.BindView;
import butterknife.ButterKnife;
import butterknife.OnClick;
import com.scb.phone.R;
import o.C14957gcv;
import o.C15715hv;
import o.nMh;
/* loaded from: classes5.dex */
public final class CustomTextviewOutlineWithIcon extends ConstraintLayout {
private IeS c;
@BindView
public ImageView ivIcon;
@BindView
public TextView tvName;
@BindView
public TextView tvTitle;
/* loaded from: classes5.dex */
public interface IeS {
void a();
}
/* JADX WARN: 'super' call moved to the top of the method (can break code semantics) */
public CustomTextviewOutlineWithIcon(Context context, AttributeSet attributeSet) {
super(context, attributeSet);
C14957gcv.e(context, "");
C14957gcv.e(attributeSet, "");
ButterKnife.c(this, LayoutInflater.from(context).inflate(R.layout.2131559371, (ViewGroup) this, true));
TypedArray obtainStyledAttributes = context.obtainStyledAttributes(attributeSet, C15715hv.jbe.CommonInputToNewPageViewGroup, 0, 0);
C14957gcv.c(obtainStyledAttributes, "");
String string = obtainStyledAttributes.getString(0);
ImageView imageView = null;
if (string != null) {
TextView textView = this.tvName;
if (textView == null) {
C14957gcv.a("");
textView = null;
}
textView.setHint(string);
}
String string2 = obtainStyledAttributes.getString(3);
if (string2 != null) {
TextView textView2 = this.tvTitle;
if (textView2 == null) {
C14957gcv.a("");
textView2 = null;
}
textView2.setText(string2);
}
Drawable drawable = obtainStyledAttributes.getDrawable(1);
if (drawable != null) {
ImageView imageView2 = this.ivIcon;
if (imageView2 == null) {
C14957gcv.a("");
imageView2 = null;
}
imageView2.setImageDrawable(drawable);
}
obtainStyledAttributes.getBoolean(2, false);
ImageView imageView3 = this.ivIcon;
if (imageView3 != null) {
imageView = imageView3;
} else {
C14957gcv.a("");
}
ImageView imageView4 = imageView;
C14957gcv.e(imageView4, "");
imageView4.setVisibility(0);
obtainStyledAttributes.recycle();
}
public final void setValue(String str) {
TextView textView = this.tvName;
if (textView == null) {
C14957gcv.a("");
textView = null;
}
textView.setText(str);
}
public final void setIcon(int i) {
ImageView imageView = this.ivIcon;
ImageView imageView2 = null;
if (imageView == null) {
C14957gcv.a("");
imageView = null;
}
ImageView imageView3 = imageView;
C14957gcv.e(imageView3, "");
imageView3.setVisibility(0);
ImageView imageView4 = this.ivIcon;
if (imageView4 != null) {
imageView2 = imageView4;
} else {
C14957gcv.a("");
}
imageView2.setImageDrawable(nMh.getDrawable(getContext(), i));
}
@OnClick
public final void onClick() {
IeS ieS = this.c;
if (ieS != null) {
ieS.a();
}
}
public final void setTvTitle(TextView textView) {
C14957gcv.e(textView, "");
this.tvTitle = textView;
}
public final void setTvName(TextView textView) {
C14957gcv.e(textView, "");
this.tvName = textView;
}
public final void setIvIcon(ImageView imageView) {
C14957gcv.e(imageView, "");
this.ivIcon = imageView;
}
public final void setCustomTextviewOutlineWithIconListener(IeS ieS) {
C14957gcv.e(ieS, "");
this.c = ieS;
}
}