Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public void mostraFragmentUser(ImageButton imageButton, int activeIconId) {
- MenuItem profilo = mPresenter.trovaMenuItemProfilo();
- if(profilo!=null){
- if (fragmentManager.findFragmentByTag(UserFragment.TAG) != null) {
- fragmentManager.beginTransaction().show(fragmentManager.findFragmentByTag(UserFragment.TAG)).commit();
- } else {
- //fragmentManager.beginTransaction().disallowAddToBackStack().add(R.id.fragment_container, UserFragment.newInstance(null, null), UserFragment.TAG).commit();
- Bundle params = new Bundle();
- params.putString(AppConstants.BUNDLE_FUNCTION_ID, profilo.getId());
- params.putString(AppConstants.BUNDLE_FUNCTION_NAME, profilo.getLabel());
- params.putString(AppConstants.BUNDLE_FUNCTION_LEVEL, profilo.getLivello());
- params.putString(AppConstants.BUNDLE_MENU_ITEM, new Gson().toJson(profilo, MenuItem.class));
- navigationManager.showSelectedFunction(params);
- }
- if (fragmentManager.findFragmentByTag(PannelliFragment.TAG) != null) {
- fragmentManager.beginTransaction().hide(fragmentManager.findFragmentByTag(PannelliFragment.TAG)).commit();
- }
- if (fragmentManager.findFragmentByTag(MessageFragment.TAG) != null) {
- fragmentManager.beginTransaction().hide(fragmentManager.findFragmentByTag(MessageFragment.TAG)).commit();
- }
- if (fragmentManager.findFragmentByTag(ListaMovimentiFragment.TAG) != null) {
- fragmentManager.beginTransaction().hide(fragmentManager.findFragmentByTag(ListaMovimentiFragment.TAG)).commit();
- }
- if (fragmentManager.findFragmentByTag(FunctionBaseFragment.TAG) != null) {
- fragmentManager.beginTransaction().hide(fragmentManager.findFragmentByTag(FunctionBaseFragment.TAG)).commit();
- }
- deactivateButtons(imageButton, activeIconId);
- isUserActive = true;
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement