正在查看: SpeedCash v6.5.1482 应用的 PulsaActivity.java JAVA 源代码文件
本页面展示 JAVA 反编译生成的源代码文件,支持语法高亮显示。 仅供安全研究与技术分析使用,严禁用于任何非法用途。请遵守相关法律法规。
正在查看: SpeedCash v6.5.1482 应用的 PulsaActivity.java JAVA 源代码文件
本页面展示 JAVA 反编译生成的源代码文件,支持语法高亮显示。 仅供安全研究与技术分析使用,严禁用于任何非法用途。请遵守相关法律法规。
package com.bm.sc.bebasbayar.ui.activity.ubp;
import android.animation.ValueAnimator;
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.Selection;
import android.text.TextWatcher;
import android.util.TypedValue;
import android.view.KeyEvent;
import android.view.View;
import android.view.inputmethod.InputMethodManager;
import android.widget.CompoundButton;
import android.widget.HorizontalScrollView;
import android.widget.ImageView;
import android.widget.LinearLayout;
import android.widget.RelativeLayout;
import android.widget.TextView;
import androidx.annotation.IdRes;
import androidx.appcompat.app.ActionBar;
import androidx.appcompat.widget.AppCompatImageView;
import androidx.appcompat.widget.SearchView;
import androidx.constraintlayout.widget.ConstraintLayout;
import androidx.core.content.ContextCompat;
import androidx.recyclerview.widget.RecyclerView;
import com.bm.sc.auth.data.local.OneClickPayAddModel;
import com.bm.sc.auth.helper.OneClickPayHelperAdd;
import com.bm.sc.auth.helper.OpenPaymentHelper;
import com.bm.sc.auth.ui.BottomNavigationActivity;
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.DialogPlusOption;
import com.bm.sc.bebasbayar.adapter.entity.GroupPulsaEntity;
import com.bm.sc.bebasbayar.adapter.entity.ProdukListEntity;
import com.bm.sc.bebasbayar.adapter.entity.PulsaEntity;
import com.bm.sc.bebasbayar.adapter.entity.SelfNumberEntity;
import com.bm.sc.bebasbayar.adapter.entity.VoucherEntity;
import com.bm.sc.bebasbayar.adapter.list.HistoryPulsaAdapter;
import com.bm.sc.bebasbayar.adapter.list.PulsaCarouselAdapter;
import com.bm.sc.bebasbayar.adapter.list.PulsaTypeGroupAdapter;
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.MessageParser;
import com.bm.sc.bebasbayar.helper.ShowcaseHelper;
import com.bm.sc.bebasbayar.helper.UBPHelper;
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.api.ListPulsaGameMessage;
import com.bm.sc.bebasbayar.message.mp.ApiMpMessageWrapper;
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.OneKlickPayActivity;
import com.bm.sc.bebasbayar.ui.activity.OtherHomeMenuActivity;
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.ticket.PesawatBookingListActivity;
import com.bm.sc.bebasbayar.ui.activity.ubp.PulsaActivity;
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.pulsa.FilterPulsaFragment;
import com.bm.sc.util.android.Compat;
import com.bm.sc.util.android.Device;
import com.bm.sc.util.android.OnSingleClickListener;
import com.bm.sc.util.common.Var;
import com.bm.sc.util.format.Locales;
import com.bumptech.glide.Glide;
import com.bumptech.glide.request.RequestOptions;
import com.google.android.material.chip.Chip;
import com.google.android.material.chip.ChipGroup;
import com.google.android.material.switchmaterial.SwitchMaterial;
import com.google.android.material.textfield.TextInputEditText;
import com.google.android.material.textfield.TextInputLayout;
import com.orhanobut.dialogplus.DialogPlus;
import eu.davidea.flexibleadapter.common.SmoothScrollLinearLayoutManager;
import java.util.ArrayList;
import java.util.Collection;
import java.util.Collections;
import java.util.Comparator;
import java.util.HashMap;
import java.util.Iterator;
import java.util.LinkedHashSet;
import java.util.List;
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.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 PulsaActivity extends TransactionActivity implements AdapterInvoker<GroupPulsaEntity>, UbpHistoryFragment.UbpHistoryListener, UBPHelper.CrossSellingListener, PulsaCarouselAdapter.Callback, HistoryPulsaAdapter.Callback {
public static final String ABOVE150 = ">Rp150.000";
public static final String BELOW50 = "<Rp50.000";
public static final String BETWEEN100_150 = "Rp100.000 - Rp150.000";
public static final String BETWEEN50_100 = "Rp50.000 - Rp100.000";
public static final String MODE_TAG = "mode:tag";
public static final String PHONE_PREFIX = "phone:prx";
public static Comparator<PulsaEntity> SORT_BY_CODE = new Comparator() {
@Override
public final int compare(Object obj, Object obj2) {
int V1;
V1 = PulsaActivity.V1((PulsaEntity) obj, (PulsaEntity) obj2);
return V1;
}
};
public static final int VOUCHER_REQUEST_CODE_PULSA = 12991;
public int B;
public MessageSender C;
public View D;
public View E;
public String G;
public double H;
public RecyclerView N;
public RecyclerView O;
public PulsaTypeGroupAdapter P;
public AppCompatImageView Q;
public ArrayList<GroupPulsaEntity> R;
public String S;
public ArrayList<String> T;
public HistoryPulsaAdapter U;
public InputMethodManager V;
public Chip W;
public Chip X;
public ChipGroup Y;
public HorizontalScrollView Z;
public SwitchMaterial c0;
public View d0;
public View e0;
public View f0;
public TextView g0;
public TextInputLayout h0;
public TextInputEditText i0;
public TextView j0;
public View k0;
public double m;
public PulsaPaketanGameMessage m0;
public KonfettiView n;
public ConstraintLayout n0;
public ConstraintLayout o0;
public String p;
public ConstraintLayout p0;
public double q;
public ConstraintLayout q0;
public TextView r0;
public TextInputEditText s;
public TextView s0;
public LinearLayout t0;
public PulsaEntity v0;
public ImageView w0;
public DialogPlus x;
public ConstraintLayout x0;
public TextView y0;
public Timer z;
public final HashMap<String, Integer> i = UBPHelper.getProductIconList();
public final ArrayList<VoucherEntity> j = new ArrayList<>();
public final int k = R.id.menu_item_pulsa_reg;
public boolean l = false;
public boolean o = false;
public ArrayList<ProdukListEntity> r = new ArrayList<>();
public String t = null;
public String u = "";
public String v = "";
public String w = "";
public DialogPlus y = null;
public boolean A = true;
public View F = null;
public double I = 0.0d;
public double J = 0.0d;
public double K = 0.0d;
public boolean L = false;
public boolean M = false;
public String a0 = "";
public String b0 = "";
public boolean l0 = false;
public boolean u0 = false;
public class a implements TextWatcher {
public class C0033a extends TimerTask {
public C0033a() {
}
public void b() {
String n1 = PulsaActivity.this.n1();
if (!n1.isEmpty() && n1.length() > 8 && n1.length() < 17 && PulsaActivity.this.M) {
PulsaActivity.this.A = false;
PulsaActivity.this.inquiry();
PulsaActivity.this.findViewById(R.id.layout_product_not_found).setVisibility(8);
} else if (n1.length() <= 16) {
if (n1.length() < 5) {
PulsaActivity.this.resetForm(false);
}
} else {
InputMethodManager inputMethodManager = (InputMethodManager) PulsaActivity.this.getSystemService("input_method");
Objects.requireNonNull(inputMethodManager);
inputMethodManager.hideSoftInputFromWindow(PulsaActivity.this.s.getWindowToken(), 0);
PulsaActivity.this.s.clearFocus();
}
}
@Override
public void run() {
PulsaActivity.this.runOnUiThread(new Runnable() {
@Override
public final void run() {
PulsaActivity.a.C0033a.this.b();
}
});
}
}
public a() {
}
@Override
public void afterTextChanged(Editable editable) {
if (editable.length() == 0) {
PulsaActivity.this.findViewById(R.id.cl_suggest_input).setVisibility(0);
PulsaActivity.this.X1();
return;
}
if (editable.length() > 0) {
PulsaActivity.this.Y1();
}
PulsaActivity.this.findViewById(R.id.tv_warning).setVisibility(8);
if (editable.length() <= 1 || editable.length() >= 9) {
PulsaActivity.this.findViewById(R.id.cl_suggest_input).setVisibility(8);
} else {
PulsaActivity.this.findViewById(R.id.tv_warning).setVisibility(0);
((TextView) PulsaActivity.this.findViewById(R.id.tv_warning)).setText(R.string.warn_phone);
}
}
@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 (PulsaActivity.this.z != null) {
PulsaActivity.this.z.cancel();
}
PulsaActivity.this.z = new Timer();
PulsaActivity.this.z.schedule(new C0033a(), 1500L);
}
}
public class b implements View.OnClickListener {
public final PulsaEntity a;
public b(PulsaEntity pulsaEntity) {
this.a = pulsaEntity;
}
@Override
public void onClick(View view) {
PulsaActivity.this.a1(this.a);
}
}
public class c implements SearchView.OnQueryTextListener {
public c() {
}
public boolean onQueryTextChange(String str) {
PulsaActivity.this.a2(str);
return false;
}
public boolean onQueryTextSubmit(String str) {
return false;
}
}
public class d extends OnSingleClickListener {
public final ArrayList b;
public d(ArrayList arrayList) {
this.b = arrayList;
}
public void b(ArrayList arrayList, String str, String str2) {
PulsaActivity.this.a0 = str;
PulsaActivity.this.b0 = str2;
PulsaActivity pulsaActivity = PulsaActivity.this;
pulsaActivity.p1(pulsaActivity.Y, arrayList);
PulsaActivity.this.a2("");
PulsaActivity.this.W.setVisibility(8);
PulsaActivity.this.X.setTextColor(ColorStateList.valueOf(ContextCompat.getColor(PulsaActivity.this.getApplicationContext(), R.color.black)));
PulsaActivity.this.X.setChipStrokeColorResource(R.color.transparent);
PulsaActivity.this.X.setChipStrokeWidth(RecyclerView.G0);
PulsaActivity.this.X.setChipIcon(ContextCompat.getDrawable(PulsaActivity.this.getApplicationContext(), R.drawable.filter_pulsa_black));
if (!str.isEmpty() && !str2.isEmpty()) {
Chip childAt = PulsaActivity.this.Y.getChildAt(arrayList.indexOf(str));
if (childAt != null) {
PulsaActivity.this.W1(childAt);
PulsaActivity.this.g1(str, str2);
return;
}
return;
}
if (!str.isEmpty()) {
Chip childAt2 = PulsaActivity.this.Y.getChildAt(arrayList.indexOf(str));
if (childAt2 != null) {
PulsaActivity.this.W1(childAt2);
PulsaActivity.this.a2(str);
return;
}
return;
}
if (str2.isEmpty()) {
return;
}
PulsaActivity.this.a2(str2);
PulsaActivity.this.X.setTextColor(ColorStateList.valueOf(ContextCompat.getColor(PulsaActivity.this.getApplicationContext(), R.color.colorPrimaryAlt)));
PulsaActivity.this.X.setChipStrokeColorResource(R.color.colorPrimaryAlt);
PulsaActivity.this.X.setChipStrokeWidth(1.3f);
PulsaActivity.this.X.setChipIcon(ContextCompat.getDrawable(PulsaActivity.this.getApplicationContext(), R.drawable.filter_pulsa_blue));
}
@Override
public void onSingleClick(View view) {
?? newInstance = FilterPulsaFragment.newInstance();
newInstance.setTypeList(this.b);
newInstance.setSelectedType(PulsaActivity.this.a0);
newInstance.setSelectedPrice(PulsaActivity.this.b0);
final ArrayList arrayList = this.b;
newInstance.setOnSaveListener(new FilterPulsaFragment.OnApplyListener() {
@Override
public final void onSaveFilter(String str, String str2) {
PulsaActivity.d.this.b(arrayList, str, str2);
}
});
newInstance.show(PulsaActivity.this.getSupportFragmentManager(), "filter");
}
}
public class e implements MessageProcess {
public e() {
}
@Override
public void afterProcess(BaseMessage baseMessage) {
APIMessageWrapper aPIMessageWrapper = new APIMessageWrapper(baseMessage);
ArrayList arrayList = new ArrayList();
String replaceFirst = ((BaseActivity) PulsaActivity.this).appSession.retrieve(AppSession.PROPERTY_HANDPHONE).replaceFirst("^62", "0");
if (aPIMessageWrapper.isOK()) {
ArrayList<HashMap<String, Object>> data = aPIMessageWrapper.getData();
HashMap<String, Object> hashMap = data.get(0);
if (!Var.toString(hashMap.get("id_pelanggan"), "").isEmpty()) {
Var.toString(hashMap.get("produk"), "");
Var.toString(hashMap.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"), ""));
if (!produkListEntity.getIdPel1().equalsIgnoreCase(replaceFirst)) {
arrayList.add(produkListEntity);
}
}
} else {
PulsaActivity.this.findViewById(R.id.group_history_view).setVisibility(8);
}
ProdukListEntity produkListEntity2 = new ProdukListEntity();
produkListEntity2.setIdPel1(replaceFirst);
produkListEntity2.setProduk("");
produkListEntity2.setName("");
arrayList.add(0, produkListEntity2);
PulsaActivity.this.r = arrayList;
PulsaActivity.this.U.updateList(PulsaActivity.this.r);
PulsaActivity.this.O.setAdapter(PulsaActivity.this.U);
if (arrayList.isEmpty()) {
PulsaActivity.this.findViewById(R.id.group_history_view).setVisibility(8);
} else {
PulsaActivity.this.findViewById(R.id.group_history_view).setVisibility(0);
}
}
@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) {
PulsaActivity.this.onTransactionDone(false, baseMessage);
if (PulsaActivity.this.s.getText() == null || PulsaActivity.this.s.getText().toString().isEmpty() || PulsaActivity.this.s.getText().toString().length() <= 11 || !PulsaActivity.this.A) {
return;
}
PulsaActivity.this.closeKeyboard();
}
@Override
public void backgroundProcess(long j, long j2, boolean z) {
}
@Override
public void preProcess() {
if (PulsaActivity.this.s.getText() != null && !PulsaActivity.this.s.getText().toString().isEmpty() && PulsaActivity.this.s.getText().toString().length() > 11 && PulsaActivity.this.A) {
PulsaActivity.this.hideKeyboard();
}
PulsaActivity.this.onTransactionPrepare(false);
}
}
public class g implements MessageProcess {
public g() {
}
public void b(int i, Boolean bool) {
PulsaActivity.this.u = "";
PulsaActivity.this.v = "";
PulsaActivity.this.setKode_voucher("");
PulsaActivity.this.doTransaction(true, null);
}
@Override
public void afterProcess(BaseMessage baseMessage) {
APIMessageWrapper aPIMessageWrapper = new APIMessageWrapper(baseMessage);
if (aPIMessageWrapper.isOK()) {
PulsaActivity.this.doTransaction(true, null);
} else {
SearchView.OnCloseListener onCloseListener = PulsaActivity.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) {
PulsaActivity.g.this.b(i, (Boolean) obj);
}
});
}
}
@Override
public void backgroundProcess(long j, long j2, boolean z) {
}
@Override
public void preProcess() {
}
}
public class h implements MessageProcess {
public final PulsaEntity a;
public h(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"));
PulsaActivity.this.u = Var.toString(hashMap2.get("kode_voucher"), "");
PulsaActivity.this.J = Var.toDouble(hashMap.get("nominal_voucher"), 0.0d);
PulsaActivity.this.v = Var.toString(hashMap2.get("kode_voucher"), "");
PulsaActivity.this.K = Var.toDouble(hashMap.get("nominal_voucher"), 0.0d);
}
if (PulsaActivity.this.n1().isEmpty()) {
Affinity.info(PulsaActivity.this, false, "Pastikan nomor yang anda masukan sudah benar");
} else {
PulsaActivity.this.d1(this.a);
}
}
@Override
public void backgroundProcess(long j, long j2, boolean z) {
}
@Override
public void preProcess() {
}
}
public class i implements View.OnClickListener {
public final PulsaEntity a;
public i(PulsaEntity pulsaEntity) {
this.a = pulsaEntity;
}
@Override
public void onClick(View view) {
PulsaActivity.this.openVoucherList(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) {
PulsaActivity.this.a1(this.a);
}
}
public class k implements View.OnClickListener {
public final PulsaEntity a;
public k(PulsaEntity pulsaEntity) {
this.a = pulsaEntity;
}
@Override
public void onClick(View view) {
PulsaActivity.this.a1(this.a);
}
}
public class l implements View.OnClickListener {
public final PulsaEntity a;
public l(PulsaEntity pulsaEntity) {
this.a = pulsaEntity;
}
@Override
public void onClick(View view) {
PulsaActivity.this.changePaymentMethod(this.a);
}
}
public class m implements View.OnClickListener {
public final PulsaEntity a;
public m(PulsaEntity pulsaEntity) {
this.a = pulsaEntity;
}
@Override
public void onClick(View view) {
PulsaActivity.this.changePaymentMethod(this.a);
}
}
public class n implements View.OnClickListener {
public final PulsaEntity a;
public n(PulsaEntity pulsaEntity) {
this.a = pulsaEntity;
}
@Override
public void onClick(View view) {
PulsaActivity.this.a1(this.a);
}
}
public class o implements View.OnClickListener {
public final PulsaEntity a;
public o(PulsaEntity pulsaEntity) {
this.a = pulsaEntity;
}
@Override
public void onClick(View view) {
PulsaActivity.this.a1(this.a);
}
}
public void A1(PulsaEntity pulsaEntity, View view) {
payment(pulsaEntity);
}
public void B1(PulsaEntity pulsaEntity, View view) {
payment(pulsaEntity);
}
public void C1(PulsaEntity pulsaEntity, View view) {
payment(pulsaEntity);
}
public void D1(PulsaEntity pulsaEntity, View view) {
payment(pulsaEntity);
}
public void E1(View view) {
this.y.dismiss();
Affinity.launch(this, Deposit2Activity.class);
}
public void F1(PulsaEntity pulsaEntity, View view) {
Bundle bundle = new Bundle();
bundle.putString("idProduk", pulsaEntity.getIdproduk());
bundle.putString("group", "pulsa");
bundle.putDouble("harga", pulsaEntity.getHargajual());
bundle.putInt("requestCode", 12991);
Affinity.listen(this, OptionVoucherListActivity.class, 0, bundle);
}
public void G1(PulsaEntity pulsaEntity, TextView textView, int i2, Boolean bool) {
if (bool.booleanValue()) {
this.F.findViewById(R.id.voucher_container).setVisibility(8);
this.F.findViewById(R.id.voucher_add_container).setVisibility(8);
this.q0.setVisibility(0);
this.F.findViewById(R.id.switch_poin).setEnabled(true);
this.c0.setEnabled(true);
this.H = Var.toDouble(pulsaEntity.getNominalUp(), 0.0d);
this.B = Var.toInt(Integer.valueOf(pulsaEntity.getHargajual()), 0);
((TextView) this.F.findViewById(R.id.pulsa_price)).setText(Locales.moneyNoFraction(Var.toString(Integer.valueOf(this.B), "")));
((TextView) this.F.findViewById(R.id.pulsa_price_nett)).setText(Locales.moneyNoFraction(Var.toString(Integer.valueOf(this.B), "")));
textView.setText(Locales.moneyNoFraction(Var.toString(Integer.valueOf(this.B), "")));
String.format(Locale.getDefault(), "- %1$s", Locales.moneyNoFraction(Var.toString(Integer.valueOf((int) this.H), "0")));
if (this.H > 0.0d) {
this.F.findViewById(R.id.tv_label_discount).setVisibility(8);
this.F.findViewById(R.id.pulsa_discount).setVisibility(8);
((TextView) this.F.findViewById(R.id.pulsa_discount)).setText(String.format(Locale.getDefault(), "- %1$s", Locales.moneyNoFraction(Var.toString(Integer.valueOf((int) this.H), "0"))));
} else {
this.F.findViewById(R.id.tv_label_discount).setVisibility(8);
this.F.findViewById(R.id.pulsa_discount).setVisibility(8);
}
this.w = "";
this.u = "";
this.J = 0.0d;
this.I = 0.0d;
setKode_voucher("");
if (!this.v.equals("")) {
String str = this.v;
this.u = str;
setKode_voucher(str);
this.J = this.K;
this.n.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.q0.setVisibility(8);
this.n0.setVisibility(0);
}
if (Var.toDouble(this.p, 0.0d) >= this.B) {
this.F.findViewById(R.id.btn_pay).setVisibility(0);
this.F.findViewById(R.id.btn_topup).setVisibility(4);
this.j0.setVisibility(8);
this.s0.setTextColor(ContextCompat.getColor(this, R.color.colorInvoice));
this.r0.setTextColor(ContextCompat.getColor(this, R.color.colorInvoice));
return;
}
if (this.o) {
this.F.findViewById(R.id.btn_pay).setVisibility(0);
this.F.findViewById(R.id.btn_topup).setVisibility(4);
this.j0.setVisibility(8);
this.s0.setTextColor(ContextCompat.getColor(this, R.color.colorInvoice));
this.r0.setTextColor(ContextCompat.getColor(this, R.color.colorInvoice));
return;
}
this.F.findViewById(R.id.btn_pay).setVisibility(4);
this.F.findViewById(R.id.btn_topup).setVisibility(0);
this.j0.setVisibility(0);
this.t0.setBackgroundDrawable(ContextCompat.getDrawable(this, R.drawable.ecm_panel_white_red_rounded_stroke));
this.w0.setImageDrawable(ContextCompat.getDrawable(this, R.drawable.baseline_keyboard_arrow_down_red_24));
this.x0.setBackgroundDrawable(ContextCompat.getDrawable(this, R.drawable.ecm_panel_white_red_rounded_stroke));
this.y0.setTextColor(ContextCompat.getColor(this, R.color.colorLevelPremium));
((TextView) this.F.findViewById(R.id.tv_balance_insufficient)).setTextColor(ContextCompat.getColor(this, R.color.colorLevelPremium));
}
}
public void H1(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) {
PulsaActivity.this.G1(pulsaEntity, textView, i2, (Boolean) obj);
}
});
}
public void I1(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) {
int i2;
if (!z2) {
((TextView) this.F.findViewById(R.id.label_poin_voucher)).setTextColor(ContextCompat.getColor(this, R.color.colorPrimaryAlt));
((TextView) this.F.findViewById(R.id.label_poin_voucher2)).setTextColor(ContextCompat.getColor(this, R.color.Black));
this.n0.setEnabled(true);
this.q0.setEnabled(true);
this.F.findViewById(R.id.poin_voucher_arrowRIght).setEnabled(true);
this.l = 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.n0.setBackgroundResource(R.drawable.bb_background_transparent_blue_rounded_8);
this.q0.setBackgroundResource(R.drawable.bb_background_transparent_blue_rounded_8);
textView2.setVisibility(8);
textView3.setVisibility(8);
textView3.setText("- Rp0");
textView4.setText(Locales.moneyNoFraction(String.valueOf(this.B)));
constraintLayout.setVisibility(8);
this.n0.setVisibility(8);
this.q0.setVisibility(0);
textView6.setText(Locales.moneyNoFraction(Var.toString(Integer.valueOf(this.B), "")));
imageView3.setEnabled(true);
imageView.setEnabled(true);
imageView.setEnabled(true);
if (this.v.equals("")) {
i2 = 0;
} else {
String str = this.v;
this.u = str;
this.J = this.K;
setKode_voucher(str);
this.n.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.q0.setVisibility(8);
i2 = 0;
this.n0.setVisibility(0);
}
if (Var.toDouble(this.p, 0.0d) >= this.B) {
this.p0.setVisibility(0);
this.k0.findViewById(R.id.btn_topup).setVisibility(4);
this.j0.setVisibility(8);
this.s0.setTextColor(ContextCompat.getColor(this, R.color.colorInvoice));
this.r0.setTextColor(ContextCompat.getColor(this, R.color.colorInvoice));
return;
}
if (z) {
this.p0.setVisibility(i2);
this.k0.findViewById(R.id.btn_topup).setVisibility(4);
this.j0.setVisibility(8);
this.s0.setTextColor(ContextCompat.getColor(this, R.color.colorInvoice));
this.r0.setTextColor(ContextCompat.getColor(this, R.color.colorInvoice));
return;
}
this.p0.setVisibility(4);
this.k0.findViewById(R.id.btn_topup).setVisibility(0);
this.j0.setVisibility(0);
this.j0.setTextColor(ContextCompat.getColor(this, R.color.colorLevelPremium));
this.t0.setBackgroundDrawable(ContextCompat.getDrawable(this, R.drawable.ecm_panel_white_red_rounded_stroke));
this.w0.setImageDrawable(ContextCompat.getDrawable(this, R.drawable.baseline_keyboard_arrow_down_red_24));
this.y0.setTextColor(ContextCompat.getColor(this, R.color.colorLevelPremium));
this.x0.setBackgroundDrawable(ContextCompat.getDrawable(this, R.drawable.ecm_panel_white_red_rounded_stroke));
return;
}
((TextView) this.F.findViewById(R.id.label_poin_voucher)).setTextColor(ContextCompat.getColor(this, R.color.Gray));
((TextView) this.F.findViewById(R.id.label_poin_voucher2)).setTextColor(ContextCompat.getColor(this, R.color.Gray));
this.n0.setEnabled(false);
this.q0.setEnabled(false);
this.F.findViewById(R.id.poin_voucher_arrowRIght).setEnabled(false);
this.l = 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.n0.setBackgroundResource(R.drawable.bb_background_transparent_grey_rounded8_stroke1);
this.q0.setBackgroundResource(R.drawable.bb_background_transparent_grey_rounded8_stroke1);
textView2.setVisibility(0);
textView3.setVisibility(0);
constraintLayout.setVisibility(0);
if (d2 > this.B) {
textView3.setText("- " + Locales.moneyNoFraction(String.valueOf(this.B)));
} else {
textView3.setText("- " + Locales.moneyNoFraction(this.appSession.retrieve(AppSession.PROPERTY_POIN)));
}
int i3 = this.B;
if (d2 > i3) {
textView4.setText("Gratis");
} else {
textView4.setText(Locales.moneyNoFraction(String.valueOf(i3 - d2)));
}
if (d2 > this.B) {
textView5.setText("Yeay! kamu hemat " + Locales.moneyNoFraction(String.valueOf(this.B)));
} else {
textView5.setText("Yeay! kamu hemat " + Locales.moneyNoFraction(this.appSession.retrieve(AppSession.PROPERTY_POIN)));
}
this.w = "";
this.u = "";
this.J = 0.0d;
this.I = 0.0d;
setKode_voucher("");
this.n0.setVisibility(8);
this.q0.setVisibility(0);
int i4 = this.B;
if (d2 > i4) {
textView6.setText("Gratis");
} else {
textView6.setText(Locales.moneyNoFraction(String.valueOf(i4 - d2)));
}
imageView3.setEnabled(false);
imageView.setEnabled(false);
if (Var.toDouble(this.p, 0.0d) + d2 >= this.B) {
this.p0.setVisibility(0);
this.k0.findViewById(R.id.btn_topup).setVisibility(4);
this.j0.setVisibility(8);
this.s0.setTextColor(ContextCompat.getColor(this, R.color.colorInvoice));
this.r0.setTextColor(ContextCompat.getColor(this, R.color.colorInvoice));
return;
}
if (z) {
this.p0.setVisibility(0);
this.k0.findViewById(R.id.btn_topup).setVisibility(4);
this.j0.setVisibility(8);
this.s0.setTextColor(ContextCompat.getColor(this, R.color.colorInvoice));
this.r0.setTextColor(ContextCompat.getColor(this, R.color.colorInvoice));
return;
}
this.p0.setVisibility(4);
this.k0.findViewById(R.id.btn_topup).setVisibility(0);
this.j0.setVisibility(0);
this.j0.setTextColor(ContextCompat.getColor(this, R.color.colorLevelPremium));
this.t0.setBackgroundDrawable(ContextCompat.getDrawable(this, R.drawable.ecm_panel_white_red_rounded_stroke));
this.w0.setImageDrawable(ContextCompat.getDrawable(this, R.drawable.baseline_keyboard_arrow_down_red_24));
this.y0.setTextColor(ContextCompat.getColor(this, R.color.colorLevelPremium));
this.x0.setBackgroundDrawable(ContextCompat.getDrawable(this, R.drawable.ecm_panel_white_red_rounded_stroke));
}
public void J1(PulsaEntity pulsaEntity, View view) {
openVoucherList(pulsaEntity);
}
public void K1(PulsaEntity pulsaEntity, View view) {
openVoucherList(pulsaEntity);
}
public void L1(AtomicBoolean atomicBoolean, AtomicBoolean atomicBoolean2, PulsaEntity pulsaEntity, boolean z) {
ImageView imageView = (ImageView) findViewById(R.id.ic_logo_sc);
this.l0 = z;
if (!z) {
atomicBoolean2.set(false);
this.c0.setEnabled(true);
imageView.setImageDrawable(ContextCompat.getDrawable(getApplicationContext(), R.drawable.ic_speedcash));
this.s0.setText(getApplicationContext().getString(R.string.saldo_speedcash));
this.r0.setText(Locales.moneyNoFraction(this.appSession.retrieve(AppSession.PROPERTY_BALANCE)));
this.n0.setVisibility(0);
View view = this.F;
if (view == null || !view.isShown()) {
return;
}
this.y.dismiss();
setSelectedPulsaEntity(pulsaEntity);
o1(pulsaEntity);
return;
}
atomicBoolean.set(z);
this.c0.setEnabled(false);
this.c0.setChecked(false);
this.l = false;
imageView.setImageDrawable(ContextCompat.getDrawable(getApplicationContext(), R.drawable.ic_other_payment));
this.s0.setText("Metode bayar lainnya");
this.r0.setText("QRIS/Virtual Account/Kartu");
this.s0.setTextColor(-16777216);
this.r0.setTextColor(-16777216);
this.j0.setTextColor(ColorStateList.valueOf(ContextCompat.getColor(getApplicationContext(), R.color.colorPrimaryAlt)));
this.p0.setVisibility(0);
this.k0.findViewById(R.id.btn_topup).setVisibility(8);
this.k0.findViewById(R.id.tv_balance_insufficient).setVisibility(8);
this.n0.setVisibility(8);
this.o0.setVisibility(8);
this.x0.setBackgroundDrawable(ContextCompat.getDrawable(getApplicationContext(), R.drawable.bb_background_transparent_grey_rounded8_stroke1));
this.t0.setBackgroundDrawable(ContextCompat.getDrawable(getApplicationContext(), R.drawable.bb_background_transparent_grey_rounded8_stroke1));
this.y0.setTextColor(ContextCompat.getColor(getApplicationContext(), R.color.colorInvoice));
this.w0.setImageDrawable(ContextCompat.getDrawable(getApplicationContext(), R.drawable.ic_keyboard_arrow_down_24));
}
public Unit M1(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 N1(View view) {
this.Q.setVisibility(8);
Editable text = this.s.getText();
Objects.requireNonNull(text);
text.clear();
i1(this.s);
}
public void O1(int i2, Boolean bool) {
this.M = bool.booleanValue();
}
public void P1(View view) {
if (getIntent().getExtras() != null ? Var.toBoolean(Boolean.valueOf(getIntent().getExtras().getBoolean(AppSession.IS_FROM_NEW_HOME)), false) : false) {
Affinity.purge(this, OtherHomeMenuActivity.class);
} else {
Affinity.purge(this, BottomNavigationActivity.class);
}
}
public void Q1(ArrayList arrayList) {
this.x = Affinity.option(this, R.string.pulsa_choose_provider, arrayList, this);
}
public boolean R1(TextView textView, int i2, KeyEvent keyEvent) {
if (i2 != 0 && i2 != 5 && (keyEvent == null || keyEvent.getAction() != 0 || n1().length() < 5)) {
return true;
}
inquiry();
return true;
}
public void S1(PulsaEntity pulsaEntity, int i2, Boolean bool) {
bool.booleanValue();
setSelectedPulsaEntity(pulsaEntity);
o1(pulsaEntity);
}
public void T1(final PulsaEntity pulsaEntity) {
Affinity.refreshBalance(this, new BBCallback() {
@Override
public final void do_callback(int i2, Object obj) {
PulsaActivity.this.S1(pulsaEntity, i2, (Boolean) obj);
}
});
}
public void U1(ValueAnimator valueAnimator) {
this.Z.scrollTo(0, 0);
}
public static int V1(PulsaEntity pulsaEntity, PulsaEntity pulsaEntity2) {
String var = Var.toString(pulsaEntity.getIs_gangguan(), "");
if (var.equals("1")) {
return 1;
}
return var.compareTo(Var.toString(pulsaEntity2.getIs_gangguan(), ""));
}
public static Bundle getPulsaBundle(String str) {
Bundle bundle = new Bundle();
bundle.putString("phone:init", str);
return bundle;
}
public void q1(Chip chip, CompoundButton compoundButton, boolean z) {
if (z) {
chip.setChipBackgroundColor(ColorStateList.valueOf(ContextCompat.getColor(getApplicationContext(), R.color.WhiteSmoke)));
chip.setTextColor(ColorStateList.valueOf(ContextCompat.getColor(getApplicationContext(), R.color.colorPrimaryAlt)));
} else {
chip.setChipBackgroundColor(ColorStateList.valueOf(ContextCompat.getColor(getApplicationContext(), R.color.WhiteSmoke)));
chip.setTextColor(ColorStateList.valueOf(ContextCompat.getColor(getApplicationContext(), R.color.black)));
}
}
public Unit r1(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 s1(View view, ArrayList arrayList, View view2) {
this.Z.setVisibility(8);
view.setVisibility(0);
this.W.setVisibility(8);
this.X.setTextColor(ColorStateList.valueOf(ContextCompat.getColor(getApplicationContext(), R.color.black)));
this.X.setChipStrokeColorResource(R.color.transparent);
this.X.setChipStrokeWidth(RecyclerView.G0);
this.X.setChipIcon(ContextCompat.getDrawable(this, R.drawable.filter_pulsa_black));
p1(this.Y, arrayList);
a2("");
i1(view);
}
public void t1(View view, View view2) {
a2("");
this.Z.setVisibility(0);
view.setVisibility(8);
}
public void u1(ArrayList arrayList, ChipGroup chipGroup, int i2) {
Chip chip = (Chip) this.Y.findViewById(i2);
a2("");
if (chip == null) {
p1(this.Y, arrayList);
} else {
W1(chip);
a2(chip.getText().toString());
}
}
public void v1(ArrayList arrayList, CompoundButton compoundButton, boolean z) {
this.W.setVisibility(8);
this.X.setTextColor(ColorStateList.valueOf(ContextCompat.getColor(getApplicationContext(), R.color.black)));
this.X.setChipStrokeColorResource(R.color.transparent);
this.X.setChipStrokeWidth(RecyclerView.G0);
this.X.setChipIcon(ContextCompat.getDrawable(this, R.drawable.filter_pulsa_black));
p1(this.Y, arrayList);
a2("");
this.b0 = "";
this.a0 = "";
}
public void w1(PulsaEntity pulsaEntity, View view) {
openVoucherList(pulsaEntity);
}
public void x1(PulsaEntity pulsaEntity, View view) {
openVoucherList(pulsaEntity);
}
public void y1(PulsaEntity pulsaEntity, View view) {
openVoucherList(pulsaEntity);
}
public void z1(PulsaEntity pulsaEntity, View view) {
openVoucherList(pulsaEntity);
}
public final void W1(Chip chip) {
if (this.W.getVisibility() == 0) {
this.Y.addView(Z0((String) this.W.getText()), 0);
}
this.W.setTextColor(ColorStateList.valueOf(ContextCompat.getColor(getApplicationContext(), R.color.colorPrimaryAlt)));
this.W.setText(chip.getText());
this.W.setSelected(true);
this.W.setVisibility(0);
this.X.setTextColor(ColorStateList.valueOf(ContextCompat.getColor(getApplicationContext(), R.color.colorPrimaryAlt)));
this.X.setChipStrokeColorResource(R.color.colorPrimaryAlt);
this.X.setChipStrokeWidth(1.3f);
this.X.setChipIcon(ContextCompat.getDrawable(this, R.drawable.filter_pulsa_blue));
this.Y.removeView(chip);
ValueAnimator ofInt = ValueAnimator.ofInt(this.Z.getScrollX(), this.Z.getScrollY());
ofInt.setDuration(2000L);
ofInt.addUpdateListener(new ValueAnimator.AnimatorUpdateListener() {
@Override
public final void onAnimationUpdate(ValueAnimator valueAnimator) {
PulsaActivity.this.U1(valueAnimator);
}
});
ofInt.start();
getClassSimpleName();
}
public final void X1() {
this.s.setTextAppearance(R.style.form_bold);
}
public final void Y1() {
this.s.setTextAppearance(R.style.input_product_code);
}
public final Chip Z0(String str) {
final Chip chip = new Chip(this);
int applyDimension = (int) TypedValue.applyDimension(1, 2.0f, getResources().getDisplayMetrics());
chip.setTextSize(13.0f);
chip.setPadding(applyDimension, applyDimension, applyDimension, applyDimension);
chip.setCheckable(true);
chip.setCheckedIconVisible(false);
chip.setClickable(true);
chip.setText(str);
chip.setTag(str);
chip.setVisibility(0);
chip.setChipBackgroundColor(ColorStateList.valueOf(ContextCompat.getColor(getApplicationContext(), R.color.WhiteSmoke)));
chip.setTextColor(ColorStateList.valueOf(ContextCompat.getColor(getApplicationContext(), R.color.black)));
chip.setOnCheckedChangeListener(new CompoundButton.OnCheckedChangeListener() {
@Override
public final void onCheckedChanged(CompoundButton compoundButton, boolean z) {
PulsaActivity.this.q1(chip, compoundButton, z);
}
});
return chip;
}
public final void Z1(String str) {
WidgetHelper.setProductIdTag(this.s, str, str);
TextInputEditText textInputEditText = this.s;
if (textInputEditText != null) {
textInputEditText.setText(str);
Editable text = this.s.getText();
if (text != null) {
Selection.setSelection(text, text.length());
}
}
}
public final void a1(PulsaEntity pulsaEntity) {
OneClickPayAddModel composeRequestMsgAddCart;
if (Var.toString(n1(), "").equals("")) {
Affinity.info(this, false, getString(R.string.error_required_field, "Nomor Handphone"));
return;
}
getTransactionMessage(true).setItem(BaseMessage.INDEX_VERSION_CODE, 482);
getTransactionMessage(true).setItem(BaseMessage.INDEX_VERSION_NAME, BuildConfig.VERSION_NAME);
getTransactionMessage(true);
if (this.u0) {
OneClickPayHelperAdd oneClickPayHelperAdd = OneClickPayHelperAdd.INSTANCE;
Context applicationContext = getApplicationContext();
PulsaPaketanGameMessage pulsaPaketanGameMessage = this.m0;
String retrieve = this.appSession.retrieve(AppSession.PROPERTY_MERCHANT_ID);
String idproduk = pulsaEntity.getIdproduk();
String n1 = n1();
long round = Math.round(Float.parseFloat(String.valueOf(this.B)));
Editable text = this.i0.getText();
Objects.requireNonNull(text);
composeRequestMsgAddCart = oneClickPayHelperAdd.composeRequestMsgAddCart(applicationContext, false, pulsaPaketanGameMessage, "", retrieve, idproduk, n1, round, 1, "", text.toString(), "", Device.getDeviceUUID(this).toString());
} else {
composeRequestMsgAddCart = OneClickPayHelperAdd.INSTANCE.composeRequestMsgAddCart(getApplicationContext(), false, this.m0, "", this.appSession.retrieve(AppSession.PROPERTY_MERCHANT_ID), pulsaEntity.getIdproduk(), n1(), Math.round(Float.parseFloat(String.valueOf(this.B))), 1, "", this.G, "", Device.getDeviceUUID(this).toString());
}
OneClickPayHelperAdd.INSTANCE.addToCartOneClickPayItem(this, composeRequestMsgAddCart, new Function1() {
public final Object invoke(Object obj) {
Unit r1;
r1 = PulsaActivity.this.r1((BaseMessage) obj);
return r1;
}
});
}
public final void a2(String str) {
if (str.isEmpty()) {
this.P.setCollectionFilterOriginal(this.R);
this.P.updateList(this.R);
return;
}
ArrayList arrayList = (ArrayList) h1(str);
if (arrayList.isEmpty()) {
this.P.getFilter().filter(str);
} else {
this.P.setCollectionFilterOriginal(arrayList);
this.P.updateList(arrayList);
}
}
@Override
public void adapterResult(BaseAdapter baseAdapter, GroupPulsaEntity groupPulsaEntity, int i2) {
}
public final ArrayList<GroupPulsaEntity> b1(ArrayList<HashMap<String, Object>> arrayList) {
String str;
Iterator<HashMap<String, Object>> it;
JSONArray jSONArray;
int i2;
LinkedHashSet linkedHashSet;
String str2;
GroupPulsaEntity groupPulsaEntity;
int i3;
ArrayList<GroupPulsaEntity> arrayList2 = new ArrayList<>();
LinkedHashSet linkedHashSet2 = new LinkedHashSet();
Iterator<HashMap<String, Object>> it2 = arrayList.iterator();
while (it2.hasNext()) {
HashMap<String, Object> next = it2.next();
if (next.get("provider") != null) {
Object obj = next.get("provider");
Objects.requireNonNull(obj);
str = obj.toString();
} else {
str = "";
}
this.S = null;
if (!str.isEmpty()) {
Object obj2 = next.get("image");
Objects.requireNonNull(obj2);
this.S = obj2.toString();
Glide.with(getApplicationContext()).load(this.S).apply(new RequestOptions().placeholder(R.drawable.bb_splash_hexagon).error(R.drawable.bb_splash_hexagon)).into(this.Q);
}
JSONArray jSONArray2 = new JSONArray((Collection) next.get("products"));
int i4 = 0;
while (i4 < jSONArray2.length()) {
try {
JSONObject jSONObject = jSONArray2.getJSONObject(i4);
String optString = jSONObject.optString("jenis", "");
GroupPulsaEntity groupPulsaEntity2 = new GroupPulsaEntity(optString, jSONObject.optInt("columnCount", 1));
JSONArray jSONArray3 = jSONObject.getJSONArray(PesawatBookingListActivity.FLAG_DATA);
ArrayList<PulsaEntity> arrayList3 = new ArrayList<>();
it = it2;
int i5 = 0;
while (i5 < jSONArray3.length()) {
try {
JSONObject jSONObject2 = jSONArray3.getJSONObject(i5);
JSONArray jSONArray4 = jSONArray3;
jSONArray = jSONArray2;
try {
int optInt = jSONObject2.optInt("statuspay", 0);
if (optInt < 0) {
linkedHashSet = linkedHashSet2;
i2 = i4;
str2 = optString;
groupPulsaEntity = groupPulsaEntity2;
i3 = i5;
} else {
i2 = i4;
try {
linkedHashSet = linkedHashSet2;
} catch (JSONException e2) {
e = e2;
getClassSimpleName();
Objects.requireNonNull(e.getMessage());
i4 = i2 + 1;
it2 = it;
jSONArray2 = jSONArray;
}
try {
str2 = optString;
groupPulsaEntity = groupPulsaEntity2;
i3 = i5;
PulsaEntity pulsaEntity = new PulsaEntity(jSONObject2.optString("idproduk", ""), jSONObject2.optString("namaproduk", ""), (int) Var.toDouble(jSONObject2.get("hargajual"), 0.0d), jSONObject2.optString("denom", ""));
pulsaEntity.setCashback(jSONObject2.optString(MPMessage.IncludeMessage.CASHBACK, "0"));
pulsaEntity.setNominalUp(jSONObject2.optString("nominalUp", "0"));
pulsaEntity.setDescription(jSONObject2.optString(MPMessage.INDEX_DESC, ""));
pulsaEntity.setIs_gangguan(jSONObject2.optString("is_gangguan", ""));
pulsaEntity.setResid(Integer.valueOf(Var.toInt(this.i.get(str), getMainProductLogoResId())));
pulsaEntity.setStatus(optInt);
pulsaEntity.setJenis(jSONObject2.optString("jenis", "Empty"));
pulsaEntity.setImgUrl(this.S);
pulsaEntity.setShortnameProduct(jSONObject2.optString("shortname_product", ""));
pulsaEntity.setDiscountNominal(jSONObject2.optString("discount_nominal", "0"));
pulsaEntity.setDiscountPercentage(jSONObject2.optString("discount_precentage", "0"));
pulsaEntity.setBadge(jSONObject2.optString("badge", ""));
pulsaEntity.setKuota(jSONObject2.optString("kuota", ""));
pulsaEntity.setMasaaktif(jSONObject2.optString("masaaktif", ""));
pulsaEntity.setDescription_html(jSONObject2.optString("description_html", ""));
pulsaEntity.setHarga_normal(jSONObject2.optString("harga_normal", ""));
if (Var.toString(jSONObject2.optString("is_gangguan"), "").equalsIgnoreCase("0")) {
arrayList3.add(pulsaEntity);
}
} catch (JSONException e3) {
e = e3;
linkedHashSet2 = linkedHashSet;
getClassSimpleName();
Objects.requireNonNull(e.getMessage());
i4 = i2 + 1;
it2 = it;
jSONArray2 = jSONArray;
}
}
i5 = i3 + 1;
jSONArray3 = jSONArray4;
jSONArray2 = jSONArray;
i4 = i2;
linkedHashSet2 = linkedHashSet;
optString = str2;
groupPulsaEntity2 = groupPulsaEntity;
} catch (JSONException e4) {
e = e4;
i2 = i4;
getClassSimpleName();
Objects.requireNonNull(e.getMessage());
i4 = i2 + 1;
it2 = it;
jSONArray2 = jSONArray;
}
} catch (JSONException e5) {
e = e5;
jSONArray = jSONArray2;
i2 = i4;
getClassSimpleName();
Objects.requireNonNull(e.getMessage());
i4 = i2 + 1;
it2 = it;
jSONArray2 = jSONArray;
}
}
LinkedHashSet linkedHashSet3 = linkedHashSet2;
jSONArray = jSONArray2;
i2 = i4;
String str3 = optString;
GroupPulsaEntity groupPulsaEntity3 = groupPulsaEntity2;
Collections.sort(arrayList3, SORT_BY_CODE);
groupPulsaEntity3.setProductsGroup(arrayList3);
arrayList2.add(groupPulsaEntity3);
linkedHashSet2 = linkedHashSet3;
linkedHashSet2.add(str3);
} catch (JSONException e6) {
e = e6;
it = it2;
}
i4 = i2 + 1;
it2 = it;
jSONArray2 = jSONArray;
}
}
if (!linkedHashSet2.isEmpty()) {
c1(new ArrayList(linkedHashSet2));
}
return arrayList2;
}
public final void c1(final ArrayList<String> arrayList) {
this.Z = (HorizontalScrollView) findViewById(R.id.hsv_filter_grouping);
final View findViewById = findViewById(R.id.cl_search);
findViewById(R.id.sv_pulsa).setOnQueryTextListener(new c());
findViewById(R.id.chip_search).setOnClickListener(new View.OnClickListener() {
@Override
public final void onClick(View view) {
PulsaActivity.this.s1(findViewById, arrayList, view);
}
});
findViewById(R.id.tv_end_search).setOnClickListener(new View.OnClickListener() {
@Override
public final void onClick(View view) {
PulsaActivity.this.t1(findViewById, view);
}
});
Chip findViewById2 = findViewById(R.id.chip_filter);
this.X = findViewById2;
findViewById2.setOnClickListener(new d(arrayList));
Chip findViewById3 = findViewById(R.id.chip_selected);
this.W = findViewById3;
findViewById3.setCheckable(true);
this.W.setCheckedIconVisible(false);
this.W.setClickable(true);
this.W.setChipStrokeColorResource(R.color.colorPrimaryAlt);
this.W.setChipStrokeWidth(1.3f);
ChipGroup chipGroup = (ChipGroup) findViewById(R.id.cg_group_filter);
this.Y = chipGroup;
p1(chipGroup, arrayList);
this.Y.setOnCheckedChangeListener(new ChipGroup.OnCheckedChangeListener() {
public final void onCheckedChanged(ChipGroup chipGroup2, int i2) {
PulsaActivity.this.u1(arrayList, chipGroup2, i2);
}
});
this.W.setOnCheckedChangeListener(new CompoundButton.OnCheckedChangeListener() {
@Override
public final void onCheckedChanged(CompoundButton compoundButton, boolean z) {
PulsaActivity.this.v1(arrayList, compoundButton, z);
}
});
this.Z.setVisibility(0);
}
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.B), atomicBoolean.get(), atomicBoolean2.get());
changePaymentMethodFragment.setOnSelectedChoice(new ChangePaymentMethodFragment.OnSelectedChoice() {
@Override
public final void selectedChoice(boolean z) {
PulsaActivity.this.L1(atomicBoolean2, atomicBoolean, pulsaEntity, z);
}
});
changePaymentMethodFragment.show(getSupportFragmentManager(), "Change Source Found");
}
@android.annotation.SuppressLint({"SetTextI18n"})
public final void d1(final com.bm.sc.bebasbayar.adapter.entity.PulsaEntity r43) {
throw new UnsupportedOperationException("Method not decompiled: com.bm.sc.bebasbayar.ui.activity.ubp.PulsaActivity.d1(com.bm.sc.bebasbayar.adapter.entity.PulsaEntity):void");
}
public final void e1(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 g());
MessageSender messageSender = new MessageSender(this, messageComposer);
messageSender.setRequestMessage(aPIMessageWrapper);
messageSender.execute();
}
public final void f1(PulsaEntity pulsaEntity) {
getTransactionMessage(true).setItem(BaseMessage.INDEX_VERSION_CODE, 482);
getTransactionMessage(true).setItem(BaseMessage.INDEX_VERSION_NAME, BuildConfig.VERSION_NAME);
getTransactionMessage(true);
OpenPaymentHelper openPaymentHelper = OpenPaymentHelper.INSTANCE;
openPaymentHelper.createOpenPayment(this, openPaymentHelper.composeRequestMsg(getApplicationContext(), false, this.m0, "", this.appSession.retrieve(AppSession.PROPERTY_MERCHANT_ID), pulsaEntity.getIdproduk(), n1(), Math.round(Float.parseFloat(String.valueOf(this.B))), 1, "", this.G, "", Device.getDeviceUUID(this).toString()), new Function1() {
public final Object invoke(Object obj) {
Unit M1;
M1 = PulsaActivity.this.M1((BaseMessage) obj);
return M1;
}
});
}
public final void g1(String str, String str2) {
ArrayList arrayList = (ArrayList) h1(str2);
if (arrayList.isEmpty()) {
a2("NOT-FOUND-ANYTHINGS");
return;
}
this.P.setCollectionFilterOriginal(arrayList);
this.P.updateList(arrayList);
this.P.getFilter().filter(str);
}
@Override
public String getClassSimpleName() {
return "pulsa";
}
@Override
public Activity getInvokerActivity() {
return this;
}
@Override
public int getMainProductLogoResId() {
return R.drawable.ic_bb_pulsa;
}
@Override
public String getPageGroupName() {
return "pulsa";
}
@Override
public String getProductName() {
return this.G;
}
@Override
public String getSelectedProductCode() {
String str = this.t;
if (str == null) {
return WidgetHelper.getProductIdTag(this.s);
}
this.t = null;
return str;
}
public PulsaEntity getSelectedPulsaEntity() {
return this.v0;
}
@Override
public BaseMessage getTransactionMessage(boolean z) {
Editable text = this.s.getText();
Objects.requireNonNull(text);
if (text.toString().isEmpty()) {
Affinity.info(this, false, getString(R.string.error_required_field, "Nomor Handphone"));
return null;
}
Editable text2 = this.s.getText();
Objects.requireNonNull(text2);
if (text2.toString().equalsIgnoreCase("")) {
Affinity.info(this, false, getString(R.string.error_required_field, "Nomor Handphone"));
return null;
}
if (this.s.getText().toString().length() < 8) {
Affinity.info(this, false, "Nomor handphone minimal 8 digit");
return null;
}
if (z && getSelectedPulsaEntity().getIdproduk().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) {
return new ListPulsaGameMessage(retrieve, n1());
}
PulsaPaketanGameMessage pulsaPaketanGameMessage = new PulsaPaketanGameMessage(retrieve, this.appSession.retrieve(AppSession.PROPERTY_MERCHANT_PIN), this.appSession.retrieve(AppSession.PROPERTY_AUTH_TOKEN), getSelectedPulsaEntity().getIdproduk());
this.m0 = pulsaPaketanGameMessage;
pulsaPaketanGameMessage.setAdditional_dataValue(0, n1());
Device.getAddressLocation(this);
this.m0.setAdditional_dataValue(109, Device.getLogDevice(this));
this.m0.setIncludesValue(MPMessage.IncludeMessage.CUSTOMER_ID_1, n1());
this.m0.setIncludesValue(MPMessage.IncludeMessage.AMOUNT, String.valueOf(this.B));
this.m0.setIncludesValue(MPMessage.IncludeMessage.PRODUCT_NAME, this.G);
this.m0.setIncludesValue(MPMessage.IncludeMessage.DISCOUNT, Var.toString(Integer.valueOf((int) this.H), "0"));
if (this.l) {
this.m0.setIncludesValue(MPMessage.IncludeMessage.PAYMENT_METHOD_PRIORITY, "POIN");
} else {
this.m0.setIncludesValue(MPMessage.IncludeMessage.PAYMENT_METHOD_PRIORITY, "");
}
if (getKode_voucher() != null) {
this.m0.setIncludesValue(MPMessage.IncludeMessage.JENIS_STRUK, getKode_voucher());
}
this.m0.setItem(BaseMessage.INDEX_UUID, Var.toString(Device.getDeviceUUID(getApplicationContext()).toString(), ""));
this.m0.setAdditional_dataValue(109, Device.getLogDevice(this));
setIsIdPelSaved(false);
return this.m0;
}
@Override
public int getViewResource() {
return R.layout.activity_pulsa_2;
}
@Override
public String getWikiNameSpace() {
return null;
}
public final List<GroupPulsaEntity> h1(String str) {
PulsaEntity next;
ArrayList arrayList = new ArrayList();
Iterator<GroupPulsaEntity> it = this.R.iterator();
while (it.hasNext()) {
GroupPulsaEntity next2 = it.next();
ArrayList<PulsaEntity> arrayList2 = new ArrayList<>();
Iterator<PulsaEntity> it2 = next2.getProductsGroup().iterator();
while (it2.hasNext()) {
next = it2.next();
str.hashCode();
switch (str) {
case "Rp50.000 - Rp100.000":
if (next.getHargajual() > 50000 && next.getHargajual() < 100000) {
arrayList2.add(next);
break;
}
break;
case "<Rp50.000":
if (next.getHargajual() >= 50000) {
break;
} else {
arrayList2.add(next);
break;
}
case ">Rp150.000":
if (next.getHargajual() <= 150000) {
break;
} else {
arrayList2.add(next);
break;
}
case "Rp100.000 - Rp150.000":
if (next.getHargajual() > 100000 && next.getHargajual() < 150000) {
arrayList2.add(next);
break;
}
break;
default:
if (!next.getShortnameProduct().toLowerCase().contains(str.toLowerCase()) && !next.getDescription().toLowerCase().contains(str.toLowerCase())) {
break;
} else {
arrayList2.add(next);
break;
}
break;
}
}
if (!arrayList2.isEmpty()) {
GroupPulsaEntity groupPulsaEntity = new GroupPulsaEntity();
groupPulsaEntity.setType(next2.getType());
groupPulsaEntity.setColumnCount(next2.getColumnCount());
groupPulsaEntity.setProductsGroup(arrayList2);
arrayList.add(groupPulsaEntity);
}
}
return arrayList;
}
public final void i1(View view) {
InputMethodManager inputMethodManager = this.V;
if (inputMethodManager != null) {
inputMethodManager.showSoftInput(view, 0);
this.V.toggleSoftInput(2, 1);
}
Objects.requireNonNull(view);
view.requestFocus();
}
public void inquiry() {
ListPulsaGameMessage listPulsaGameMessage = new ListPulsaGameMessage(this.appSession.retrieve(AppSession.PROPERTY_MERCHANT_ID), n1());
listPulsaGameMessage.setItem("type", "PULSA");
MessageComposer messageComposer = new MessageComposer(2, "v2/" + listPulsaGameMessage.getPath());
messageComposer.setShowProgressRegular(this.A);
messageComposer.setIs_credential(false);
messageComposer.setMessageProcess(new f());
MessageSender messageSender = this.C;
if (messageSender != null) {
messageSender.cancel();
}
MessageSender messageSender2 = new MessageSender(this, messageComposer);
this.C = messageSender2;
messageSender2.setRequestMessage(listPulsaGameMessage);
this.C.execute();
}
public boolean isAssignedAsData() {
return k1() == 2131364831;
}
@Override
public boolean isEnabledVoucher() {
return true;
}
@Override
public boolean isMainSubscriberId() {
return true;
}
@Override
public boolean isNeedToDisplayShowcase() {
return false;
}
@Override
public boolean isPulsaPage() {
return true;
}
@Override
public boolean isSearchVisible() {
return false;
}
public final String j1() {
Bundle extras = getIntent().getExtras();
return extras != null ? extras.getString("phone:prx", "") : "";
}
@IdRes
public final int k1() {
Bundle extras = getIntent().getExtras();
return extras != null ? extras.getInt("mode:tag", R.id.menu_item_pulsa_reg) : R.id.menu_item_pulsa_reg;
}
public final void l1() {
UbpHistoryFragment ubpHistoryFragment = new UbpHistoryFragment();
ubpHistoryFragment.setArguments(ubpHistoryFragment.setupDefaultBundle(11275, "Riwayat Transaksi", this.r));
ubpHistoryFragment.show(getSupportFragmentManager(), "pulsa_history_option");
}
public final void m1() {
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", "pulsa");
messageComposer.addMessage("is_pulsa", 1);
messageComposer.setShowProgressRegular(false);
messageComposer.setIs_encrypted(false);
messageComposer.setMessageProcess(new e());
new MessageSender(this, messageComposer).execute();
}
public final String n1() {
Editable text = this.s.getText();
Objects.requireNonNull(text);
String obj = text.toString();
if (!obj.startsWith(QRISO.ID_ADD_DATA)) {
return obj;
}
return "0" + obj.substring(2);
}
public final void o1(PulsaEntity pulsaEntity) {
this.u = "";
this.J = 0.0d;
this.v = "";
this.K = 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", pulsaEntity.getIdproduk());
MessageComposer messageComposer = new MessageComposer(7, "ro/activity/voucher_applied");
messageComposer.setShowProgressRegular(true);
messageComposer.setIs_encrypted(false);
messageComposer.setMessageProcess(new h(pulsaEntity));
MessageSender messageSender = new MessageSender(this, messageComposer);
messageSender.setRequestMessage(aPIMessageWrapper);
messageSender.execute();
}
@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 == 12991) {
TextView textView = (TextView) this.F.findViewById(R.id.tv_label_discount);
TextView textView2 = (TextView) this.F.findViewById(R.id.pulsa_discount);
TextView textView3 = (TextView) this.F.findViewById(R.id.pulsa_price_nett);
ConstraintLayout findViewById = this.F.findViewById(R.id.voucher_add_container);
RelativeLayout relativeLayout = (RelativeLayout) this.F.findViewById(R.id.voucher_container);
SwitchMaterial findViewById2 = this.F.findViewById(R.id.switch_poin);
String var = Var.toString(this.appSession.retrieve(AppSession.PROPERTY_BALANCE), "0");
TextView textView4 = (TextView) this.F.findViewById(R.id.btn_pay_nominal);
findViewById.setVisibility(8);
this.n0.setVisibility(8);
this.w = intent.getStringExtra("desc_voucher");
this.u = intent.getStringExtra("kode_voucher");
this.J = intent.getDoubleExtra("nominal_voucher", 0.0d);
String stringExtra = intent.getStringExtra("satuan_voucher");
setKode_voucher(this.u);
if (this.w.isEmpty() && this.u.isEmpty()) {
findViewById.setVisibility(8);
this.n0.setVisibility(8);
this.F.findViewById(R.id.btn_list_voucher).setVisibility(8);
} else {
relativeLayout.setVisibility(8);
findViewById.setVisibility(0);
this.n0.setVisibility(8);
this.F.findViewById(R.id.btn_list_voucher).setVisibility(8);
if (this.w.isEmpty()) {
this.F.findViewById(R.id.voucher_desc).setVisibility(8);
this.F.findViewById(R.id.voucher_divider).setVisibility(8);
} else {
this.F.findViewById(R.id.voucher_desc).setVisibility(0);
this.F.findViewById(R.id.voucher_divider).setVisibility(0);
((TextView) this.F.findViewById(R.id.voucher_desc)).setText(Compat.Html_fromHtml(this.w));
}
((TextView) this.F.findViewById(R.id.voucher_code)).setText(Compat.Html_fromHtml(getString(R.string.voucher_code_info, this.u)));
}
if (this.J == 0.0d) {
textView.setVisibility(8);
textView2.setVisibility(8);
findViewById(R.id.view_my_hp).setVisibility(8);
findViewById(R.id.pulsa_carousel_logo).setVisibility(8);
findViewById(R.id.pulsa_carousel_phone).setVisibility(8);
return;
}
((TextView) this.F.findViewById(R.id.voucher_code2)).setText("Dapat voucher " + Locales.moneyNoFraction(Var.toString(Double.valueOf(this.J), "")));
if (stringExtra == null || !stringExtra.equals("saldo")) {
if (stringExtra.equals("poin")) {
findViewById.setVisibility(8);
((TextView) this.F.findViewById(R.id.label_poin)).setText("Gunakan" + Locales.moneyNoFraction(String.valueOf(this.J)).replace("Rp", "") + " SpeedCash Poinmu");
((TextView) this.F.findViewById(R.id.label_poin_voucher)).setText("Kamu akan dapat" + Locales.moneyNoFraction(String.valueOf(this.J)).replace("Rp", "") + " SpeedCash Poin");
this.n0.setVisibility(0);
if (this.H > 0.0d) {
textView.setVisibility(8);
textView2.setVisibility(8);
} else {
textView.setVisibility(8);
textView2.setVisibility(8);
}
this.n.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());
findViewById2.setEnabled(true);
return;
}
return;
}
double d2 = this.H;
double d3 = this.J;
this.H = d2 + d3;
this.m = this.B - d3;
textView.setVisibility(0);
textView2.setVisibility(0);
textView2.setText(String.format(Locale.getDefault(), "- %1$s", Locales.moneyNoFraction(Var.toString(Integer.valueOf((int) this.H), "0"))));
textView3.setText(Locales.moneyNoFraction(Var.toString(Double.valueOf(this.m), "")));
findViewById2.setEnabled(false);
this.n0.setVisibility(8);
findViewById.setVisibility(0);
this.F.findViewById(R.id.voucher_add_container).setVisibility(0);
TextView textView5 = (TextView) this.F.findViewById(R.id.tv_balance_insufficient);
this.s0 = (TextView) this.F.findViewById(R.id.sc_label_balance);
if (Var.toDouble(var, 0.0d) >= this.m) {
this.F.findViewById(R.id.btn_pay).setVisibility(0);
this.F.findViewById(R.id.btn_topup).setVisibility(4);
textView5.setVisibility(8);
this.s0.setTextColor(ContextCompat.getColor(this, R.color.colorInvoice));
this.r0.setTextColor(ContextCompat.getColor(this, R.color.colorInvoice));
} else if (this.o) {
this.F.findViewById(R.id.btn_pay).setVisibility(0);
this.F.findViewById(R.id.btn_topup).setVisibility(4);
textView5.setVisibility(8);
this.s0.setTextColor(ContextCompat.getColor(this, R.color.colorInvoice));
this.r0.setTextColor(ContextCompat.getColor(this, R.color.colorInvoice));
} else {
this.F.findViewById(R.id.btn_pay).setVisibility(4);
this.F.findViewById(R.id.btn_topup).setVisibility(0);
textView5.setVisibility(0);
this.s0.setTextColor(ContextCompat.getColor(this, R.color.colorLevelPremium));
this.r0.setTextColor(ContextCompat.getColor(this, R.color.colorLevelPremium));
((TextView) this.F.findViewById(R.id.tv_balance_insufficient)).setTextColor(ContextCompat.getColor(this, R.color.colorLevelPremium));
}
textView4.setText(Locales.moneyNoFraction(Var.toString(Double.valueOf(this.m), "")));
}
}
public void onAttachedToWindow() {
this.L = true;
super/*android.app.Activity*/.onAttachedToWindow();
}
@Override
public void onBackPressed() {
closeKeyboard();
boolean z = getIntent().getExtras() != null ? Var.toBoolean(Boolean.valueOf(getIntent().getExtras().getBoolean(AppSession.IS_FROM_NEW_HOME)), false) : false;
boolean z2 = getIntent().getExtras() != null ? Var.toBoolean(Boolean.valueOf(getIntent().getExtras().getBoolean(AppSession.IS_FROM_ONE_CLICK)), false) : false;
if (z) {
Affinity.purge(this, OtherHomeMenuActivity.class);
} else if (z2) {
Affinity.purge(this, OneKlickPayActivity.class);
} else {
super.onBackPressed();
}
}
@Override
public void onClick(View view) {
if (view.getId() == 2131365281) {
l1();
} else {
super.onClick(view);
}
}
@Override
public void onClickData(ProdukListEntity produkListEntity) {
Z1(produkListEntity.getIdPel1());
}
@Override
public void onClickedData(int i2, PulsaEntity pulsaEntity) {
setSelectedPulsaEntity(pulsaEntity);
o1(pulsaEntity);
}
@Override
public void onCreate(Bundle bundle) {
SelfNumberEntity selfNumberEntity;
super.onCreate(bundle);
this.D = findViewById(R.id.loading_pulsa);
this.V = (InputMethodManager) getSystemService("input_method");
this.Q = findViewById(R.id.img_provider);
RecyclerView recyclerView = (RecyclerView) findViewById(R.id.rv_pulsa_list);
this.N = recyclerView;
recyclerView.setLayoutManager(new SmoothScrollLinearLayoutManager(this, 1, false));
this.N.setNestedScrollingEnabled(false);
this.s = findViewById(R.id.pulsa_field_nohp);
findViewById(R.id.til_pulsa_field_nohp).setEndIconOnClickListener(new View.OnClickListener() {
@Override
public final void onClick(View view) {
PulsaActivity.this.N1(view);
}
});
WidgetHelper.setAutoComplete2(this.s, this, this.appSession, "PULSA", 5, new BBCallback() {
@Override
public final void do_callback(int i2, Object obj) {
PulsaActivity.this.O1(i2, (Boolean) obj);
}
});
View findViewById = findViewById(R.id.pulsa_carousel_more_btn);
this.E = findViewById;
findViewById.setOnClickListener(this);
attachUIHandler(null);
ShowcaseHelper.transactionShowCase(this, true);
onShowcaseFinished();
this.s.requestFocus();
String var = Var.toString(new AppSession(this).retrieve(AppSession.PROPERTY_BALANCE), "0");
if (var == null) {
this.balance_insufficient_container.setVisibility(8);
} else if (var.equals("0") || var.isEmpty()) {
this.balance_insufficient_container.setVisibility(0);
} else {
this.balance_insufficient_container.setVisibility(8);
}
Bundle extras = getIntent().getExtras();
if (extras != null) {
this.u0 = extras.getBoolean(AppSession.IS_FROM_ONE_CLICK, false);
}
Bundle extras2 = getIntent().getExtras();
if (extras2 != null && (selfNumberEntity = (SelfNumberEntity) extras2.getParcelable("self_number_entity")) != null) {
Z1(selfNumberEntity.getIdPel());
}
if (extras2 != null) {
String string = extras2.getString("tittle");
if (getToolbar() != null && string != null) {
ActionBar supportActionBar = getSupportActionBar();
Objects.requireNonNull(supportActionBar);
supportActionBar.setTitle(string);
}
}
if (getToolbar() != null) {
getToolbar().setNavigationOnClickListener(new View.OnClickListener() {
@Override
public final void onClick(View view) {
PulsaActivity.this.P1(view);
}
});
}
ArrayList arrayList = new ArrayList(this.configSession.retrieveSet(ConfigSession.PROPERTY_WHITE_LIST_ID));
this.T = 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.T;
Object obj2 = ((HashMap) arrayList.get(i2)).get(DataMessage.ID_OUTLET);
Objects.requireNonNull(obj2);
arrayList2.add(obj2.toString());
}
}
RecyclerView recyclerView2 = (RecyclerView) findViewById(R.id.rv_history);
this.O = recyclerView2;
recyclerView2.setFocusable(false);
HistoryPulsaAdapter historyPulsaAdapter = new HistoryPulsaAdapter(this);
this.U = historyPulsaAdapter;
historyPulsaAdapter.setCallback(this);
ArrayList<String> arrayList3 = this.T;
if (arrayList3 != null && arrayList3.size() > 0) {
for (int i3 = 0; i3 < this.T.size(); i3++) {
if (this.T.get(i3).equals(this.appSession.retrieve(AppSession.PROPERTY_MERCHANT_ID))) {
this.o = true;
}
}
}
m1();
}
@Override
public void onCrossSellProduct(ProdukListEntity produkListEntity) {
HashMap hashMap = Var.toHashMap(produkListEntity.getAria_data());
PulsaEntity pulsaEntity = new PulsaEntity(produkListEntity.getCode(), produkListEntity.getName(), (int) Var.toDouble(hashMap.get("harga_jual"), 0.0d), String.valueOf(produkListEntity.getPrice()));
pulsaEntity.setCashback(Var.toString(hashMap.get(MPMessage.IncludeMessage.CASHBACK), ""));
pulsaEntity.setNominalUp(Var.toString(hashMap.get("nominalUp"), ""));
pulsaEntity.setResid(Integer.valueOf(getMainProductLogoResId()));
setSelectedPulsaEntity(pulsaEntity);
o1(pulsaEntity);
}
public void onDetachedFromWindow() {
this.L = false;
super/*android.app.Activity*/.onDetachedFromWindow();
}
@Override
public void onItemClick(DialogPlus dialogPlus, Object obj, View view, int i2) {
if (!(obj instanceof DialogPlusOption)) {
super.onItemClick(dialogPlus, obj, view, i2);
return;
}
DialogPlusOption dialogPlusOption = (DialogPlusOption) obj;
if (dialogPlusOption.getText().startsWith("Provider")) {
this.t = Var.toString(dialogPlusOption.getObject(), "");
super.onItemClick(dialogPlus, obj, view, 0);
DialogPlus dialogPlus2 = this.x;
if (dialogPlus2 == null || !dialogPlus2.isShowing()) {
return;
}
this.x.dismiss();
return;
}
if (i2 != 0) {
super.onItemClick(dialogPlus, obj, view, i2);
return;
}
DialogPlus dialogPlus3 = this.transactionIdPelDialog;
if (dialogPlus3 != null && dialogPlus3.isShowing()) {
this.transactionIdPelDialog.dismiss();
}
HashMap<String, HashMap<String, HashMap<String, String>>> parseProduk = MessageParser.PulsaGame.parseProduk(this.dataSession.retrieve(DataSession.PROPERTY_LIST_PULSA_NEW));
final ArrayList arrayList = new ArrayList();
for (String str : parseProduk.keySet()) {
HashMap<String, HashMap<String, String>> hashMap = parseProduk.get(str);
Objects.requireNonNull(hashMap);
ArrayList arrayList2 = new ArrayList(hashMap.keySet());
DialogPlusOption dialogPlusOption2 = new DialogPlusOption("Provider " + str, Var.toInt(this.i.get(str), getMainProductLogoResId()));
dialogPlusOption2.setObject(arrayList2.get(0));
arrayList.add(dialogPlusOption2);
}
new Handler().postDelayed(new Runnable() {
@Override
public final void run() {
PulsaActivity.this.Q1(arrayList);
}
}, 500L);
}
@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.F != null) {
this.r0.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) {
Z1(code);
if (i2 == 39791) {
inquiry();
}
}
}
public void onPause() {
super/*androidx.fragment.app.FragmentActivity*/.onPause();
EventBus.getDefault().unregister(this);
}
@Override
public void onResume() {
super.onResume();
if (this.F != null) {
this.r0.setText(Locales.moneyNoFraction(this.appSession.retrieve(AppSession.PROPERTY_BALANCE)));
}
}
@Override
public void onShowcaseFinished() {
String j1 = j1();
if (!j1.isEmpty()) {
this.s.setText(j1);
inquiry();
}
this.s.addTextChangedListener(new a());
this.s.setOnEditorActionListener(new TextView.OnEditorActionListener() {
@Override
public final boolean onEditorAction(TextView textView, int i2, KeyEvent keyEvent) {
boolean R1;
R1 = PulsaActivity.this.R1(textView, i2, keyEvent);
return R1;
}
});
}
@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) {
this.A = true;
findViewById(R.id.layout_product_not_found).setVisibility(8);
this.D.setVisibility(8);
if (z) {
PulsaPaketanGameMessage pulsaPaketanGameMessage = new PulsaPaketanGameMessage(baseMessage);
pulsaPaketanGameMessage.isOK();
return pulsaPaketanGameMessage;
}
ApiMpMessageWrapper apiMpMessageWrapper = new ApiMpMessageWrapper(baseMessage);
if (apiMpMessageWrapper.isApiOK()) {
this.R = b1(apiMpMessageWrapper.getData());
PulsaTypeGroupAdapter pulsaTypeGroupAdapter = new PulsaTypeGroupAdapter(this);
this.P = pulsaTypeGroupAdapter;
pulsaTypeGroupAdapter.setOnPassingPulsaEntity(new PulsaTypeGroupAdapter.OnPassingPulsaEntity() {
@Override
public final void onSelected(PulsaEntity pulsaEntity) {
PulsaActivity.this.T1(pulsaEntity);
}
});
this.N.setAdapter(this.P);
this.P.setCollectionFilterOriginal(this.R);
this.P.updateList(this.R);
this.N.setVisibility(0);
this.Q.setVisibility(0);
} else {
findViewById(R.id.layout_product_not_found).setVisibility(0);
}
return apiMpMessageWrapper;
}
@Override
public void onTransactionPrepare(boolean z) {
findViewById(R.id.layout_product_not_found).setVisibility(8);
this.D.setVisibility(0);
}
@Override
public void onUbpHistoryChoosen(UbpHistoryFragment ubpHistoryFragment, int i2, ProdukListEntity produkListEntity) {
String idPel1 = produkListEntity.getIdPel1();
if (i2 == 11275) {
WidgetHelper.setProductIdTag(this.s, idPel1, idPel1);
}
}
public void openVoucherList(PulsaEntity pulsaEntity) {
Bundle bundle = new Bundle();
bundle.putString("idProduk", pulsaEntity.getIdproduk());
bundle.putString("group", "pulsa");
bundle.putDouble("harga", pulsaEntity.getHargajual());
bundle.putInt("requestCode", 12991);
Affinity.listen(this, OptionVoucherListActivity.class, 0, bundle);
}
@Override
public void optionChoosen(OptionListFragment1 optionListFragment1, int i2, ProdukListEntity produkListEntity) {
String code = produkListEntity.getCode();
if (i2 == 39791 || i2 == 57345) {
WidgetHelper.setProductIdTag(this.s, code, code);
if (i2 == 39791) {
inquiry();
}
this.dialog.dismiss();
}
}
@Override
public void optionChoosen1(OptionListFragment2 optionListFragment2, int i2, ProdukListEntity produkListEntity) {
String code = produkListEntity.getCode();
if (i2 == 11275) {
WidgetHelper.setProductIdTag(this.s, code, code);
inquiry();
this.dialog.dismiss();
}
}
public final void p1(ChipGroup chipGroup, ArrayList<String> arrayList) {
chipGroup.removeAllViews();
Iterator<String> it = arrayList.iterator();
while (it.hasNext()) {
chipGroup.addView(Z0(it.next()));
}
}
public void payment(PulsaEntity pulsaEntity) {
this.v = "";
this.K = 0.0d;
this.y.dismiss();
if (this.l0) {
f1(pulsaEntity);
return;
}
TextInputEditText textInputEditText = this.s;
String idproduk = pulsaEntity.getIdproduk();
Editable text = this.s.getText();
Objects.requireNonNull(text);
String obj = text.toString();
Objects.requireNonNull(obj);
WidgetHelper.setProductIdTag(textInputEditText, idproduk, obj);
if (this.u.equals("")) {
doTransaction(true, null);
} else {
e1(this.u, pulsaEntity.getIdproduk(), pulsaEntity.getHargajual());
}
}
@Override
public void resetForm(boolean z) {
if (z) {
WidgetHelper.removeProductIdTag(this.s);
}
this.Q.setVisibility(8);
findViewById(R.id.pulsa_carousel_more_btn).setVisibility(0);
}
public void setSelectedPulsaEntity(PulsaEntity pulsaEntity) {
this.v0 = pulsaEntity;
}
}