178 lines
5.3 KiB
Java
178 lines
5.3 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.View;
|
|
import android.view.ViewGroup;
|
|
import android.widget.ImageView;
|
|
import android.widget.TextView;
|
|
import androidx.constraintlayout.widget.ConstraintLayout;
|
|
import butterknife.BindView;
|
|
import butterknife.ButterKnife;
|
|
import com.scb.phone.R;
|
|
import o.C14957gcv;
|
|
import o.C15715hv;
|
|
|
|
/* loaded from: classes5.dex */
|
|
public final class CustomRibbonStatus extends ConstraintLayout {
|
|
private Drawable c;
|
|
private String d;
|
|
private String e;
|
|
|
|
@BindView
|
|
public ImageView ivIcon;
|
|
|
|
@BindView
|
|
public TextView tvAction;
|
|
|
|
@BindView
|
|
public TextView tvContent;
|
|
|
|
/* JADX WARN: 'super' call moved to the top of the method (can break code semantics) */
|
|
public CustomRibbonStatus(Context context) {
|
|
super(context);
|
|
C14957gcv.e(context, "");
|
|
apq_(null);
|
|
}
|
|
|
|
/* JADX WARN: 'super' call moved to the top of the method (can break code semantics) */
|
|
public CustomRibbonStatus(Context context, AttributeSet attributeSet) {
|
|
super(context, attributeSet);
|
|
C14957gcv.e(context, "");
|
|
apq_(attributeSet);
|
|
}
|
|
|
|
/* JADX WARN: 'super' call moved to the top of the method (can break code semantics) */
|
|
public CustomRibbonStatus(Context context, AttributeSet attributeSet, int i) {
|
|
super(context, attributeSet, i);
|
|
C14957gcv.e(context, "");
|
|
apq_(attributeSet);
|
|
}
|
|
|
|
private final void apq_(AttributeSet attributeSet) {
|
|
LayoutInflater.from(getContext()).inflate(R.layout.2131559325, (ViewGroup) this, true);
|
|
ButterKnife.c(this);
|
|
if (attributeSet != null) {
|
|
TypedArray obtainStyledAttributes = getContext().obtainStyledAttributes(attributeSet, C15715hv.jbe.CustomRibbonStatus, 0, 0);
|
|
String str = "";
|
|
C14957gcv.c(obtainStyledAttributes, "");
|
|
try {
|
|
Drawable drawable = getResources().getDrawable(obtainStyledAttributes.getResourceId(2, R.drawable.ic_paid), getContext().getTheme());
|
|
C14957gcv.c(drawable, "");
|
|
this.c = drawable;
|
|
String string = obtainStyledAttributes.getString(1);
|
|
if (string == null) {
|
|
string = "";
|
|
}
|
|
this.e = string;
|
|
String string2 = obtainStyledAttributes.getString(0);
|
|
if (string2 != null) {
|
|
str = string2;
|
|
}
|
|
this.d = str;
|
|
obtainStyledAttributes.recycle();
|
|
e();
|
|
} catch (Throwable th) {
|
|
obtainStyledAttributes.recycle();
|
|
throw th;
|
|
}
|
|
}
|
|
}
|
|
|
|
private final void e() {
|
|
ImageView imageView = this.ivIcon;
|
|
String str = null;
|
|
if (imageView == null) {
|
|
C14957gcv.a("");
|
|
imageView = null;
|
|
}
|
|
Drawable drawable = this.c;
|
|
if (drawable == null) {
|
|
C14957gcv.a("");
|
|
drawable = null;
|
|
}
|
|
imageView.setImageDrawable(drawable);
|
|
TextView textView = this.tvContent;
|
|
if (textView == null) {
|
|
C14957gcv.a("");
|
|
textView = null;
|
|
}
|
|
String str2 = this.e;
|
|
if (str2 == null) {
|
|
C14957gcv.a("");
|
|
str2 = null;
|
|
}
|
|
textView.setText(str2);
|
|
TextView textView2 = this.tvAction;
|
|
if (textView2 == null) {
|
|
C14957gcv.a("");
|
|
textView2 = null;
|
|
}
|
|
String str3 = this.d;
|
|
if (str3 == null) {
|
|
C14957gcv.a("");
|
|
} else {
|
|
str = str3;
|
|
}
|
|
textView2.setText(str);
|
|
}
|
|
|
|
public final void setIcon(Drawable drawable) {
|
|
C14957gcv.e(drawable, "");
|
|
ImageView imageView = this.ivIcon;
|
|
if (imageView == null) {
|
|
C14957gcv.a("");
|
|
imageView = null;
|
|
}
|
|
imageView.setImageDrawable(drawable);
|
|
}
|
|
|
|
public final void setContent(String str) {
|
|
C14957gcv.e(str, "");
|
|
TextView textView = this.tvContent;
|
|
if (textView == null) {
|
|
C14957gcv.a("");
|
|
textView = null;
|
|
}
|
|
textView.setText(str);
|
|
}
|
|
|
|
public final void setAction(String str) {
|
|
C14957gcv.e(str, "");
|
|
TextView textView = this.tvAction;
|
|
if (textView == null) {
|
|
C14957gcv.a("");
|
|
textView = null;
|
|
}
|
|
textView.setText(str);
|
|
}
|
|
|
|
public final void setActionListener(View.OnClickListener onClickListener) {
|
|
C14957gcv.e(onClickListener, "");
|
|
TextView textView = this.tvAction;
|
|
if (textView == null) {
|
|
C14957gcv.a("");
|
|
textView = null;
|
|
}
|
|
textView.setOnClickListener(onClickListener);
|
|
}
|
|
|
|
public final void setTvContent(TextView textView) {
|
|
C14957gcv.e(textView, "");
|
|
this.tvContent = textView;
|
|
}
|
|
|
|
public final void setTvAction(TextView textView) {
|
|
C14957gcv.e(textView, "");
|
|
this.tvAction = textView;
|
|
}
|
|
|
|
public final void setIvIcon(ImageView imageView) {
|
|
C14957gcv.e(imageView, "");
|
|
this.ivIcon = imageView;
|
|
}
|
|
}
|