what-the-bank/sources/com/scb/phone/view/fragment/investment/scbs/ScbsLandingFragment.java

368 lines
14 KiB
Java
Raw Normal View History

2024-07-27 18:17:47 +07:00
package com.scb.phone.view.fragment.investment.scbs;
import android.content.Context;
import android.graphics.Color;
import android.graphics.Typeface;
import android.os.Bundle;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.ImageView;
import android.widget.Space;
import android.widget.TextView;
import androidx.recyclerview.widget.LinearLayoutManager;
import androidx.recyclerview.widget.RecyclerView;
import butterknife.BindView;
import butterknife.ButterKnife;
import butterknife.OnClick;
import butterknife.Unbinder;
import com.github.mikephil.charting.charts.PieChart;
import com.google.android.gms.maps.model.BitmapDescriptorFactory;
import com.scb.phone.R;
import com.scb.phone.view.activity.BaseActivity;
import com.scb.phone.view.activity.investment.scbs.AddAccountInfoActivity;
import com.scb.phone.view.activity.investment.scbs.ScbsAccountDetailActivity;
import com.scb.phone.view.activity.partner.PartnerAuthorizationActivity;
import com.scb.phone.view.adapter.investment.scbs.LandingAccountsAdapter;
import com.scb.phone.view.adapter.investment.scbs.PieChartLegendAdapter;
import com.scb.phone.view.fragment.investment.scbs.ScbsLandingFragment;
import java.text.DecimalFormat;
import java.util.ArrayList;
import java.util.List;
import o.AbstractC12009eqC;
import o.BpT;
import o.BzM;
import o.C0871Qk;
import o.C0872Ql;
import o.C0873Qm;
import o.C12923fLa;
import o.C14957gcv;
import o.C16075kv;
import o.C16180lwo;
import o.C2640aiS;
import o.C2727ak;
import o.C7968cyO;
import o.Dfa;
import o.EnumC1274Zk;
import o.Ikb;
import o.InterfaceC13391fZD;
import o.InterfaceC9355diF;
import o.Klc;
import o.NNu;
import o.OT;
import o.ZI;
import o.bHA;
import o.gnL;
import o.nMh;
import o.pyT;
/* loaded from: classes5.dex */
public class ScbsLandingFragment extends Hilt_ScbsLandingFragment<C0873Qm> implements InterfaceC9355diF {
private HeaderBinding c;
private BzM d = new BzM();
@InterfaceC13391fZD
public bHA scbsLandingPresenter;
/* loaded from: classes5.dex */
public class HeaderBinding_ViewBinding implements Unbinder {
private View c;
private View d;
private HeaderBinding e;
public HeaderBinding_ViewBinding(HeaderBinding headerBinding, View view) {
this.e = headerBinding;
headerBinding.marketValueText = (TextView) pyT.e(view, R.id.tv_market_value, "field 'marketValueText'", TextView.class);
headerBinding.netGainText = (TextView) pyT.e(view, R.id.tv_net_gain, "field 'netGainText'", TextView.class);
headerBinding.asOfDateText = (TextView) pyT.e(view, R.id.tv_as_of_date, "field 'asOfDateText'", TextView.class);
headerBinding.marketValueArrowImage = (ImageView) pyT.e(view, R.id.iv_market_value_arrow, "field 'marketValueArrowImage'", ImageView.class);
headerBinding.pieChart = (PieChart) pyT.e(view, R.id.scbs_pie_chart, "field 'pieChart'", PieChart.class);
View a = pyT.a(view, R.id.bt_button_trade_now, "field 'tradeNowButton' and method 'tradeNowButtonClicked'");
headerBinding.tradeNowButton = a;
this.d = a;
a.setOnClickListener(new gnL(this, headerBinding) { // from class: com.scb.phone.view.fragment.investment.scbs.ScbsLandingFragment.HeaderBinding_ViewBinding.1
private HeaderBinding b;
private HeaderBinding_ViewBinding e;
{
this.e = this;
this.b = headerBinding;
}
@Override // o.gnL
public final void e(View view2) {
this.b.tradeNowButtonClicked(view2);
}
});
View a2 = pyT.a(view, R.id.bt_button_open_other, "field 'otherProductButton' and method 'otherProductButtonClicked'");
headerBinding.otherProductButton = a2;
this.c = a2;
a2.setOnClickListener(new gnL(this, headerBinding) { // from class: com.scb.phone.view.fragment.investment.scbs.ScbsLandingFragment.HeaderBinding_ViewBinding.3
private HeaderBinding a;
private HeaderBinding_ViewBinding b;
{
this.b = this;
this.a = headerBinding;
}
@Override // o.gnL
public final void e(View view2) {
this.a.otherProductButtonClicked(view2);
}
});
headerBinding.legendRecyclerView = (RecyclerView) pyT.e(view, R.id.rv_legend_recycler_view, "field 'legendRecyclerView'", RecyclerView.class);
}
@Override // butterknife.Unbinder
public final void a() {
HeaderBinding headerBinding = this.e;
if (headerBinding == null) {
throw new IllegalStateException("Bindings already cleared.");
}
this.e = null;
headerBinding.marketValueText = null;
headerBinding.netGainText = null;
headerBinding.asOfDateText = null;
headerBinding.marketValueArrowImage = null;
headerBinding.pieChart = null;
headerBinding.tradeNowButton = null;
headerBinding.otherProductButton = null;
headerBinding.legendRecyclerView = null;
this.d.setOnClickListener(null);
this.d = null;
this.c.setOnClickListener(null);
this.c = null;
}
}
public static ScbsLandingFragment h() {
return new ScbsLandingFragment();
}
@Override // com.scb.phone.view.fragment.BaseHeaderAndFooterFragment, androidx.fragment.app.Fragment
public View onCreateView(LayoutInflater layoutInflater, ViewGroup viewGroup, Bundle bundle) {
View onCreateView = super.onCreateView(layoutInflater, viewGroup, bundle);
this.c.pieChart.setHoleRadius(35.0f);
this.c.pieChart.setTransparentCircleRadius(35.0f);
this.c.pieChart.setRotationAngle(BitmapDescriptorFactory.HUE_RED);
this.c.pieChart.setExtraOffsets(-4.0f, -4.0f, -4.0f, -4.0f);
byte b = 0;
this.c.pieChart.setRotationEnabled(false);
this.c.pieChart.setHighlightPerTapEnabled(false);
this.c.pieChart.setRotationAngle(270.0f);
this.c.pieChart.k();
this.c.pieChart.d(C2640aiS.c);
this.c.pieChart.l().q = false;
this.c.pieChart.setDescription(null);
this.c.pieChart.setDrawEntryLabels(false);
this.scbsLandingPresenter.e((bHA) this);
BzM bzM = this.d;
if (getActivity() != null) {
bzM.c(((BaseActivity) getActivity()).scbAnalytics, "scbs_portfolio");
}
bHA bha = this.scbsLandingPresenter;
if (bha.f != 0) {
bha.f.y();
}
bha.b.a();
BpT bpT = bha.b;
bpT.d(bpT.i, new bHA.HBt(bha, b));
return onCreateView;
}
@Override // com.scb.phone.view.fragment.BaseHeaderAndFooterFragment
public final AbstractC12009eqC<C0873Qm> avh_(LayoutInflater layoutInflater, ViewGroup viewGroup) {
this.c = new HeaderBinding(this);
View inflate = layoutInflater.inflate(R.layout.2131560045, viewGroup, false);
View inflate2 = layoutInflater.inflate(R.layout.2131560044, viewGroup, false);
ButterKnife.c(this.c, inflate);
LandingAccountsAdapter landingAccountsAdapter = new LandingAccountsAdapter(getContext(), inflate2, new Space(getContext()));
landingAccountsAdapter.a = inflate;
landingAccountsAdapter.c = new AbstractC12009eqC.RVV(this) { // from class: o.fiO
private ScbsLandingFragment d;
@Override // o.AbstractC12009eqC.RVV
public final void b(Object obj) {
ScbsLandingFragment.a(this.d, (C0873Qm) obj);
}
{
this.d = this;
}
};
return landingAccountsAdapter;
}
@Override // com.scb.phone.view.fragment.BaseFragment, androidx.fragment.app.Fragment
public void onDestroy() {
this.scbsLandingPresenter.w_();
super.onDestroy();
}
@Override // o.InterfaceC9355diF
public final void c(C0871Qk c0871Qk) {
this.c.marketValueText.setText(c0871Qk.f);
this.c.netGainText.setText(c0871Qk.h);
this.c.netGainText.setTextColor(nMh.getColor(getContext(), c0871Qk.g));
this.c.asOfDateText.setVisibility(c0871Qk.b == null ? 8 : 0);
this.c.asOfDateText.setText(c0871Qk.b);
this.c.marketValueArrowImage.setImageResource(c0871Qk.a);
e(c0871Qk.d);
this.c.tradeNowButton.setVisibility(c0871Qk.i ? 0 : 8);
if (c0871Qk.c) {
PieChart pieChart = this.c.pieChart;
List<C0872Ql> list = c0871Qk.j;
ArrayList arrayList = new ArrayList();
ArrayList arrayList2 = new ArrayList();
for (C0872Ql c0872Ql : list) {
arrayList2.add(new Ikb(c0872Ql.a, c0872Ql.b, ""));
arrayList.add(Integer.valueOf(Color.parseColor(c0872Ql.c)));
}
C16180lwo c16180lwo = new C16180lwo(arrayList2, "");
c16180lwo.e = arrayList;
Dfa dfa = new Dfa(c16180lwo);
dfa.b(new C12923fLa(this.c.pieChart, new DecimalFormat("###,###,###")));
dfa.j();
dfa.a();
dfa.Gy_(Typeface.createFromAsset(getContext().getAssets(), "fonts/PSL001Pro.ttf"));
pieChart.setData(dfa);
this.c.legendRecyclerView.setNestedScrollingEnabled(false);
getContext();
this.c.legendRecyclerView.setLayoutManager(new LinearLayoutManager());
this.c.legendRecyclerView.setAdapter(new PieChartLegendAdapter(c0871Qk.j));
this.c.pieChart.invalidate();
} else {
this.c.pieChart.setVisibility(8);
this.c.legendRecyclerView.setVisibility(8);
}
this.c.otherProductButton.setVisibility(c0871Qk.e ? 8 : 0);
}
@Override // o.InterfaceC9355diF
public final void e(String str) {
Context context = getContext();
if (context != null) {
startActivity(PartnerAuthorizationActivity.ajM_(context, str));
}
}
@Override // o.InterfaceC9355diF
public final void c(OT ot) {
ScbsAccountDetailActivity.e(getContext(), ot);
}
@Override // o.InterfaceC9355diF
public final void e(int i) {
if (getContext() != null) {
startActivity(AddAccountInfoActivity.ahz_(getContext(), i));
}
}
/* loaded from: classes5.dex */
public class HeaderBinding {
@BindView
TextView asOfDateText;
private ScbsLandingFragment d;
@BindView
RecyclerView legendRecyclerView;
@BindView
ImageView marketValueArrowImage;
@BindView
TextView marketValueText;
@BindView
TextView netGainText;
@BindView
View otherProductButton;
@BindView
PieChart pieChart;
@BindView
View tradeNowButton;
public HeaderBinding(ScbsLandingFragment scbsLandingFragment) {
this.d = scbsLandingFragment;
}
@OnClick
public void tradeNowButtonClicked(View view) {
this.d.d.d("source", "SCBS_landing");
ScbsLandingFragment scbsLandingFragment = this.d;
BzM bzM = scbsLandingFragment.d;
if (scbsLandingFragment.getActivity() != null) {
bzM.c(((BaseActivity) scbsLandingFragment.getActivity()).scbAnalytics, "trade_now");
}
final bHA bha = this.d.scbsLandingPresenter;
ZI.IeS ieS = new ZI.IeS(bha) { // from class: o.bHz
private bHA b;
@Override // o.ZI.IeS
public final void e(Object obj) {
((InterfaceC9355diF) obj).e(this.b.h.g.a);
}
{
this.b = bha;
}
};
if (bha.f != 0) {
ieS.e(bha.f);
}
}
@OnClick
public void otherProductButtonClicked(View view) {
ScbsLandingFragment scbsLandingFragment = this.d;
if (scbsLandingFragment.getActivity() != null) {
((BaseActivity) scbsLandingFragment.getActivity()).scbAnalytics.c("scbsonboard_open_other");
}
final bHA bha = this.d.scbsLandingPresenter;
final C7968cyO p = bha.d.b.p();
if (bha.h.g != null) {
C16075kv c16075kv = bha.e;
String str = EnumC1274Zk.SCBS_PORTFOLIO.entryPoint;
C14957gcv.e(str, "");
Klc klc = c16075kv.d;
C14957gcv.e(str, "");
klc.e.d(str);
ZI.IeS ieS = new ZI.IeS(bha, p) { // from class: o.bHB
private C7968cyO c;
private bHA d;
@Override // o.ZI.IeS
public final void e(Object obj) {
C7968cyO c7968cyO = this.c;
((InterfaceC9355diF) obj).e((!r1.h.b || r1.h.d) ? 0 : 1);
}
{
this.d = bha;
this.c = p;
}
};
if (bha.f != 0) {
ieS.e(bha.f);
}
}
}
}
public static /* synthetic */ void a(ScbsLandingFragment scbsLandingFragment, C0873Qm c0873Qm) {
bHA bha = scbsLandingFragment.scbsLandingPresenter;
bha.a = c0873Qm;
if (bha.f != 0) {
bha.f.y();
}
bha.c.a(new C2727ak(c0873Qm.e, c0873Qm.d, c0873Qm.b));
NNu nNu = bha.c;
nNu.d(nNu.i, new bHA.IeS(bha, (byte) 0));
}
}