135 lines
4.0 KiB
Java
135 lines
4.0 KiB
Java
|
package com.scb.phone.view.custom.easycash;
|
||
|
|
||
|
import android.content.Context;
|
||
|
import android.content.res.TypedArray;
|
||
|
import android.util.AttributeSet;
|
||
|
import android.view.LayoutInflater;
|
||
|
import android.view.View;
|
||
|
import android.view.ViewGroup;
|
||
|
import android.widget.ImageView;
|
||
|
import android.widget.LinearLayout;
|
||
|
import android.widget.TextView;
|
||
|
import butterknife.BindView;
|
||
|
import butterknife.ButterKnife;
|
||
|
import com.scb.phone.R;
|
||
|
import com.scb.phone.view.custom.easycash.CustomTileToggle;
|
||
|
import o.C15715hv;
|
||
|
import o.Tlu;
|
||
|
import o.nMh;
|
||
|
|
||
|
/* loaded from: classes5.dex */
|
||
|
public class CustomTileToggle extends LinearLayout {
|
||
|
private int b;
|
||
|
public View c;
|
||
|
private HBt e;
|
||
|
|
||
|
@BindView
|
||
|
public LinearLayout leftTile;
|
||
|
|
||
|
@BindView
|
||
|
ImageView leftTileIcon;
|
||
|
|
||
|
@BindView
|
||
|
TextView leftTileTitle;
|
||
|
|
||
|
@BindView
|
||
|
public LinearLayout rightTile;
|
||
|
|
||
|
@BindView
|
||
|
ImageView rightTileIcon;
|
||
|
|
||
|
@BindView
|
||
|
TextView rightTileTitle;
|
||
|
|
||
|
/* loaded from: classes5.dex */
|
||
|
public interface HBt {
|
||
|
void d(int i, View view);
|
||
|
}
|
||
|
|
||
|
public CustomTileToggle(Context context) {
|
||
|
this(context, null);
|
||
|
}
|
||
|
|
||
|
public CustomTileToggle(Context context, AttributeSet attributeSet) {
|
||
|
this(context, attributeSet, 0);
|
||
|
}
|
||
|
|
||
|
public CustomTileToggle(Context context, AttributeSet attributeSet, int i) {
|
||
|
super(context, attributeSet, i);
|
||
|
this.b = -1;
|
||
|
this.c = null;
|
||
|
((LayoutInflater) context.getSystemService("layout_inflater")).inflate(R.layout.2131559375, (ViewGroup) this, true);
|
||
|
ButterKnife.c(this);
|
||
|
TypedArray obtainStyledAttributes = context.obtainStyledAttributes(attributeSet, C15715hv.jbe.CustomTileToggle, 0, 0);
|
||
|
try {
|
||
|
this.leftTileIcon.setImageResource(obtainStyledAttributes.getResourceId(0, 0));
|
||
|
this.rightTileIcon.setImageResource(obtainStyledAttributes.getResourceId(2, 0));
|
||
|
this.leftTileTitle.setText(obtainStyledAttributes.getString(1));
|
||
|
this.rightTileTitle.setText(obtainStyledAttributes.getString(3));
|
||
|
} finally {
|
||
|
obtainStyledAttributes.recycle();
|
||
|
}
|
||
|
}
|
||
|
|
||
|
public void setTextSize(float f) {
|
||
|
this.leftTileTitle.setTextSize(f);
|
||
|
this.rightTileTitle.setTextSize(f);
|
||
|
}
|
||
|
|
||
|
public void setTextSize(int i, float f) {
|
||
|
this.leftTileTitle.setTextSize(i, f);
|
||
|
this.rightTileTitle.setTextSize(i, f);
|
||
|
}
|
||
|
|
||
|
public final void a(HBt hBt) {
|
||
|
this.e = hBt;
|
||
|
this.leftTile.setOnClickListener(new View.OnClickListener(this) { // from class: o.eDc
|
||
|
private CustomTileToggle b;
|
||
|
|
||
|
@Override // android.view.View.OnClickListener
|
||
|
public final void onClick(View view) {
|
||
|
this.b.a(view);
|
||
|
}
|
||
|
|
||
|
{
|
||
|
this.b = this;
|
||
|
}
|
||
|
});
|
||
|
this.rightTile.setOnClickListener(new View.OnClickListener(this) { // from class: o.eDc
|
||
|
private CustomTileToggle b;
|
||
|
|
||
|
@Override // android.view.View.OnClickListener
|
||
|
public final void onClick(View view) {
|
||
|
this.b.a(view);
|
||
|
}
|
||
|
|
||
|
{
|
||
|
this.b = this;
|
||
|
}
|
||
|
});
|
||
|
}
|
||
|
|
||
|
public final void a(View view) {
|
||
|
int i;
|
||
|
if (view.equals(this.leftTile)) {
|
||
|
i = 0;
|
||
|
} else {
|
||
|
i = view.equals(this.rightTile) ? 1 : -1;
|
||
|
}
|
||
|
if (this.b != i) {
|
||
|
View view2 = this.c;
|
||
|
if (view2 != null) {
|
||
|
view2.setBackground(nMh.getDrawable(getContext(), R.drawable.bg_white_rounded));
|
||
|
}
|
||
|
this.c = view;
|
||
|
view.setBackground(nMh.getDrawable(getContext(), R.drawable.rounded_purple_view_pager));
|
||
|
this.e.d(i, view);
|
||
|
}
|
||
|
}
|
||
|
|
||
|
public void setDisabledAppearanceLeftTile() {
|
||
|
this.leftTileTitle.setTextColor(nMh.getColor(getContext(), R.color.f3412131099849));
|
||
|
Tlu.pE_(this.leftTileIcon.getDrawable().mutate(), nMh.getColor(getContext(), R.color.f3412131099849));
|
||
|
}
|
||
|
}
|