导航菜单

页面标题

页面副标题

SpeedCash v6.5.1482 - PlaneActivity.java 源代码

正在查看: SpeedCash v6.5.1482 应用的 PlaneActivity.java JAVA 源代码文件

本页面展示 JAVA 反编译生成的源代码文件,支持语法高亮显示。 仅供安全研究与技术分析使用,严禁用于任何非法用途。请遵守相关法律法规。


package com.bm.sc.bebasbayar.ui.activity.ticket;

import android.app.Activity;
import android.content.Context;
import android.content.Intent;
import android.os.Bundle;
import android.os.Handler;
import android.text.Editable;
import android.view.View;
import android.widget.ImageView;
import android.widget.TextView;
import com.bm.sc.auth.ui.BottomNavigationActivity;
import com.bm.sc.bebasbayar.R;
import com.bm.sc.bebasbayar.adapter.BaseAdapter;
import com.bm.sc.bebasbayar.adapter.entity.KeretaTicketEntity;
import com.bm.sc.bebasbayar.adapter.entity.ProdukListEntity;
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.helper.Affinity;
import com.bm.sc.bebasbayar.helper.TicketingHelper;
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.api.APIMessageWrapper;
import com.bm.sc.bebasbayar.message.mp.PesawatMessage;
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.OtherHomeMenuActivity;
import com.bm.sc.bebasbayar.ui.activity.info.OpenWebViewActivity;
import com.bm.sc.bebasbayar.ui.activity.ticket.PlaneActivity;
import com.bm.sc.bebasbayar.ui.fragment.dialog.OptionListFragment;
import com.bm.sc.bebasbayar.ui.fragment.kereta.KeretaCancelFragment;
import com.bm.sc.bebasbayar.ui.fragment.ticket.AirportStationFragment;
import com.bm.sc.bebasbayar.ui.fragment.ticket.VerticalCalendarFragment;
import com.bm.sc.bebasbayar.ui.fragment.ticket.plane.PassengerCountPlaneFragment;
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.Mapper;
import com.bumptech.glide.Glide;
import com.bumptech.glide.load.engine.DiskCacheStrategy;
import com.bumptech.glide.request.RequestOptions;
import com.google.android.material.textfield.TextInputEditText;
import eu.davidea.flexibleadapter.items.IFlexible;
import java.util.ArrayList;
import java.util.Calendar;
import java.util.HashMap;
import java.util.Iterator;
import java.util.LinkedHashMap;
import java.util.Objects;
import org.greenrobot.eventbus.EventBus;
import org.greenrobot.eventbus.Subscribe;
import org.greenrobot.eventbus.ThreadMode;

public class PlaneActivity extends BaseActivity implements AdapterInvoker<Object>, OptionListFragment.OnOptionChoosenListener {
    public static final int BOOKING_DETAIL_REQUEST_CODE = 49023;
    public static final int BOOKING_REFUND_REQUEST_CODE = 49011;
    public static final String SEPARATOR = "::";
    public TextInputEditText d;
    public TextInputEditText e;
    public TextInputEditText f;
    public TextInputEditText g;
    public View h;
    public TextView i;
    public String n;
    public String o;
    public String p;
    public String q;
    public Calendar r;
    public HashMap<String, Object> s;
    public ArrayList<IFlexible> c = new ArrayList<>();
    public int j = 0;
    public int k = 1;
    public int l = 0;
    public int m = 0;

    public class a extends OnSingleClickListener {
        public a() {
        }

        @Override
        public void onSingleClick(View view) {
            ?? newInstance = AirportStationFragment.newInstance();
            newInstance.setArguments(newInstance.setupDefaultBundle("Pilih kota/bandara keberangkatan", "airport", Boolean.TRUE, 54345));
            newInstance.show(PlaneActivity.this.getSupportFragmentManager().beginTransaction().remove(newInstance), "route_option");
        }
    }

    public class b extends OnSingleClickListener {
        public b() {
        }

        @Override
        public void onSingleClick(View view) {
            ?? newInstance = AirportStationFragment.newInstance();
            newInstance.setArguments(newInstance.setupDefaultBundle("Pilih kota/bandara tujuan", "airport", Boolean.FALSE, 43234));
            newInstance.show(PlaneActivity.this.getSupportFragmentManager().beginTransaction().remove(newInstance), "route_option");
        }
    }

    public class c extends OnSingleClickListener {
        public c() {
        }

        @Override
        public void onSingleClick(View view) {
            PlaneActivity.this.P();
        }
    }

    public class d extends OnSingleClickListener {
        public d() {
        }

        public void d(Calendar calendar) {
            PlaneActivity.this.J(calendar);
        }

        public void e(VerticalCalendarFragment verticalCalendarFragment) {
            verticalCalendarFragment.show(PlaneActivity.this.getSupportFragmentManager().beginTransaction().remove(verticalCalendarFragment), "date_option");
        }

        public void f(final VerticalCalendarFragment verticalCalendarFragment) {
            PlaneActivity.this.runOnUiThread(new Runnable() {
                @Override
                public final void run() {
                    PlaneActivity.d.this.e(verticalCalendarFragment);
                }
            });
        }

        @Override
        public void onSingleClick(View view) {
            final VerticalCalendarFragment newInstance;
            if (PlaneActivity.this.r != null) {
                Calendar calendar = PlaneActivity.this.r;
                newInstance = VerticalCalendarFragment.newInstance();
                newInstance.setCalendar(calendar);
            } else {
                PlaneActivity.this.r = Calendar.getInstance();
                newInstance = VerticalCalendarFragment.newInstance();
            }
            newInstance.setHeaderLabel("Pilih Tanggal Keberangkatan");
            newInstance.setOnDialogClosingListener(new VerticalCalendarFragment.OnDateSelectedListener() {
                @Override
                public final void onDialogClosing(Calendar calendar2) {
                    PlaneActivity.d.this.d(calendar2);
                }
            });
            new Handler().postDelayed(new Runnable() {
                @Override
                public final void run() {
                    PlaneActivity.d.this.f(newInstance);
                }
            }, 100L);
        }
    }

    public class e implements MessageProcess {
        public e() {
        }

        @Override
        public void afterProcess(BaseMessage baseMessage) {
            PesawatMessage pesawatMessage = new PesawatMessage(baseMessage);
            if (pesawatMessage.isOK()) {
                ((BaseActivity) PlaneActivity.this).dataSession.store(DataSession.PROPERTY_LIST_MASKAPAI, pesawatMessage.getValueFromAdditional_data(22));
                ((BaseActivity) PlaneActivity.this).dataSession.store(DataSession.PROPERTY_LIST_ROUTE, pesawatMessage.getValueFromAdditional_data(47));
                ((BaseActivity) PlaneActivity.this).dataSession.store(DataSession.PROPERTY_LIST_MASKAPAI_CONFIG, pesawatMessage.getValueFromAdditional_data(25));
            }
        }

        @Override
        public void backgroundProcess(long j, long j2, boolean z) {
        }

        @Override
        public void preProcess() {
            ((BaseActivity) PlaneActivity.this).dataSession.remove(DataSession.PROPERTY_LIST_MASKAPAI);
            ((BaseActivity) PlaneActivity.this).dataSession.remove(DataSession.PROPERTY_LIST_ROUTE);
            ((BaseActivity) PlaneActivity.this).dataSession.remove(DataSession.PROPERTY_LIST_MASKAPAI_CONFIG);
        }
    }

    public class f implements MessageProcess {
        public final BBCallback a;

        public f(BBCallback bBCallback) {
            this.a = bBCallback;
        }

        @Override
        public void afterProcess(BaseMessage baseMessage) {
            APIMessageWrapper aPIMessageWrapper = new APIMessageWrapper(baseMessage);
            if (aPIMessageWrapper.isOK()) {
                HashMap hashMap = (HashMap) aPIMessageWrapper.getData().get(0).get("list_rute");
                Objects.requireNonNull(hashMap);
                HashMap hashMap2 = (HashMap) hashMap.get("Indonesia");
                ((BaseActivity) PlaneActivity.this).dataSession.store(DataSession.PROPERTY_LIST_ROUTE_FAVORIT, Mapper.collectionToJSON((ArrayList) hashMap.get("Destinasi Populer")).toString());
                DataSession dataSession = ((BaseActivity) PlaneActivity.this).dataSession;
                Objects.requireNonNull(hashMap2);
                dataSession.store(DataSession.PROPERTY_LIST_ROUTE_DOMESTIK, Mapper.mapToJSON(hashMap2).toString());
                this.a.do_callback(1, null);
            }
        }

        @Override
        public void backgroundProcess(long j, long j2, boolean z) {
        }

        @Override
        public void preProcess() {
            ((BaseActivity) PlaneActivity.this).dataSession.remove(DataSession.PROPERTY_LIST_ROUTE_FAVORIT);
        }
    }

    public void Q(View view, TextView textView, ImageView imageView, int i, String str) {
        if (Var.toString(str, "null").equalsIgnoreCase("null") && str.isEmpty()) {
            M();
            return;
        }
        LinkedHashMap<String, Object> jsonToMap = Mapper.jsonToMap(str);
        this.o = Var.toString(jsonToMap.get("url_webview"), "");
        this.p = Var.toString(jsonToMap.get("title_webview"), "");
        this.q = Var.toString(jsonToMap.get("url_img"), "");
        if (this.o.isEmpty() || this.p.isEmpty() || this.q.isEmpty()) {
            M();
            return;
        }
        view.setVisibility(0);
        textView.setText(this.p);
        Glide.with(this).load(this.q).apply(new RequestOptions().diskCacheStrategy(DiskCacheStrategy.NONE).skipMemoryCache(true).placeholder(2131100792).error(R.color.grey___)).into(imageView);
    }

    public void R(int i, int i2, int i3) {
        this.k = i;
        this.l = i2;
        this.m = i3;
        this.s.clear();
        this.s.put(KeretaTicketEntity.ADULT, Integer.valueOf(this.k));
        this.s.put("child", Integer.valueOf(this.l));
        this.s.put("baby", Integer.valueOf(this.m));
        String str = this.k + " Dewasa; " + this.l + " Anak; " + this.m + " Bayi";
        this.n = str;
        this.f.setText(str);
    }

    public void S(PassengerCountPlaneFragment passengerCountPlaneFragment) {
        passengerCountPlaneFragment.show(getSupportFragmentManager().beginTransaction().remove(passengerCountPlaneFragment), FirebaseProcessor.KEY_TITLE);
    }

    public void T(final PassengerCountPlaneFragment passengerCountPlaneFragment) {
        runOnUiThread(new Runnable() {
            @Override
            public final void run() {
                PlaneActivity.this.S(passengerCountPlaneFragment);
            }
        });
    }

    public void U(int i, Object obj) {
        O();
    }

    public void V(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 W(int i, ArrayList arrayList) {
        if (i == TicketingHelper.CALLBACK_SUCCESS) {
            int size = arrayList.size();
            this.j = size;
            this.i.setText(Var.toString(Integer.valueOf(size), "0"));
            this.appSession.store(AppSession.LIST_BOOKING_PLANE, Mapper.listToJsonString(arrayList));
        }
    }

    public final void J(Calendar calendar) {
        this.g.setText(DateTime.format(calendar.getTime(), DateTime.FORMAT_DATE_EDMY_LONG_DAY_SHORT_MONTH));
        this.r = calendar;
        WidgetHelper.setProductIdTag(this.h, DateTime.format(calendar.getTime(), "yyyy-MM-dd"), "");
    }

    public final void K() {
        final TextView textView = (TextView) findViewById(R.id.tv_title_web);
        final View findViewById = findViewById(R.id.cv_web_info);
        final ImageView imageView = (ImageView) findViewById(R.id.ic_img_web);
        findViewById.setOnClickListener(this);
        imageView.setOnClickListener(this);
        M();
        ApiConfig.fetchConfig(this, R.xml.sc_info_ticket_plane, "sc_info_ticket_plane", new BBCallback() {
            @Override
            public final void do_callback(int i, Object obj) {
                PlaneActivity.this.Q(findViewById, textView, imageView, i, (String) obj);
            }
        });
    }

    public final void L(BBCallback bBCallback) {
        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(PesawatMessage.AIRPORT);
        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.setShowProgressRegular(false);
        messageComposer.setIs_credential(true);
        messageComposer.setIs_encrypted(true);
        messageComposer.setMessageProcess(new e());
        MessageSender messageSender = new MessageSender(this, messageComposer);
        messageSender.setRequestMessage(pesawatMessage);
        messageSender.execute();
        MessageComposer messageComposer2 = new MessageComposer(2, "ticketing/get_rute_airplane");
        messageComposer2.setIs_cacheable(true);
        messageComposer2.setShowProgressRegular(false);
        messageComposer2.setIs_encrypted(false);
        messageComposer2.setMessageProcess(new f(bBCallback));
        MessageSender messageSender2 = new MessageSender(this, messageComposer2);
        messageSender2.setRequestMessage(new APIMessageWrapper());
        messageSender2.execute();
    }

    public final void M() {
        findViewById(R.id.cv_web_info).setVisibility(8);
    }

    public final void N() {
        String[] split = this.configSession.retrieveMap(ConfigSession.PROPERTY_PREFERENCE, ConfigSession.KEY_PREFERENCE_PESAWAT).split("::");
        String ignoreBound = Var.getIgnoreBound(split, 0, "");
        String ignoreBound2 = Var.getIgnoreBound(split, 1, "");
        Iterator<Object> it = Mapper.jsonToList(this.dataSession.retrieve(DataSession.PROPERTY_LIST_ROUTE_FAVORIT)).iterator();
        while (it.hasNext()) {
            HashMap hashMap = (HashMap) it.next();
            String var = Var.toString(hashMap.get("airport_id"), "");
            String var2 = Var.toString(hashMap.get("nama_kota"), "");
            String var3 = Var.toString(hashMap.get("nama_bandara"), "");
            if (!ignoreBound.isEmpty() && var.equalsIgnoreCase(ignoreBound)) {
                this.c.add(new AirportStationFragment.AirportEntity(var, var3, var2, "Destinasi Populer", 0, true));
            } else if (!ignoreBound2.isEmpty() && var.equalsIgnoreCase(ignoreBound2)) {
                this.c.add(new AirportStationFragment.AirportEntity(var, var3, var2, "Destinasi Populer", 0, true));
            }
            if (this.c.isEmpty() && (var2.contains("Surabaya") || var2.contains("Jakarta"))) {
                this.c.add(new AirportStationFragment.AirportEntity(var, var3, var2, "Destinasi Populer", 0, true));
            }
        }
    }

    public final void O() {
        N();
        TextView textView = (TextView) findViewById(R.id.notification_count);
        this.i = textView;
        textView.setText(Var.toString(Integer.valueOf(this.j), "0"));
        this.i.setOnClickListener(this);
        findViewById(R.id.iv_my_booking).setOnClickListener(this);
        TextInputEditText findViewById = findViewById(R.id.input_origin);
        this.d = findViewById;
        findViewById.setOnClickListener(new a());
        if (this.c.size() > 0) {
            AirportStationFragment.AirportEntity airportEntity = this.c.get(0);
            WidgetHelper.setProductIdTag(this.d, airportEntity.getAirport_id(), airportEntity.getAirport_city() + " (" + airportEntity.getAirport_id() + ")");
        }
        TextInputEditText findViewById2 = findViewById(R.id.input_destination);
        this.e = findViewById2;
        findViewById2.setOnClickListener(new b());
        if (this.c.size() > 0 && this.c.size() == 2) {
            AirportStationFragment.AirportEntity airportEntity2 = this.c.get(1);
            WidgetHelper.setProductIdTag(this.e, airportEntity2.getAirport_id(), airportEntity2.getAirport_city() + " (" + airportEntity2.getAirport_id() + ")");
        }
        K();
        HashMap<String, Object> hashMap = new HashMap<>();
        this.s = hashMap;
        hashMap.put(KeretaTicketEntity.ADULT, Integer.valueOf(this.k));
        this.s.put("child", Integer.valueOf(this.l));
        this.s.put("baby", Integer.valueOf(this.m));
        TextInputEditText findViewById3 = findViewById(R.id.input_passanger_pesawat);
        this.f = findViewById3;
        findViewById3.setOnClickListener(new c());
        String str = this.k + " Dewasa; " + this.l + " Anak; " + this.m + " Bayi";
        this.n = str;
        this.f.setText(str);
        View findViewById4 = findViewById(R.id.input_date);
        this.h = findViewById4;
        findViewById4.setOnClickListener(this);
        TextInputEditText findViewById5 = findViewById(R.id.input_tanggal_pesawat);
        this.g = findViewById5;
        findViewById5.setOnClickListener(new d());
        findViewById(R.id.btn_search).setOnClickListener(this);
        findViewById(R.id.plane_route_swap).setOnClickListener(this);
        J(Calendar.getInstance());
        Bundle extras = getIntent().getExtras();
        if (extras != null) {
            adapterResult(null, extras.getString(KeretaCancelFragment.BOOKCODE_TAG, "") + "::" + extras.getString("plane:tag", ""), 0);
        }
        findViewById(R.id.btn_info).setOnClickListener(this);
        findViewById(R.id.iv_ticket).setOnClickListener(this);
        findViewById(R.id.label_ticket).setOnClickListener(this);
        findViewById(R.id.iv_refund).setOnClickListener(this);
        findViewById(R.id.label_refund).setOnClickListener(this);
        Y();
    }

    public final void P() {
        final PassengerCountPlaneFragment newInstance = PassengerCountPlaneFragment.newInstance();
        newInstance.setPaxData(this.s);
        newInstance.setOnSaveListener(new PassengerCountPlaneFragment.OnSaveListener() {
            @Override
            public final void onSaveValue(int i, int i2, int i3) {
                PlaneActivity.this.R(i, i2, i3);
            }
        });
        new Handler().postDelayed(new Runnable() {
            @Override
            public final void run() {
                PlaneActivity.this.T(newInstance);
            }
        }, 300L);
    }

    public final void X(String str, String str2) {
        Bundle bundle = new Bundle();
        bundle.putString("url", str);
        bundle.putString(FirebaseProcessor.KEY_TITLE, str2);
        Intent intent = new Intent((Context) this, (Class<?>) OpenWebViewActivity.class);
        intent.putExtras(bundle);
        startActivity(intent);
    }

    public final void Y() {
        TicketingHelper.getListBookingPlane(this, DateTime.getCalculatedDate("yyyy-MM-dd", -30), DateTime.format(DateTime.parse(Calendar.getInstance().toString(), "dd-MM-yyyy"), "yyyy-MM-dd"), false, new BBCallback() {
            @Override
            public final void do_callback(int i, Object obj) {
                PlaneActivity.this.W(i, (ArrayList) obj);
            }
        });
    }

    @Override
    public void adapterResult(BaseAdapter baseAdapter, Object obj, int i) {
    }

    @Override
    public String getClassSimpleName() {
        return ConfigSession.KEY_PREFERENCE_PESAWAT;
    }

    @Override
    public Activity getInvokerActivity() {
        return this;
    }

    @Override
    public int getLayoutResource() {
        return R.layout.activity_plane;
    }

    @Override
    public String getWikiNameSpace() {
        return "panduan_transaksi:tiket:pesawat";
    }

    @Override
    public boolean isEligibleForFavorit() {
        return true;
    }

    @Override
    public void onActivityResult(int i, int i2, Intent intent) {
        if (i == 49023) {
            if (i2 == -1) {
                adapterResult(null, intent.getStringExtra("MESSAGE"), 0);
            }
        } else if (i != 49011) {
            super.onActivityResult(i, i2, intent);
        } else if (i2 == -1) {
            findViewById(R.id.btn_search).performClick();
        }
    }

    @Override
    public void onBackPressed() {
        if (getIntent().getExtras() != null ? Var.toBoolean(Boolean.valueOf(getIntent().getExtras().getBoolean(AppSession.IS_FROM_NEW_HOME)), false) : false) {
            Affinity.purge(this, OtherHomeMenuActivity.class);
        } else {
            super.onBackPressed();
        }
    }

    @Override
    public void onClick(View view) {
        if (view.getId() == 2131365164) {
            String productIdTag = WidgetHelper.getProductIdTag(this.d);
            Editable text = this.d.getText();
            WidgetHelper.setProductIdTag(this.d, WidgetHelper.getProductIdTag(this.e), this.e.getText());
            WidgetHelper.setProductIdTag(this.e, productIdTag, text);
            return;
        }
        if (view.getId() != 2131362413) {
            if (view.getId() == 2131364370 || view.getId() == 2131364961) {
                if (this.j < 1) {
                    Affinity.info(this, false, "Anda belum melakukan booking");
                    return;
                } else {
                    Affinity.launch(this, PlaneListBookedActivity.class);
                    return;
                }
            }
            if (view.getId() == 2131364465 || view.getId() == 2131364381) {
                Affinity.launch(this, RefundListActivity.class);
                return;
            }
            if (view.getId() == 2131362347 || view.getId() == 2131367072 || view.getId() == 2131363786) {
                X(this.o, this.p);
                return;
            } else if (view.getId() == 2131364396 || view.getId() == 2131364471) {
                Affinity.launch(this, PlaneListTicketActivity.class);
                return;
            } else {
                super.onClick(view);
                return;
            }
        }
        TicketingHelper.getAirport(this.dataSession, false, this);
        String productIdTag2 = WidgetHelper.getProductIdTag(this.d);
        String productIdTag3 = WidgetHelper.getProductIdTag(this.e);
        String productIdTag4 = WidgetHelper.getProductIdTag(this.h);
        int i = Var.toInt(Integer.valueOf(this.k), 0);
        int i2 = Var.toInt(Integer.valueOf(this.l), 0);
        int i3 = Var.toInt(Integer.valueOf(this.m), 0);
        String obj = this.d.getEditableText().toString();
        String obj2 = this.e.getEditableText().toString();
        String obj3 = this.g.getEditableText().toString();
        String obj4 = this.f.getEditableText().toString();
        obj4.replace(";", ",");
        if (productIdTag2.isEmpty()) {
            Affinity.info(this, false, getString(R.string.plane_err_empty_departure));
            return;
        }
        if (productIdTag3.isEmpty()) {
            Affinity.info(this, false, getString(R.string.plane_err_empty_arrival));
            return;
        }
        if (productIdTag4.isEmpty()) {
            Affinity.info(this, false, getString(R.string.plane_err_empty_date));
            return;
        }
        if (productIdTag2.equals(productIdTag3)) {
            Affinity.info(this, false, getString(R.string.plane_err_same_airport));
            return;
        }
        int i4 = i + i2;
        if (i4 + i3 == 0) {
            Affinity.info(this, false, getString(R.string.plane_err_pax_empty));
            return;
        }
        if (i4 > 6) {
            Affinity.info(this, false, getString(R.string.plane_err_pax_limit));
            return;
        }
        Bundle bundle = new Bundle();
        bundle.putString(String.valueOf(12), productIdTag2);
        bundle.putString(String.valueOf(13), productIdTag3);
        bundle.putString(String.valueOf(15), productIdTag4);
        bundle.putString(String.valueOf(14), productIdTag4);
        bundle.putInt(String.valueOf(16), i);
        bundle.putInt(String.valueOf(17), i2);
        bundle.putInt(String.valueOf(18), i3);
        bundle.putString("title:origin", obj);
        bundle.putString("title:dest", obj2);
        bundle.putString(PlaneScheduleActivity.SET_DATE_SUBTITLE, obj3);
        bundle.putString(PlaneScheduleActivity.SET_PASSENGER_SUBTITLE, obj4);
        Affinity.launch(this, PlaneScheduleActivity.class, bundle);
    }

    @Override
    public void onCreate(Bundle bundle) {
        super.onCreate(bundle);
        this.appSession.clearBookingPlaneSession();
        TicketingHelper.setAirlinesFromFirebase(this);
        L(new BBCallback() {
            @Override
            public final void do_callback(int i, Object obj) {
                PlaneActivity.this.U(i, obj);
            }
        });
        Bundle extras = getIntent().getExtras();
        if (extras != null) {
            String string = extras.getString("tittle");
            if (getToolbar() != null && string != null) {
                getSupportActionBar().setTitle(string);
            }
        }
        if (getToolbar() != null) {
            getToolbar().setNavigationOnClickListener(new View.OnClickListener() {
                @Override
                public final void onClick(View view) {
                    PlaneActivity.this.V(view);
                }
            });
        }
    }

    @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"));
        }
    }

    @Override
    public void onOptionChoosen(OptionListFragment optionListFragment, int i, ProdukListEntity produkListEntity) {
        if (i == 54345 || i == 43234) {
            boolean z = i == 54345;
            WidgetHelper.setProductIdTag(z ? this.d : this.e, produkListEntity.getCode(), produkListEntity.getName());
            WidgetHelper.setProductIdDrawable((ImageView) findViewById(z ? R.id.ffl_origin : R.id.ffl_destination), produkListEntity);
        }
    }

    public void onStart() {
        super.onStart();
        if (EventBus.getDefault().isRegistered(this)) {
            return;
        }
        EventBus.getDefault().register(this);
    }

    public void onStop() {
        super.onStop();
        EventBus.getDefault().unregister(this);
    }
}