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

95 lines
3.1 KiB
Java
Raw Permalink Normal View History

2024-07-27 18:17:47 +07:00
package com.scb.phone.view.custom.common;
import android.content.Context;
import android.content.res.TypedArray;
import android.text.TextUtils;
import android.util.AttributeSet;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.RelativeLayout;
import android.widget.TextView;
import butterknife.BindView;
import butterknife.ButterKnife;
import com.scb.phone.R;
import o.AQw;
import o.RU;
import o.nMh;
/* loaded from: classes5.dex */
public class CustomMerchantRecentTransaction extends RelativeLayout {
@BindView
public View borderView;
@BindView
TextView dateTextView;
@BindView
TextView valueTextView;
public CustomMerchantRecentTransaction(Context context) {
super(context);
apm_(context, null);
}
public CustomMerchantRecentTransaction(Context context, AttributeSet attributeSet) {
super(context, attributeSet);
apm_(context, attributeSet);
}
public CustomMerchantRecentTransaction(Context context, AttributeSet attributeSet, int i) {
super(context, attributeSet, i);
apm_(context, attributeSet);
}
private void apm_(Context context, AttributeSet attributeSet) {
String str;
boolean z;
int i;
String str2;
LayoutInflater.from(getContext()).inflate(R.layout.2131559276, (ViewGroup) this, true);
ButterKnife.c(this);
int color = nMh.getColor(context, R.color.f3432131099851);
if (attributeSet != null) {
TypedArray obtainStyledAttributes = getContext().getTheme().obtainStyledAttributes(attributeSet, AQw.Sts.RecentTransactionLayout, 0, 0);
str2 = obtainStyledAttributes.getString(0);
str = obtainStyledAttributes.getString(2);
i = obtainStyledAttributes.getColor(3, nMh.getColor(context, R.color.f3432131099851));
z = obtainStyledAttributes.getBoolean(1, false);
obtainStyledAttributes.recycle();
} else {
str = null;
z = false;
i = color;
str2 = null;
}
if (!TextUtils.isEmpty(str2)) {
this.dateTextView.setText(str2);
}
if (!TextUtils.isEmpty(str)) {
this.valueTextView.setText(str);
}
this.valueTextView.setTextColor(i);
View view = this.borderView;
if (view != null) {
view.setVisibility(z ? 0 : 4);
}
}
public void setRecentTransactionDisplay(RU ru) {
String str;
this.dateTextView.setText(ru.j);
if ("C".equalsIgnoreCase(ru.d)) {
this.valueTextView.setTextColor(nMh.getColor(getContext(), R.color.f3432131099851));
str = String.format(getContext().getString(R.string.credit_value), ru.e);
} else if ("D".equalsIgnoreCase(ru.d)) {
this.valueTextView.setTextColor(nMh.getColor(getContext(), R.color.f13582131100866));
str = String.format(getContext().getString(R.string.debit_value), ru.e);
} else {
str = ru.e;
}
this.valueTextView.setText(str);
}
}