what-the-bank/sources/com/scb/phone/view/custom/hml/CustomTutorialImageAndText....

115 lines
3.3 KiB
Java

package com.scb.phone.view.custom.hml;
import android.content.Context;
import android.content.res.TypedArray;
import android.graphics.drawable.Drawable;
import android.text.TextUtils;
import android.util.AttributeSet;
import android.view.LayoutInflater;
import android.view.ViewGroup;
import android.widget.ImageView;
import android.widget.RelativeLayout;
import android.widget.TextView;
import butterknife.BindView;
import butterknife.ButterKnife;
import com.scb.phone.R;
import o.C12891fKc;
import o.C14957gcv;
import o.C15715hv;
/* loaded from: classes5.dex */
public final class CustomTutorialImageAndText extends RelativeLayout {
@BindView
public ImageView imageView;
@BindView
public TextView textView;
public CustomTutorialImageAndText(Context context) {
super(context);
apJ_(null);
}
public CustomTutorialImageAndText(Context context, AttributeSet attributeSet) {
super(context, attributeSet);
apJ_(attributeSet);
}
public CustomTutorialImageAndText(Context context, AttributeSet attributeSet, int i) {
super(context, attributeSet, i);
apJ_(attributeSet);
}
private void apJ_(AttributeSet attributeSet) {
ButterKnife.c(this, LayoutInflater.from(getContext()).inflate(R.layout.2131559387, (ViewGroup) this, true));
if (attributeSet != null) {
TypedArray obtainStyledAttributes = getContext().obtainStyledAttributes(attributeSet, C15715hv.jbe.CustomTutorialImageAndText);
C14957gcv.c(obtainStyledAttributes, "");
String string = obtainStyledAttributes.getString(0);
if (string != null) {
C14957gcv.c((Object) string, "");
setText(string);
}
Drawable drawable = obtainStyledAttributes.getDrawable(1);
if (drawable != null) {
C14957gcv.c(drawable, "");
setImage(drawable);
}
obtainStyledAttributes.recycle();
}
}
public final void setText(String str) {
C14957gcv.e(str, "");
TextView textView = this.textView;
if (textView == null) {
C14957gcv.a("");
textView = null;
}
textView.setText(str);
}
public final void setImage(int i) {
ImageView imageView = this.imageView;
if (imageView == null) {
C14957gcv.a("");
imageView = null;
}
imageView.setImageResource(i);
}
public final void setImage(String str, int i) {
C14957gcv.e(str, "");
if (TextUtils.isEmpty(str)) {
return;
}
ImageView imageView = this.imageView;
if (imageView == null) {
C14957gcv.a("");
imageView = null;
}
C12891fKc.azm_(i, imageView, str);
}
public final void setImage(Drawable drawable) {
C14957gcv.e(drawable, "");
ImageView imageView = this.imageView;
if (imageView == null) {
C14957gcv.a("");
imageView = null;
}
imageView.setImageDrawable(drawable);
}
public final void setTextView(TextView textView) {
C14957gcv.e(textView, "");
this.textView = textView;
}
public final void setImageView(ImageView imageView) {
C14957gcv.e(imageView, "");
this.imageView = imageView;
}
}