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);
}
Aggregations