Advertisement
Guest User

Untitled

a guest
Dec 19th, 2018
59
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.05 KB | None | 0 0
  1. public void mostraFragmentUser(ImageButton imageButton, int activeIconId) {
  2.  
  3. MenuItem profilo = mPresenter.trovaMenuItemProfilo();
  4. if(profilo!=null){
  5.  
  6. if (fragmentManager.findFragmentByTag(UserFragment.TAG) != null) {
  7. fragmentManager.beginTransaction().show(fragmentManager.findFragmentByTag(UserFragment.TAG)).commit();
  8. } else {
  9. //fragmentManager.beginTransaction().disallowAddToBackStack().add(R.id.fragment_container, UserFragment.newInstance(null, null), UserFragment.TAG).commit();
  10. Bundle params = new Bundle();
  11. params.putString(AppConstants.BUNDLE_FUNCTION_ID, profilo.getId());
  12. params.putString(AppConstants.BUNDLE_FUNCTION_NAME, profilo.getLabel());
  13. params.putString(AppConstants.BUNDLE_FUNCTION_LEVEL, profilo.getLivello());
  14. params.putString(AppConstants.BUNDLE_MENU_ITEM, new Gson().toJson(profilo, MenuItem.class));
  15. navigationManager.showSelectedFunction(params);
  16. }
  17. if (fragmentManager.findFragmentByTag(PannelliFragment.TAG) != null) {
  18. fragmentManager.beginTransaction().hide(fragmentManager.findFragmentByTag(PannelliFragment.TAG)).commit();
  19. }
  20. if (fragmentManager.findFragmentByTag(MessageFragment.TAG) != null) {
  21. fragmentManager.beginTransaction().hide(fragmentManager.findFragmentByTag(MessageFragment.TAG)).commit();
  22. }
  23. if (fragmentManager.findFragmentByTag(ListaMovimentiFragment.TAG) != null) {
  24. fragmentManager.beginTransaction().hide(fragmentManager.findFragmentByTag(ListaMovimentiFragment.TAG)).commit();
  25. }
  26. if (fragmentManager.findFragmentByTag(FunctionBaseFragment.TAG) != null) {
  27. fragmentManager.beginTransaction().hide(fragmentManager.findFragmentByTag(FunctionBaseFragment.TAG)).commit();
  28. }
  29. deactivateButtons(imageButton, activeIconId);
  30. isUserActive = true;
  31. }
  32.  
  33.  
  34. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement