use of net.iGap.model.payment.Payment in project iGap-Android by KianIranian-STDG.
the class ActivityMain method checkIntent.
private void checkIntent(Intent intent) {
if (G.isRestartActivity) {
return;
}
if (intent.getAction() != null && intent.getAction().equals("net.iGap.payment")) {
FragmentManager fragmentManager = getSupportFragmentManager();
Fragment fragment = fragmentManager.findFragmentByTag(PaymentFragment.class.getName());
if (fragment instanceof PaymentFragment) {
((PaymentFragment) fragment).setPaymentResult(new Payment(intent.getStringExtra("status"), intent.getStringExtra("message"), intent.getStringExtra("order_id"), intent.getStringExtra("tax"), intent.getStringExtra("discount")));
}
}
new HelperGetDataFromOtherApp(this, intent);
// check has shared data if true setup main fragment (room list) ui
Fragment fragmentBottomNav = getSupportFragmentManager().findFragmentByTag(BottomNavigationFragment.class.getName());
if (fragmentBottomNav instanceof BottomNavigationFragment) {
// set true just for checking state
((BottomNavigationFragment) fragmentBottomNav).checkHasSharedData(true);
((BottomNavigationFragment) fragmentBottomNav).isFirstTabItem();
}
if (intent.getAction() != null && intent.getAction().equals("net.iGap.activities.OPEN_ACCOUNT")) {
new HelperFragment(getSupportFragmentManager(), new FragmentSetting()).load();
}
Bundle extras = intent.getExtras();
if (extras != null) {
long roomId = extras.getLong(ActivityMain.openChat);
if (!FragmentLanguage.languageChanged && roomId > 0) {
// if language changed not need check enter to chat
// GoToChatActivity goToChatActivity = new GoToChatActivity(roomId);
// TODO this change is duo to room null bug. if it works server must change routine.
long peerId = extras.getLong("PeerID");
long userId = extras.getLong(ActivityMain.userId);
if (AccountManager.getInstance().getCurrentUser().getId() != userId) {
new AccountHelper().changeAccount(userId);
updateUiForChangeAccount();
}
HelperUrl.goToActivityFromFCM(this, roomId, peerId);
}
FragmentLanguage.languageChanged = false;
boolean openMediaPlayer = extras.getBoolean(ActivityMain.openMediaPlayer);
if (openMediaPlayer) {
if (getSupportFragmentManager().findFragmentByTag(FragmentMediaPlayer.class.getName()) == null) {
FragmentMediaPlayer fragment = new FragmentMediaPlayer();
new HelperFragment(getSupportFragmentManager(), fragment).setReplace(false).load();
}
}
}
}
Aggregations