132 lines
4.8 KiB
Java
132 lines
4.8 KiB
Java
package com.scb.phone.view.fragment.ebillsubscription;
|
|
|
|
import android.content.Intent;
|
|
import android.os.Bundle;
|
|
import android.view.LayoutInflater;
|
|
import android.view.View;
|
|
import android.view.ViewGroup;
|
|
import android.widget.TextView;
|
|
import androidx.core.widget.NestedScrollView;
|
|
import androidx.recyclerview.widget.LinearLayoutManager;
|
|
import androidx.recyclerview.widget.RecyclerView;
|
|
import butterknife.BindView;
|
|
import butterknife.ButterKnife;
|
|
import butterknife.OnClick;
|
|
import com.scb.phone.R;
|
|
import com.scb.phone.view.activity.ebillsubscription.EBillSubscriptionActivity;
|
|
import com.scb.phone.view.activity.ebillsubscription.EBillSubscriptionSearchActivity;
|
|
import com.scb.phone.view.activity.ebillsubscription.RtpEBillSubscriptionDetailActivity;
|
|
import com.scb.phone.view.adapter.ebillsubscription.EBillSubscriptionAdapter;
|
|
import java.util.List;
|
|
import o.C0682Mc;
|
|
import o.C10461eEv;
|
|
import o.C4652beH;
|
|
import o.CeT;
|
|
import o.IaV;
|
|
import o.InterfaceC13391fZD;
|
|
import o.cYS;
|
|
|
|
/* loaded from: classes5.dex */
|
|
public class EBillSubscriptionFragment extends Hilt_EBillSubscriptionFragment implements EBillSubscriptionAdapter.RVV, cYS.HBt {
|
|
private boolean c = false;
|
|
private EBillSubscriptionAdapter d;
|
|
|
|
@InterfaceC13391fZD
|
|
public C4652beH eBillSubscriptionPresenter;
|
|
|
|
@BindView
|
|
TextView noEBillSubscriptionTextView;
|
|
|
|
@BindView
|
|
RecyclerView recyclerView;
|
|
|
|
@BindView
|
|
NestedScrollView scrollView;
|
|
|
|
public static EBillSubscriptionFragment d() {
|
|
return new EBillSubscriptionFragment();
|
|
}
|
|
|
|
@Override // androidx.fragment.app.Fragment
|
|
public View onCreateView(LayoutInflater layoutInflater, ViewGroup viewGroup, Bundle bundle) {
|
|
byte b = 0;
|
|
View inflate = layoutInflater.inflate(R.layout.2131559622, viewGroup, false);
|
|
ButterKnife.c(this, inflate);
|
|
this.eBillSubscriptionPresenter.e((C4652beH) this);
|
|
NestedScrollView nestedScrollView = this.scrollView;
|
|
if (nestedScrollView != null) {
|
|
nestedScrollView.setOnScrollChangeListener(new C10461eEv(this));
|
|
}
|
|
aa();
|
|
C4652beH c4652beH = this.eBillSubscriptionPresenter;
|
|
if (c4652beH.f != 0) {
|
|
c4652beH.f.v();
|
|
}
|
|
c4652beH.a.a();
|
|
IaV iaV = c4652beH.a;
|
|
iaV.d(iaV.i, new C4652beH.IeS(c4652beH, b));
|
|
return inflate;
|
|
}
|
|
|
|
@Override // androidx.fragment.app.Fragment
|
|
public void setUserVisibleHint(boolean z) {
|
|
C4652beH c4652beH;
|
|
super.setUserVisibleHint(z);
|
|
if (!z || (c4652beH = this.eBillSubscriptionPresenter) == null) {
|
|
return;
|
|
}
|
|
c4652beH.a();
|
|
}
|
|
|
|
@OnClick
|
|
public void onButtonNewSubscriptionClick() {
|
|
getActivity().startActivity(new Intent(getActivity(), (Class<?>) EBillSubscriptionSearchActivity.class));
|
|
}
|
|
|
|
@Override // com.scb.phone.view.fragment.BaseFragment
|
|
public final void aJ_() {
|
|
super.aJ_();
|
|
this.eBillSubscriptionPresenter.a();
|
|
}
|
|
|
|
@Override // com.scb.phone.view.adapter.ebillsubscription.EBillSubscriptionAdapter.RVV
|
|
public final void a(int i) {
|
|
List<C0682Mc> list = this.d.c;
|
|
C0682Mc c0682Mc = list != null ? list.get(i) : null;
|
|
Intent intent = new Intent(getContext(), (Class<?>) RtpEBillSubscriptionDetailActivity.class);
|
|
intent.putExtra("com.scb.phone.EXTRA_EBILL_SUBSCRIPTION_ITEM_DISPLAY", c0682Mc);
|
|
startActivityForResult(intent, 6021);
|
|
}
|
|
|
|
@Override // com.scb.phone.view.fragment.BaseFragment, androidx.fragment.app.Fragment
|
|
public void onActivityResult(int i, int i2, Intent intent) {
|
|
EBillSubscriptionActivity eBillSubscriptionActivity;
|
|
C4652beH c4652beH;
|
|
if (i == 6021 && (getActivity() instanceof EBillSubscriptionActivity) && (c4652beH = (eBillSubscriptionActivity = (EBillSubscriptionActivity) getActivity()).eBillSubscriptionPresenter) != null) {
|
|
c4652beH.b();
|
|
eBillSubscriptionActivity.eBillSubscriptionPresenter.a();
|
|
}
|
|
super.onActivityResult(i, i2, intent);
|
|
}
|
|
|
|
@Override // o.cYS.HBt
|
|
public final void c(CeT ceT, List<C0682Mc> list, boolean z) {
|
|
if (this.eBillSubscriptionPresenter.e) {
|
|
this.noEBillSubscriptionTextView.setVisibility(0);
|
|
return;
|
|
}
|
|
EBillSubscriptionAdapter eBillSubscriptionAdapter = this.d;
|
|
if (eBillSubscriptionAdapter == null) {
|
|
this.d = new EBillSubscriptionAdapter(getContext(), list, this);
|
|
getContext();
|
|
this.recyclerView.setLayoutManager(new LinearLayoutManager(1, false));
|
|
this.recyclerView.setNestedScrollingEnabled(false);
|
|
this.recyclerView.setAdapter(this.d);
|
|
this.eBillSubscriptionPresenter.a();
|
|
return;
|
|
}
|
|
eBillSubscriptionAdapter.c.addAll(list);
|
|
eBillSubscriptionAdapter.notifyDataSetChanged();
|
|
}
|
|
}
|