what-the-bank/sources/com/scb/phone/view/fragment/loan/SmeLoanDetailFragment.java

197 lines
7.5 KiB
Java
Raw Permalink Normal View History

2024-07-27 18:17:47 +07:00
package com.scb.phone.view.fragment.loan;
import android.content.Context;
import android.os.Bundle;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.LinearLayout;
import android.widget.TextView;
import androidx.recyclerview.widget.LinearLayoutManager;
import androidx.recyclerview.widget.RecyclerView;
import butterknife.BindView;
import butterknife.ButterKnife;
import com.scb.phone.R;
import com.scb.phone.view.adapter.loan.SmeLoanDetailCommercialItemAdapter;
import com.scb.phone.view.adapter.loan.SmeLoanDetailLgItemAdapter;
import com.scb.phone.view.adapter.loan.SmeLoanDetailPnItemAdapter;
import com.scb.phone.view.custom.common.CustomBillsToPay;
import com.scb.phone.view.fragment.loan.SmeLoanDetailFragment;
import java.util.Collections;
import java.util.List;
import o.C0385Fj;
import o.C0390Fm;
import o.C0394Fo;
import o.C0395Fp;
import o.C16113lN;
import o.C16148leh;
import o.C4102bPy;
import o.InterfaceC12843fIr;
import o.InterfaceC13391fZD;
import o.InterfaceC8943daQ;
import o.pug;
/* loaded from: classes5.dex */
public class SmeLoanDetailFragment extends Hilt_SmeLoanDetailFragment implements InterfaceC8943daQ.LWm {
private LWm c;
public C0390Fm d;
@BindView
CustomBillsToPay mCustomBillsToPay;
@InterfaceC13391fZD
public C4102bPy mPresenter;
@BindView
LinearLayout mSmeLoanBillToPayLinearLayout;
@BindView
LinearLayout mSmeLoanDetailEmptyStateLinearLayout;
@BindView
TextView mSmeLoanDetailEmptyStateMessageTextView;
@BindView
LinearLayout mSmeLoanDetailListLinearLayout;
@BindView
RecyclerView mSmeLoanDetailRecyclerView;
@BindView
TextView mSmeLoanDetailTotalLabelTextView;
/* loaded from: classes5.dex */
public interface LWm {
void a(C0385Fj c0385Fj);
}
@Override // androidx.fragment.app.Fragment
public View onCreateView(LayoutInflater layoutInflater, ViewGroup viewGroup, Bundle bundle) {
View inflate = layoutInflater.inflate(R.layout.2131559935, viewGroup, false);
ButterKnife.c(this, inflate);
this.mPresenter.e((C4102bPy) this);
return inflate;
}
@Override // o.InterfaceC8943daQ.LWm
public final void b(C0390Fm c0390Fm) {
this.mSmeLoanBillToPayLinearLayout.setVisibility(0);
this.mCustomBillsToPay.setIconDrawable(c0390Fm.d, R.drawable.ic_loan_detail_default);
if (c0390Fm.q) {
this.mCustomBillsToPay.setCompletedTextVisibility(0);
this.mCustomBillsToPay.setDueDateVisibility(8);
this.mCustomBillsToPay.setAmountTitleTextVisibility(8);
this.mCustomBillsToPay.setAmountVisibility(8);
this.mCustomBillsToPay.setCompletedText(c0390Fm.t);
this.mCustomBillsToPay.setPayButtonVisibility(8);
return;
}
this.mCustomBillsToPay.setDueDate(c0390Fm.g);
this.mCustomBillsToPay.setAmountTitle(getString(R.string.amount_due));
this.mCustomBillsToPay.setAmountValue(c0390Fm.i);
this.mCustomBillsToPay.setPayButtonVisibility(0);
this.mCustomBillsToPay.setOnCustomBillsToPayClickListener(new InterfaceC12843fIr(this) { // from class: o.fmz
private SmeLoanDetailFragment e;
@Override // o.InterfaceC12843fIr
public final void c() {
SmeLoanDetailFragment.c(this.e);
}
{
this.e = this;
}
});
this.mCustomBillsToPay.setAmountTitleTextVisibility(0);
this.mCustomBillsToPay.setAmountVisibility(0);
this.mCustomBillsToPay.setDueDateVisibility(0);
this.mCustomBillsToPay.setCompletedTextVisibility(8);
}
@Override // o.InterfaceC8943daQ.LWm
public final void b() {
this.mSmeLoanBillToPayLinearLayout.setVisibility(8);
}
@Override // o.InterfaceC8943daQ.LWm
public final void d() {
this.mSmeLoanDetailEmptyStateLinearLayout.setVisibility(0);
this.mSmeLoanDetailEmptyStateMessageTextView.setText(getString(R.string.sme_loan_detail_empty_note_state_message));
this.mSmeLoanDetailListLinearLayout.setVisibility(8);
}
@Override // o.InterfaceC8943daQ.LWm
public final void e() {
this.mSmeLoanDetailEmptyStateLinearLayout.setVisibility(0);
this.mSmeLoanDetailEmptyStateMessageTextView.setText(getString(R.string.sme_loan_detail_empty_letter_of_guarantee_state_message));
this.mSmeLoanDetailListLinearLayout.setVisibility(8);
}
@Override // o.InterfaceC8943daQ.LWm
public final void a(C0390Fm c0390Fm) {
this.mSmeLoanDetailEmptyStateLinearLayout.setVisibility(8);
this.mSmeLoanDetailListLinearLayout.setVisibility(0);
getContext();
LinearLayoutManager linearLayoutManager = new LinearLayoutManager();
C16148leh c16148leh = new C16148leh(null);
RecyclerView.Sts d = c16148leh.d(new SmeLoanDetailCommercialItemAdapter(getContext(), c16148leh, Collections.singletonList(c0390Fm)));
this.mSmeLoanDetailRecyclerView.setLayoutManager(linearLayoutManager);
this.mSmeLoanDetailRecyclerView.setAdapter(d);
}
@Override // o.InterfaceC8943daQ.LWm
public final void d(List<C0394Fo> list) {
this.mSmeLoanDetailEmptyStateLinearLayout.setVisibility(8);
this.mSmeLoanDetailListLinearLayout.setVisibility(0);
getContext();
LinearLayoutManager linearLayoutManager = new LinearLayoutManager();
C16148leh c16148leh = new C16148leh(null);
RecyclerView.Sts d = c16148leh.d(new SmeLoanDetailPnItemAdapter(getContext(), c16148leh, list));
this.mSmeLoanDetailRecyclerView.setLayoutManager(linearLayoutManager);
this.mSmeLoanDetailRecyclerView.setAdapter(d);
}
@Override // o.InterfaceC8943daQ.LWm
public final void a(List<C0395Fp> list) {
this.mSmeLoanDetailEmptyStateLinearLayout.setVisibility(8);
this.mSmeLoanDetailListLinearLayout.setVisibility(0);
getContext();
LinearLayoutManager linearLayoutManager = new LinearLayoutManager();
C16148leh c16148leh = new C16148leh(null);
RecyclerView.Sts d = c16148leh.d(new SmeLoanDetailLgItemAdapter(getContext(), c16148leh, list));
this.mSmeLoanDetailRecyclerView.setLayoutManager(linearLayoutManager);
this.mSmeLoanDetailRecyclerView.setAdapter(d);
}
@Override // o.InterfaceC8943daQ.LWm
public final void d(String str) {
this.mSmeLoanDetailTotalLabelTextView.setText(getString(R.string.sme_loan_detail_total_label, str));
this.mSmeLoanDetailTotalLabelTextView.setVisibility(0);
}
@Override // o.InterfaceC8943daQ.LWm
public final void c() {
this.mSmeLoanDetailTotalLabelTextView.setVisibility(4);
}
/* JADX WARN: Multi-variable type inference failed */
@Override // com.scb.phone.view.fragment.loan.Hilt_SmeLoanDetailFragment, com.scb.phone.view.fragment.Hilt_BaseFragment, androidx.fragment.app.Fragment
public void onAttach(Context context) {
super.onAttach(context);
if (context instanceof LWm) {
this.c = (LWm) context;
}
}
public static /* synthetic */ void c(SmeLoanDetailFragment smeLoanDetailFragment) {
smeLoanDetailFragment.c("loan_paybutton", new pug("loanproduct", "commercial_loan"));
LWm lWm = smeLoanDetailFragment.c;
if (lWm != null) {
C4102bPy c4102bPy = smeLoanDetailFragment.mPresenter;
C0390Fm c0390Fm = smeLoanDetailFragment.d;
C16113lN c16113lN = c4102bPy.b;
lWm.a(C16113lN.c(c0390Fm));
}
}
}