what-the-bank/sources/com/scb/phone/view/fragment/investment/funddetails/FundSummaryTabFragment.java

110 lines
4.2 KiB
Java
Raw Permalink Normal View History

2024-07-27 18:17:47 +07:00
package com.scb.phone.view.fragment.investment.funddetails;
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.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.investment.funddetails.LtfSummaryAdapter;
import java.util.ArrayList;
import java.util.List;
import o.C0849Px;
import o.C16148leh;
import o.InterfaceC6650cZB;
/* loaded from: classes5.dex */
public class FundSummaryTabFragment extends Hilt_FundSummaryTabFragment implements InterfaceC6650cZB {
private LtfSummaryAdapter d;
@BindView
RelativeLayout mContainerRelativeLayout;
@BindView
TextView mEmptyCenterTitle;
@BindView
TextView mEmptyDescription;
@BindView
ImageView mEmptyImage;
@BindView
TextView mEmptyTitle;
@BindView
RecyclerView mRecyclerView;
@BindView
TextView mShowMessages;
public static FundSummaryTabFragment a(List<C0849Px> list, String str) {
FundSummaryTabFragment fundSummaryTabFragment = new FundSummaryTabFragment();
if (list != null) {
Bundle bundle = new Bundle();
bundle.putParcelableArrayList("com.scb.phone.FUND_LTF_LIST", (ArrayList) list);
bundle.putString("EXTRA_FUND_TYPE", str);
fundSummaryTabFragment.setArguments(bundle);
}
return fundSummaryTabFragment;
}
@Override // androidx.fragment.app.Fragment
public View onCreateView(LayoutInflater layoutInflater, ViewGroup viewGroup, Bundle bundle) {
View inflate = layoutInflater.inflate(R.layout.2131559669, viewGroup, false);
ButterKnife.c(this, inflate);
if (getArguments() != null) {
ArrayList parcelableArrayList = getArguments().getParcelableArrayList("com.scb.phone.FUND_LTF_LIST");
String string = getArguments().getString("EXTRA_FUND_TYPE");
if (parcelableArrayList == null) {
d();
} else if (!parcelableArrayList.isEmpty()) {
this.mContainerRelativeLayout.setVisibility(8);
this.mShowMessages.setVisibility(8);
this.mRecyclerView.setVisibility(0);
LtfSummaryAdapter ltfSummaryAdapter = this.d;
if (ltfSummaryAdapter != null) {
ltfSummaryAdapter.a = parcelableArrayList;
ltfSummaryAdapter.notifyDataSetChanged();
} else {
getContext();
this.mRecyclerView.setLayoutManager(new LinearLayoutManager(1, false));
this.mRecyclerView.setNestedScrollingEnabled(false);
C16148leh c16148leh = new C16148leh(null);
LtfSummaryAdapter ltfSummaryAdapter2 = new LtfSummaryAdapter(getContext(), parcelableArrayList, string, c16148leh);
this.d = ltfSummaryAdapter2;
this.mRecyclerView.setAdapter(c16148leh.d(ltfSummaryAdapter2));
c16148leh.b(this.mRecyclerView);
}
} else {
this.mEmptyTitle.setVisibility(8);
this.mEmptyCenterTitle.setVisibility(0);
this.mEmptyCenterTitle.setText(getResources().getString(R.string.custom_empty_no_transactions));
this.mEmptyDescription.setVisibility(8);
this.mContainerRelativeLayout.setVisibility(0);
this.mShowMessages.setVisibility(8);
this.mRecyclerView.setVisibility(8);
this.mEmptyImage.setVisibility(8);
}
} else {
d();
}
return inflate;
}
private void d() {
this.mEmptyTitle.setText(getResources().getString(R.string.ltf_divided_empty_title));
this.mEmptyDescription.setText(getResources().getString(R.string.ltf_divided_empty_description));
this.mContainerRelativeLayout.setVisibility(0);
this.mEmptyImage.setVisibility(0);
this.mShowMessages.setVisibility(8);
this.mRecyclerView.setVisibility(8);
}
}