正在查看: Hopscotch v9.7.2 应用的 CreditTransferActivity.java JAVA 源代码文件
本页面展示 JAVA 反编译生成的源代码文件,支持语法高亮显示。 仅供安全研究与技术分析使用,严禁用于任何非法用途。请遵守相关法律法规。
正在查看: Hopscotch v9.7.2 应用的 CreditTransferActivity.java JAVA 源代码文件
本页面展示 JAVA 反编译生成的源代码文件,支持语法高亮显示。 仅供安全研究与技术分析使用,严禁用于任何非法用途。请遵守相关法律法规。
package in.hopscotch.android.activity;
import android.app.Activity;
import android.content.DialogInterface;
import android.os.Bundle;
import android.text.Editable;
import android.text.TextWatcher;
import android.view.MenuItem;
import android.widget.ImageView;
import android.widget.LinearLayout;
import android.widget.RadioGroup;
import androidx.appcompat.widget.AppCompatTextView;
import in.hopscotch.android.api.ApiParam;
import in.hopscotch.android.api.factory.CustomerInfoApiFactory;
import in.hopscotch.android.api.model.Details;
import in.hopscotch.android.api.model.RefundInstrument;
import in.hopscotch.android.api.model.RefundRequest;
import in.hopscotch.android.api.model.VerifyUPIRequest;
import in.hopscotch.android.api.response.ActionResponse;
import in.hopscotch.android.api.rest.HSRetrofitCallback;
import in.hopscotch.android.components.CustomProgressbar;
import in.hopscotch.android.components.button.BottomButton;
import in.hopscotch.android.components.edittext.CustomTextInputEditText;
import kotlin.Metadata;
import kotlin.jvm.internal.Intrinsics;
import org.jetbrains.annotations.NotNull;
import retrofit2.Response;
@Metadata
public final class CreditTransferActivity extends androidx.appcompat.app.i {
public static final int i = 0;
private in.hopscotch.android.databinding.y binding;
private double creditAmount;
private boolean isExperimentFLow;
private boolean isUPIRefundsFlow;
public static final class a implements TextWatcher {
public final in.hopscotch.android.databinding.y b;
public a(in.hopscotch.android.databinding.y yVar) {
this.b = yVar;
}
@Override
public final void afterTextChanged(Editable editable) {
}
@Override
public final void beforeTextChanged(CharSequence charSequence, int i, int i2, int i3) {
}
@Override
public final void onTextChanged(CharSequence charSequence, int i, int i2, int i3) {
int length = String.valueOf(charSequence).length();
CreditTransferActivity creditTransferActivity = CreditTransferActivity.this;
if (length > 0) {
CreditTransferActivity.V0(creditTransferActivity, false);
return;
}
in.hopscotch.android.databinding.y yVar = this.b;
if (!Intrinsics.areEqual(String.valueOf(yVar.k.getText()), String.valueOf(charSequence))) {
CreditTransferActivity.V0(creditTransferActivity, true);
return;
}
AppCompatTextView appCompatTextView = yVar.x;
Intrinsics.checkNotNullExpressionValue(appCompatTextView, "verifyText");
in.hopscotch.android.core.util.j.b(appCompatTextView);
}
}
public static final class b extends HSRetrofitCallback<ActionResponse> {
public b() {
}
@Override
public final void onFailure(Throwable th) {
?? r4 = CreditTransferActivity.this;
in.hopscotch.android.databinding.y yVar = ((CreditTransferActivity) r4).binding;
if (yVar == null) {
Intrinsics.throwUninitializedPropertyAccessException("binding");
yVar = null;
}
CustomProgressbar customProgressbar = yVar.g;
Intrinsics.checkNotNullExpressionValue(customProgressbar, "eddProgressBar");
in.hopscotch.android.core.util.j.b(customProgressbar);
in.hopscotch.android.util.q.h((Activity) r4, r4.getString(2132019191), (DialogInterface.OnDismissListener) null);
r4.finish();
}
@Override
public final void onResponse(Response<ActionResponse> response) {
?? r0 = CreditTransferActivity.this;
in.hopscotch.android.databinding.y yVar = ((CreditTransferActivity) r0).binding;
in.hopscotch.android.databinding.y yVar2 = null;
if (yVar == null) {
Intrinsics.throwUninitializedPropertyAccessException("binding");
yVar = null;
}
CustomProgressbar customProgressbar = yVar.g;
Intrinsics.checkNotNullExpressionValue(customProgressbar, "eddProgressBar");
in.hopscotch.android.core.util.j.b(customProgressbar);
if (response == null || !response.isSuccessful()) {
in.hopscotch.android.util.q.h((Activity) r0, r0.getString(2132019191), (DialogInterface.OnDismissListener) null);
r0.finish();
return;
}
if (response.body() != null) {
Object body = response.body();
Intrinsics.checkNotNull(body);
String str = ((ActionResponse) body).action;
String str2 = in.hopscotch.android.util.a1.a;
if ("success".equalsIgnoreCase(str)) {
in.hopscotch.android.databinding.y yVar3 = ((CreditTransferActivity) r0).binding;
if (yVar3 == null) {
Intrinsics.throwUninitializedPropertyAccessException("binding");
yVar3 = null;
}
yVar3.f.setVisibility(8);
in.hopscotch.android.databinding.y yVar4 = ((CreditTransferActivity) r0).binding;
if (yVar4 == null) {
Intrinsics.throwUninitializedPropertyAccessException("binding");
yVar4 = null;
}
yVar4.u.f.setVisibility(0);
in.hopscotch.android.databinding.y yVar5 = ((CreditTransferActivity) r0).binding;
if (yVar5 == null) {
Intrinsics.throwUninitializedPropertyAccessException("binding");
} else {
yVar2 = yVar5;
}
yVar2.u.e.j("https://www.hopscotch.in/assets_helpcentre/images/done.gif", false, false);
return;
}
}
ActionResponse actionResponse = (ActionResponse) response.body();
in.hopscotch.android.util.q.h((Activity) r0, actionResponse != null ? actionResponse.errorMsg : null, (DialogInterface.OnDismissListener) null);
}
}
public static void R0(in.hopscotch.android.activity.CreditTransferActivity r9, in.hopscotch.android.databinding.y r10) {
throw new UnsupportedOperationException("Method not decompiled: in.hopscotch.android.activity.CreditTransferActivity.R0(in.hopscotch.android.activity.CreditTransferActivity, in.hopscotch.android.databinding.y):void");
}
public static void S0(CreditTransferActivity creditTransferActivity, in.hopscotch.android.databinding.y yVar) {
Intrinsics.checkNotNullParameter(yVar, "$this_with");
Intrinsics.checkNotNullParameter(creditTransferActivity, "this$0");
CustomTextInputEditText customTextInputEditText = yVar.k;
if (String.valueOf(customTextInputEditText.getText()).length() > 0) {
String valueOf = String.valueOf(customTextInputEditText.getText());
in.hopscotch.android.databinding.y yVar2 = creditTransferActivity.binding;
if (yVar2 == null) {
Intrinsics.throwUninitializedPropertyAccessException("binding");
yVar2 = null;
}
CustomProgressbar customProgressbar = yVar2.g;
Intrinsics.checkNotNullExpressionValue(customProgressbar, "eddProgressBar");
in.hopscotch.android.core.util.j.f(customProgressbar);
CustomerInfoApiFactory.getInstance().verifyUPIAddress(new VerifyUPIRequest(ApiParam.INSTRUMENT_TYPE_UPI, new Details(valueOf)), new f(creditTransferActivity));
}
}
public static void T0(in.hopscotch.android.databinding.y yVar, CreditTransferActivity creditTransferActivity, int i2) {
Intrinsics.checkNotNullParameter(yVar, "$this_with");
Intrinsics.checkNotNullParameter(creditTransferActivity, "this$0");
BottomButton bottomButton = yVar.e;
LinearLayout linearLayout = yVar.p;
LinearLayout linearLayout2 = yVar.q;
if (i2 != 2131364222) {
Intrinsics.checkNotNullExpressionValue(linearLayout2, "llUpiInput");
in.hopscotch.android.core.util.j.b(linearLayout2);
Intrinsics.checkNotNullExpressionValue(linearLayout, "llInput");
in.hopscotch.android.core.util.j.f(linearLayout);
creditTransferActivity.isUPIRefundsFlow = false;
bottomButton.setEnabled(true);
return;
}
Intrinsics.checkNotNullExpressionValue(linearLayout2, "llUpiInput");
in.hopscotch.android.core.util.j.f(linearLayout2);
Intrinsics.checkNotNullExpressionValue(linearLayout, "llInput");
in.hopscotch.android.core.util.j.b(linearLayout);
bottomButton.setEnabled(false);
AppCompatTextView appCompatTextView = yVar.x;
Intrinsics.checkNotNullExpressionValue(appCompatTextView, "verifyText");
in.hopscotch.android.core.util.j.b(appCompatTextView);
ImageView imageView = yVar.w;
Intrinsics.checkNotNullExpressionValue(imageView, "upiStatusIcon");
in.hopscotch.android.core.util.j.b(imageView);
AppCompatTextView appCompatTextView2 = yVar.o;
Intrinsics.checkNotNullExpressionValue(appCompatTextView2, "errorUpiText");
in.hopscotch.android.core.util.j.b(appCompatTextView2);
creditTransferActivity.isUPIRefundsFlow = true;
}
public static final void V0(CreditTransferActivity creditTransferActivity, boolean z) {
in.hopscotch.android.databinding.y yVar = null;
if (z) {
in.hopscotch.android.databinding.y yVar2 = creditTransferActivity.binding;
if (yVar2 == null) {
Intrinsics.throwUninitializedPropertyAccessException("binding");
yVar2 = null;
}
AppCompatTextView appCompatTextView = yVar2.x;
Intrinsics.checkNotNullExpressionValue(appCompatTextView, "verifyText");
in.hopscotch.android.core.util.j.f(appCompatTextView);
in.hopscotch.android.databinding.y yVar3 = creditTransferActivity.binding;
if (yVar3 == null) {
Intrinsics.throwUninitializedPropertyAccessException("binding");
yVar3 = null;
}
yVar3.x.setTextColor(androidx.core.content.a.b(creditTransferActivity, 2131099965));
in.hopscotch.android.databinding.y yVar4 = creditTransferActivity.binding;
if (yVar4 == null) {
Intrinsics.throwUninitializedPropertyAccessException("binding");
yVar4 = null;
}
yVar4.x.setText(creditTransferActivity.getString(2132019440));
in.hopscotch.android.databinding.y yVar5 = creditTransferActivity.binding;
if (yVar5 == null) {
Intrinsics.throwUninitializedPropertyAccessException("binding");
} else {
yVar = yVar5;
}
yVar.e.setEnabled(true);
return;
}
in.hopscotch.android.databinding.y yVar6 = creditTransferActivity.binding;
if (yVar6 == null) {
Intrinsics.throwUninitializedPropertyAccessException("binding");
yVar6 = null;
}
AppCompatTextView appCompatTextView2 = yVar6.x;
Intrinsics.checkNotNullExpressionValue(appCompatTextView2, "verifyText");
in.hopscotch.android.core.util.j.f(appCompatTextView2);
in.hopscotch.android.databinding.y yVar7 = creditTransferActivity.binding;
if (yVar7 == null) {
Intrinsics.throwUninitializedPropertyAccessException("binding");
yVar7 = null;
}
yVar7.x.setTextColor(androidx.core.content.a.b(creditTransferActivity, 2131099810));
in.hopscotch.android.databinding.y yVar8 = creditTransferActivity.binding;
if (yVar8 == null) {
Intrinsics.throwUninitializedPropertyAccessException("binding");
yVar8 = null;
}
yVar8.x.setText(creditTransferActivity.getString(2132019441));
in.hopscotch.android.databinding.y yVar9 = creditTransferActivity.binding;
if (yVar9 == null) {
Intrinsics.throwUninitializedPropertyAccessException("binding");
} else {
yVar = yVar9;
}
yVar.e.setEnabled(false);
}
public final void W0(Object obj) {
String string = getString(this.isUPIRefundsFlow ? 2132019403 : 2132017322);
Intrinsics.checkNotNull(string);
RefundInstrument refundInstrument = new RefundInstrument(string, obj);
String string2 = getString(2132018911);
Intrinsics.checkNotNullExpressionValue(string2, "getString(...)");
String string3 = getString(2132019317);
Intrinsics.checkNotNullExpressionValue(string3, "getString(...)");
String string4 = this.isUPIRefundsFlow ? getString(2132019405) : getString(2132018896);
Intrinsics.checkNotNull(string4);
RefundRequest refundRequest = new RefundRequest(string2, string3, string4, refundInstrument, true);
in.hopscotch.android.databinding.y yVar = this.binding;
if (yVar == null) {
Intrinsics.throwUninitializedPropertyAccessException("binding");
yVar = null;
}
CustomProgressbar customProgressbar = yVar.g;
Intrinsics.checkNotNullExpressionValue(customProgressbar, "eddProgressBar");
in.hopscotch.android.core.util.j.f(customProgressbar);
CustomerInfoApiFactory.getInstance().transferToBankAccount(refundRequest, new b());
}
public final void onCreate(Bundle bundle) {
super/*androidx.fragment.app.n*/.onCreate(bundle);
androidx.databinding.p h = androidx.databinding.g.h(this, 2131558457);
Intrinsics.checkNotNullExpressionValue(h, "setContentView(...)");
in.hopscotch.android.databinding.y yVar = (in.hopscotch.android.databinding.y) h;
this.binding = yVar;
final in.hopscotch.android.databinding.y yVar2 = null;
if (yVar == null) {
Intrinsics.throwUninitializedPropertyAccessException("binding");
yVar = null;
}
setContentView(yVar.E());
in.hopscotch.android.databinding.y yVar3 = this.binding;
if (yVar3 == null) {
Intrinsics.throwUninitializedPropertyAccessException("binding");
yVar3 = null;
}
setSupportActionBar(yVar3.v.d);
androidx.appcompat.app.a supportActionBar = getSupportActionBar();
if (supportActionBar != null) {
supportActionBar.t(true);
supportActionBar.w();
}
Bundle extras = getIntent().getExtras();
this.creditAmount = extras != null ? extras.getDouble("credit") : 0.0d;
in.hopscotch.android.databinding.y yVar4 = this.binding;
if (yVar4 == null) {
Intrinsics.throwUninitializedPropertyAccessException("binding");
} else {
yVar2 = yVar4;
}
yVar2.v.e.setText(getString(2132018975));
boolean b2 = in.hopscotch.android.core.providers.a.b();
?? r1 = yVar2.e;
RadioGroup radioGroup = yVar2.t;
AppCompatTextView appCompatTextView = yVar2.d;
if (b2) {
appCompatTextView.setText(getString(2132017324));
this.isExperimentFLow = true;
} else {
yVar2.s.setChecked(true);
LinearLayout linearLayout = yVar2.q;
Intrinsics.checkNotNullExpressionValue(linearLayout, "llUpiInput");
in.hopscotch.android.core.util.j.b(linearLayout);
Intrinsics.checkNotNullExpressionValue(radioGroup, "rgPaymentMode");
in.hopscotch.android.core.util.j.b(radioGroup);
LinearLayout linearLayout2 = yVar2.p;
Intrinsics.checkNotNullExpressionValue(linearLayout2, "llInput");
in.hopscotch.android.core.util.j.f(linearLayout2);
this.isUPIRefundsFlow = false;
this.isExperimentFLow = false;
r1.setEnabled(true);
appCompatTextView.setText(getString(2132017323));
}
radioGroup.setOnCheckedChangeListener(new RadioGroup.OnCheckedChangeListener(this) {
public final CreditTransferActivity b;
{
this.b = this;
}
@Override
public final void onCheckedChanged(RadioGroup radioGroup2, int i2) {
CreditTransferActivity.T0(yVar2, this.b, i2);
}
});
yVar2.k.addTextChangedListener(new a(yVar2));
yVar2.x.setOnClickListener(new c(0, yVar2, this));
yVar2.w.setOnClickListener(new androidx.media3.ui.g(yVar2, 5));
r1.setOnClickListener(new d(0, this, yVar2));
yVar2.u.d.setOnClickListener(new androidx.media3.ui.j(this, 4));
}
public final boolean onOptionsItemSelected(@NotNull MenuItem menuItem) {
Intrinsics.checkNotNullParameter(menuItem, "item");
if (menuItem.getItemId() == 16908332) {
onBackPressed();
}
return super/*android.app.Activity*/.onOptionsItemSelected(menuItem);
}
}