what-the-bank/sources/com/scb/phone/view/fragment/donations/DonationsFoundationDetailsF...

158 lines
5.4 KiB
Java
Raw Normal View History

2024-07-27 18:17:47 +07:00
package com.scb.phone.view.fragment.donations;
import android.content.Intent;
import android.os.Bundle;
import android.util.DisplayMetrics;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.webkit.WebView;
import android.widget.ImageView;
import android.widget.TextView;
import butterknife.BindView;
import butterknife.ButterKnife;
import butterknife.OnClick;
import com.google.android.material.appbar.AppBarLayout;
import com.scb.phone.R;
import com.scb.phone.view.activity.transferandpay.FavouriteSelectedActivity;
import java.lang.ref.WeakReference;
import o.C12891fKc;
import o.C12914fKz;
import o.C17515xRi;
import o.C1818aPT;
import o.InterfaceC13391fZD;
import o.JL;
import o.ZI;
import o.cYQ;
import o.nMh;
/* loaded from: classes5.dex */
public class DonationsFoundationDetailsFragment extends Hilt_DonationsFoundationDetailsFragment implements AppBarLayout.ojQ, cYQ.HBt {
@BindView
ImageView backgroundImageView;
@InterfaceC13391fZD
public C1818aPT donationsFoundationDetailPresenter;
@BindView
AppBarLayout mAppBarLayout;
@BindView
TextView mFoundationName;
@BindView
WebView mHtmlDescriptionWebView;
@BindView
ImageView mLogoImageView;
public static DonationsFoundationDetailsFragment b(JL jl) {
DonationsFoundationDetailsFragment donationsFoundationDetailsFragment = new DonationsFoundationDetailsFragment();
Bundle bundle = new Bundle();
bundle.putParcelable("SELECTED_IMAGE_POSITION", jl);
donationsFoundationDetailsFragment.setArguments(bundle);
return donationsFoundationDetailsFragment;
}
@Override // androidx.fragment.app.Fragment
public View onCreateView(LayoutInflater layoutInflater, ViewGroup viewGroup, Bundle bundle) {
View inflate = layoutInflater.inflate(R.layout.2131559576, viewGroup, false);
ButterKnife.c(this, inflate);
super.aa();
Z();
Y();
this.mAppBarLayout.e(this);
ab();
DisplayMetrics displayMetrics = new DisplayMetrics();
getActivity().getWindowManager().getDefaultDisplay().getMetrics(displayMetrics);
this.backgroundImageView.getLayoutParams().height = (displayMetrics.heightPixels * 38) / 100;
this.donationsFoundationDetailPresenter.e((C1818aPT) this);
final JL jl = (JL) getArguments().getParcelable("SELECTED_IMAGE_POSITION");
C1818aPT c1818aPT = this.donationsFoundationDetailPresenter;
c1818aPT.d = jl;
ZI.IeS ieS = new ZI.IeS(jl) { // from class: o.aPU
private JL a;
@Override // o.ZI.IeS
public final void e(Object obj) {
((cYQ.HBt) obj).e(this.a);
}
{
this.a = jl;
}
};
if (c1818aPT.f != 0) {
ieS.e(c1818aPT.f);
}
return inflate;
}
@Override // com.google.android.material.appbar.AppBarLayout.RVV
public final void c(AppBarLayout appBarLayout, int i) {
C12914fKz.e(new Object[]{appBarLayout, Integer.valueOf(i), new WeakReference(this.mActionBarTitle)}, 650072314, -650072295, i);
}
@Override // com.scb.phone.view.fragment.BaseFragment
public final void aa() {
super.aa();
Z();
Y();
}
@Override // o.cYQ.HBt
public final void a() {
Intent intent = new Intent(getContext(), (Class<?>) FavouriteSelectedActivity.class);
intent.putExtra("source", "input");
startActivity(intent);
}
@Override // o.cYQ.HBt
public final void e(JL jl) {
String W = W();
getContext();
C12891fKc.azn_(nMh.getDrawable(getContext(), R.drawable.donations_place_holder), this.backgroundImageView, jl.c);
C12891fKc.aze_(R.drawable.donations_place_holder_logo, this.mLogoImageView, jl.e);
if (W.equals("th")) {
this.mFoundationName.setText(jl.h.c);
WebView webView = this.mHtmlDescriptionWebView;
StringBuilder sb = new StringBuilder();
sb.append(getString(R.string.web_responsive));
sb.append(getString(R.string.close_tag, jl.a.c));
webView.loadDataWithBaseURL(null, sb.toString(), "text/html", "UTF-8", null);
} else {
this.mFoundationName.setText(jl.h.d);
WebView webView2 = this.mHtmlDescriptionWebView;
StringBuilder sb2 = new StringBuilder();
sb2.append(getString(R.string.web_responsive));
sb2.append(getString(R.string.close_tag, jl.a.d));
webView2.loadDataWithBaseURL(null, sb2.toString(), "text/html", "UTF-8", null);
}
this.mHtmlDescriptionWebView.getSettings().setJavaScriptEnabled(true);
this.mHtmlDescriptionWebView.getSettings().setDomStorageEnabled(true);
}
@OnClick
public void onDonateButtonClick() {
C1818aPT c1818aPT = this.donationsFoundationDetailPresenter;
C17515xRi c17515xRi = c1818aPT.a;
c17515xRi.e.g(c1818aPT.d.d.d);
ZI.IeS ieS = new ZI.IeS() { // from class: o.aPR
@Override // o.ZI.IeS
public final void e(Object obj) {
((cYQ.HBt) obj).a();
}
};
if (c1818aPT.f != 0) {
ieS.e(c1818aPT.f);
}
}
@Override // com.scb.phone.view.fragment.BaseFragment, androidx.fragment.app.Fragment
public void onDestroy() {
super.onDestroy();
this.donationsFoundationDetailPresenter.w_();
}
}