@Override public View onCreateView( LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) { View view = inflater.inflate(R.layout.fragment_connect_request_pending_manager, container, false); optionsMenuControl = new OptionsMenuControl(); if (savedInstanceState == null) { String userId = getArguments().getString(ARGUMENT_USER_ID); String conversationId = getArguments().getString(ARGUMENT_CONVERSATION_ID); ConnectRequestLoadMode loademode = ConnectRequestLoadMode.valueOf(getArguments().getString(ARGUMENT_LOAD_MODE)); userRequester = IConnectStore.UserRequester.valueOf(getArguments().getString(ARGUMENT_USER_REQUESTER)); getChildFragmentManager() .beginTransaction() .add( R.id.fl__pending_connect_request, PendingConnectRequestFragment.newInstance( userId, conversationId, loademode, userRequester), PendingConnectRequestFragment.TAG) .commit(); getChildFragmentManager() .beginTransaction() .add( R.id.fl__pending_connect_request__settings_box, OptionsMenuFragment.newInstance(false), OptionsMenuFragment.TAG) .commit(); } return view; }
public static PendingConnectRequestManagerFragment newInstance( String userId, String conversationId, ConnectRequestLoadMode loadMode, IConnectStore.UserRequester userRequester) { PendingConnectRequestManagerFragment newFragment = new PendingConnectRequestManagerFragment(); Bundle args = new Bundle(); args.putString(ARGUMENT_USER_ID, userId); args.putString(ARGUMENT_CONVERSATION_ID, conversationId); args.putString(ARGUMENT_USER_REQUESTER, userRequester.toString()); args.putString(ARGUMENT_LOAD_MODE, loadMode.toString()); newFragment.setArguments(args); return newFragment; }
private void restoreCurrentPageAfterClosingOverlay() { if (getControllerFactory() == null || getControllerFactory().isTornDown()) { return; } IConnectStore.UserRequester userRequester = IConnectStore.UserRequester.valueOf(getArguments().getString(ARGUMENT_USER_REQUESTER)); if (userRequester == IConnectStore.UserRequester.CONVERSATION) { getControllerFactory() .getNavigationController() .setRightPage(Page.PENDING_CONNECT_REQUEST_AS_CONVERSATION, TAG); } else { getControllerFactory() .getNavigationController() .setRightPage(Page.PENDING_CONNECT_REQUEST, TAG); } }
@Override public void openCommonUserProfile(View anchor, User user) { if (LayoutSpec.isTablet(getActivity())) { IConnectStore.UserRequester userRequester = IConnectStore.UserRequester.valueOf(getArguments().getString(ARGUMENT_USER_REQUESTER)); if (userRequester == IConnectStore.UserRequester.CONVERSATION) { // Launch common user in new popover getControllerFactory() .getConversationScreenController() .setPopoverLaunchedMode(DialogLaunchMode.COMMON_USER); getControllerFactory().getPickUserController().showUserProfile(user, anchor); } else { // Lauch common user in existing popover getContainer().openCommonUserProfile(anchor, user); } } else { if (isShowingCommonUserProfile) { return; } isShowingCommonUserProfile = true; getControllerFactory().getNavigationController().setRightPage(Page.COMMON_USER_PROFILE, TAG); UserProfile profileFragment = (UserProfile) getChildFragmentManager().findFragmentById(R.id.fl__pending_connect_request); if (profileFragment != null) { profileFragment.isBelowUserProfile(true); } getStoreFactory().getSingleParticipantStore().setUser(user); getChildFragmentManager() .beginTransaction() .setCustomAnimations( R.anim.open_profile, R.anim.close_profile, R.anim.open_profile, R.anim.close_profile) .replace( R.id.fl__pending_connect_request, SingleParticipantFragment.newInstance(true, IConnectStore.UserRequester.SEARCH), SingleParticipantFragment.TAG) .addToBackStack(SingleParticipantFragment.TAG) .commit(); } }