正在查看: SpeedCash v6.5.1482 应用的 PlaneBookingActivity.java JAVA 源代码文件
本页面展示 JAVA 反编译生成的源代码文件,支持语法高亮显示。 仅供安全研究与技术分析使用,严禁用于任何非法用途。请遵守相关法律法规。
正在查看: SpeedCash v6.5.1482 应用的 PlaneBookingActivity.java JAVA 源代码文件
本页面展示 JAVA 反编译生成的源代码文件,支持语法高亮显示。 仅供安全研究与技术分析使用,严禁用于任何非法用途。请遵守相关法律法规。
package com.bm.sc.bebasbayar.ui.activity.ticket;
import android.content.Intent;
import android.os.Bundle;
import android.view.View;
import android.widget.CompoundButton;
import android.widget.ImageView;
import android.widget.LinearLayout;
import android.widget.TextView;
import androidx.appcompat.widget.SearchView;
import androidx.constraintlayout.widget.ConstraintLayout;
import androidx.core.content.ContextCompat;
import com.bm.sc.bebasbayar.R;
import com.bm.sc.bebasbayar.adapter.entity.ProdukListEntity;
import com.bm.sc.bebasbayar.adapter.holder.TicketDataHolder;
import com.bm.sc.bebasbayar.handler.MessageComposer;
import com.bm.sc.bebasbayar.handler.MessageSender;
import com.bm.sc.bebasbayar.helper.Affinity;
import com.bm.sc.bebasbayar.helper.MessageParser;
import com.bm.sc.bebasbayar.helper.TicketingHelper;
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.MPMessage;
import com.bm.sc.bebasbayar.message.api.APIMessageWrapper;
import com.bm.sc.bebasbayar.message.mp.PesawatMessage;
import com.bm.sc.bebasbayar.message.qr.DataMessage;
import com.bm.sc.bebasbayar.setting.ApiConfig;
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.cash.Deposit2Activity;
import com.bm.sc.bebasbayar.ui.activity.list.OptionVoucherListActivity;
import com.bm.sc.bebasbayar.ui.activity.ticket.PlaneBookingActivity;
import com.bm.sc.bebasbayar.ui.fragment.kereta.TrainDetailPassengerFragment;
import com.bm.sc.bebasbayar.ui.fragment.ticket.plane.DetailRutePlaneFragment2;
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.DateTime;
import com.bm.sc.util.format.Locales;
import com.bumptech.glide.Glide;
import com.bumptech.glide.RequestManager;
import com.bumptech.glide.load.engine.DiskCacheStrategy;
import com.bumptech.glide.request.RequestOptions;
import com.google.android.material.bottomsheet.BottomSheetDialogFragment;
import com.google.android.material.switchmaterial.SwitchMaterial;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.Objects;
import java.util.concurrent.TimeUnit;
import nl.dionsegijn.konfetti.core.PartyFactory;
import nl.dionsegijn.konfetti.core.emitter.Emitter;
import nl.dionsegijn.konfetti.xml.KonfettiView;
public class PlaneBookingActivity extends BaseActivity {
public LinearLayout A;
public KonfettiView g;
public TicketDataHolder j;
public PesawatMessage k;
public HashMap<String, String> l;
public ArrayList<HashMap<String, Object>> m;
public TextView n;
public String o;
public double p;
public double q;
public double r;
public double s;
public ArrayList<String> t;
public ProdukListEntity u;
public TextView v;
public TextView w;
public TextView x;
public TextView y;
public TextView z;
public String c = "";
public String d = "";
public double e = 0.0d;
public double f = 0.0d;
public boolean h = false;
public boolean i = false;
public class a implements MessageProcess {
public a() {
}
public void b(int i, Boolean bool) {
PlaneBookingActivity.this.finish();
}
@Override
public void afterProcess(BaseMessage baseMessage) {
PlaneBookingActivity.this.k = new PesawatMessage(baseMessage);
if (PlaneBookingActivity.this.k.isOK()) {
PlaneBookingActivity.this.S();
} else {
SearchView.OnQueryTextListener onQueryTextListener = PlaneBookingActivity.this;
Affinity.info(onQueryTextListener, -1, onQueryTextListener.getString(R.string.title_warning), PlaneBookingActivity.this.k.getMessageDescription(), new BBCallback() {
@Override
public final void do_callback(int i, Object obj) {
PlaneBookingActivity.a.this.b(i, (Boolean) obj);
}
});
}
}
@Override
public void backgroundProcess(long j, long j2, boolean z) {
}
@Override
public void preProcess() {
}
}
public class b extends OnSingleClickListener {
public b() {
}
@Override
public void onSingleClick(View view) {
BottomSheetDialogFragment trainDetailPassengerFragment = new TrainDetailPassengerFragment();
trainDetailPassengerFragment.setArguments(TrainDetailPassengerFragment.getBundle(PlaneBookingActivity.this.m));
trainDetailPassengerFragment.show(PlaneBookingActivity.this.getSupportFragmentManager(), "list_passenger_detail");
}
}
public class c extends OnSingleClickListener {
public c() {
}
@Override
public void onSingleClick(View view) {
PlaneBookingActivity.this.L();
}
}
public class d implements MessageProcess {
public class a implements View.OnClickListener {
public a() {
}
@Override
public void onClick(View view) {
Bundle bundle = new Bundle();
bundle.putString("idProduk", PlaneBookingActivity.this.o);
bundle.putString("group", ConfigSession.KEY_PREFERENCE_PESAWAT);
bundle.putDouble("harga", PlaneBookingActivity.this.getNominal());
bundle.putInt("requestCode", 62591);
Affinity.listen(PlaneBookingActivity.this, OptionVoucherListActivity.class, 0, bundle);
}
}
public d() {
}
public void f(ConstraintLayout constraintLayout, ConstraintLayout constraintLayout2, TextView textView, ImageView imageView, ImageView imageView2, ImageView imageView3, ImageView imageView4, ConstraintLayout constraintLayout3, double d, TextView textView2, String str, boolean z, CompoundButton compoundButton, boolean z2) {
int i;
if (!z2) {
((TextView) PlaneBookingActivity.this.findViewById(R.id.label_poin_voucher)).setTextColor(ContextCompat.getColor(PlaneBookingActivity.this, R.color.colorPrimaryAlt));
((TextView) PlaneBookingActivity.this.findViewById(R.id.label_poin_voucher2)).setTextColor(ContextCompat.getColor(PlaneBookingActivity.this, R.color.Black));
constraintLayout.setEnabled(true);
constraintLayout2.setEnabled(true);
PlaneBookingActivity.this.findViewById(R.id.poin_voucher_arrowRIght).setEnabled(true);
PlaneBookingActivity planeBookingActivity = PlaneBookingActivity.this;
planeBookingActivity.h = false;
planeBookingActivity.j.setUsedPaymentPoint(PlaneBookingActivity.this.h);
textView.setTextColor(ContextCompat.getColor(PlaneBookingActivity.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);
constraintLayout.setBackgroundResource(R.drawable.bb_background_transparent_blue_rounded_16);
constraintLayout2.setBackgroundResource(R.drawable.bb_background_transparent_blue_rounded_16);
PlaneBookingActivity.this.A.setVisibility(8);
PlaneBookingActivity.this.findViewById(R.id.ticket_poin_amount).setVisibility(8);
((TextView) PlaneBookingActivity.this.findViewById(R.id.ticket_poin_amount)).setText("- Rp0");
PlaneBookingActivity.this.n.setText(Locales.moneyNoFraction(String.valueOf(PlaneBookingActivity.this.getNominalTotal())));
constraintLayout3.setVisibility(8);
constraintLayout.setVisibility(8);
constraintLayout2.setVisibility(0);
PlaneBookingActivity planeBookingActivity2 = PlaneBookingActivity.this;
planeBookingActivity2.c = planeBookingActivity2.d;
planeBookingActivity2.j.setVoucher_code(PlaneBookingActivity.this.d);
imageView3.setEnabled(true);
imageView.setEnabled(true);
imageView.setEnabled(true);
if (PlaneBookingActivity.this.d.equals("")) {
i = 0;
} else {
PlaneBookingActivity planeBookingActivity3 = PlaneBookingActivity.this;
planeBookingActivity3.c = planeBookingActivity3.d;
planeBookingActivity3.e = planeBookingActivity3.f;
PlaneBookingActivity.this.g.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());
constraintLayout2.setVisibility(8);
i = 0;
constraintLayout.setVisibility(0);
}
if (Var.toDouble(str, 0.0d) >= PlaneBookingActivity.this.getNominalTotal()) {
PlaneBookingActivity.this.findViewById(R.id.btn_pay).setVisibility(i);
PlaneBookingActivity.this.findViewById(R.id.btn_topup).setVisibility(8);
return;
} else if (z) {
PlaneBookingActivity.this.findViewById(R.id.btn_pay).setVisibility(i);
PlaneBookingActivity.this.findViewById(R.id.btn_topup).setVisibility(8);
return;
} else {
PlaneBookingActivity.this.findViewById(R.id.btn_pay).setVisibility(8);
PlaneBookingActivity.this.findViewById(R.id.btn_topup).setVisibility(i);
return;
}
}
((TextView) PlaneBookingActivity.this.findViewById(R.id.label_poin_voucher)).setTextColor(ContextCompat.getColor(PlaneBookingActivity.this, R.color.Gray));
((TextView) PlaneBookingActivity.this.findViewById(R.id.label_poin_voucher2)).setTextColor(ContextCompat.getColor(PlaneBookingActivity.this, R.color.Gray));
constraintLayout.setEnabled(false);
constraintLayout2.setEnabled(false);
PlaneBookingActivity.this.findViewById(R.id.poin_voucher_arrowRIght).setEnabled(false);
PlaneBookingActivity planeBookingActivity4 = PlaneBookingActivity.this;
planeBookingActivity4.h = true;
planeBookingActivity4.j.setUsedPaymentPoint(PlaneBookingActivity.this.h);
textView.setTextColor(ContextCompat.getColor(PlaneBookingActivity.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);
constraintLayout.setBackgroundResource(R.drawable.bb_background_transparent_grey);
constraintLayout2.setBackgroundResource(R.drawable.bb_background_transparent_grey);
PlaneBookingActivity.this.A.setVisibility(0);
constraintLayout3.setVisibility(0);
PlaneBookingActivity.this.findViewById(R.id.ticket_poin_amount).setVisibility(0);
((TextView) PlaneBookingActivity.this.findViewById(R.id.ticket_poin_amount_label)).setText("SpeedCash Poin Digunakan");
if (d > PlaneBookingActivity.this.getNominalTotal()) {
((TextView) PlaneBookingActivity.this.findViewById(R.id.ticket_poin_amount)).setText(Locales.moneyNoFraction(Var.toString(Double.valueOf(PlaneBookingActivity.this.getNominalTotal()), "0")));
} else {
((TextView) PlaneBookingActivity.this.findViewById(R.id.ticket_poin_amount)).setText("- " + Locales.moneyNoFraction(((BaseActivity) PlaneBookingActivity.this).appSession.retrieve(AppSession.PROPERTY_POIN)));
}
if (d > PlaneBookingActivity.this.getNominalTotal()) {
PlaneBookingActivity.this.n.setText("Gratis");
} else {
PlaneBookingActivity.this.n.setText(Locales.moneyNoFraction(String.valueOf(PlaneBookingActivity.this.getNominalTotal() - d)));
}
if (d > PlaneBookingActivity.this.getNominalTotal()) {
textView2.setText("Yeay! kamu hemat " + Locales.moneyNoFraction(String.valueOf(PlaneBookingActivity.this.getNominalTotal())));
} else {
textView2.setText("Yeay! kamu hemat " + Locales.moneyNoFraction(((BaseActivity) PlaneBookingActivity.this).appSession.retrieve(AppSession.PROPERTY_POIN)));
}
PlaneBookingActivity planeBookingActivity5 = PlaneBookingActivity.this;
planeBookingActivity5.c = "";
planeBookingActivity5.e = 0.0d;
planeBookingActivity5.j.setVoucher_code("");
constraintLayout.setVisibility(8);
constraintLayout2.setVisibility(0);
imageView3.setEnabled(false);
imageView.setEnabled(false);
if (Var.toDouble(str, 0.0d) + d >= PlaneBookingActivity.this.getNominalTotal()) {
PlaneBookingActivity.this.findViewById(R.id.btn_pay).setVisibility(0);
PlaneBookingActivity.this.findViewById(R.id.btn_topup).setVisibility(8);
} else if (z) {
PlaneBookingActivity.this.findViewById(R.id.btn_pay).setVisibility(0);
PlaneBookingActivity.this.findViewById(R.id.btn_topup).setVisibility(8);
} else {
PlaneBookingActivity.this.findViewById(R.id.btn_pay).setVisibility(8);
PlaneBookingActivity.this.findViewById(R.id.btn_topup).setVisibility(0);
}
}
public void g(View view) {
Bundle bundle = new Bundle();
bundle.putString("idProduk", PlaneBookingActivity.this.o);
bundle.putString("group", ConfigSession.KEY_PREFERENCE_PESAWAT);
bundle.putDouble("harga", PlaneBookingActivity.this.getNominal());
bundle.putInt("requestCode", 62591);
Affinity.listen(PlaneBookingActivity.this, OptionVoucherListActivity.class, 0, bundle);
}
public void h(View view) {
Bundle bundle = new Bundle();
bundle.putString("idProduk", PlaneBookingActivity.this.o);
bundle.putString("group", ConfigSession.KEY_PREFERENCE_PESAWAT);
bundle.putDouble("harga", PlaneBookingActivity.this.getNominal());
bundle.putInt("requestCode", 62591);
Affinity.listen(PlaneBookingActivity.this, OptionVoucherListActivity.class, 0, bundle);
}
public void i(View view) {
Bundle bundle = new Bundle();
bundle.putString("idProduk", PlaneBookingActivity.this.o);
bundle.putString("group", ConfigSession.KEY_PREFERENCE_PESAWAT);
bundle.putDouble("harga", PlaneBookingActivity.this.getNominal());
bundle.putInt("requestCode", 62591);
Affinity.listen(PlaneBookingActivity.this, OptionVoucherListActivity.class, 0, bundle);
}
public void j(View view) {
Bundle bundle = new Bundle();
bundle.putString("idProduk", PlaneBookingActivity.this.o);
bundle.putString("group", ConfigSession.KEY_PREFERENCE_PESAWAT);
bundle.putDouble("harga", PlaneBookingActivity.this.getNominal());
bundle.putInt("requestCode", 62591);
Affinity.listen(PlaneBookingActivity.this, OptionVoucherListActivity.class, 0, bundle);
}
@Override
public void afterProcess(BaseMessage baseMessage) {
ConstraintLayout constraintLayout;
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"));
PlaneBookingActivity.this.c = Var.toString(hashMap2.get("kode_voucher"), "");
PlaneBookingActivity.this.e = Var.toDouble(hashMap.get("nominal_voucher"), 0.0d);
PlaneBookingActivity.this.d = Var.toString(hashMap2.get("kode_voucher"), "");
PlaneBookingActivity.this.f = Var.toDouble(hashMap.get("nominal_voucher"), 0.0d);
((TextView) PlaneBookingActivity.this.findViewById(R.id.ticket_detail_voucher_et)).setText(PlaneBookingActivity.this.c);
PlaneBookingActivity.this.j.setVoucher_code(PlaneBookingActivity.this.c);
}
PlaneBookingActivity planeBookingActivity = PlaneBookingActivity.this;
final boolean z = planeBookingActivity.i;
final double d = Var.toDouble(((BaseActivity) planeBookingActivity).appSession.retrieve(AppSession.PROPERTY_POIN), 0.0d);
ConstraintLayout findViewById = PlaneBookingActivity.this.findViewById(R.id.view_info_hemat);
findViewById.setVisibility(8);
PlaneBookingActivity planeBookingActivity2 = PlaneBookingActivity.this;
planeBookingActivity2.A = (LinearLayout) planeBookingActivity2.findViewById(R.id.ticket_detail_poin_container);
PlaneBookingActivity.this.A.setVisibility(8);
TextView textView = (TextView) PlaneBookingActivity.this.findViewById(R.id.label_poin);
final TextView textView2 = (TextView) PlaneBookingActivity.this.findViewById(R.id.label_poin_voucher3);
final ConstraintLayout findViewById2 = PlaneBookingActivity.this.findViewById(R.id.btn_voucher);
ConstraintLayout findViewById3 = PlaneBookingActivity.this.findViewById(R.id.btn_poin);
final ConstraintLayout findViewById4 = PlaneBookingActivity.this.findViewById(R.id.btn_list_voucher);
final String var = Var.toString(((BaseActivity) PlaneBookingActivity.this).appSession.retrieve(AppSession.PROPERTY_BALANCE), "0");
if (PlaneBookingActivity.this.c.equals("")) {
constraintLayout = findViewById;
PlaneBookingActivity.this.findViewById(R.id.btn_voucher).setVisibility(8);
} else {
findViewById2.setVisibility(0);
findViewById4.setVisibility(8);
TextView textView3 = (TextView) PlaneBookingActivity.this.findViewById(R.id.label_poin_voucher);
StringBuilder sb = new StringBuilder();
sb.append("Kamu akan dapat");
constraintLayout = findViewById;
sb.append(Locales.moneyNoFraction(String.valueOf(PlaneBookingActivity.this.e)).replace("Rp", ""));
sb.append(" SpeedCash Poin");
textView3.setText(sb.toString());
PlaneBookingActivity.this.g.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());
}
SwitchMaterial findViewById5 = PlaneBookingActivity.this.findViewById(R.id.switch_poin);
final ImageView imageView = (ImageView) PlaneBookingActivity.this.findViewById(R.id.poin_voucher_arrowRIght);
final ImageView imageView2 = (ImageView) PlaneBookingActivity.this.findViewById(R.id.persen_voucher);
final ImageView imageView3 = (ImageView) PlaneBookingActivity.this.findViewById(R.id.poin_voucher);
final ImageView imageView4 = (ImageView) PlaneBookingActivity.this.findViewById(R.id.poin_voucher_arrowRight2);
final TextView textView4 = (TextView) PlaneBookingActivity.this.findViewById(R.id.label_info_hemat);
final ConstraintLayout constraintLayout2 = constraintLayout;
findViewById5.setOnCheckedChangeListener(new CompoundButton.OnCheckedChangeListener() {
@Override
public final void onCheckedChanged(CompoundButton compoundButton, boolean z2) {
PlaneBookingActivity.d.this.f(findViewById2, findViewById4, textView2, imageView2, imageView3, imageView4, imageView, constraintLayout2, d, textView4, var, z, compoundButton, z2);
}
});
textView.setText("Gunakan" + Locales.moneyNoFraction(((BaseActivity) PlaneBookingActivity.this).appSession.retrieve(AppSession.PROPERTY_POIN)).replace("Rp", "") + " SpeedCash Poinmu");
if (d > 0.0d) {
findViewById3.setVisibility(0);
} else {
findViewById3.setVisibility(8);
}
PlaneBookingActivity.this.g.setOnClickListener(new a());
findViewById2.setOnClickListener(new View.OnClickListener() {
@Override
public final void onClick(View view) {
PlaneBookingActivity.d.this.g(view);
}
});
imageView.setOnClickListener(new View.OnClickListener() {
@Override
public final void onClick(View view) {
PlaneBookingActivity.d.this.h(view);
}
});
imageView2.setOnClickListener(new View.OnClickListener() {
@Override
public final void onClick(View view) {
PlaneBookingActivity.d.this.i(view);
}
});
imageView4.setOnClickListener(new View.OnClickListener() {
@Override
public final void onClick(View view) {
PlaneBookingActivity.d.this.j(view);
}
});
}
@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) {
PlaneBookingActivity planeBookingActivity = PlaneBookingActivity.this;
planeBookingActivity.c = "";
planeBookingActivity.e = 0.0d;
planeBookingActivity.d = "";
planeBookingActivity.f = 0.0d;
planeBookingActivity.payment();
}
@Override
public void afterProcess(BaseMessage baseMessage) {
APIMessageWrapper aPIMessageWrapper = new APIMessageWrapper(baseMessage);
if (aPIMessageWrapper.isOK()) {
PlaneBookingActivity.this.payment();
} else {
SearchView.OnQueryTextListener onQueryTextListener = PlaneBookingActivity.this;
Affinity.info(onQueryTextListener, 1, onQueryTextListener.getString(R.string.title_info), Var.toString(aPIMessageWrapper.getMap().get("keterangan"), ""), new BBCallback() {
@Override
public final void do_callback(int i, Object obj) {
PlaneBookingActivity.e.this.b(i, (Boolean) obj);
}
});
}
}
@Override
public void backgroundProcess(long j, long j2, boolean z) {
}
@Override
public void preProcess() {
}
}
public void N(int i, Boolean bool) {
if (bool.booleanValue()) {
Affinity.purge(this, PlaneActivity.class);
}
}
public void O(int i, String str) {
if (Var.toString(str, "null").equalsIgnoreCase("null") && str.isEmpty()) {
return;
}
this.dataSession.store(DataSession.PROPERTY_LIST_MASKAPAI_DETAILS, str);
}
public void P(int i, Boolean bool) {
bool.booleanValue();
K();
}
public void Q(PesawatMessage pesawatMessage, int i, Boolean bool) {
if (bool.booleanValue()) {
StringBuilder sb = new StringBuilder();
sb.append("onClick: ");
sb.append(pesawatMessage.isPending());
Bundle bundle = new Bundle();
bundle.putString("book_type", "Pesawat");
bundle.putString("discount_info", Var.toString(pesawatMessage.getDiscountInfo(), ""));
bundle.putString(MPMessage.IncludeMessage.REFF_ID, Var.toString(pesawatMessage.getReff_id(), ""));
bundle.putBoolean("is_pending", Var.toBoolean(pesawatMessage.isWaiting(), false));
bundle.putInt("cashback_poin", Var.toInt(Integer.valueOf(pesawatMessage.getCashback_poin()), 0));
bundle.putInt("used_poin", Var.toInt(Integer.valueOf(pesawatMessage.getUsed_poin()), 0));
bundle.putString("bookingDetailMessage", this.k.getValueFromAdditional_data(47));
bundle.putString("plane_detail_departure_airport", this.x.getText().toString());
bundle.putString("plane_detail_arrival_airport", this.y.getText().toString());
bundle.putString("plane_detail_departure_time", this.v.getText().toString());
bundle.putString("plane_detail_arrival_time", this.w.getText().toString());
bundle.putString("plane_detail_booking_countdown", this.z.getText().toString());
Affinity.purge(this, BookingSuccessActivity.class, bundle);
}
}
public void R(int i, final PesawatMessage pesawatMessage) {
if (pesawatMessage != null) {
Affinity.info(this, pesawatMessage.isWaiting().booleanValue() ? 2 : 1, getString(R.string.title_info), pesawatMessage.getMessageDescription(), new BBCallback() {
@Override
public final void do_callback(int i2, Object obj) {
PlaneBookingActivity.this.Q(pesawatMessage, i2, (Boolean) obj);
}
});
}
}
public final void J(String str, String str2, int i) {
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(i));
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 K() {
this.c = "";
this.e = 0.0d;
this.d = "";
this.f = 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", Double.valueOf(getNominal()));
aPIMessageWrapper.setItem("channel", this.o);
MessageComposer messageComposer = new MessageComposer(7, "ro/activity/voucher_applied");
messageComposer.setShowProgressRegular(true);
messageComposer.setIs_encrypted(false);
messageComposer.setMessageProcess(new d());
MessageSender messageSender = new MessageSender(this, messageComposer);
messageSender.setRequestMessage(aPIMessageWrapper);
messageSender.execute();
}
public final void L() {
ArrayList arrayList = Var.toArrayList(this.k.getIncludes().get("flight_route"));
HashMap hashMap = Var.toHashMap(this.k.getIncludes().get("flight_detail"));
Bundle bundle = new Bundle();
bundle.putSerializable("flight_detail", hashMap);
bundle.putSerializable("flight_route", arrayList);
BottomSheetDialogFragment newInstance = DetailRutePlaneFragment2.newInstance();
newInstance.setArguments(bundle);
newInstance.show(getSupportFragmentManager(), "detail_route");
}
public final void M(double d2) {
if (d2 <= 0.0d) {
findViewById(R.id.ticket_detail_discount_container).setVisibility(8);
return;
}
setNominalTotal((getNominal() + this.s) - getDiscount());
findViewById(R.id.ticket_detail_discount_container).setVisibility(0);
((TextView) findViewById(R.id.ticket_discount_amount)).setText(Locales.moneyNoFraction(Var.toString(Double.valueOf(d2), "0")));
this.n.setText(Locales.moneyNoFraction(Var.toString(Double.valueOf(getNominalTotal()), "0")));
}
public final void S() {
StringBuilder sb;
StringBuilder sb2;
String[] split = this.k.getValueFromAdditional_data(47).split(";");
String str = "-";
this.o = Var.getIgnoreBound(split, 6, "-");
String ignoreBound = Var.getIgnoreBound(split, 20, "-");
ArrayList arrayList = Var.toArrayList(this.k.getIncludes().get("flight_route"));
int i = 0;
HashMap hashMap = (HashMap) arrayList.get(0);
this.u = new ProdukListEntity();
HashMap<String, ProdukListEntity> airlinesMapFromFirebase = TicketingHelper.getAirlinesMapFromFirebase(this.dataSession);
Objects.requireNonNull(airlinesMapFromFirebase);
for (String str2 : airlinesMapFromFirebase.keySet()) {
if (Var.toString(hashMap.get("airplane_code"), "").equalsIgnoreCase(str2)) {
this.u = airlinesMapFromFirebase.get(str2);
}
}
ImageView imageView = (ImageView) findViewById(R.id.plane_detail_logo_iv);
RequestManager with = Glide.with(this);
ProdukListEntity produkListEntity = this.u;
Objects.requireNonNull(produkListEntity);
with.load(produkListEntity.getDrawable_url()).apply(new RequestOptions().diskCacheStrategy(DiskCacheStrategy.ALL).placeholder(R.drawable.img_powered_by_sc).error(R.drawable.img_powered_by_sc).override(imageView.getWidth(), imageView.getHeight())).into(imageView);
String str3 = " ";
((TextView) findViewById(R.id.plane_detail_ticket_date)).setText(Var.toString(this.u.getName(), "").concat(" ").concat(ignoreBound));
((TextView) findViewById(R.id.plane_detail_booking_code)).setText(Var.getIgnoreBound(split, 2, "-"));
int i2 = Var.toInt(this.k.getValueFromAdditional_data(71), 0);
this.v = (TextView) findViewById(R.id.plane_detail_departure_time);
this.w = (TextView) findViewById(R.id.plane_detail_arrival_time);
this.x = (TextView) findViewById(R.id.plane_detail_departure_airport);
this.y = (TextView) findViewById(R.id.plane_detail_arrival_airport);
if (i2 > 1) {
sb = new StringBuilder(Var.getIgnoreBound(split, 18, "00:00").concat(" ").concat(Var.getIgnoreBound(split, 21, "-")));
sb2 = new StringBuilder(Var.getIgnoreBound(split, 18, "00:00").concat(" ").concat(Var.getIgnoreBound(split, 46, "-")));
} else if (i2 > 0) {
sb = new StringBuilder(Var.getIgnoreBound(split, 18, "00:00").concat(" ").concat(Var.getIgnoreBound(split, 21, "-")));
sb2 = new StringBuilder(Var.getIgnoreBound(split, 18, "00:00").concat(" ").concat(Var.getIgnoreBound(split, 37, "-")));
} else {
sb = new StringBuilder(Var.getIgnoreBound(split, 18, "00:00").concat(" ").concat(Var.getIgnoreBound(split, 21, "-")));
sb2 = new StringBuilder(Var.getIgnoreBound(split, 18, "00:00").concat(" ").concat(Var.getIgnoreBound(split, 22, "-")));
}
String convert = DateTime.convert(Var.toString(sb, ""), "yyyy-MM-dd HH:mm", "dd MMM yyyy HH:mm");
String convert2 = DateTime.convert(Var.toString(sb2, ""), "yyyy-MM-dd HH:mm", "dd MMM yyyy HH:mm");
this.v.setText(convert);
this.w.setText(convert2);
String ignoreBound2 = Var.getIgnoreBound(split, 10, "-");
String ignoreBound3 = Var.getIgnoreBound(split, 11, "-");
String var = Var.toString(this.l.get(ignoreBound2), ignoreBound2);
String var2 = Var.toString(this.l.get(ignoreBound3), ignoreBound3);
this.x.setText(var.replaceAll(",+.*", ""));
this.y.setText(var2.replaceAll(",+.*", ""));
if (arrayList.size() == 1) {
this.w.setText(DateTime.convert(Var.toString(hashMap.get("date_arrive"), ""), "yyyyMMdd", DateTime.FORMAT_DATE_TIME_DMY_SHORT_MONTH_DASH) + " " + Var.toString(hashMap.get("time_arrive"), ""));
} else if (arrayList.size() == 2) {
HashMap hashMap2 = (HashMap) arrayList.get(1);
this.w.setText(DateTime.convert(Var.toString(hashMap2.get("date_arrive"), ""), "yyyyMMdd", DateTime.FORMAT_DATE_TIME_DMY_SHORT_MONTH_DASH) + " " + Var.toString(hashMap2.get("time_arrive"), ""));
}
String convert3 = DateTime.convert(Var.getIgnoreBound(split, 16, ""), DateTime.FORMAT_DATE_DMYHM_SHORT_MONTH_SLASH, DateTime.FORMAT_DATE_TIME_DMYHM_SHORT_MONTH_DASH);
TextView textView = (TextView) findViewById(R.id.plane_detail_booking_countdown);
this.z = textView;
textView.setText(convert3);
this.m = new ArrayList<>();
int i3 = Var.toInt(this.k.getAdditional_datas().get(16), 0);
int i4 = Var.toInt(this.k.getAdditional_datas().get(17), 0);
int i5 = Var.toInt(this.k.getAdditional_datas().get(18), 0);
String[] split2 = Var.getIgnoreBound(split, 30, "").split("#");
HashMap hashMap3 = new HashMap();
hashMap3.put("MRS", "Nyonya");
hashMap3.put("MR", "Tuan");
hashMap3.put("MS", "Nona");
hashMap3.put("MSTR", "Tuan");
hashMap3.put("MISS", "Nona");
HashMap hashMap4 = new HashMap();
hashMap4.put("ADT", "Dewasa");
hashMap4.put("CHD", "Anak");
hashMap4.put("INF", "Bayi");
int length = split2.length;
int i6 = 0;
int i7 = 1;
int i8 = 1;
int i9 = 1;
while (i6 < length) {
String[] split3 = split2[i6].split(":");
String var3 = Var.toString(hashMap4.get(Var.getIgnoreBound(split3, i, str)), "Dewasa");
int i10 = length;
String var4 = Var.toString(hashMap3.get(Var.getIgnoreBound(split3, 1, str)), "Tuan");
StringBuilder sb3 = new StringBuilder();
String[] strArr = split2;
HashMap hashMap5 = hashMap3;
sb3.append(Var.getIgnoreBound(split3, 2, str));
sb3.append(str3);
sb3.append(Var.getIgnoreBound(split3, 3, str));
String sb4 = sb3.toString();
String ignoreBound4 = Var.getIgnoreBound(split3, 5, str);
String ignoreBound5 = Var.getIgnoreBound(split3, 6, str);
HashMap<String, Object> hashMap6 = new HashMap<>();
String str4 = str;
String str5 = str3;
if (var3.equalsIgnoreCase("bayi")) {
hashMap6.put("pax_number", Integer.valueOf(i7));
i7++;
} else if (var3.equalsIgnoreCase("anak")) {
hashMap6.put("pax_number", Integer.valueOf(i9));
i9++;
} else {
hashMap6.put("pax_number", Integer.valueOf(i8));
i8++;
}
hashMap6.put("pax_type", var3);
hashMap6.put("pax_id", ignoreBound4);
hashMap6.put("pax_name", sb4);
hashMap6.put("pax_phone", ignoreBound5);
hashMap6.put("pax_title", var4);
hashMap6.put("is_airplane", Boolean.TRUE);
this.m.add(hashMap6);
i6++;
length = i10;
split2 = strArr;
hashMap3 = hashMap5;
str = str4;
str3 = str5;
i = 0;
}
((TextView) findViewById(R.id.plane_detail_passenger_summary)).setText((i5 <= 0 || i4 <= 0) ? (i5 <= 0 || i4 != 0) ? (i5 != 0 || i4 <= 0) ? getString(R.string.ticket_train_passenger, Var.toString(Integer.valueOf(i3), "1")) : getString(R.string.ticket_train_passenger_include_child, Var.toString(Integer.valueOf(i3), "1"), Var.toString(Integer.valueOf(i4), "0")) : getString(R.string.ticket_train_passenger_include_infant, Var.toString(Integer.valueOf(i3), "1"), Var.toString(Integer.valueOf(i5), "0")) : getString(R.string.ticket_plane_passenger_include_child_baby, Var.toString(Integer.valueOf(i3), "1"), Var.toString(Integer.valueOf(i5), "0"), Var.toString(Integer.valueOf(i4), "0")));
findViewById(R.id.plane_detail_passenger_button).setOnClickListener(new b());
findViewById(R.id.plane_detail_flight).setOnClickListener(new c());
setDiscount(Var.toDouble(this.j.getDiscount(), 0.0d));
setNominal(Var.toDouble(Var.getIgnoreBound(split, 25, "0"), 0.0d));
this.j.setNominal(String.valueOf((int) getNominal()));
this.s = Var.toDouble(this.k.getIncludes().get(MPMessage.IncludeMessage.ADMIN), 0.0d);
String var5 = Var.toString(this.appSession.retrieve(AppSession.PROPERTY_BALANCE), "0");
setNominalTotal((getNominal() + this.s) - getDiscount());
this.n.setText(Locales.moneyNoFraction(Var.toString(Double.valueOf(getNominalTotal()), "0")));
M(getDiscount());
((TextView) findViewById(R.id.ticket_detail_total_price)).setText(Locales.moneyNoFraction(Var.toString(Double.valueOf(getNominal()), "0")));
((TextView) findViewById(R.id.ticket_detail_admin)).setText(Locales.moneyNoFraction(Var.toString(Integer.valueOf(Var.toInt(Integer.valueOf((int) this.s), 0)), "0")));
if (Var.toInt(Integer.valueOf((int) this.s), 0) > 0) {
findViewById(R.id.ticket_detail_admin_container).setVisibility(0);
} else {
findViewById(R.id.ticket_detail_admin_container).setVisibility(8);
}
((TextView) findViewById(R.id.ticket_detail_balance_tv)).setText(Locales.moneyNoFraction(var5));
if (Var.toDouble(var5, 0.0d) < getNominalTotal()) {
findViewById(R.id.btn_payment_container).setVisibility(8);
findViewById(R.id.btn_hold_booking_container).setVisibility(8);
findViewById(R.id.btn_topup_container).setVisibility(0);
findViewById(R.id.ticket_balance_insufficient).setVisibility(0);
findViewById(R.id.ticket_detail_balance_container).setBackgroundResource(R.drawable.panel_light_red_rounded);
((TextView) findViewById(R.id.ticket_detail_balance_label)).setTextColor(ContextCompat.getColor(this, R.color.colorLevelPremium));
((TextView) findViewById(R.id.ticket_detail_balance_tv)).setTextColor(ContextCompat.getColor(this, R.color.colorLevelPremium));
((TextView) findViewById(R.id.ticket_balance_insufficient)).setTextColor(ContextCompat.getColor(this, R.color.colorLevelPremium));
findViewById(R.id.btn_topup).setOnClickListener(this);
} else {
findViewById(R.id.btn_payment_container).setVisibility(0);
findViewById(R.id.btn_hold_booking_container).setVisibility(0);
findViewById(R.id.btn_topup_container).setVisibility(8);
findViewById(R.id.ticket_balance_insufficient).setVisibility(8);
((TextView) findViewById(R.id.ticket_detail_balance_label)).setTextColor(ContextCompat.getColor(this, R.color.colorInvoice));
((TextView) findViewById(R.id.ticket_detail_balance_tv)).setTextColor(ContextCompat.getColor(this, R.color.colorInvoice));
}
findViewById(R.id.ticket_detail_voucher_et).setOnClickListener(this);
findViewById(R.id.ticket_detail_voucher_et).setFocusableInTouchMode(false);
Affinity.refreshBalance(this, new BBCallback() {
@Override
public final void do_callback(int i11, Object obj) {
PlaneBookingActivity.this.P(i11, (Boolean) obj);
}
});
}
public final void T() {
PesawatMessage pesawatMessage = new PesawatMessage(this.appSession.retrieve(AppSession.PROPERTY_MERCHANT_ID), this.appSession.retrieve(AppSession.PROPERTY_MERCHANT_PIN), this.appSession.retrieve(AppSession.PROPERTY_AUTH_TOKEN));
pesawatMessage.setProductCode(this.j.getMaskapai());
pesawatMessage.setStep(2);
pesawatMessage.setAdditional_dataValue(19, BaseMessage.RESULT_NOK);
pesawatMessage.setIncludesValue(MPMessage.IncludeMessage.REFF_ID, this.j.getReffid());
pesawatMessage.setIncludesValue(MPMessage.IncludeMessage.CUSTOMER_ID_1, this.j.getBookcode());
Device.getAddressLocation(this);
pesawatMessage.setAdditional_dataValue(109, Device.getLogDevice(this));
MessageComposer messageComposer = new MessageComposer(1, "");
messageComposer.setRequest_method(MessageComposer.POST);
messageComposer.setData_type(1);
messageComposer.setIs_credential(true);
messageComposer.setIs_encrypted(true);
messageComposer.setShowProgressRegular(true);
messageComposer.setMessageProcess(new a());
MessageSender messageSender = new MessageSender(this, messageComposer);
messageSender.setRequestMessage(pesawatMessage);
messageSender.execute();
}
public double getDiscount() {
return this.r;
}
@Override
public int getLayoutResource() {
return R.layout.activity_plane_booking;
}
public double getNominal() {
return this.p;
}
public double getNominalTotal() {
return this.q;
}
@Override
public String getWikiNameSpace() {
return null;
}
@Override
public boolean isEligibleForFavorit() {
return false;
}
@Override
public void onActivityResult(int i, int i2, Intent intent) {
StringBuilder sb = new StringBuilder();
sb.append("onActivityResult: ");
sb.append(i2);
if (i2 != 62591) {
super.onActivityResult(i, i2, intent);
return;
}
this.c = intent.getStringExtra("kode_voucher");
this.e = intent.getDoubleExtra("nominal_voucher", 0.0d);
String stringExtra = intent.getStringExtra("satuan_voucher");
setDiscount(getDiscount() + this.e);
M(getDiscount());
((TextView) findViewById(R.id.ticket_detail_voucher_et)).setText(this.c);
String str = this.c;
if (str != null) {
this.j.setVoucher_code(str);
}
if (stringExtra == null || !stringExtra.equals("poin")) {
return;
}
((TextView) findViewById(R.id.label_poin)).setText("Gunakan" + Locales.moneyNoFraction(String.valueOf(this.e)).replace("Rp", "") + " SpeedCash Poinmu");
this.g.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());
}
@Override
public void onBackPressed() {
if (!this.j.ispurge()) {
super.onBackPressed();
return;
}
Affinity.confirm(this, "Konfirmasi Pindah Halaman", "Apakah Anda yakin akan kembali ke Menu Pesawat?\nData booking masih dapat dilihat di Menu " + getString(R.string.title_activity_list_booking_plane), new BBCallback() {
@Override
public final void do_callback(int i, Object obj) {
PlaneBookingActivity.this.N(i, (Boolean) obj);
}
});
}
@Override
public void onClick(View view) {
if (view.getId() == 2131362377) {
if (this.c.equals("")) {
payment();
return;
} else {
J(this.c, this.o, (int) getNominal());
return;
}
}
if (view.getId() == 2131362343) {
onBackPressed();
return;
}
if (view.getId() == 2131362442) {
Affinity.purge(this, Deposit2Activity.class);
return;
}
if (view.getId() != 2131366182) {
super.onClick(view);
return;
}
Bundle bundle = new Bundle();
bundle.putString("idProduk", this.o);
bundle.putString("group", ConfigSession.KEY_PREFERENCE_PESAWAT);
bundle.putDouble("harga", getNominal());
bundle.putInt("requestCode", 62591);
Affinity.listen(this, OptionVoucherListActivity.class, 0, bundle);
}
@Override
public void onCreate(Bundle bundle) {
super.onCreate(bundle);
TextView textView = (TextView) findViewById(R.id.ticketing_second_step_tv);
ImageView imageView = (ImageView) findViewById(R.id.ticketing_second_step_iv);
textView.setTextColor(getResources().getColor(R.color.colorInvoice));
imageView.setImageDrawable(ContextCompat.getDrawable(this, R.drawable.ic_step_number_2_cyan));
this.n = (TextView) findViewById(R.id.ticket_detail_total_pay);
Bundle extras = getIntent().getExtras();
if (extras != null) {
this.j = new TicketDataHolder(extras);
this.l = MessageParser.parsePesawatRoute(Var.toString(this.dataSession.retrieve(DataSession.PROPERTY_LIST_ROUTE), ""));
if (this.dataSession.retrieve(DataSession.PROPERTY_LIST_MASKAPAI_DETAILS).isEmpty()) {
ApiConfig.fetchConfig(this, R.xml.bb_maskapai_map, "bb_maskapai_map", new BBCallback() {
@Override
public final void do_callback(int i, Object obj) {
PlaneBookingActivity.this.O(i, (String) obj);
}
});
}
if (this.j.isHaspaid()) {
findViewById(R.id.btn_payment_container).setVisibility(8);
findViewById(R.id.btn_hold_booking_container).setVisibility(8);
} else {
findViewById(R.id.btn_payment_container).setVisibility(0);
findViewById(R.id.btn_hold_booking_container).setVisibility(0);
findViewById(R.id.btn_pay).setOnClickListener(this);
findViewById(R.id.btn_hold_booking).setOnClickListener(this);
}
ArrayList arrayList = new ArrayList(this.configSession.retrieveSet(ConfigSession.PROPERTY_WHITE_LIST_ID));
this.t = new ArrayList<>();
for (int i = 0; i < arrayList.size(); i++) {
Object obj = ((HashMap) arrayList.get(i)).get(DataMessage.ID_OUTLET);
Objects.requireNonNull(obj);
if (!obj.toString().equals("")) {
ArrayList<String> arrayList2 = this.t;
Object obj2 = ((HashMap) arrayList.get(i)).get(DataMessage.ID_OUTLET);
Objects.requireNonNull(obj2);
arrayList2.add(obj2.toString());
}
}
ArrayList<String> arrayList3 = this.t;
if (arrayList3 != null && arrayList3.size() > 0) {
for (int i2 = 0; i2 < this.t.size(); i2++) {
if (this.t.get(i2).equals(this.appSession.retrieve(AppSession.PROPERTY_MERCHANT_ID))) {
this.i = true;
}
}
}
this.g = findViewById(R.id.voucher_cheers);
findViewById(R.id.btn_voucher).setVisibility(8);
findViewById(R.id.btn_poin).setVisibility(8);
findViewById(R.id.view_info_hemat).setVisibility(8);
T();
}
}
public void payment() {
TicketingHelper.prePesawatDoPay(this, this.j, new BBCallback() {
@Override
public final void do_callback(int i, Object obj) {
PlaneBookingActivity.this.R(i, (PesawatMessage) obj);
}
});
}
public void setDiscount(double d2) {
this.r = d2;
}
public void setNominal(double d2) {
this.p = d2;
}
public void setNominalTotal(double d2) {
this.q = d2;
}
}