Search in sources :

Example 1 with InternetFragment

use of net.iGap.fragments.payment.InternetFragment in project iGap-Android by KianIranian-STDG.

the class FragmentPayment method onViewCreated.

@Override
public void onViewCreated(@NotNull View view, @Nullable Bundle savedInstanceState) {
    super.onViewCreated(view, savedInstanceState);
    HelperTracker.sendTracker(HelperTracker.TRACKER_FINANCIAL_SERVICES);
    fragmentPaymentBinding.fpToolbar.addView(HelperToolbar.create().setContext(getContext()).setLifecycleOwner(getViewLifecycleOwner()).setLeftIcon(R.string.icon_back).setLogoShown(true).setDefaultTitle(getString(R.string.financial_services)).setListener(new ToolbarListener() {

        @Override
        public void onLeftIconClickListener(View view) {
            popBackStackFragment();
        }
    }).getView());
    fragmentPaymentViewModel.goToPaymentBillPage.observe(getViewLifecycleOwner(), type -> {
        if (getActivity() != null && type != null) {
            new HelperFragment(getActivity().getSupportFragmentManager(), FragmentPaymentBill.newInstance(type)).setReplace(false).load();
        }
    });
    fragmentPaymentViewModel.goToPaymentInquiryPage.observe(getViewLifecycleOwner(), type -> {
        if (getActivity() != null && type != null) {
            if (type) {
                new HelperFragment(getActivity().getSupportFragmentManager(), new FragmentPaymentInquiryMobile()).setReplace(false).load();
            } else {
                new HelperFragment(getActivity().getSupportFragmentManager(), new FragmentPaymentInquiryTelephone()).setReplace(false).load();
            }
        }
    });
    fragmentPaymentViewModel.goToPaymentCharge.observe(getViewLifecycleOwner(), go -> {
        if (getActivity() != null && go != null && go) {
            new HelperFragment(getActivity().getSupportFragmentManager(), ChargeFragment.newInstance()).setReplace(false).load();
        }
    });
    fragmentPaymentViewModel.goToButInternetPackage.observe(getViewLifecycleOwner(), go -> {
        if (getActivity() != null && go != null && go) {
            new HelperFragment(getActivity().getSupportFragmentManager(), new InternetFragment()).setReplace(false).load(true);
        }
    });
    fragmentPaymentViewModel.goToCardToCardPage.observe(getViewLifecycleOwner(), isGo -> {
        if (getActivity() != null && isGo != null && isGo) {
            CardToCardHelper.CallCardToCard(getActivity());
        }
    });
    fragmentPaymentBinding.setBackHandler(this::popBackStackFragment);
}
Also used : ToolbarListener(net.iGap.observers.interfaces.ToolbarListener) FragmentPaymentInquiryMobile(net.iGap.fragments.inquiryBill.FragmentPaymentInquiryMobile) InternetFragment(net.iGap.fragments.payment.InternetFragment) HelperFragment(net.iGap.helper.HelperFragment) View(android.view.View)

Aggregations

View (android.view.View)1 FragmentPaymentInquiryMobile (net.iGap.fragments.inquiryBill.FragmentPaymentInquiryMobile)1 InternetFragment (net.iGap.fragments.payment.InternetFragment)1 HelperFragment (net.iGap.helper.HelperFragment)1 ToolbarListener (net.iGap.observers.interfaces.ToolbarListener)1