what-the-bank/sources/com/scb/phone/view/custom/transferandpay/CustomFavoriteHeaderSection...

134 lines
4.0 KiB
Java
Raw Permalink Normal View History

2024-07-27 18:17:47 +07:00
package com.scb.phone.view.custom.transferandpay;
import android.content.Context;
import android.content.res.TypedArray;
import android.os.Parcel;
import android.os.Parcelable;
import android.util.AttributeSet;
import android.view.View;
import android.widget.ImageView;
import android.widget.LinearLayout;
import android.widget.TextView;
import butterknife.BindView;
import butterknife.ButterKnife;
import butterknife.OnClick;
import com.scb.phone.R;
import o.C15715hv;
/* loaded from: classes5.dex */
public class CustomFavoriteHeaderSection extends LinearLayout {
private String c;
private View.OnClickListener d;
@BindView
ImageView mImageButton;
@BindView
TextView textTitle;
public CustomFavoriteHeaderSection(Context context) {
super(context);
inflate(getContext(), R.layout.2131559025, this);
ButterKnife.c(this);
aqb_(null);
setTitle(this.c);
}
public CustomFavoriteHeaderSection(Context context, AttributeSet attributeSet) {
super(context, attributeSet);
inflate(getContext(), R.layout.2131559025, this);
ButterKnife.c(this);
aqb_(attributeSet);
setTitle(this.c);
}
public CustomFavoriteHeaderSection(Context context, AttributeSet attributeSet, int i) {
super(context, attributeSet, i);
inflate(getContext(), R.layout.2131559025, this);
ButterKnife.c(this);
aqb_(attributeSet);
setTitle(this.c);
}
@Override // android.view.View
protected Parcelable onSaveInstanceState() {
RVV rvv = new RVV(super.onSaveInstanceState());
rvv.e = this.c;
return rvv;
}
@Override // android.view.View
protected void onRestoreInstanceState(Parcelable parcelable) {
if (!(parcelable instanceof RVV)) {
super.onRestoreInstanceState(parcelable);
return;
}
RVV rvv = (RVV) parcelable;
super.onRestoreInstanceState(rvv.getSuperState());
String str = rvv.e;
this.c = str;
setTitle(str);
}
@OnClick
public void onEditButtonClick(View view) {
View.OnClickListener onClickListener = this.d;
if (onClickListener != null) {
onClickListener.onClick(view);
}
}
private void aqb_(AttributeSet attributeSet) {
if (attributeSet == null) {
return;
}
TypedArray obtainStyledAttributes = getContext().obtainStyledAttributes(attributeSet, C15715hv.jbe.CustomFavoriteHeaderSection, 0, 0);
this.c = obtainStyledAttributes.getString(0);
obtainStyledAttributes.recycle();
}
public void setTitle(String str) {
this.textTitle.setText(str);
}
public void setButton(boolean z) {
this.mImageButton.setVisibility(z ? 0 : 4);
}
/* loaded from: classes5.dex */
static class RVV extends View.BaseSavedState {
public static final Parcelable.Creator<RVV> CREATOR = new Parcelable.Creator<RVV>() { // from class: com.scb.phone.view.custom.transferandpay.CustomFavoriteHeaderSection.RVV.3
@Override // android.os.Parcelable.Creator
public final /* synthetic */ RVV createFromParcel(Parcel parcel) {
return new RVV(parcel);
}
@Override // android.os.Parcelable.Creator
public final /* bridge */ /* synthetic */ RVV[] newArray(int i) {
return new RVV[i];
}
};
String e;
RVV(Parcelable parcelable) {
super(parcelable);
}
RVV(Parcel parcel) {
super(parcel);
this.e = parcel.readString();
}
@Override // android.view.View.BaseSavedState, android.view.AbsSavedState, android.os.Parcelable
public final void writeToParcel(Parcel parcel, int i) {
super.writeToParcel(parcel, i);
parcel.writeString(this.e);
}
}
@Override // android.view.View
public void setOnClickListener(View.OnClickListener onClickListener) {
this.d = onClickListener;
}
}