正在查看: Mabilis Cash v1.19.4 应用的 PHSelectPaymentMethodActivity.java JAVA 源代码文件
本页面展示 JAVA 反编译生成的源代码文件,支持语法高亮显示。 仅供安全研究与技术分析使用,严禁用于任何非法用途。请遵守相关法律法规。
正在查看: Mabilis Cash v1.19.4 应用的 PHSelectPaymentMethodActivity.java JAVA 源代码文件
本页面展示 JAVA 反编译生成的源代码文件,支持语法高亮显示。 仅供安全研究与技术分析使用,严禁用于任何非法用途。请遵守相关法律法规。
package com.loans.mabiliscash.payment;
import android.content.Intent;
import android.os.Bundle;
import android.text.Editable;
import android.text.TextUtils;
import android.text.TextWatcher;
import android.view.View;
import androidx.annotation.NonNull;
import androidx.annotation.Nullable;
import androidx.annotation.StringRes;
import androidx.fragment.app.Fragment;
import androidx.recyclerview.widget.LinearLayoutManager;
import com.lingyue.supertoolkit.tools.customtools.CollectionUtils;
import com.lingyue.supertoolkit.widgets.adapters.LinearVerticalDivider;
import com.lingyue.supertoolkit.widgets.adapters.OnItemClickListener;
import com.loans.mabiliscash.R;
import com.loans.mabiliscash.auth.idcard.d4;
import com.loans.mabiliscash.common.BindClickCall;
import com.loans.mabiliscash.common.PHViewBindingActivity;
import com.loans.mabiliscash.databinding.ActivitySelectPaymentMethodBinding;
import com.loans.mabiliscash.models.response.PaymentMethodSelectBean;
import com.loans.mabiliscash.utils.ComponentExtensionsKt;
import com.veda.android.statistics.AutoTrackHelper;
import java.util.ArrayList;
import java.util.Iterator;
import kotlin.Unit;
import kotlin.collections.CollectionsKt;
import kotlin.jvm.functions.Function0;
import kotlin.jvm.functions.Function1;
public class PHSelectPaymentMethodActivity extends PHViewBindingActivity<ActivitySelectPaymentMethodBinding> {
private ArrayList<PaymentMethodSelectBean> p;
private ArrayList<PaymentMethodSelectBean> q;
@Nullable
private PaymentMethodSelectBean r;
private SelectPaymentMethodListAdapter s;
private boolean f236t;
private int f237u = R.string.add_bank_card;
private void f0() {
V(((ActivitySelectPaymentMethodBinding) this.o).d, new BindClickCall() {
@Override
public final void onClick(View view) {
PHSelectPaymentMethodActivity.this.h0(view);
}
});
ComponentExtensionsKt.f(((ActivitySelectPaymentMethodBinding) this.o).b, new Function0() {
public final Object invoke() {
Unit i02;
i02 = PHSelectPaymentMethodActivity.this.i0();
return i02;
}
});
}
public void g0(View view, int i, PaymentMethodSelectBean paymentMethodSelectBean) {
m0(paymentMethodSelectBean);
this.s.j(paymentMethodSelectBean);
this.s.notifyDataSetChanged();
l0();
BindCardTrackUtil.s(this, getString(this.f237u), this.f236t, paymentMethodSelectBean != null ? paymentMethodSelectBean.label : "");
AutoTrackHelper.trackRecyclerViewItemOnClick(view, i, paymentMethodSelectBean);
}
public void h0(View view) {
((ActivitySelectPaymentMethodBinding) this.o).b.setText("");
BindCardTrackUtil.w(this, getString(this.f237u), this.f236t);
}
public Unit i0() {
BindCardTrackUtil.y(this, getString(this.f237u), this.f236t);
return Unit.a;
}
public void k0(String str) {
if (CollectionUtils.a(this.q)) {
return;
}
this.p.clear();
if (str.length() == 0) {
this.p.addAll(this.q);
this.s.notifyDataSetChanged();
return;
}
Iterator<PaymentMethodSelectBean> it = this.q.iterator();
while (it.hasNext()) {
PaymentMethodSelectBean next = it.next();
if (next.label.toLowerCase().contains(str.toLowerCase())) {
this.p.add(next);
}
}
this.s.notifyDataSetChanged();
}
private void l0() {
if (this.r != null) {
Intent intent = new Intent();
intent.putExtra("selectPayMethodInfo", this.r);
setResult(2001, intent);
finish();
}
}
private void m0(PaymentMethodSelectBean paymentMethodSelectBean) {
this.r = paymentMethodSelectBean;
}
public static void startWithFragment(Fragment fragment, ArrayList<PaymentMethodSelectBean> arrayList, int i, boolean z2) {
startWithFragment(fragment, arrayList, i, R.string.add_bank_card, z2);
}
protected boolean d() {
return true;
}
@Override
public ActivitySelectPaymentMethodBinding bindingInflater() {
return ActivitySelectPaymentMethodBinding.c(getLayoutInflater());
}
protected void j() {
super.j();
this.s = new SelectPaymentMethodListAdapter(this, this.p);
int intExtra = getIntent().getIntExtra("currentChoosePosition", -1);
if (intExtra != -1 && intExtra < this.p.size()) {
m0(this.p.get(intExtra));
}
this.s.j(this.r);
((ActivitySelectPaymentMethodBinding) this.o).e.setAdapter(this.s);
this.s.h(new OnItemClickListener() {
public final void a(View view, int i, Object obj) {
PHSelectPaymentMethodActivity.this.g0(view, i, (PaymentMethodSelectBean) obj);
}
});
Q();
}
@Override
protected void k(@NonNull Bundle bundle) {
super.k(bundle);
this.q = (ArrayList) bundle.getSerializable("payMethodInfoList");
m0((PaymentMethodSelectBean) bundle.getSerializable("save_extra_current_choose_pay_method"));
ArrayList<PaymentMethodSelectBean> arrayList = new ArrayList<>();
this.p = arrayList;
arrayList.addAll(this.q);
this.f236t = bundle.getBoolean("isFromOrderApply", false);
this.f237u = getIntent().getIntExtra("activityLabelResId", R.string.add_bank_card);
}
protected void o() {
super.o();
BindCardTrackUtil.u(this, getString(this.f237u), this.f236t, CollectionUtils.a(this.q) ? "" : d4.a(",", CollectionsKt.h0(this.q, new Function1() {
public final Object invoke(Object obj) {
String str;
str = ((PaymentMethodSelectBean) obj).label;
return str;
}
})));
f0();
setTitle(this.f237u);
((ActivitySelectPaymentMethodBinding) this.o).e.setLayoutManager(new LinearLayoutManager(this));
((ActivitySelectPaymentMethodBinding) this.o).e.addItemDecoration(new LinearVerticalDivider(getResources().getDimension(2131165610), getResources().getDimension(2131165383), getResources().getColor(R.color.c_f3f3f3)));
((ActivitySelectPaymentMethodBinding) this.o).b.addTextChangedListener(new TextWatcher() {
@Override
public void afterTextChanged(Editable editable) {
String obj = editable.toString();
PHSelectPaymentMethodActivity.this.k0(obj);
((ActivitySelectPaymentMethodBinding) ((PHViewBindingActivity) PHSelectPaymentMethodActivity.this).o).d.setVisibility(TextUtils.isEmpty(obj) ? 8 : 0);
?? r3 = PHSelectPaymentMethodActivity.this;
BindCardTrackUtil.A(r3, r3.getString(((PHSelectPaymentMethodActivity) r3).f237u), PHSelectPaymentMethodActivity.this.f236t);
}
@Override
public void beforeTextChanged(CharSequence charSequence, int i, int i2, int i3) {
}
@Override
public void onTextChanged(CharSequence charSequence, int i, int i2, int i3) {
}
});
}
protected void s(@NonNull Bundle bundle) {
super.s(bundle);
bundle.putSerializable("save_extra_current_choose_pay_method", this.r);
bundle.putSerializable("payMethodInfoList", this.q);
bundle.putBoolean("isFromOrderApply", this.f236t);
bundle.putInt("activityLabelResId", this.f237u);
}
public static void startWithFragment(Fragment fragment, ArrayList<PaymentMethodSelectBean> arrayList, int i, @StringRes int i2, boolean z2) {
if (fragment.isAdded()) {
Intent intent = new Intent(fragment.requireContext(), (Class<?>) PHSelectPaymentMethodActivity.class);
intent.putExtra("payMethodInfoList", arrayList);
intent.putExtra("currentChoosePosition", i);
intent.putExtra("activityLabelResId", i2);
intent.putExtra("isFromOrderApply", z2);
fragment.startActivityForResult(intent, 10024);
}
}
}