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

193 lines
7.2 KiB
Java

package com.scb.phone.view.custom.common;
import android.content.Context;
import android.content.res.TypedArray;
import android.graphics.Typeface;
import android.graphics.drawable.Drawable;
import android.text.TextUtils;
import android.util.AttributeSet;
import android.view.LayoutInflater;
import android.view.ViewGroup;
import android.widget.ProgressBar;
import android.widget.RelativeLayout;
import android.widget.TextView;
import androidx.constraintlayout.widget.ConstraintLayout;
import butterknife.BindView;
import butterknife.ButterKnife;
import com.scb.phone.R;
import o.C15715hv;
import o.C6583cXR;
import o.nMh;
/* loaded from: classes5.dex */
public class CustomHorizontalProgressBar extends RelativeLayout {
private int a;
private int b;
private String c;
private int d;
private int e;
private int f;
private Drawable g;
private Context h;
private String i;
private int j;
private String k;
private String l;
private int m;
@BindView
TextView mAvailableTitleTextView;
@BindView
TextView mAvailableValueTextView;
@BindView
ProgressBar mProgressBar;
@BindView
public ConstraintLayout mTotalContainerLinearLayout;
@BindView
TextView mTotalTitleTextView;
@BindView
TextView mTotalValueTextView;
@BindView
TextView mUsedTitleTextView;
@BindView
TextView mUsedValueTextView;
private int n;
/* renamed from: o, reason: collision with root package name */
private int f8019o;
private int p;
private int r;
private int s;
public CustomHorizontalProgressBar(Context context, AttributeSet attributeSet) {
super(context, attributeSet);
this.h = context;
TypedArray obtainStyledAttributes = context.obtainStyledAttributes(attributeSet, C15715hv.jbe.CustomHorizontalProgressBar, 0, 0);
this.n = obtainStyledAttributes.getColor(13, nMh.getColor(context, R.color.f3092131099816));
this.r = obtainStyledAttributes.getColor(15, nMh.getColor(context, R.color.f13682131100876));
this.b = obtainStyledAttributes.getColor(1, nMh.getColor(context, R.color.f3092131099816));
this.d = obtainStyledAttributes.getColor(3, nMh.getColor(context, R.color.f2272131099733));
this.j = obtainStyledAttributes.getColor(7, nMh.getColor(context, R.color.f3092131099816));
this.f8019o = obtainStyledAttributes.getColor(9, nMh.getColor(context, R.color.f3092131099816));
this.s = obtainStyledAttributes.getDimensionPixelSize(14, context.getResources().getDimensionPixelSize(R.dimen.f16082131165374));
this.p = obtainStyledAttributes.getDimensionPixelSize(16, context.getResources().getDimensionPixelSize(R.dimen.f16092131165375));
this.a = obtainStyledAttributes.getDimensionPixelSize(2, context.getResources().getDimensionPixelSize(R.dimen.f16082131165374));
this.e = obtainStyledAttributes.getDimensionPixelSize(4, context.getResources().getDimensionPixelSize(R.dimen.f16092131165375));
this.f = obtainStyledAttributes.getDimensionPixelSize(8, context.getResources().getDimensionPixelSize(R.dimen.f16072131165373));
this.m = obtainStyledAttributes.getDimensionPixelSize(11, context.getResources().getDimensionPixelSize(R.dimen.f16082131165374));
this.g = obtainStyledAttributes.getDrawable(5) != null ? obtainStyledAttributes.getDrawable(5) : nMh.getDrawable(context, R.drawable.card_progress_bar);
this.l = obtainStyledAttributes.getString(12) != null ? obtainStyledAttributes.getString(12) : context.getResources().getString(R.string.account_summary_credit_card_used);
this.c = obtainStyledAttributes.getString(0) != null ? obtainStyledAttributes.getString(0) : context.getResources().getString(R.string.account_summary_credit_card_available);
this.i = obtainStyledAttributes.getString(6) != null ? obtainStyledAttributes.getString(6) : context.getResources().getString(R.string.account_summary_credit_card_total);
this.k = obtainStyledAttributes.getString(10);
obtainStyledAttributes.recycle();
((LayoutInflater) context.getSystemService("layout_inflater")).inflate(R.layout.2131559037, (ViewGroup) this, true);
ButterKnife.c(this);
setView();
}
public void setView() {
this.mAvailableTitleTextView.setTextSize(2, C6583cXR.a(this.a, this.h));
this.mAvailableValueTextView.setTextSize(2, C6583cXR.a(this.e, this.h));
this.mTotalTitleTextView.setTextSize(2, C6583cXR.a(this.f, this.h));
this.mTotalValueTextView.setTextSize(2, C6583cXR.a(this.m, this.h));
this.mUsedTitleTextView.setTextSize(2, C6583cXR.a(this.s, this.h));
this.mUsedValueTextView.setTextSize(2, C6583cXR.a(this.p, this.h));
this.mAvailableTitleTextView.setTextColor(this.b);
this.mAvailableValueTextView.setTextColor(this.d);
this.mTotalTitleTextView.setTextColor(this.j);
this.mTotalValueTextView.setTextColor(this.f8019o);
this.mUsedTitleTextView.setTextColor(this.n);
this.mUsedValueTextView.setTextColor(this.r);
this.mUsedTitleTextView.setText(this.l);
this.mAvailableTitleTextView.setText(this.c);
this.mTotalTitleTextView.setText(this.i);
this.mProgressBar.setProgressDrawable(this.g);
if (TextUtils.isEmpty(this.k)) {
return;
}
this.mTotalValueTextView.setTypeface(Typeface.createFromAsset(getResources().getAssets(), this.k));
}
public void setUsedTitle(String str) {
if (str != null) {
this.mUsedTitleTextView.setText(str);
}
}
public void setUsedValueColor(int i) {
this.mUsedValueTextView.setTextColor(i);
}
public void setUsedValue(String str) {
if (str != null) {
this.mUsedValueTextView.setText(str);
}
}
public void setAvailableTitle(String str) {
if (str != null) {
this.mAvailableTitleTextView.setText(str);
}
}
public void setAvailableValue(String str) {
if (str != null) {
this.mAvailableValueTextView.setText(str);
}
}
public void setTotalTitle(String str) {
if (str != null) {
this.mTotalTitleTextView.setText(str);
}
}
public void setTotalValue(String str) {
if (str != null) {
this.mTotalValueTextView.setText(str);
}
}
public void setTotalValueAllCaps(boolean z) {
this.mTotalValueTextView.setAllCaps(z);
}
public void setUsedTitleAllCaps(boolean z) {
this.mUsedTitleTextView.setAllCaps(z);
}
public void setAvailableTitleAllCaps(boolean z) {
this.mAvailableTitleTextView.setAllCaps(z);
}
public void setProgressBarDrawable(Drawable drawable) {
if (drawable != null) {
this.mProgressBar.setProgressDrawable(drawable);
}
}
public void setProgressBar(int i) {
this.mProgressBar.setProgress(i);
}
public void setVisibilityProgressBar(int i) {
this.mProgressBar.setVisibility(i);
}
public void setSecondaryProgressBar(int i) {
this.mProgressBar.setSecondaryProgress(i);
}
public void setProgressMax(int i) {
this.mProgressBar.setMax(i);
}
}