what-the-bank/sources/com/scb/phone/view/fragment/investment/redeem/TransactionsTabFragment.java

198 lines
6.8 KiB
Java
Raw Permalink Normal View History

2024-07-27 18:17:47 +07:00
package com.scb.phone.view.fragment.investment.redeem;
import android.content.DialogInterface;
import android.content.Intent;
import android.content.IntentFilter;
import android.os.Bundle;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.ImageView;
import android.widget.RelativeLayout;
import android.widget.TextView;
import androidx.fragment.app.FragmentActivity;
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.activity.BaseActivity;
import com.scb.phone.view.adapter.investment.InvestmentDetailsTransactionAdapter;
import com.scb.phone.view.custom.common.CustomDialog;
import com.scb.phone.view.fragment.BaseFragment;
import com.scb.phone.view.fragment.investment.redeem.TransactionsTabFragment;
import java.util.List;
import o.AbstractC3737bFP;
import o.C12914fKz;
import o.C17809ztu;
import o.OM;
import o.cZG;
import o.fIB;
import o.fSQ;
import o.gjJ;
import o.glR;
/* loaded from: classes5.dex */
public abstract class TransactionsTabFragment extends BaseFragment implements cZG.tOB, fIB {
@BindView
RelativeLayout mContainerRelativeLayout;
@BindView
TextView mEmptyCenterTitle;
@BindView
TextView mEmptyDescription;
@BindView
ImageView mEmptyImage;
@BindView
TextView mEmptyTitle;
@BindView
RecyclerView mRecyclerView;
@BindView
TextView mShowMessages;
protected abstract AbstractC3737bFP f();
protected abstract String i();
@Override // androidx.fragment.app.Fragment
public View onCreateView(LayoutInflater layoutInflater, ViewGroup viewGroup, Bundle bundle) {
View inflate = layoutInflater.inflate(R.layout.2131559734, viewGroup, false);
ButterKnife.c(this, inflate);
f().e((AbstractC3737bFP) this);
getContext();
this.mRecyclerView.setLayoutManager(new LinearLayoutManager(1, false));
this.mRecyclerView.setNestedScrollingEnabled(false);
((BaseFragment) this).b = glR.Ge_(getContext(), new IntentFilter("com.scb.phone/BROADCAST_INVESTMENT_DETAILS")).subscribe(new fSQ(this) { // from class: o.fiE
private TransactionsTabFragment c;
@Override // o.fSQ
public final void c(Object obj) {
TransactionsTabFragment.b(this.c);
}
{
this.c = this;
}
}, new fSQ() { // from class: o.fiJ
@Override // o.fSQ
public final void c(Object obj) {
guQ.a((Throwable) obj);
}
});
return inflate;
}
@Override // o.cZG.tOB
public final void b(List<OM> list) {
this.mRecyclerView.setVisibility(0);
this.mRecyclerView.setAdapter(new InvestmentDetailsTransactionAdapter(getContext(), list, this));
}
@Override // com.scb.phone.view.fragment.BaseFragment, androidx.fragment.app.Fragment
public void onDestroy() {
f().w_();
super.onDestroy();
}
@Override // o.cZG.tOB
public final void b() {
this.mEmptyTitle.setVisibility(8);
this.mEmptyCenterTitle.setVisibility(0);
this.mEmptyCenterTitle.setText(i());
this.mEmptyDescription.setVisibility(8);
this.mContainerRelativeLayout.setVisibility(0);
this.mShowMessages.setVisibility(8);
this.mRecyclerView.setVisibility(8);
this.mEmptyImage.setVisibility(8);
}
@Override // com.scb.phone.view.fragment.BaseFragment, o.InterfaceC6638cYp
public final void v() {
this.mContainerRelativeLayout.setVisibility(8);
this.mShowMessages.setVisibility(8);
this.mRecyclerView.setVisibility(8);
super.v();
}
@Override // o.fIB
public final void d(final int i) {
CustomDialog c = CustomDialog.b(getContext()).c(R.string.investment_transaction_fund_cancel_title);
String string = getString(R.string.investment_transaction_fund_cancel_description);
if (gjJ.a(string)) {
c.mTextTextView.setVisibility(0);
c.mTextTextView.setText(string);
}
((CustomDialog) CustomDialog.e(new Object[]{c.aoT_(R.string.delete, new DialogInterface.OnClickListener(this, i) { // from class: o.fiD
private TransactionsTabFragment c;
private int e;
@Override // android.content.DialogInterface.OnClickListener
public final void onClick(DialogInterface dialogInterface, int i2) {
this.c.f().a(this.e);
}
{
this.c = this;
this.e = i;
}
}), Integer.valueOf(R.string.permission_deny), new DialogInterface.OnClickListener() { // from class: o.fiB
@Override // android.content.DialogInterface.OnClickListener
public final void onClick(DialogInterface dialogInterface, int i2) {
dialogInterface.dismiss();
}
}})).show();
}
@Override // o.cZG.tOB
public final void c() {
FragmentActivity activity = getActivity();
if (!getUserVisibleHint() || activity == null) {
return;
}
C12914fKz.e(new Object[]{activity, Integer.valueOf(R.id.view_group_root), Integer.valueOf(R.drawable.ic_check_circle_white_24dp), getString(R.string.fund_cancel_success_message), Integer.valueOf(R.color.f13832131100891)}, 1259223802, -1259223796, R.id.view_group_root);
}
@Override // o.cZG.tOB
public final void a(String str) {
FragmentActivity activity = getActivity();
if (!getUserVisibleHint() || activity == null) {
return;
}
C12914fKz.e(new Object[]{activity, Integer.valueOf(R.id.view_group_root), Integer.valueOf(R.drawable.ic_error_white_24dp), str, Integer.valueOf(R.color.f2852131099792)}, 1259223802, -1259223796, R.id.view_group_root);
}
@Override // o.cZG.tOB
public final void e() {
if (getActivity() != null) {
((BaseActivity) getActivity()).a(new BaseActivity.IeS(this) { // from class: o.fiI
private TransactionsTabFragment c;
@Override // com.scb.phone.view.activity.BaseActivity.IeS
public final void e() {
C10457eEr.aqd_(this.c, new Intent("com.scb.phone/BROADCAST_HOME_ACTIVITY_REFRESH"));
}
{
this.c = this;
}
});
}
}
public static /* synthetic */ void b(TransactionsTabFragment transactionsTabFragment) {
AbstractC3737bFP f = transactionsTabFragment.f();
if (f.f != 0) {
f.f.v();
}
f.c.a();
C17809ztu c17809ztu = f.c;
c17809ztu.d(c17809ztu.i, new AbstractC3737bFP.IeS(f, (byte) 0));
}
}