Search in sources :

Example 1 with PickUserFragment

use of com.waz.zclient.pages.main.pickuser.PickUserFragment in project wire-android by wireapp.

the class ConversationListManagerFragment method onShowPickUser.

//////////////////////////////////////////////////////////////////////////////////////////
//
//  PickUserControllerScreenObserver
//
//////////////////////////////////////////////////////////////////////////////////////////
@Override
public void onShowPickUser(IPickUserController.Destination destination, View anchorView) {
    if (!getCurrentPickerDestination().equals(destination)) {
        onHidePickUser(getCurrentPickerDestination(), true);
        return;
    }
    Page page = getControllerFactory().getNavigationController().getCurrentLeftPage();
    switch(page) {
        // TODO: START is set as left page on tablet, fix
        case START:
        case CONVERSATION_LIST:
            Fragment fragment = getChildFragmentManager().findFragmentByTag(PickUserFragment.TAG);
            if (fragment == null || !(fragment instanceof PickUserFragment)) {
                getControllerFactory().getOnboardingController().incrementPeoplePickerShowCount();
                PickUserFragment pickUserFragment = PickUserFragment.newInstance(false);
                getChildFragmentManager().beginTransaction().setCustomAnimations(R.anim.slide_in_from_bottom_pick_user, R.anim.open_new_conversation__thread_list_out, R.anim.open_new_conversation__thread_list_in, R.anim.slide_out_to_bottom_pick_user).replace(R.id.fl__conversation_list_main, pickUserFragment, PickUserFragment.TAG).addToBackStack(PickUserFragment.TAG).commit();
            }
            break;
        case PICK_USER:
            break;
    }
    getControllerFactory().getNavigationController().setLeftPage(Page.PICK_USER, TAG);
}
Also used : PickUserFragment(com.waz.zclient.pages.main.pickuser.PickUserFragment) Page(com.waz.zclient.controllers.navigation.Page) BlockedUserProfileFragment(com.waz.zclient.pages.main.connect.BlockedUserProfileFragment) Fragment(android.support.v4.app.Fragment) FirstTimeAssignUsernameFragment(com.waz.zclient.newreg.fragments.FirstTimeAssignUsernameFragment) ParticipantsDialogFragment(com.waz.zclient.pages.main.participants.dialog.ParticipantsDialogFragment) OptionsMenuFragment(com.waz.zclient.pages.main.participants.OptionsMenuFragment) PendingConnectRequestManagerFragment(com.waz.zclient.pages.main.connect.PendingConnectRequestManagerFragment) SendConnectRequestFragment(com.waz.zclient.pages.main.connect.SendConnectRequestFragment) CameraFragment(com.waz.zclient.pages.main.profile.camera.CameraFragment) PickUserFragment(com.waz.zclient.pages.main.pickuser.PickUserFragment) BaseFragment(com.waz.zclient.pages.BaseFragment)

Example 2 with PickUserFragment

use of com.waz.zclient.pages.main.pickuser.PickUserFragment in project wire-android by wireapp.

the class ConversationListManagerFragment method onCreateView.

@Override
public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
    View view = inflater.inflate(R.layout.fragment_conversation_list_manager, container, false);
    mainContainer = ViewUtils.getView(view, R.id.fl__conversation_list_main);
    startuiLoadingIndicatorView = ViewUtils.getView(view, R.id.liv__conversations__loading_indicator);
    listLoadingIndicatorView = ViewUtils.getView(view, R.id.lbv__conversation_list__loading_indicator);
    startuiLoadingIndicatorView.setColor(getResources().getColor(R.color.people_picker__loading__color));
    listLoadingIndicatorView.setColor(getControllerFactory().getAccentColorController().getColor());
    confirmationMenu = ViewUtils.getView(view, R.id.cm__confirm_action_light);
    confirmationMenu.setVisibility(View.GONE);
    confirmationMenu.resetFullScreenPadding();
    optionsMenuControl = new OptionsMenuControl();
    if (savedInstanceState == null) {
        // When re-starting app to open into specific page, child fragments may exist despite savedInstanceState == null
        if (getControllerFactory().getPickUserController().isShowingUserProfile()) {
            getControllerFactory().getPickUserController().hideUserProfile();
        }
        if (getControllerFactory().getPickUserController().isShowingPickUser(IPickUserController.Destination.CONVERSATION_LIST)) {
            getControllerFactory().getPickUserController().hidePickUser(IPickUserController.Destination.CONVERSATION_LIST, false);
            Fragment pickUserFragment = getChildFragmentManager().findFragmentByTag(PickUserFragment.TAG);
            if (pickUserFragment != null) {
                getChildFragmentManager().popBackStack(PickUserFragment.TAG, FragmentManager.POP_BACK_STACK_INCLUSIVE);
            }
        }
        getChildFragmentManager().beginTransaction().add(R.id.fl__conversation_list_main, ConversationListFragment.newInstance(ConversationListFragment.Mode.NORMAL), ConversationListFragment.TAG).add(R.id.fl__conversation_list__settings_box, OptionsMenuFragment.newInstance(true), OptionsMenuFragment.TAG).commit();
    }
    return view;
}
Also used : OptionsMenuControl(com.waz.zclient.pages.main.participants.OptionsMenuControl) View(android.view.View) LoadingIndicatorView(com.waz.zclient.views.LoadingIndicatorView) BlockedUserProfileFragment(com.waz.zclient.pages.main.connect.BlockedUserProfileFragment) Fragment(android.support.v4.app.Fragment) FirstTimeAssignUsernameFragment(com.waz.zclient.newreg.fragments.FirstTimeAssignUsernameFragment) ParticipantsDialogFragment(com.waz.zclient.pages.main.participants.dialog.ParticipantsDialogFragment) OptionsMenuFragment(com.waz.zclient.pages.main.participants.OptionsMenuFragment) PendingConnectRequestManagerFragment(com.waz.zclient.pages.main.connect.PendingConnectRequestManagerFragment) SendConnectRequestFragment(com.waz.zclient.pages.main.connect.SendConnectRequestFragment) CameraFragment(com.waz.zclient.pages.main.profile.camera.CameraFragment) PickUserFragment(com.waz.zclient.pages.main.pickuser.PickUserFragment) BaseFragment(com.waz.zclient.pages.BaseFragment)

Example 3 with PickUserFragment

use of com.waz.zclient.pages.main.pickuser.PickUserFragment in project wire-android by wireapp.

the class ParticipantFragment method onBackPressed.

//////////////////////////////////////////////////////////////////////////////////////////
//
//  OnBackPressedListener
//
//////////////////////////////////////////////////////////////////////////////////////////
@Override
public boolean onBackPressed() {
    PickUserFragment pickUserFragment = (PickUserFragment) getChildFragmentManager().findFragmentByTag(PickUserFragment.TAG);
    if (pickUserFragment != null && pickUserFragment.onBackPressed()) {
        return true;
    }
    SingleOtrClientFragment singleOtrClientFragment = (SingleOtrClientFragment) getChildFragmentManager().findFragmentByTag(SingleOtrClientFragment.TAG);
    if (singleOtrClientFragment != null) {
        getControllerFactory().getConversationScreenController().hideOtrClient();
        return true;
    }
    SingleParticipantFragment singleUserFragment = (SingleParticipantFragment) getChildFragmentManager().findFragmentByTag(SingleParticipantFragment.TAG);
    if (singleUserFragment != null && singleUserFragment.onBackPressed()) {
        return true;
    }
    if (closeMenu()) {
        return true;
    }
    if (getControllerFactory().getPickUserController().isShowingPickUser(getCurrentPickerDestination())) {
        getControllerFactory().getPickUserController().hidePickUser(getCurrentPickerDestination(), true);
        return true;
    }
    if (getControllerFactory().getConversationScreenController().isShowingUser()) {
        getControllerFactory().getConversationScreenController().hideUser();
        return true;
    }
    if (getControllerFactory().getConversationScreenController().isShowingParticipant()) {
        getControllerFactory().getConversationScreenController().hideParticipants(true, false);
        return true;
    }
    return false;
}
Also used : PickUserFragment(com.waz.zclient.pages.main.pickuser.PickUserFragment)

Aggregations

PickUserFragment (com.waz.zclient.pages.main.pickuser.PickUserFragment)3 Fragment (android.support.v4.app.Fragment)2 FirstTimeAssignUsernameFragment (com.waz.zclient.newreg.fragments.FirstTimeAssignUsernameFragment)2 BaseFragment (com.waz.zclient.pages.BaseFragment)2 BlockedUserProfileFragment (com.waz.zclient.pages.main.connect.BlockedUserProfileFragment)2 PendingConnectRequestManagerFragment (com.waz.zclient.pages.main.connect.PendingConnectRequestManagerFragment)2 SendConnectRequestFragment (com.waz.zclient.pages.main.connect.SendConnectRequestFragment)2 OptionsMenuFragment (com.waz.zclient.pages.main.participants.OptionsMenuFragment)2 ParticipantsDialogFragment (com.waz.zclient.pages.main.participants.dialog.ParticipantsDialogFragment)2 CameraFragment (com.waz.zclient.pages.main.profile.camera.CameraFragment)2 View (android.view.View)1 Page (com.waz.zclient.controllers.navigation.Page)1 OptionsMenuControl (com.waz.zclient.pages.main.participants.OptionsMenuControl)1 LoadingIndicatorView (com.waz.zclient.views.LoadingIndicatorView)1