215 lines
7.6 KiB
Java
215 lines
7.6 KiB
Java
|
package com.scb.phone.view.fragment.ccrredemption.mileage;
|
||
|
|
||
|
import android.content.Intent;
|
||
|
import android.os.Bundle;
|
||
|
import android.text.Editable;
|
||
|
import android.text.InputFilter;
|
||
|
import android.view.LayoutInflater;
|
||
|
import android.view.View;
|
||
|
import android.view.ViewGroup;
|
||
|
import android.widget.EditText;
|
||
|
import android.widget.TextView;
|
||
|
import butterknife.BindView;
|
||
|
import butterknife.ButterKnife;
|
||
|
import butterknife.OnClick;
|
||
|
import butterknife.OnFocusChange;
|
||
|
import butterknife.OnTextChanged;
|
||
|
import com.scb.phone.R;
|
||
|
import com.scb.phone.view.activity.ccrredemption.mileage.MileageReviewRedemptionActivity;
|
||
|
import com.scb.phone.view.custom.common.DefaultButton;
|
||
|
import o.C0469Hf;
|
||
|
import o.C3171asV;
|
||
|
import o.InterfaceC13391fZD;
|
||
|
import o.InterfaceC9038dcF;
|
||
|
import o.ZI;
|
||
|
import o.nMh;
|
||
|
|
||
|
/* loaded from: classes5.dex */
|
||
|
public class MileageAirlineMembershipDetailsFragment extends Hilt_MileageAirlineMembershipDetailsFragment implements InterfaceC9038dcF {
|
||
|
|
||
|
@BindView
|
||
|
DefaultButton btnReview;
|
||
|
|
||
|
@BindView
|
||
|
EditText edtLastName;
|
||
|
|
||
|
@BindView
|
||
|
EditText edtMembershipId;
|
||
|
private C0469Hf f;
|
||
|
|
||
|
@InterfaceC13391fZD
|
||
|
public C3171asV presenter;
|
||
|
|
||
|
@BindView
|
||
|
TextView txvLastNameError;
|
||
|
|
||
|
@BindView
|
||
|
TextView txvMembershipIdError;
|
||
|
private String d = "";
|
||
|
private String c = "";
|
||
|
|
||
|
@Override // androidx.fragment.app.Fragment
|
||
|
public View onCreateView(LayoutInflater layoutInflater, ViewGroup viewGroup, Bundle bundle) {
|
||
|
View inflate = layoutInflater.inflate(R.layout.2131559452, viewGroup, false);
|
||
|
ButterKnife.c(this, inflate);
|
||
|
this.btnReview.setButtonEnabled(false);
|
||
|
this.edtLastName.setFilters(new InputFilter[]{new InputFilter.AllCaps(), new InputFilter.LengthFilter(5)});
|
||
|
this.edtLastName.setInputType(524432);
|
||
|
this.edtMembershipId.setFilters(new InputFilter[]{new InputFilter.AllCaps(), new InputFilter.LengthFilter(40)});
|
||
|
this.edtMembershipId.setInputType(524432);
|
||
|
C0469Hf c0469Hf = (C0469Hf) getActivity().getIntent().getParcelableExtra("MileageAirlineMembershipDetailsActivity.MILEAGE_REDEMPTION_DTO_EXTRA");
|
||
|
this.f = c0469Hf;
|
||
|
if (c0469Hf.c) {
|
||
|
this.btnReview.setText(getResources().getString(R.string.redeem));
|
||
|
}
|
||
|
this.presenter.e((C3171asV) this);
|
||
|
return inflate;
|
||
|
}
|
||
|
|
||
|
/* JADX INFO: Access modifiers changed from: protected */
|
||
|
@OnTextChanged
|
||
|
public void membershipIdTextChange(Editable editable) {
|
||
|
String obj = editable.toString();
|
||
|
this.d = obj;
|
||
|
C3171asV c3171asV = this.presenter;
|
||
|
if (!obj.isEmpty() && !C3171asV.c(obj)) {
|
||
|
ZI.IeS ieS = new ZI.IeS() { // from class: o.asY
|
||
|
@Override // o.ZI.IeS
|
||
|
public final void e(Object obj2) {
|
||
|
((InterfaceC9038dcF) obj2).c();
|
||
|
}
|
||
|
};
|
||
|
if (c3171asV.f != 0) {
|
||
|
ieS.e(c3171asV.f);
|
||
|
}
|
||
|
} else {
|
||
|
ZI.IeS ieS2 = new ZI.IeS() { // from class: o.asX
|
||
|
@Override // o.ZI.IeS
|
||
|
public final void e(Object obj2) {
|
||
|
((InterfaceC9038dcF) obj2).d();
|
||
|
}
|
||
|
};
|
||
|
if (c3171asV.f != 0) {
|
||
|
ieS2.e(c3171asV.f);
|
||
|
}
|
||
|
}
|
||
|
this.btnReview.setButtonEnabled(this.presenter.d(this.d, this.c));
|
||
|
}
|
||
|
|
||
|
/* JADX INFO: Access modifiers changed from: protected */
|
||
|
@OnTextChanged
|
||
|
public void lastNameTextChange(Editable editable) {
|
||
|
String obj = editable.toString();
|
||
|
this.c = obj;
|
||
|
C3171asV c3171asV = this.presenter;
|
||
|
if (!obj.isEmpty() && !C3171asV.e(obj)) {
|
||
|
ZI.IeS ieS = new ZI.IeS() { // from class: o.atb
|
||
|
@Override // o.ZI.IeS
|
||
|
public final void e(Object obj2) {
|
||
|
((InterfaceC9038dcF) obj2).e();
|
||
|
}
|
||
|
};
|
||
|
if (c3171asV.f != 0) {
|
||
|
ieS.e(c3171asV.f);
|
||
|
}
|
||
|
} else {
|
||
|
ZI.IeS ieS2 = new ZI.IeS() { // from class: o.atd
|
||
|
@Override // o.ZI.IeS
|
||
|
public final void e(Object obj2) {
|
||
|
((InterfaceC9038dcF) obj2).b();
|
||
|
}
|
||
|
};
|
||
|
if (c3171asV.f != 0) {
|
||
|
ieS2.e(c3171asV.f);
|
||
|
}
|
||
|
}
|
||
|
this.btnReview.setButtonEnabled(this.presenter.d(this.d, this.c));
|
||
|
}
|
||
|
|
||
|
@Override // o.InterfaceC9038dcF
|
||
|
public final void c() {
|
||
|
this.txvMembershipIdError.setVisibility(0);
|
||
|
this.edtMembershipId.setBackground(nMh.getDrawable(getActivity(), R.drawable.shape_red_reounded_reactangle_border));
|
||
|
}
|
||
|
|
||
|
@Override // o.InterfaceC9038dcF
|
||
|
public final void e() {
|
||
|
this.txvLastNameError.setVisibility(0);
|
||
|
this.edtLastName.setBackground(nMh.getDrawable(getActivity(), R.drawable.shape_red_reounded_reactangle_border));
|
||
|
}
|
||
|
|
||
|
@Override // o.InterfaceC9038dcF
|
||
|
public final void d() {
|
||
|
this.txvMembershipIdError.setVisibility(8);
|
||
|
this.edtMembershipId.setBackground(nMh.getDrawable(getActivity(), R.drawable.bg_button_fake_white_with_purple_border_rounded));
|
||
|
}
|
||
|
|
||
|
@Override // o.InterfaceC9038dcF
|
||
|
public final void b() {
|
||
|
this.txvLastNameError.setVisibility(8);
|
||
|
this.edtLastName.setBackground(nMh.getDrawable(getActivity(), R.drawable.bg_button_fake_white_with_purple_border_rounded));
|
||
|
}
|
||
|
|
||
|
/* JADX INFO: Access modifiers changed from: protected */
|
||
|
@OnFocusChange
|
||
|
public void onMembershipIdFocusChange() {
|
||
|
if (this.edtMembershipId.hasFocus()) {
|
||
|
if (this.d.isEmpty() || C3171asV.c(this.d)) {
|
||
|
this.edtMembershipId.setBackground(nMh.getDrawable(getActivity(), R.drawable.bg_button_fake_white_with_purple_border_rounded));
|
||
|
return;
|
||
|
}
|
||
|
return;
|
||
|
}
|
||
|
if (this.d.isEmpty() || C3171asV.c(this.d)) {
|
||
|
this.edtMembershipId.setBackground(nMh.getDrawable(getActivity(), R.drawable.shape_gray_rounded_rectangle));
|
||
|
}
|
||
|
}
|
||
|
|
||
|
/* JADX INFO: Access modifiers changed from: protected */
|
||
|
@OnFocusChange
|
||
|
public void onLastNameFocusChange() {
|
||
|
if (this.edtLastName.hasFocus()) {
|
||
|
if (this.c.isEmpty() || C3171asV.e(this.c)) {
|
||
|
this.edtLastName.setBackground(nMh.getDrawable(getActivity(), R.drawable.bg_button_fake_white_with_purple_border_rounded));
|
||
|
return;
|
||
|
}
|
||
|
return;
|
||
|
}
|
||
|
if (this.c.isEmpty() || C3171asV.e(this.c)) {
|
||
|
this.edtLastName.setBackground(nMh.getDrawable(getActivity(), R.drawable.shape_gray_rounded_rectangle));
|
||
|
}
|
||
|
}
|
||
|
|
||
|
@Override // com.scb.phone.view.fragment.BaseFragment, androidx.fragment.app.Fragment
|
||
|
public void onActivityResult(int i, int i2, Intent intent) {
|
||
|
if (i == 105 && intent != null) {
|
||
|
getActivity().setResult(-1, intent);
|
||
|
getActivity().finish();
|
||
|
}
|
||
|
super.onActivityResult(i, i2, intent);
|
||
|
}
|
||
|
|
||
|
/* JADX INFO: Access modifiers changed from: package-private */
|
||
|
@OnClick
|
||
|
public void onReviewClick() {
|
||
|
C3171asV c3171asV = this.presenter;
|
||
|
ZI.IeS ieS = new ZI.IeS() { // from class: o.asT
|
||
|
@Override // o.ZI.IeS
|
||
|
public final void e(Object obj) {
|
||
|
((InterfaceC9038dcF) obj).a();
|
||
|
}
|
||
|
};
|
||
|
if (c3171asV.f != 0) {
|
||
|
ieS.e(c3171asV.f);
|
||
|
}
|
||
|
}
|
||
|
|
||
|
@Override // o.InterfaceC9038dcF
|
||
|
public final void a() {
|
||
|
C0469Hf c0469Hf = this.f;
|
||
|
c0469Hf.g = this.d;
|
||
|
c0469Hf.d = this.c;
|
||
|
startActivityForResult(MileageReviewRedemptionActivity.ZR_(getActivity(), this.f), 105);
|
||
|
}
|
||
|
}
|