103 lines
3.7 KiB
Java
103 lines
3.7 KiB
Java
package com.scb.phone.view.custom.cardmanagement;
|
|
|
|
import android.content.Context;
|
|
import android.text.SpannableString;
|
|
import android.text.TextPaint;
|
|
import android.text.method.LinkMovementMethod;
|
|
import android.text.style.ClickableSpan;
|
|
import android.util.AttributeSet;
|
|
import android.view.LayoutInflater;
|
|
import android.view.View;
|
|
import android.view.ViewGroup;
|
|
import android.widget.CheckBox;
|
|
import android.widget.LinearLayout;
|
|
import android.widget.TextView;
|
|
import butterknife.BindView;
|
|
import butterknife.ButterKnife;
|
|
import butterknife.OnClick;
|
|
import com.scb.phone.R;
|
|
import o.InterfaceC10303eAL;
|
|
import o.eAO;
|
|
import o.nMh;
|
|
|
|
/* loaded from: classes5.dex */
|
|
public class TermsAndConditionsView extends LinearLayout {
|
|
eAO a;
|
|
InterfaceC10303eAL d;
|
|
|
|
@BindView
|
|
public CheckBox termsCheckBox;
|
|
|
|
@BindView
|
|
TextView txvTermsAndConditions;
|
|
|
|
public TermsAndConditionsView(Context context, AttributeSet attributeSet) {
|
|
super(context, attributeSet);
|
|
((LayoutInflater) context.getSystemService("layout_inflater")).inflate(R.layout.2131560133, (ViewGroup) this, true);
|
|
ButterKnife.c(this);
|
|
SpannableString spannableString = new SpannableString(getContext().getResources().getString(R.string.agree_to_label));
|
|
spannableString.setSpan(new ClickableSpan(this) { // from class: com.scb.phone.view.custom.cardmanagement.TermsAndConditionsView.4
|
|
private TermsAndConditionsView a;
|
|
|
|
{
|
|
this.a = this;
|
|
}
|
|
|
|
@Override // android.text.style.ClickableSpan
|
|
public final void onClick(View view) {
|
|
this.a.termsCheckBox.toggle();
|
|
if (this.a.a != null) {
|
|
this.a.a.c(this.a.termsCheckBox.isChecked());
|
|
}
|
|
}
|
|
|
|
@Override // android.text.style.ClickableSpan, android.text.style.CharacterStyle
|
|
public final void updateDrawState(TextPaint textPaint) {
|
|
textPaint.setUnderlineText(false);
|
|
textPaint.setColor(nMh.getColor(this.a.getContext(), R.color.f2272131099733));
|
|
}
|
|
}, 0, spannableString.length(), 33);
|
|
this.txvTermsAndConditions.setText(spannableString);
|
|
SpannableString spannableString2 = new SpannableString(getContext().getResources().getString(R.string.terms_and_conditions));
|
|
spannableString2.setSpan(new ClickableSpan(this) { // from class: com.scb.phone.view.custom.cardmanagement.TermsAndConditionsView.2
|
|
private TermsAndConditionsView d;
|
|
|
|
{
|
|
this.d = this;
|
|
}
|
|
|
|
@Override // android.text.style.ClickableSpan
|
|
public final void onClick(View view) {
|
|
if (this.d.d != null) {
|
|
this.d.d.j();
|
|
}
|
|
}
|
|
|
|
@Override // android.text.style.ClickableSpan, android.text.style.CharacterStyle
|
|
public final void updateDrawState(TextPaint textPaint) {
|
|
textPaint.setUnderlineText(true);
|
|
textPaint.setColor(nMh.getColor(this.d.getContext(), R.color.f13682131100876));
|
|
}
|
|
}, 0, spannableString2.length(), 33);
|
|
this.txvTermsAndConditions.append(spannableString2);
|
|
this.txvTermsAndConditions.setMovementMethod(LinkMovementMethod.getInstance());
|
|
this.txvTermsAndConditions.setHighlightColor(0);
|
|
}
|
|
|
|
@OnClick
|
|
public void onCheckBoxClick() {
|
|
eAO eao = this.a;
|
|
if (eao != null) {
|
|
eao.c(this.termsCheckBox.isChecked());
|
|
}
|
|
}
|
|
|
|
public void setTermsCheckboxListener(eAO eao) {
|
|
this.a = eao;
|
|
}
|
|
|
|
public void setTermsAndConditionsListener(InterfaceC10303eAL interfaceC10303eAL) {
|
|
this.d = interfaceC10303eAL;
|
|
}
|
|
}
|