正在查看: SpeedCash v6.5.1482 应用的 TelkomselPerzonaActivity.java JAVA 源代码文件
本页面展示 JAVA 反编译生成的源代码文件,支持语法高亮显示。 仅供安全研究与技术分析使用,严禁用于任何非法用途。请遵守相关法律法规。
正在查看: SpeedCash v6.5.1482 应用的 TelkomselPerzonaActivity.java JAVA 源代码文件
本页面展示 JAVA 反编译生成的源代码文件,支持语法高亮显示。 仅供安全研究与技术分析使用,严禁用于任何非法用途。请遵守相关法律法规。
package com.bm.sc.bebasbayar.ui.activity.ubp.paketdata;
import android.app.Activity;
import android.content.Context;
import android.content.Intent;
import android.content.res.ColorStateList;
import android.os.Bundle;
import android.os.Handler;
import android.text.Editable;
import android.text.TextWatcher;
import android.view.View;
import android.view.inputmethod.InputMethodManager;
import android.widget.CompoundButton;
import android.widget.ImageView;
import android.widget.RelativeLayout;
import android.widget.TextView;
import androidx.appcompat.widget.AppCompatButton;
import androidx.appcompat.widget.SearchView;
import androidx.constraintlayout.widget.ConstraintLayout;
import androidx.core.content.ContextCompat;
import androidx.fragment.app.FragmentTransaction;
import androidx.recyclerview.widget.RecyclerView;
import com.bm.sc.auth.helper.OneClickPayHelperAdd;
import com.bm.sc.auth.helper.OpenPaymentHelper;
import com.bm.sc.auth.ui.oneclick.OneClickCartActivity;
import com.bm.sc.bebasbayar.BuildConfig;
import com.bm.sc.bebasbayar.R;
import com.bm.sc.bebasbayar.adapter.BaseAdapter;
import com.bm.sc.bebasbayar.adapter.entity.ProdukListEntity;
import com.bm.sc.bebasbayar.adapter.entity.PulsaEntity;
import com.bm.sc.bebasbayar.adapter.entity.VoucherEntity;
import com.bm.sc.bebasbayar.adapter.list.HistoryPulsaAdapter;
import com.bm.sc.bebasbayar.handler.FirebaseProcessor;
import com.bm.sc.bebasbayar.handler.MessageComposer;
import com.bm.sc.bebasbayar.handler.MessageSender;
import com.bm.sc.bebasbayar.handler.QRISO;
import com.bm.sc.bebasbayar.helper.Affinity;
import com.bm.sc.bebasbayar.helper.WidgetHelper;
import com.bm.sc.bebasbayar.iface.AdapterInvoker;
import com.bm.sc.bebasbayar.iface.BBCallback;
import com.bm.sc.bebasbayar.iface.MessageProcess;
import com.bm.sc.bebasbayar.message.BaseMessage;
import com.bm.sc.bebasbayar.message.BusMessage;
import com.bm.sc.bebasbayar.message.MPMessage;
import com.bm.sc.bebasbayar.message.api.APIMessageWrapper;
import com.bm.sc.bebasbayar.message.mp.DimoMessage;
import com.bm.sc.bebasbayar.message.mp.PaketPerzonaWrapper;
import com.bm.sc.bebasbayar.message.mp.PulsaPaketanGameMessage;
import com.bm.sc.bebasbayar.message.qr.DataMessage;
import com.bm.sc.bebasbayar.setting.session.AppSession;
import com.bm.sc.bebasbayar.setting.session.ConfigSession;
import com.bm.sc.bebasbayar.setting.session.DataSession;
import com.bm.sc.bebasbayar.ui.BaseActivity;
import com.bm.sc.bebasbayar.ui.activity.TransactionActivity;
import com.bm.sc.bebasbayar.ui.activity.cash.Deposit2Activity;
import com.bm.sc.bebasbayar.ui.activity.info.OpenPaymentWebViewActivity;
import com.bm.sc.bebasbayar.ui.activity.list.OptionVoucherListActivity;
import com.bm.sc.bebasbayar.ui.activity.ubp.paketdata.TelkomselPerzonaActivity;
import com.bm.sc.bebasbayar.ui.fragment.dialog.ChangePaymentMethodFragment;
import com.bm.sc.bebasbayar.ui.fragment.dialog.OptionListFragment;
import com.bm.sc.bebasbayar.ui.fragment.dialog.OptionListFragment1;
import com.bm.sc.bebasbayar.ui.fragment.dialog.OptionListFragment2;
import com.bm.sc.bebasbayar.ui.fragment.dialog.UbpHistoryFragment;
import com.bm.sc.bebasbayar.ui.fragment.ubp.paketdata.PerzonaFragment;
import com.bm.sc.util.android.Compat;
import com.bm.sc.util.android.Device;
import com.bm.sc.util.common.Var;
import com.bm.sc.util.format.Locales;
import com.google.android.material.switchmaterial.SwitchMaterial;
import com.google.android.material.textfield.TextInputEditText;
import com.orhanobut.dialogplus.DialogPlus;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.Iterator;
import java.util.Locale;
import java.util.Objects;
import java.util.Timer;
import java.util.TimerTask;
import java.util.concurrent.TimeUnit;
import java.util.concurrent.atomic.AtomicBoolean;
import kotlin.Unit;
import kotlin.jvm.functions.Function1;
import nl.dionsegijn.konfetti.core.PartyFactory;
import nl.dionsegijn.konfetti.core.emitter.Emitter;
import nl.dionsegijn.konfetti.xml.KonfettiView;
import org.apache.commons.text.WordUtils;
import org.greenrobot.eventbus.EventBus;
import org.greenrobot.eventbus.Subscribe;
import org.greenrobot.eventbus.ThreadMode;
import org.json.JSONArray;
import org.json.JSONException;
import org.json.JSONObject;
public class TelkomselPerzonaActivity extends TransactionActivity implements AdapterInvoker<PulsaEntity>, UbpHistoryFragment.UbpHistoryListener, HistoryPulsaAdapter.Callback {
public static final int VOUCHER_REQUEST_CODE_DATA = 12992;
public Timer F;
public String G;
public String I;
public ArrayList<String> J;
public RecyclerView K;
public HistoryPulsaAdapter L;
public boolean M;
public View N;
public SwitchMaterial O;
public View P;
public TextView Q;
public ConstraintLayout R;
public ConstraintLayout S;
public ConstraintLayout T;
public TextView U;
public TextView V;
public PulsaPaketanGameMessage W;
public KonfettiView k;
public double l;
public String n;
public TextView o;
public TextInputEditText p;
public AppCompatButton q;
public String s;
public int w;
public double y;
public final ArrayList<VoucherEntity> i = new ArrayList<>();
public boolean j = false;
public boolean m = false;
public ArrayList<HashMap<String, Object>> r = new ArrayList<>();
public String t = "";
public String u = "";
public String v = "";
public View x = null;
public double z = 0.0d;
public double A = 0.0d;
public double B = 0.0d;
public DialogPlus C = null;
public boolean D = false;
public ArrayList<ProdukListEntity> E = new ArrayList<>();
public boolean H = true;
public boolean X = false;
public boolean Y = false;
public PerzonaFragment Z = PerzonaFragment.newInstance();
public class a implements TextWatcher {
public class C0034a extends TimerTask {
public final CharSequence a;
public C0034a(CharSequence charSequence) {
this.a = charSequence;
}
public void b(CharSequence charSequence) {
TelkomselPerzonaActivity.this.findViewById(R.id.img_provider).setVisibility(8);
TelkomselPerzonaActivity.this.q.setAlpha(0.3f);
TelkomselPerzonaActivity.this.q.setClickable(false);
if (charSequence.length() <= 5 || !TelkomselPerzonaActivity.this.H) {
return;
}
TelkomselPerzonaActivity.this.findViewById(R.id.img_provider).setVisibility(8);
TelkomselPerzonaActivity.this.q.setAlpha(1.0f);
TelkomselPerzonaActivity.this.q.setClickable(true);
}
@Override
public void run() {
SearchView.OnCloseListener onCloseListener = TelkomselPerzonaActivity.this;
final CharSequence charSequence = this.a;
onCloseListener.runOnUiThread(new Runnable() {
@Override
public final void run() {
TelkomselPerzonaActivity.a.C0034a.this.b(charSequence);
}
});
}
}
public a() {
}
@Override
public void afterTextChanged(Editable editable) {
if (editable.length() == 0) {
TelkomselPerzonaActivity.this.l1();
} else if (editable.length() > 0) {
TelkomselPerzonaActivity.this.m1();
}
}
@Override
public void beforeTextChanged(CharSequence charSequence, int i, int i2, int i3) {
}
@Override
public void onTextChanged(CharSequence charSequence, int i, int i2, int i3) {
if (TelkomselPerzonaActivity.this.F != null) {
TelkomselPerzonaActivity.this.F.cancel();
}
TelkomselPerzonaActivity.this.F = new Timer();
TelkomselPerzonaActivity.this.F.schedule(new C0034a(charSequence), 500L);
}
}
public class b implements View.OnClickListener {
public b() {
}
@Override
public void onClick(View view) {
TelkomselPerzonaActivity.this.H0();
}
}
public class c implements View.OnClickListener {
public c() {
}
@Override
public void onClick(View view) {
TelkomselPerzonaActivity.this.H0();
}
}
public class d implements MessageProcess {
public final PulsaEntity a;
public d(PulsaEntity pulsaEntity) {
this.a = pulsaEntity;
}
@Override
public void afterProcess(BaseMessage baseMessage) {
APIMessageWrapper aPIMessageWrapper = new APIMessageWrapper(baseMessage);
if (aPIMessageWrapper.isOK()) {
aPIMessageWrapper.getData();
HashMap<String, Object> hashMap = aPIMessageWrapper.getData().get(0);
HashMap hashMap2 = Var.toHashMap(hashMap.get("detail_voucher"));
TelkomselPerzonaActivity.this.t = Var.toString(hashMap2.get("kode_voucher"), "");
TelkomselPerzonaActivity.this.z = Var.toDouble(hashMap.get("nominal_voucher"), 0.0d);
TelkomselPerzonaActivity.this.u = Var.toString(hashMap2.get("kode_voucher"), "");
TelkomselPerzonaActivity.this.B = Var.toDouble(hashMap.get("nominal_voucher"), 0.0d);
}
TelkomselPerzonaActivity.this.I0(this.a);
}
@Override
public void backgroundProcess(long j, long j2, boolean z) {
}
@Override
public void preProcess() {
}
}
public class e implements MessageProcess {
public e() {
}
public void b(int i, Boolean bool) {
TelkomselPerzonaActivity.this.t = "";
TelkomselPerzonaActivity.this.u = "";
TelkomselPerzonaActivity.this.setKode_voucher("");
TelkomselPerzonaActivity.this.doTransaction(true, null);
}
@Override
public void afterProcess(BaseMessage baseMessage) {
APIMessageWrapper aPIMessageWrapper = new APIMessageWrapper(baseMessage);
if (aPIMessageWrapper.isOK()) {
TelkomselPerzonaActivity.this.doTransaction(true, null);
} else {
SearchView.OnCloseListener onCloseListener = TelkomselPerzonaActivity.this;
Affinity.info(onCloseListener, 1, onCloseListener.getString(R.string.title_info), Var.toString(aPIMessageWrapper.getMap().get("keterangan"), ""), new BBCallback() {
@Override
public final void do_callback(int i, Object obj) {
TelkomselPerzonaActivity.e.this.b(i, (Boolean) obj);
}
});
}
}
@Override
public void backgroundProcess(long j, long j2, boolean z) {
}
@Override
public void preProcess() {
}
}
public class f implements MessageProcess {
public f() {
}
@Override
public void afterProcess(BaseMessage baseMessage) {
APIMessageWrapper aPIMessageWrapper = new APIMessageWrapper(baseMessage);
ArrayList arrayList = new ArrayList();
if (!aPIMessageWrapper.isOK()) {
TelkomselPerzonaActivity.this.findViewById(R.id.pulsa_carousel_more_btn).setVisibility(8);
TelkomselPerzonaActivity.this.findViewById(R.id.label_history_trx).setVisibility(8);
TelkomselPerzonaActivity.this.K.setVisibility(8);
if (aPIMessageWrapper.getData().isEmpty()) {
return;
}
HashMap<String, Object> hashMap = aPIMessageWrapper.getData().get(0);
Var.toString(hashMap.get("id_pelanggan"), "");
Var.toString(hashMap.get(FirebaseProcessor.KEY_IMAGE_URL), "");
TelkomselPerzonaActivity.this.o.setText("Nomor Saya");
TelkomselPerzonaActivity.this.findViewById(R.id.label_history_trx).setVisibility(0);
if (TelkomselPerzonaActivity.this.G == null || Var.toString(((BaseActivity) TelkomselPerzonaActivity.this).appSession.retrieve(AppSession.PROPERTY_HANDPHONE_PROVIDER_ID), "").equals(TelkomselPerzonaActivity.this.G)) {
return;
}
TelkomselPerzonaActivity.this.findViewById(R.id.label_history_trx).setVisibility(8);
return;
}
TelkomselPerzonaActivity.this.M = true;
ArrayList<HashMap<String, Object>> data = aPIMessageWrapper.getData();
HashMap<String, Object> hashMap2 = aPIMessageWrapper.getData().get(0);
String var = Var.toString(hashMap2.get("id_pelanggan"), "");
TelkomselPerzonaActivity.this.o.setText("Transaksi Terakhir");
TelkomselPerzonaActivity.this.findViewById(R.id.pulsa_carousel_more_btn).setVisibility(0);
TelkomselPerzonaActivity.this.findViewById(R.id.label_history_trx).setVisibility(0);
TelkomselPerzonaActivity.this.K.setVisibility(0);
if (!var.isEmpty()) {
Var.toString(hashMap2.get("produk"), "");
Var.toString(hashMap2.get(FirebaseProcessor.KEY_IMAGE_URL), "");
}
Iterator<HashMap<String, Object>> it = data.iterator();
while (it.hasNext()) {
HashMap<String, Object> next = it.next();
ProdukListEntity produkListEntity = new ProdukListEntity();
produkListEntity.setIdPel1(Var.toString(next.get("id_pelanggan"), ""));
produkListEntity.setProduk(Var.toString(next.get("produk"), ""));
produkListEntity.setTime(Var.toString(next.get("tanggal"), ""));
produkListEntity.setDrawable_url(Var.toString(next.get(FirebaseProcessor.KEY_IMAGE_URL), ""));
produkListEntity.setName(Var.toString(next.get("nama_pelanggan"), ""));
arrayList.add(produkListEntity);
}
TelkomselPerzonaActivity.this.E = arrayList;
TelkomselPerzonaActivity.this.L.updateList(TelkomselPerzonaActivity.this.E);
TelkomselPerzonaActivity.this.K.setAdapter(TelkomselPerzonaActivity.this.L);
TelkomselPerzonaActivity.this.findViewById(R.id.label_history_trx).setVisibility(0);
if (TelkomselPerzonaActivity.this.G == null || !Var.toString(((BaseActivity) TelkomselPerzonaActivity.this).appSession.retrieve(AppSession.PROPERTY_HANDPHONE_PROVIDER_ID), "").equals(TelkomselPerzonaActivity.this.G)) {
return;
}
TelkomselPerzonaActivity.this.p.setText(((BaseActivity) TelkomselPerzonaActivity.this).appSession.retrieve(AppSession.PROPERTY_HANDPHONE));
TelkomselPerzonaActivity.this.m1();
}
@Override
public void backgroundProcess(long j, long j2, boolean z) {
}
@Override
public void preProcess() {
}
}
public class g implements Runnable {
public g() {
}
@Override
public void run() {
?? r0 = TelkomselPerzonaActivity.this;
r0.Z.setSupportFragment(r0.getSupportFragmentManager());
TelkomselPerzonaActivity telkomselPerzonaActivity = TelkomselPerzonaActivity.this;
telkomselPerzonaActivity.Z.setMapAllData(telkomselPerzonaActivity.r);
FragmentTransaction beginTransaction = TelkomselPerzonaActivity.this.getSupportFragmentManager().beginTransaction();
beginTransaction.replace(R.id.fragment_container_perzona, TelkomselPerzonaActivity.this.Z);
beginTransaction.attach(TelkomselPerzonaActivity.this.Z);
beginTransaction.commit();
}
}
public class h implements View.OnClickListener {
public final PulsaEntity a;
public h(PulsaEntity pulsaEntity) {
this.a = pulsaEntity;
}
@Override
public void onClick(View view) {
TelkomselPerzonaActivity.this.openVoucherList(this.a);
}
}
public class i implements View.OnClickListener {
public final PulsaEntity a;
public i(PulsaEntity pulsaEntity) {
this.a = pulsaEntity;
}
@Override
public void onClick(View view) {
TelkomselPerzonaActivity.this.changePaymentMethod(this.a);
}
}
public class j implements View.OnClickListener {
public final PulsaEntity a;
public j(PulsaEntity pulsaEntity) {
this.a = pulsaEntity;
}
@Override
public void onClick(View view) {
TelkomselPerzonaActivity.this.changePaymentMethod(this.a);
}
}
public class k implements View.OnClickListener {
public k() {
}
@Override
public void onClick(View view) {
TelkomselPerzonaActivity.this.H0();
}
}
public class l implements View.OnClickListener {
public l() {
}
@Override
public void onClick(View view) {
TelkomselPerzonaActivity.this.H0();
}
}
public class m implements View.OnClickListener {
public m() {
}
@Override
public void onClick(View view) {
TelkomselPerzonaActivity.this.H0();
}
}
public void Q0(PulsaEntity pulsaEntity, int i2, Boolean bool) {
bool.booleanValue();
O0(pulsaEntity);
}
public Unit R0(BaseMessage baseMessage) {
APIMessageWrapper aPIMessageWrapper = new APIMessageWrapper(baseMessage);
if (!aPIMessageWrapper.isOK()) {
Affinity.info(this, false, Var.toString(aPIMessageWrapper.getResponse_description(), ""));
return null;
}
aPIMessageWrapper.getData().get(0);
Affinity.purge(this, OneClickCartActivity.class);
return null;
}
public void S0(PulsaEntity pulsaEntity, View view) {
payment(pulsaEntity);
}
public void T0(PulsaEntity pulsaEntity, View view) {
payment(pulsaEntity);
}
public void U0(PulsaEntity pulsaEntity, View view) {
payment(pulsaEntity);
}
public void V0(PulsaEntity pulsaEntity, View view) {
payment(pulsaEntity);
}
public void W0(View view) {
this.C.dismiss();
Affinity.launch(this, Deposit2Activity.class);
}
public void X0(PulsaEntity pulsaEntity, View view) {
Bundle bundle = new Bundle();
bundle.putString("idProduk", getSelectedProductCode());
bundle.putString("group", "pulsa");
bundle.putDouble("harga", pulsaEntity.getHargajual());
bundle.putInt("requestCode", VOUCHER_REQUEST_CODE_DATA);
Affinity.listen(this, OptionVoucherListActivity.class, 0, bundle);
}
public void Y0(PulsaEntity pulsaEntity, TextView textView, int i2, Boolean bool) {
if (bool.booleanValue()) {
this.x.findViewById(R.id.voucher_container).setVisibility(8);
this.x.findViewById(R.id.voucher_add_container).setVisibility(8);
this.x.findViewById(R.id.btn_voucher).setVisibility(0);
this.T.setVisibility(0);
this.x.findViewById(R.id.switch_poin).setEnabled(true);
this.y = Var.toDouble(pulsaEntity.getNominalUp(), 0.0d);
this.w = Var.toInt(Integer.valueOf(pulsaEntity.getHargajual()), 0);
((TextView) this.x.findViewById(R.id.pulsa_price)).setText(Locales.moneyNoFraction(Var.toString(Integer.valueOf(this.w), "")));
((TextView) this.x.findViewById(R.id.pulsa_price_nett)).setText(Locales.moneyNoFraction(Var.toString(Integer.valueOf(this.w), "")));
textView.setText(Locales.moneyNoFraction(Var.toString(Integer.valueOf(this.w), "")));
String.format(Locale.getDefault(), "- %1$s", Locales.moneyNoFraction(Var.toString(Integer.valueOf((int) this.y), "0")));
if (this.y > 0.0d) {
this.x.findViewById(R.id.tv_label_discount).setVisibility(8);
this.x.findViewById(R.id.pulsa_discount).setVisibility(8);
((TextView) this.x.findViewById(R.id.pulsa_discount)).setText(String.format(Locale.getDefault(), "- %1$s", Locales.moneyNoFraction(Var.toString(Integer.valueOf((int) this.y), "0"))));
} else {
this.x.findViewById(R.id.tv_label_discount).setVisibility(8);
this.x.findViewById(R.id.pulsa_discount).setVisibility(8);
}
this.v = "";
this.t = "";
this.z = 0.0d;
this.A = 0.0d;
setKode_voucher("");
if (!this.u.equals("")) {
String str = this.u;
this.t = str;
setKode_voucher(str);
this.z = this.B;
this.k.start(new PartyFactory(new Emitter(5L, TimeUnit.SECONDS).perSecond(50)).angle(270).spread(90).setSpeedBetween(1.0f, 5.0f).timeToLive(2000L).position(0.0d, 0.0d, 1.0d, 0.0d).build());
this.T.setVisibility(8);
this.R.setVisibility(0);
}
if (Var.toDouble(this.n, 0.0d) >= this.w) {
this.x.findViewById(R.id.btn_pay).setVisibility(0);
this.x.findViewById(R.id.btn_topup).setVisibility(4);
this.Q.setVisibility(8);
this.V.setTextColor(ContextCompat.getColor(this, R.color.colorInvoice));
this.U.setTextColor(ContextCompat.getColor(this, R.color.colorInvoice));
return;
}
if (this.m) {
this.x.findViewById(R.id.btn_pay).setVisibility(0);
this.x.findViewById(R.id.btn_topup).setVisibility(4);
this.Q.setVisibility(8);
this.V.setTextColor(ContextCompat.getColor(this, R.color.colorInvoice));
this.U.setTextColor(ContextCompat.getColor(this, R.color.colorInvoice));
return;
}
this.x.findViewById(R.id.btn_pay).setVisibility(4);
this.x.findViewById(R.id.btn_topup).setVisibility(0);
this.Q.setVisibility(0);
this.V.setTextColor(ContextCompat.getColor(this, R.color.colorLevelPremium));
this.U.setTextColor(ContextCompat.getColor(this, R.color.colorLevelPremium));
((TextView) this.x.findViewById(R.id.tv_balance_insufficient)).setTextColor(ContextCompat.getColor(this, R.color.colorLevelPremium));
}
}
public void Z0(final PulsaEntity pulsaEntity, final TextView textView, View view) {
Affinity.confirm(this, "Konfirmasi Hapus Voucher", "Anda yakin akan menghapus voucher?", new BBCallback() {
@Override
public final void do_callback(int i2, Object obj) {
TelkomselPerzonaActivity.this.Y0(pulsaEntity, textView, i2, (Boolean) obj);
}
});
}
public void a1(TextView textView, ImageView imageView, ImageView imageView2, ImageView imageView3, ImageView imageView4, TextView textView2, TextView textView3, ConstraintLayout constraintLayout, double d2, TextView textView4, TextView textView5, TextView textView6, boolean z, CompoundButton compoundButton, boolean z2) {
if (!z2) {
((TextView) this.x.findViewById(R.id.label_poin_voucher)).setTextColor(ContextCompat.getColor(this, R.color.colorPrimaryAlt));
((TextView) this.x.findViewById(R.id.label_poin_voucher2)).setTextColor(ContextCompat.getColor(this, R.color.Black));
this.R.setEnabled(true);
this.T.setEnabled(true);
this.x.findViewById(R.id.poin_voucher_arrowRIght).setEnabled(true);
this.j = false;
textView.setTextColor(ContextCompat.getColor(this, R.color.Black));
imageView.setImageResource(R.drawable.ic_persen_poin);
imageView2.setImageResource(R.drawable.ic_cek_list_blue);
imageView3.setImageResource(R.drawable.ic_arrow_right_poin);
imageView4.setImageResource(R.drawable.ic_arrow_right_poin);
this.R.setBackgroundResource(R.drawable.bb_background_transparent_blue_rounded_16);
this.T.setBackgroundResource(R.drawable.bb_background_transparent_blue_rounded_16);
textView2.setVisibility(8);
textView3.setVisibility(8);
textView3.setText("- Rp0");
textView4.setText(Locales.moneyNoFraction(String.valueOf(this.w)));
constraintLayout.setVisibility(8);
this.R.setVisibility(8);
this.T.setVisibility(0);
textView6.setText(Locales.moneyNoFraction(Var.toString(Integer.valueOf(this.w), "")));
imageView3.setEnabled(true);
imageView.setEnabled(true);
if (!this.u.equals("")) {
String str = this.u;
this.t = str;
this.z = this.B;
setKode_voucher(str);
this.k.start(new PartyFactory(new Emitter(5L, TimeUnit.SECONDS).perSecond(50)).angle(270).spread(90).setSpeedBetween(1.0f, 5.0f).timeToLive(2000L).position(0.0d, 0.0d, 1.0d, 0.0d).build());
this.T.setVisibility(8);
this.R.setVisibility(0);
}
if (Var.toDouble(this.n, 0.0d) >= this.w) {
this.P.findViewById(R.id.btn_pay).setVisibility(0);
this.P.findViewById(R.id.btn_topup).setVisibility(4);
this.Q.setVisibility(8);
this.V.setTextColor(ContextCompat.getColor(this, R.color.colorInvoice));
this.U.setTextColor(ContextCompat.getColor(this, R.color.colorInvoice));
return;
}
if (z) {
this.P.findViewById(R.id.btn_pay).setVisibility(0);
this.P.findViewById(R.id.btn_topup).setVisibility(4);
this.Q.setVisibility(8);
this.V.setTextColor(ContextCompat.getColor(this, R.color.colorInvoice));
this.U.setTextColor(ContextCompat.getColor(this, R.color.colorInvoice));
return;
}
this.P.findViewById(R.id.btn_pay).setVisibility(4);
this.P.findViewById(R.id.btn_topup).setVisibility(0);
this.Q.setVisibility(0);
this.V.setTextColor(ContextCompat.getColor(this, R.color.colorLevelPremium));
this.U.setTextColor(ContextCompat.getColor(this, R.color.colorLevelPremium));
this.Q.setTextColor(ContextCompat.getColor(this, R.color.colorLevelPremium));
return;
}
((TextView) this.x.findViewById(R.id.label_poin_voucher)).setTextColor(ContextCompat.getColor(this, R.color.Gray));
((TextView) this.x.findViewById(R.id.label_poin_voucher2)).setTextColor(ContextCompat.getColor(this, R.color.Gray));
this.R.setEnabled(false);
this.T.setEnabled(false);
this.x.findViewById(R.id.poin_voucher_arrowRIght).setEnabled(false);
this.j = true;
textView.setTextColor(ContextCompat.getColor(this, R.color.Gray));
imageView.setImageResource(R.drawable.ic_poin_persen_disable);
imageView2.setImageResource(R.drawable.ic_cek_list_disable);
imageView3.setImageResource(R.drawable.ic_arrow_right_poin_disable);
imageView4.setImageResource(R.drawable.ic_arrow_right_poin_disable);
this.R.setBackgroundResource(R.drawable.bb_background_transparent_grey);
this.T.setBackgroundResource(R.drawable.bb_background_transparent_grey);
textView2.setVisibility(0);
textView3.setVisibility(0);
constraintLayout.setVisibility(0);
if (d2 > this.w) {
textView3.setText("- " + Locales.moneyNoFraction(String.valueOf(this.w)));
} else {
textView3.setText("- " + Locales.moneyNoFraction(this.appSession.retrieve(AppSession.PROPERTY_POIN)));
}
int i2 = this.w;
if (d2 > i2) {
textView4.setText("Gratis");
} else {
textView4.setText(Locales.moneyNoFraction(String.valueOf(i2 - d2)));
}
if (d2 > this.w) {
textView5.setText("Yeay! kamu hemat " + Locales.moneyNoFraction(String.valueOf(this.w)));
} else {
textView5.setText("Yeay! kamu hemat " + Locales.moneyNoFraction(this.appSession.retrieve(AppSession.PROPERTY_POIN)));
}
this.v = "";
this.t = "";
this.z = 0.0d;
this.A = 0.0d;
setKode_voucher("");
this.R.setVisibility(8);
this.T.setVisibility(0);
int i3 = this.w;
if (d2 > i3) {
textView6.setText("Gratis");
} else {
textView6.setText(Locales.moneyNoFraction(String.valueOf(i3 - d2)));
}
imageView3.setEnabled(false);
imageView.setEnabled(false);
if (Var.toDouble(this.n, 0.0d) + d2 >= this.w) {
this.P.findViewById(R.id.btn_pay).setVisibility(0);
this.P.findViewById(R.id.btn_topup).setVisibility(4);
this.Q.setVisibility(8);
this.V.setTextColor(ContextCompat.getColor(this, R.color.colorInvoice));
this.U.setTextColor(ContextCompat.getColor(this, R.color.colorInvoice));
return;
}
if (z) {
this.P.findViewById(R.id.btn_pay).setVisibility(0);
this.P.findViewById(R.id.btn_topup).setVisibility(4);
this.Q.setVisibility(8);
this.V.setTextColor(ContextCompat.getColor(this, R.color.colorInvoice));
this.U.setTextColor(ContextCompat.getColor(this, R.color.colorInvoice));
return;
}
this.P.findViewById(R.id.btn_pay).setVisibility(4);
this.P.findViewById(R.id.btn_topup).setVisibility(0);
this.Q.setVisibility(0);
this.V.setTextColor(ContextCompat.getColor(this, R.color.colorLevelPremium));
this.U.setTextColor(ContextCompat.getColor(this, R.color.colorLevelPremium));
this.Q.setTextColor(ContextCompat.getColor(this, R.color.colorLevelPremium));
}
public void b1(PulsaEntity pulsaEntity, View view) {
openVoucherList(pulsaEntity);
}
public void c1(PulsaEntity pulsaEntity, View view) {
openVoucherList(pulsaEntity);
}
public void d1(PulsaEntity pulsaEntity, View view) {
openVoucherList(pulsaEntity);
}
public void e1(PulsaEntity pulsaEntity, View view) {
openVoucherList(pulsaEntity);
}
public void f1(PulsaEntity pulsaEntity, View view) {
openVoucherList(pulsaEntity);
}
public void g1(PulsaEntity pulsaEntity, View view) {
openVoucherList(pulsaEntity);
}
public static Bundle getPaketDataBundle(String str, Boolean bool) {
Bundle bundle = new Bundle();
bundle.putString("query:param", str);
bundle.putBoolean(AppSession.IS_FROM_ONE_CLICK, bool.booleanValue());
return bundle;
}
public void h1(AtomicBoolean atomicBoolean, AtomicBoolean atomicBoolean2, PulsaEntity pulsaEntity, boolean z) {
ImageView imageView = (ImageView) findViewById(R.id.ic_logo_sc);
this.X = z;
if (!z) {
atomicBoolean2.set(false);
this.O.setEnabled(true);
imageView.setImageDrawable(ContextCompat.getDrawable(getApplicationContext(), R.drawable.ic_speedcash));
this.V.setText(getApplicationContext().getString(R.string.saldo_speedcash));
this.U.setText(Locales.moneyNoFraction(this.appSession.retrieve(AppSession.PROPERTY_BALANCE)));
this.R.setVisibility(0);
View view = this.x;
if (view == null || !view.isShown()) {
return;
}
this.C.dismiss();
O0(pulsaEntity);
return;
}
atomicBoolean.set(z);
this.O.setEnabled(false);
this.O.setChecked(false);
this.j = false;
imageView.setImageDrawable(ContextCompat.getDrawable(getApplicationContext(), R.drawable.ic_other_payment));
this.V.setText("Metode bayar lainnya");
this.U.setText("QRIS/Virtual Account/Kartu");
this.V.setTextColor(-16777216);
this.U.setTextColor(-16777216);
this.Q.setTextColor(ColorStateList.valueOf(ContextCompat.getColor(getApplicationContext(), R.color.colorPrimaryAlt)));
this.P.findViewById(R.id.btn_pay).setVisibility(0);
this.P.findViewById(R.id.btn_topup).setVisibility(8);
this.P.findViewById(R.id.tv_balance_insufficient).setVisibility(8);
this.R.setVisibility(8);
this.T.setVisibility(8);
this.S.setVisibility(8);
}
public Unit i1(BaseMessage baseMessage) {
APIMessageWrapper aPIMessageWrapper = new APIMessageWrapper(baseMessage);
if (!aPIMessageWrapper.isOK()) {
Affinity.info(this, false, Var.toString(aPIMessageWrapper.getResponse_description(), ""));
return null;
}
String var = Var.toString(aPIMessageWrapper.getData().get(0).get("url"), "https://www.speedcash.co.id/");
this.dataSession.store(DataSession.KEY_URL_LAST_OPEN_PAYMENT, var);
Bundle bundle = new Bundle();
bundle.putString("url", var);
bundle.putString(FirebaseProcessor.KEY_TITLE, "Pembayaran " + getProductName());
Intent intent = new Intent((Context) this, (Class<?>) OpenPaymentWebViewActivity.class);
intent.putExtras(bundle);
startActivity(intent);
return null;
}
public void j1(View view) {
onBackPressed();
}
public void k1(View view) {
L0();
}
public void l(View view) {
this.H = true;
doTransaction(false, null);
}
public final void H0() {
if (Var.toString(N0(), "").equals("")) {
Affinity.info(this, false, getString(R.string.error_required_field, "Nomor Handphone"));
return;
}
String str = this.I;
PulsaPaketanGameMessage pulsaPaketanGameMessage = (PulsaPaketanGameMessage) getTransactionMessage(false);
pulsaPaketanGameMessage.setItem(BaseMessage.INDEX_VERSION_CODE, 482);
pulsaPaketanGameMessage.setItem(BaseMessage.INDEX_VERSION_NAME, BuildConfig.VERSION_NAME);
PulsaPaketanGameMessage pulsaPaketanGameMessage2 = (PulsaPaketanGameMessage) getTransactionMessage(true);
pulsaPaketanGameMessage2.setItem(BaseMessage.INDEX_VERSION_CODE, 482);
pulsaPaketanGameMessage2.setItem(BaseMessage.INDEX_VERSION_NAME, BuildConfig.VERSION_NAME);
if (this.Y) {
str = Var.toString(this.x.findViewById(R.id.input_nama_pembayaran).getText().toString(), "");
}
String str2 = str;
getTransactionMessage(true).setItem(BaseMessage.INDEX_VERSION_CODE, 482);
getTransactionMessage(true).setItem(BaseMessage.INDEX_VERSION_NAME, BuildConfig.VERSION_NAME);
getTransactionMessage(true);
OneClickPayHelperAdd oneClickPayHelperAdd = OneClickPayHelperAdd.INSTANCE;
oneClickPayHelperAdd.addToCartOneClickPayItem(this, oneClickPayHelperAdd.composeRequestMsgAddCart(getApplicationContext(), true, pulsaPaketanGameMessage2, pulsaPaketanGameMessage, this.appSession.retrieve(AppSession.PROPERTY_MERCHANT_ID), getSelectedProductCode(), N0(), Math.round(Float.parseFloat(String.valueOf(this.w))), 1, "", str2, "", Device.getDeviceUUID(this).toString()), new Function1() {
public final Object invoke(Object obj) {
Unit R0;
R0 = TelkomselPerzonaActivity.this.R0((BaseMessage) obj);
return R0;
}
});
}
public final void I0(final com.bm.sc.bebasbayar.adapter.entity.PulsaEntity r43) {
throw new UnsupportedOperationException("Method not decompiled: com.bm.sc.bebasbayar.ui.activity.ubp.paketdata.TelkomselPerzonaActivity.I0(com.bm.sc.bebasbayar.adapter.entity.PulsaEntity):void");
}
public final void J0(String str, String str2, int i2) {
APIMessageWrapper aPIMessageWrapper = new APIMessageWrapper();
aPIMessageWrapper.setItem("kode_voucher", str);
aPIMessageWrapper.setItem(DataMessage.ID_OUTLET, this.appSession.retrieve(AppSession.PROPERTY_MERCHANT_ID));
aPIMessageWrapper.setItem(BaseMessage.INDEX_VIA, "BB ANDROID");
aPIMessageWrapper.setItem("channel", str2);
aPIMessageWrapper.setItem("nominal", Integer.valueOf(i2));
MessageComposer messageComposer = new MessageComposer(2, "voucher/check?step=payment");
messageComposer.setIs_encrypted(false);
messageComposer.setShowProgressRegular(true);
messageComposer.setMessageProcess(new e());
MessageSender messageSender = new MessageSender(this, messageComposer);
messageSender.setRequestMessage(aPIMessageWrapper);
messageSender.execute();
}
public final void K0() {
PulsaPaketanGameMessage pulsaPaketanGameMessage = (PulsaPaketanGameMessage) getTransactionMessage(false);
pulsaPaketanGameMessage.setItem(BaseMessage.INDEX_VERSION_CODE, 482);
pulsaPaketanGameMessage.setItem(BaseMessage.INDEX_VERSION_NAME, BuildConfig.VERSION_NAME);
PulsaPaketanGameMessage pulsaPaketanGameMessage2 = (PulsaPaketanGameMessage) getTransactionMessage(true);
pulsaPaketanGameMessage2.setItem(BaseMessage.INDEX_VERSION_CODE, 482);
pulsaPaketanGameMessage2.setItem(BaseMessage.INDEX_VERSION_NAME, BuildConfig.VERSION_NAME);
OpenPaymentHelper openPaymentHelper = OpenPaymentHelper.INSTANCE;
openPaymentHelper.createOpenPayment(this, openPaymentHelper.composeRequestMsg(getApplicationContext(), true, pulsaPaketanGameMessage2, pulsaPaketanGameMessage, this.appSession.retrieve(AppSession.PROPERTY_MERCHANT_ID), getSelectedProductCode(), N0(), Math.round(Float.parseFloat(String.valueOf(this.w))), 1, "", this.I, "", Device.getDeviceUUID(this).toString()), new Function1() {
public final Object invoke(Object obj) {
Unit i1;
i1 = TelkomselPerzonaActivity.this.i1((BaseMessage) obj);
return i1;
}
});
}
public final void L0() {
UbpHistoryFragment ubpHistoryFragment = new UbpHistoryFragment();
ubpHistoryFragment.setArguments(ubpHistoryFragment.setupDefaultBundle(762378, "Riwayat Transaksi", this.E));
ubpHistoryFragment.show(getSupportFragmentManager(), "pulsa_history_option");
}
public final void M0() {
MessageComposer messageComposer = new MessageComposer(7, "ro/customer/history_billinfo");
messageComposer.setRequest_method(MessageComposer.GET);
messageComposer.setData_type(2);
messageComposer.addMessage("user_id", this.appSession.retrieve(AppSession.PROPERTY_MERCHANT_ID));
messageComposer.addMessage("user_uuid", Device.getDeviceUUID(this).toString());
messageComposer.addMessage(BaseMessage.INDEX_VIA, "BB ANDROID");
messageComposer.addMessage("id_group_produk", "22");
messageComposer.addMessage("is_pulsa", 1);
messageComposer.addMessage("id_provider", this.G);
messageComposer.addMessage("is_perzona", 1);
messageComposer.setShowProgressRegular(false);
messageComposer.setIs_encrypted(false);
messageComposer.setMessageProcess(new f());
new MessageSender(this, messageComposer).execute();
}
public final String N0() {
String obj = this.p.getEditableText().toString();
if (!obj.startsWith(QRISO.ID_ADD_DATA)) {
return obj;
}
return "0" + obj.substring(2);
}
public final void O0(PulsaEntity pulsaEntity) {
this.t = "";
this.z = 0.0d;
this.u = "";
this.B = 0.0d;
APIMessageWrapper aPIMessageWrapper = new APIMessageWrapper();
aPIMessageWrapper.setItem(DataMessage.ID_OUTLET, this.appSession.retrieve(AppSession.PROPERTY_MERCHANT_ID));
aPIMessageWrapper.setItem("user_id", this.appSession.retrieve(AppSession.PROPERTY_MERCHANT_ID));
aPIMessageWrapper.setItem("user_uuid", Device.getDeviceUUID(this));
aPIMessageWrapper.setItem("nominal", Integer.valueOf(pulsaEntity.getHargajual()));
aPIMessageWrapper.setItem("channel", getSelectedProductCode());
MessageComposer messageComposer = new MessageComposer(7, "ro/activity/voucher_applied");
messageComposer.setShowProgressRegular(true);
messageComposer.setIs_encrypted(false);
messageComposer.setMessageProcess(new d(pulsaEntity));
MessageSender messageSender = new MessageSender(this, messageComposer);
messageSender.setRequestMessage(aPIMessageWrapper);
messageSender.execute();
}
public final boolean P0(String str, int i2) {
ArrayList arrayList = new ArrayList();
this.r = new ArrayList<>();
try {
JSONArray jSONArray = new JSONArray(str);
int i3 = 0;
while (i3 < jSONArray.length()) {
JSONObject jSONObject = (JSONObject) jSONArray.get(i3);
String next = jSONObject.keys().next();
JSONArray jSONArray2 = jSONObject.getJSONArray(next);
ArrayList arrayList2 = new ArrayList();
for (int i4 = 0; i4 < jSONArray2.length(); i4++) {
JSONObject jSONObject2 = (JSONObject) jSONArray2.get(i4);
PulsaEntity pulsaEntity = new PulsaEntity();
int i5 = Var.toInt(jSONObject2.getString("harga_total"), 0);
if (i2 > 0) {
i5 += i2;
pulsaEntity.setNominalUp("0");
} else {
pulsaEntity.setNominalUp(Var.toString(Integer.valueOf(i2), "0"));
}
pulsaEntity.setIdproduk(Var.toString(jSONObject2.getString("productId"), ""));
pulsaEntity.setHargajual(i5);
pulsaEntity.setDescription(Var.toString(jSONObject2.getString("quota"), ""));
pulsaEntity.setNamaproduk(Var.toString(jSONObject2.getString(MPMessage.IncludeMessage.PRODUCT_NAME), ""));
pulsaEntity.setDuration(Var.toString(jSONObject2.getString("duration"), "").replaceAll("[^\\d.]", ""));
pulsaEntity.setIs_gangguan("0");
arrayList2.add(pulsaEntity);
}
HashMap<String, Object> hashMap = new HashMap<>();
hashMap.put(FirebaseProcessor.KEY_TITLE, WordUtils.capitalizeFully(next));
hashMap.put("data", arrayList2);
this.r.add(hashMap);
i3++;
arrayList = arrayList2;
}
if (arrayList.size() <= 0) {
return true;
}
findViewById(R.id.btn_inq).setVisibility(8);
findViewById(R.id.til_input_phone).setVisibility(8);
findViewById(R.id.img_provider).setVisibility(8);
findViewById(R.id.tv_label).setVisibility(8);
findViewById(R.id.transaction_import_idpel).setVisibility(8);
findViewById(R.id.pulsa_carousel_more_btn).setVisibility(8);
findViewById(R.id.label_history_trx).setVisibility(8);
this.K.setVisibility(8);
findViewById(R.id.fragment_container_perzona).setVisibility(0);
return true;
} catch (JSONException e2) {
getClassSimpleName();
Objects.requireNonNull(e2.getMessage());
return false;
}
}
public void changePaymentMethod(final PulsaEntity pulsaEntity) {
final AtomicBoolean atomicBoolean = new AtomicBoolean(false);
final AtomicBoolean atomicBoolean2 = new AtomicBoolean(false);
?? changePaymentMethodFragment = new ChangePaymentMethodFragment();
changePaymentMethodFragment.setTagihan(Double.valueOf(this.w), atomicBoolean.get(), atomicBoolean2.get());
changePaymentMethodFragment.setOnSelectedChoice(new ChangePaymentMethodFragment.OnSelectedChoice() {
@Override
public final void selectedChoice(boolean z) {
TelkomselPerzonaActivity.this.h1(atomicBoolean2, atomicBoolean, pulsaEntity, z);
}
});
changePaymentMethodFragment.show(getSupportFragmentManager(), "Change Source Found");
}
@Override
public String getClassSimpleName() {
return TelkomselPerzonaActivity.class.getSimpleName();
}
@Override
public Activity getInvokerActivity() {
return this;
}
@Override
public int getMainProductLogoResId() {
return 0;
}
@Override
public String getProductName() {
return this.s;
}
@Override
public String getSelectedProductCode() {
return "VPTSELDT";
}
@Override
public BaseMessage getTransactionMessage(boolean z) {
if (this.p.getEditableText().toString().isEmpty()) {
Affinity.info(this, false, getString(R.string.error_required_field, "Nomor Handphone"));
return null;
}
if (this.p.getEditableText().toString().equalsIgnoreCase("")) {
Affinity.info(this, false, getString(R.string.error_required_field, "Nomor Handphone"));
return null;
}
if (this.p.getEditableText().length() < 8) {
Affinity.info(this, false, "Nomor handphone minimal 8 digit");
return null;
}
if (z && getSelectedProductCode().isEmpty()) {
Affinity.info(this, false, getString(R.string.error_invalid_payment_info));
return null;
}
String retrieve = this.appSession.retrieve(AppSession.PROPERTY_MERCHANT_ID);
if (!z) {
PulsaPaketanGameMessage pulsaPaketanGameMessage = new PulsaPaketanGameMessage(retrieve, this.appSession.retrieve(AppSession.PROPERTY_MERCHANT_PIN), this.appSession.retrieve(AppSession.PROPERTY_AUTH_TOKEN), getSelectedProductCode());
Device.getAddressLocation(this);
pulsaPaketanGameMessage.setItem(BaseMessage.INDEX_UUID, Var.toString(Device.getDeviceUUID(getApplicationContext()).toString(), ""));
pulsaPaketanGameMessage.setAdditional_dataValue(109, Device.getLogDevice(this));
pulsaPaketanGameMessage.setProcessing_code(DimoMessage.INQUIRY);
pulsaPaketanGameMessage.setAdditional_dataValue(0, N0());
pulsaPaketanGameMessage.setIncludesValue(MPMessage.IncludeMessage.CUSTOMER_ID_1, N0());
if (getKode_voucher() != null) {
pulsaPaketanGameMessage.setIncludesValue(MPMessage.IncludeMessage.JENIS_STRUK, getKode_voucher());
}
return pulsaPaketanGameMessage;
}
PulsaPaketanGameMessage pulsaPaketanGameMessage2 = new PulsaPaketanGameMessage(retrieve, this.appSession.retrieve(AppSession.PROPERTY_MERCHANT_PIN), this.appSession.retrieve(AppSession.PROPERTY_AUTH_TOKEN), getSelectedProductCode());
this.W = pulsaPaketanGameMessage2;
pulsaPaketanGameMessage2.setProcessing_code("PAY");
this.W.setAdditional_dataValue(0, N0());
Device.getAddressLocation(this);
this.W.setAdditional_dataValue(109, Device.getLogDevice(this));
this.W.setAdditional_dataValue(4, getProductName());
this.W.setIncludesValue(MPMessage.IncludeMessage.REFF_ID, this.inq_reff_id);
this.W.setIncludesValue(MPMessage.IncludeMessage.CUSTOMER_ID_1, N0());
this.W.setIncludesValue("product_code", getSelectedProductCode());
this.W.setIncludesValue(MPMessage.IncludeMessage.PRODUCT_NAME, this.I);
this.W.setIncludesValue(MPMessage.IncludeMessage.AMOUNT, String.valueOf(this.w));
this.W.setIncludesValue(MPMessage.IncludeMessage.DISCOUNT, Var.toString(Integer.valueOf((int) this.y), "0"));
if (this.j) {
this.W.setIncludesValue(MPMessage.IncludeMessage.PAYMENT_METHOD_PRIORITY, "POIN");
} else {
this.W.setIncludesValue(MPMessage.IncludeMessage.PAYMENT_METHOD_PRIORITY, "");
}
if (getKode_voucher() != null) {
this.W.setIncludesValue(MPMessage.IncludeMessage.JENIS_STRUK, getKode_voucher());
}
this.W.setItem("address", this.appSession.retrieve(AppSession.ADDRESS_USER));
return this.W;
}
@Override
public int getViewResource() {
return R.layout.activity_telkomsel_perzona;
}
@Override
public String getWikiNameSpace() {
return null;
}
@Override
public boolean isEnabledVoucher() {
return false;
}
@Override
public boolean isMainSubscriberId() {
return false;
}
@Override
public boolean isNeedToDisplayShowcase() {
return false;
}
public final void l1() {
this.p.setTextAppearance(R.style.form_bold);
}
public final void m1() {
this.p.setTextAppearance(R.style.input_product_code);
}
@Override
public void onActivityResult(int i2, int i3, Intent intent) {
super.onActivityResult(i2, i3, intent);
StringBuilder sb = new StringBuilder();
sb.append("onActivityResult: ");
sb.append(i3);
if (i3 == 12992) {
TextView textView = (TextView) this.x.findViewById(R.id.tv_label_discount);
TextView textView2 = (TextView) this.x.findViewById(R.id.pulsa_discount);
TextView textView3 = (TextView) this.x.findViewById(R.id.pulsa_price_nett);
ConstraintLayout findViewById = this.x.findViewById(R.id.voucher_add_container);
RelativeLayout relativeLayout = (RelativeLayout) this.x.findViewById(R.id.voucher_container);
SwitchMaterial findViewById2 = this.x.findViewById(R.id.switch_poin);
String var = Var.toString(this.appSession.retrieve(AppSession.PROPERTY_BALANCE), "0");
TextView textView4 = (TextView) this.x.findViewById(R.id.btn_pay_nominal);
findViewById.setVisibility(8);
this.R.setVisibility(8);
this.v = intent.getStringExtra("desc_voucher");
this.t = intent.getStringExtra("kode_voucher");
this.z = intent.getDoubleExtra("nominal_voucher", 0.0d);
setKode_voucher(this.t);
String stringExtra = intent.getStringExtra("satuan_voucher");
if (this.v.isEmpty() && this.t.isEmpty()) {
findViewById.setVisibility(8);
this.R.setVisibility(8);
this.T.setVisibility(8);
} else {
relativeLayout.setVisibility(8);
findViewById.setVisibility(0);
this.R.setVisibility(8);
this.x.findViewById(R.id.btn_list_voucher).setVisibility(8);
if (this.v.isEmpty()) {
this.x.findViewById(R.id.voucher_desc).setVisibility(8);
this.x.findViewById(R.id.voucher_divider).setVisibility(8);
} else {
this.x.findViewById(R.id.voucher_desc).setVisibility(0);
this.x.findViewById(R.id.voucher_divider).setVisibility(0);
((TextView) this.x.findViewById(R.id.voucher_desc)).setText(Compat.Html_fromHtml(this.v));
}
((TextView) this.x.findViewById(R.id.voucher_code)).setText(Compat.Html_fromHtml(getString(R.string.voucher_code_info, this.t)));
}
if (this.z == 0.0d) {
textView.setVisibility(8);
textView2.setVisibility(8);
return;
}
((TextView) this.x.findViewById(R.id.voucher_code2)).setText("Dapat voucher " + Locales.moneyNoFraction(Var.toString(Double.valueOf(this.z), "")));
if (stringExtra == null || !stringExtra.equals("saldo")) {
if (stringExtra.equals("poin")) {
findViewById.setVisibility(8);
((TextView) this.x.findViewById(R.id.label_poin)).setText("Gunakan" + Locales.moneyNoFraction(String.valueOf(this.z)).replace("Rp", "") + " SpeedCash Poinmu");
((TextView) this.x.findViewById(R.id.label_poin_voucher)).setText("Kamu akan dapat" + Locales.moneyNoFraction(String.valueOf(this.z)).replace("Rp", "") + " SpeedCash Poin");
this.R.setVisibility(0);
if (this.y > 0.0d) {
textView.setVisibility(8);
textView2.setVisibility(8);
} else {
textView.setVisibility(8);
textView2.setVisibility(8);
}
this.k.start(new PartyFactory(new Emitter(5L, TimeUnit.SECONDS).perSecond(50)).angle(270).spread(90).setSpeedBetween(1.0f, 5.0f).timeToLive(2000L).position(0.0d, 0.0d, 1.0d, 0.0d).build());
return;
}
return;
}
double d2 = this.y;
double d3 = this.z;
this.y = d2 + d3;
this.l = this.w - d3;
textView.setVisibility(0);
textView2.setVisibility(0);
textView2.setText(String.format(Locale.getDefault(), "- %1$s", Locales.moneyNoFraction(Var.toString(Integer.valueOf((int) this.y), "0"))));
textView3.setText(Locales.moneyNoFraction(Var.toString(Double.valueOf(this.l), "")));
findViewById.setVisibility(0);
findViewById2.setEnabled(false);
this.R.setVisibility(8);
this.T.setVisibility(8);
TextView textView5 = (TextView) this.x.findViewById(R.id.tv_balance_insufficient);
this.V = (TextView) this.x.findViewById(R.id.sc_label_balance);
if (Var.toDouble(var, 0.0d) >= this.l) {
this.x.findViewById(R.id.btn_pay).setVisibility(0);
this.x.findViewById(R.id.btn_topup).setVisibility(4);
textView5.setVisibility(8);
this.V.setTextColor(ContextCompat.getColor(this, R.color.colorInvoice));
this.U.setTextColor(ContextCompat.getColor(this, R.color.colorInvoice));
} else if (this.m) {
this.x.findViewById(R.id.btn_pay).setVisibility(0);
this.x.findViewById(R.id.btn_topup).setVisibility(4);
textView5.setVisibility(8);
((TextView) this.x.findViewById(R.id.sc_label_balance)).setTextColor(ContextCompat.getColor(this, R.color.colorInvoice));
this.U.setTextColor(ContextCompat.getColor(this, R.color.colorInvoice));
} else {
this.x.findViewById(R.id.btn_pay).setVisibility(4);
this.x.findViewById(R.id.btn_topup).setVisibility(0);
textView5.setVisibility(0);
this.V.setTextColor(ContextCompat.getColor(this, R.color.colorLevelPremium));
this.U.setTextColor(ContextCompat.getColor(this, R.color.colorLevelPremium));
((TextView) this.x.findViewById(R.id.tv_balance_insufficient)).setTextColor(ContextCompat.getColor(this, R.color.colorLevelPremium));
}
textView4.setText(Locales.moneyNoFraction(Var.toString(Double.valueOf(this.l), "")));
}
}
public void onAttachedToWindow() {
this.D = true;
super/*android.app.Activity*/.onAttachedToWindow();
}
@Override
public void onBackPressed() {
M0();
if (findViewById(R.id.btn_inq).getVisibility() != 8) {
super.onBackPressed();
return;
}
this.H = true;
findViewById(R.id.btn_inq).setVisibility(0);
findViewById(R.id.til_input_phone).setVisibility(0);
findViewById(R.id.img_provider).setVisibility(0);
findViewById(R.id.tv_label).setVisibility(0);
findViewById(R.id.transaction_import_idpel).setVisibility(0);
findViewById(R.id.pulsa_carousel_more_btn).setVisibility(8);
findViewById(R.id.fragment_container_perzona).setVisibility(8);
if (N0().length() > 5) {
this.q.setAlpha(1.0f);
this.q.setClickable(true);
}
}
@Override
public void onClickData(ProdukListEntity produkListEntity) {
this.p.setText(produkListEntity.getIdPel1());
findViewById(R.id.btn_inq).performClick();
}
@Override
public void onCreate(Bundle bundle) {
super.onCreate(bundle);
Bundle extras = getIntent().getExtras();
if (extras != null) {
this.G = extras.getString("query:param", "");
this.Y = extras.getBoolean(AppSession.IS_FROM_ONE_CLICK, false);
}
this.Y = Var.toBoolean(this.appSession.retrieve(AppSession.IS_FROM_ONE_CLICK), false);
this.balance_insufficient_container.setVisibility(8);
this.p = findViewById(R.id.tie_input_phone);
AppCompatButton findViewById = findViewById(R.id.btn_inq);
this.q = findViewById;
findViewById.setOnClickListener(new View.OnClickListener() {
@Override
public final void onClick(View view) {
TelkomselPerzonaActivity.this.l(view);
}
});
getToolbar().setNavigationOnClickListener(new View.OnClickListener() {
@Override
public final void onClick(View view) {
TelkomselPerzonaActivity.this.j1(view);
}
});
TextView textView = (TextView) findViewById(R.id.label_history_trx);
this.o = textView;
textView.setText("Nomor Saya");
findViewById(R.id.pulsa_carousel_more_btn).setOnClickListener(new View.OnClickListener() {
@Override
public final void onClick(View view) {
TelkomselPerzonaActivity.this.k1(view);
}
});
this.p.addTextChangedListener(new a());
showKeyboard(this.p);
Device.getAddressLocation(this);
ArrayList arrayList = new ArrayList(this.configSession.retrieveSet(ConfigSession.PROPERTY_WHITE_LIST_ID));
this.J = new ArrayList<>();
for (int i2 = 0; i2 < arrayList.size(); i2++) {
Object obj = ((HashMap) arrayList.get(i2)).get(DataMessage.ID_OUTLET);
Objects.requireNonNull(obj);
if (!obj.toString().equals("")) {
ArrayList<String> arrayList2 = this.J;
Object obj2 = ((HashMap) arrayList.get(i2)).get(DataMessage.ID_OUTLET);
Objects.requireNonNull(obj2);
arrayList2.add(obj2.toString());
}
}
RecyclerView recyclerView = (RecyclerView) findViewById(R.id.rv_history);
this.K = recyclerView;
recyclerView.setFocusable(false);
HistoryPulsaAdapter historyPulsaAdapter = new HistoryPulsaAdapter(this);
this.L = historyPulsaAdapter;
historyPulsaAdapter.setCallback(this);
ArrayList<String> arrayList3 = this.J;
if (arrayList3 == null || arrayList3.size() <= 0) {
return;
}
for (int i3 = 0; i3 < this.J.size(); i3++) {
if (this.J.get(i3).equals(this.appSession.retrieve(AppSession.PROPERTY_MERCHANT_ID))) {
this.m = true;
}
}
}
public void onDetachedFromWindow() {
this.D = false;
super/*android.app.Activity*/.onDetachedFromWindow();
}
@Override
@Subscribe(threadMode = ThreadMode.MAIN)
public void onMessageEvent(BusMessage busMessage) {
if (busMessage.getEventType() == 1) {
this.appSession.store(AppSession.PROPERTY_BALANCE, Var.toString(Double.valueOf(busMessage.getBalance()), "0"));
if (this.x != null) {
this.U.setText(Locales.moneyNoFraction(this.appSession.retrieve(AppSession.PROPERTY_BALANCE)));
}
}
}
@Override
public void onOptionChoosen(OptionListFragment optionListFragment, int i2, ProdukListEntity produkListEntity) {
String code = produkListEntity.getCode();
if (i2 == 39791 || i2 == 57345) {
this.p.setText(code);
}
}
public void onPause() {
super/*androidx.fragment.app.FragmentActivity*/.onPause();
EventBus.getDefault().unregister(this);
}
@Override
public void onResume() {
super.onResume();
if (this.x != null) {
this.U.setText(Locales.moneyNoFraction(this.appSession.retrieve(AppSession.PROPERTY_BALANCE)));
}
if (this.Z.isVisible()) {
findViewById(R.id.img_provider).setVisibility(8);
findViewById(R.id.label_history_trx).setVisibility(8);
}
M0();
}
@Override
public void onShowcaseFinished() {
}
@Override
public void onStart() {
super.onStart();
if (!EventBus.getDefault().isRegistered(this)) {
EventBus.getDefault().register(this);
}
resetForm(false);
}
@Override
public MPMessage onTransactionDone(boolean z, BaseMessage baseMessage) {
if (z) {
PulsaPaketanGameMessage pulsaPaketanGameMessage = new PulsaPaketanGameMessage(baseMessage);
if (!pulsaPaketanGameMessage.isOK()) {
findViewById(R.id.img_provider).setVisibility(8);
findViewById(R.id.label_history_trx).setVisibility(8);
}
return pulsaPaketanGameMessage;
}
PaketPerzonaWrapper paketPerzonaWrapper = new PaketPerzonaWrapper(baseMessage);
if (paketPerzonaWrapper.isApiOK()) {
findViewById(R.id.img_provider).setVisibility(8);
findViewById(R.id.label_history_trx).setVisibility(8);
this.inq_reff_id = Var.toString(paketPerzonaWrapper.getIncludes().get(MPMessage.IncludeMessage.REFF_ID), "");
if (P0(paketPerzonaWrapper.getAdditional_datas().get(14), Var.toInt(paketPerzonaWrapper.getAdditional_datas().get(93), 0))) {
new Handler().post(new g());
} else {
Affinity.info(this, false, getString(R.string.error_connection_response));
}
}
return paketPerzonaWrapper;
}
@Override
public void onTransactionPrepare(boolean z) {
}
@Override
public void onUbpHistoryChoosen(UbpHistoryFragment ubpHistoryFragment, int i2, ProdukListEntity produkListEntity) {
String idPel1 = produkListEntity.getIdPel1();
if (i2 == 762378) {
this.p.setText(idPel1);
}
}
public void openVoucherList(PulsaEntity pulsaEntity) {
Bundle bundle = new Bundle();
bundle.putString("idProduk", getSelectedProductCode());
bundle.putString("group", "pulsa");
bundle.putDouble("harga", pulsaEntity.getHargajual());
bundle.putInt("requestCode", VOUCHER_REQUEST_CODE_DATA);
Affinity.listen(this, OptionVoucherListActivity.class, 0, bundle);
}
@Override
public void optionChoosen(OptionListFragment1 optionListFragment1, int i2, ProdukListEntity produkListEntity) {
String code = produkListEntity.getCode();
if (i2 == 762378) {
this.p.setText(code);
findViewById(R.id.btn_inquiry).performClick();
this.dialog.dismiss();
}
}
@Override
public void optionChoosen1(OptionListFragment2 optionListFragment2, int i2, ProdukListEntity produkListEntity) {
String code = produkListEntity.getCode();
if (i2 == 762378) {
this.p.setText(code);
findViewById(R.id.btn_inquiry).performClick();
this.dialog.dismiss();
}
}
public void payment(PulsaEntity pulsaEntity) {
this.u = "";
this.B = 0.0d;
this.C.dismiss();
if (this.X) {
K0();
return;
}
this.H = false;
WidgetHelper.setProductIdTag(this.p, pulsaEntity.getIdproduk(), this.p.getEditableText().toString());
if (this.t.equals("")) {
doTransaction(true, null);
} else {
J0(this.t, getSelectedProductCode(), pulsaEntity.getHargajual());
}
}
@Override
public void resetForm(boolean z) {
findViewById(R.id.img_provider).setVisibility(8);
if (this.M) {
findViewById(R.id.label_history_trx).setVisibility(0);
}
}
@Override
public void showKeyboard(View view) {
view.requestFocus();
((InputMethodManager) getSystemService("input_method")).showSoftInput(view, 1);
}
@Override
public void adapterResult(BaseAdapter baseAdapter, final PulsaEntity pulsaEntity, int i2) {
getClassSimpleName();
pulsaEntity.getNamaproduk();
this.I = pulsaEntity.getNamaproduk();
Affinity.refreshBalance(this, new BBCallback() {
@Override
public final void do_callback(int i3, Object obj) {
TelkomselPerzonaActivity.this.Q0(pulsaEntity, i3, (Boolean) obj);
}
});
}
}