what-the-bank/sources/com/scb/phone/view/fragment/sme/gifting/GiftingFragment.java

269 lines
9.7 KiB
Java
Raw Normal View History

2024-07-27 18:17:47 +07:00
package com.scb.phone.view.fragment.sme.gifting;
import android.content.Intent;
import android.os.Bundle;
import android.util.Base64;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
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.activity.sme.gifting.GiftPreviewActivity;
import com.scb.phone.view.adapter.sme.gifting.GiftingBaseListAdapter;
import com.scb.phone.view.fragment.BaseFragment;
import com.scb.phone.view.fragment.sme.gifting.GiftingFragment;
import java.nio.charset.StandardCharsets;
import java.util.ArrayList;
import java.util.List;
import o.InterfaceC6673cZp;
import o.WI;
import o.cKJ;
/* loaded from: classes5.dex */
public abstract class GiftingFragment extends BaseFragment implements InterfaceC6673cZp.vUG, GiftingBaseListAdapter.IeS {
private static byte c = 6;
private static int h = 1;
private static int j;
private GiftingBaseListAdapter d;
@BindView
protected View giftsEmptyArea;
@BindView
protected TextView giftsEmptyMsg;
@BindView
protected RecyclerView giftsRecyclerView;
protected abstract int d();
protected abstract GiftingBaseListAdapter e(List<WI> list);
protected abstract cKJ g();
private void m(String str, Object[] objArr) {
byte[] decode = Base64.decode(str, 0);
byte[] bArr = new byte[decode.length];
for (int i = 0; i < decode.length; i++) {
bArr[i] = (byte) (decode[(decode.length - i) - 1] ^ c);
}
objArr[0] = new String(bArr, StandardCharsets.UTF_8);
}
@Override // androidx.fragment.app.Fragment
public View onCreateView(LayoutInflater layoutInflater, ViewGroup viewGroup, Bundle bundle) {
View inflate = layoutInflater.inflate(R.layout.2131559682, viewGroup, false);
ButterKnife.c(this, inflate);
getContext();
LinearLayoutManager linearLayoutManager = new LinearLayoutManager(1, false);
IeS ieS = new IeS(this, linearLayoutManager);
RecyclerView recyclerView = this.giftsRecyclerView;
if (recyclerView.S == null) {
recyclerView.S = new ArrayList();
}
recyclerView.S.add(ieS);
this.giftsRecyclerView.setLayoutManager(linearLayoutManager);
g().e((cKJ) this);
return inflate;
}
@Override // androidx.fragment.app.Fragment
public void onResume() {
super.onResume();
g().c();
}
/* JADX WARN: Code restructure failed: missing block: B:10:0x0068, code lost:
r3 = new android.text.SpannableString(r7);
r2 = (android.text.SpannableString) r3;
android.text.TextUtils.copySpansFrom((android.text.SpannedString) r2, 0, r7.length(), java.lang.Object.class, r3, 0);
r7 = r3;
*/
/* JADX WARN: Code restructure failed: missing block: B:12:0x0043, code lost:
if (r7.startsWith(",*,)") != false) goto L9;
*/
/* JADX WARN: Code restructure failed: missing block: B:4:0x0029, code lost:
if (r7.startsWith(",*,)") != false) goto L9;
*/
/* JADX WARN: Code restructure failed: missing block: B:8:0x0045, code lost:
r3 = com.scb.phone.view.fragment.sme.gifting.GiftingFragment.h + 85;
com.scb.phone.view.fragment.sme.gifting.GiftingFragment.j = r3 % 128;
r3 = r3 % 2;
r2 = new java.lang.Object[1];
m(r7.substring(4), r2);
r7 = ((java.lang.String) r2[0]).intern();
r2 = r6.getText(r5);
*/
/* JADX WARN: Code restructure failed: missing block: B:9:0x0066, code lost:
if ((r2 instanceof android.text.Spanned) == false) goto L12;
*/
/* JADX WARN: Multi-variable type inference failed */
/* JADX WARN: Type inference failed for: r3v8, types: [android.text.SpannableString, android.text.Spannable] */
@Override // o.InterfaceC6673cZp.vUG
/*
Code decompiled incorrectly, please refer to instructions dump.
To view partially-correct add '--show-bad-code' argument
*/
public final void e() {
/*
r14 = this;
r0 = 2
int r1 = r0 % r0
int r1 = com.scb.phone.view.fragment.sme.gifting.GiftingFragment.j
int r1 = r1 + 73
int r2 = r1 % 128
com.scb.phone.view.fragment.sme.gifting.GiftingFragment.h = r2
int r1 = r1 % r0
r2 = 1
java.lang.String r3 = ",*,)"
r4 = 0
if (r1 != 0) goto L2c
android.view.View r1 = r14.giftsEmptyArea
r1.setVisibility(r2)
android.widget.TextView r1 = r14.giftsEmptyMsg
int r5 = r14.d()
android.content.Context r6 = r1.getContext()
java.lang.String r7 = r6.getString(r5)
boolean r3 = r7.startsWith(r3)
if (r3 == 0) goto L80
goto L45
L2c:
android.view.View r1 = r14.giftsEmptyArea
r1.setVisibility(r4)
android.widget.TextView r1 = r14.giftsEmptyMsg
int r5 = r14.d()
android.content.Context r6 = r1.getContext()
java.lang.String r7 = r6.getString(r5)
boolean r3 = r7.startsWith(r3)
if (r3 == 0) goto L80
L45:
int r3 = com.scb.phone.view.fragment.sme.gifting.GiftingFragment.h
int r3 = r3 + 85
int r8 = r3 % 128
com.scb.phone.view.fragment.sme.gifting.GiftingFragment.j = r8
int r3 = r3 % r0
r3 = 4
java.lang.String r3 = r7.substring(r3)
java.lang.Object[] r2 = new java.lang.Object[r2]
r14.m(r3, r2)
r2 = r2[r4]
java.lang.String r2 = (java.lang.String) r2
java.lang.String r7 = r2.intern()
java.lang.CharSequence r2 = r6.getText(r5)
boolean r3 = r2 instanceof android.text.Spanned
if (r3 == 0) goto L80
android.text.SpannableString r3 = new android.text.SpannableString
r3.<init>(r7)
r8 = r2
android.text.SpannedString r8 = (android.text.SpannedString) r8
r9 = 0
int r10 = r7.length()
java.lang.Class<java.lang.Object> r11 = java.lang.Object.class
r2 = r3
android.text.SpannableString r2 = (android.text.SpannableString) r2
r13 = 0
r12 = r3
android.text.TextUtils.copySpansFrom(r8, r9, r10, r11, r12, r13)
r7 = r3
L80:
r1.setText(r7)
androidx.recyclerview.widget.RecyclerView r1 = r14.giftsRecyclerView
r2 = 8
r1.setVisibility(r2)
int r1 = com.scb.phone.view.fragment.sme.gifting.GiftingFragment.h
int r1 = r1 + 37
int r2 = r1 % 128
com.scb.phone.view.fragment.sme.gifting.GiftingFragment.j = r2
int r1 = r1 % r0
return
*/
throw new UnsupportedOperationException("Method not decompiled: com.scb.phone.view.fragment.sme.gifting.GiftingFragment.e():void");
}
@Override // o.InterfaceC6673cZp.vUG
public final void d(final List<WI> list) {
this.giftsRecyclerView.setVisibility(0);
this.giftsEmptyArea.setVisibility(8);
GiftingBaseListAdapter giftingBaseListAdapter = this.d;
if (giftingBaseListAdapter == null) {
GiftingBaseListAdapter e = e(list);
this.d = e;
this.giftsRecyclerView.setAdapter(e);
} else {
giftingBaseListAdapter.c(list);
this.giftsRecyclerView.post(new Runnable(this, list) { // from class: o.fBK
private GiftingFragment a;
private List e;
@Override // java.lang.Runnable
public final void run() {
GiftingFragment giftingFragment = this.a;
List list2 = this.e;
giftingFragment.d.notifyItemInserted(list2.size() - 1);
}
{
this.a = this;
this.e = list;
}
});
}
}
@Override // com.scb.phone.view.adapter.sme.gifting.GiftingBaseListAdapter.IeS
public final void e(WI wi) {
Intent intent = new Intent(getContext(), (Class<?>) GiftPreviewActivity.class);
Bundle bundle = new Bundle();
bundle.putParcelable("EXTRA_GIFT_STATUS_SELECTED", wi);
intent.putExtras(bundle);
startActivity(intent);
}
/* loaded from: classes5.dex */
public class IeS extends RecyclerView.dAO {
private GiftingFragment d;
private LinearLayoutManager e;
public IeS(GiftingFragment giftingFragment, LinearLayoutManager linearLayoutManager) {
this.d = giftingFragment;
this.e = linearLayoutManager;
}
@Override // androidx.recyclerview.widget.RecyclerView.dAO
public final void onScrolled(RecyclerView recyclerView, int i, int i2) {
super.onScrolled(recyclerView, i, i2);
if (i2 > 0) {
int i_ = this.e.i_();
int r = this.e.r();
if (this.e.j() + i_ != r || r == 0) {
return;
}
this.d.g().a();
}
}
}
@Override // com.scb.phone.view.fragment.BaseFragment, androidx.fragment.app.Fragment
public void onDestroy() {
g().w_();
super.onDestroy();
}
@Override // o.InterfaceC6673cZp.vUG
public final void c() {
if (this.d != null) {
this.d = null;
this.giftsRecyclerView.setAdapter(null);
}
}
}