59 lines
2.0 KiB
Java
59 lines
2.0 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.RelativeLayout;
|
||
|
import android.widget.TextView;
|
||
|
import androidx.appcompat.widget.SwitchCompat;
|
||
|
import butterknife.BindView;
|
||
|
import butterknife.ButterKnife;
|
||
|
import com.scb.phone.R;
|
||
|
import o.C15715hv;
|
||
|
import o.nMh;
|
||
|
|
||
|
/* loaded from: classes5.dex */
|
||
|
public class CustomSwitchCell extends RelativeLayout {
|
||
|
private String a;
|
||
|
private int b;
|
||
|
private int c;
|
||
|
private Drawable d;
|
||
|
|
||
|
@BindView
|
||
|
View divider;
|
||
|
private boolean e;
|
||
|
|
||
|
@BindView
|
||
|
View ripple;
|
||
|
|
||
|
@BindView
|
||
|
SwitchCompat switchCompat;
|
||
|
|
||
|
@BindView
|
||
|
TextView text;
|
||
|
|
||
|
public CustomSwitchCell(Context context, AttributeSet attributeSet) {
|
||
|
super(context, attributeSet);
|
||
|
TypedArray obtainStyledAttributes = context.obtainStyledAttributes(attributeSet, C15715hv.jbe.CustomCellOptions, 0, 0);
|
||
|
this.c = obtainStyledAttributes.getColor(5, nMh.getColor(context, R.color.f14042131100912));
|
||
|
this.a = obtainStyledAttributes.getString(4) != null ? obtainStyledAttributes.getString(4) : "";
|
||
|
this.d = obtainStyledAttributes.getDrawable(1) != null ? obtainStyledAttributes.getDrawable(1) : nMh.getDrawable(context, R.drawable.ripple_purple);
|
||
|
this.b = obtainStyledAttributes.getDimensionPixelSize(2, -1);
|
||
|
this.e = obtainStyledAttributes.getBoolean(3, true);
|
||
|
obtainStyledAttributes.recycle();
|
||
|
((LayoutInflater) context.getSystemService("layout_inflater")).inflate(R.layout.2131558940, (ViewGroup) this, true);
|
||
|
ButterKnife.c(this);
|
||
|
this.text.setText(this.a);
|
||
|
this.text.setTextColor(this.c);
|
||
|
this.ripple.setBackground(this.d);
|
||
|
this.ripple.getLayoutParams().height = this.b;
|
||
|
if (this.e) {
|
||
|
this.divider.setVisibility(0);
|
||
|
}
|
||
|
}
|
||
|
}
|