use of com.waz.zclient.pages.main.giphy.GiphySharingPreviewFragment in project wire-android by wireapp.
the class MainPhoneFragment method onBackPressed.
////////////////////////////////////////////////////////////////////////////////////////////////////////
//
// Notifications
//
////////////////////////////////////////////////////////////////////////////////////////////////////////
@Override
public boolean onBackPressed() {
if (confirmationMenu.getVisibility() == View.VISIBLE) {
confirmationMenu.animateToShow(false);
return true;
}
// Clear any overlays
dismissOnBoardingHint(OnBoardingHintType.NONE);
if (getChildFragmentManager().getBackStackEntryCount() > 0) {
Fragment topFragment = getChildFragmentManager().findFragmentByTag(getChildFragmentManager().getBackStackEntryAt(getChildFragmentManager().getBackStackEntryCount() - 1).getName());
if (topFragment instanceof SingleImageFragment) {
return ((SingleImageFragment) topFragment).onBackPressed();
} else if (topFragment instanceof VideoPlayerFragment) {
return ((VideoPlayerFragment) topFragment).onBackPressed();
} else if (topFragment instanceof GiphySharingPreviewFragment) {
if (!((GiphySharingPreviewFragment) topFragment).onBackPressed()) {
getChildFragmentManager().popBackStackImmediate(GiphySharingPreviewFragment.TAG, FragmentManager.POP_BACK_STACK_INCLUSIVE);
}
return true;
} else if (topFragment instanceof CollectionFragment) {
return ((CollectionFragment) topFragment).onBackPressed();
} else if (topFragment instanceof ConfirmationFragment) {
return ((ConfirmationFragment) topFragment).onBackPressed();
}
}
// Back press is first delivered to the notification fragment, and if it's not consumed there,
// it's then delivered to the main content.
Fragment fragment = getChildFragmentManager().findFragmentById(R.id.fl_fragment_main_content);
if (fragment instanceof OnBackPressedListener && ((OnBackPressedListener) fragment).onBackPressed()) {
return true;
}
fragment = getChildFragmentManager().findFragmentById(R.id.fl__overlay_container);
if (fragment instanceof OnBackPressedListener && ((OnBackPressedListener) fragment).onBackPressed()) {
return true;
}
return getChildFragmentManager().popBackStackImmediate();
}
use of com.waz.zclient.pages.main.giphy.GiphySharingPreviewFragment in project wire-android by wireapp.
the class RootFragment method onBackPressed.
@Override
public boolean onBackPressed() {
Fragment fragment = getChildFragmentManager().findFragmentByTag(ParticipantsDialogFragment.TAG);
if (fragment instanceof OnBackPressedListener && ((OnBackPressedListener) fragment).onBackPressed()) {
return true;
}
fragment = getChildFragmentManager().findFragmentById(R.id.fl__root__right_view);
if (fragment instanceof OnBackPressedListener && ((OnBackPressedListener) fragment).onBackPressed()) {
return true;
}
fragment = getChildFragmentManager().findFragmentById(R.id.fl__root__camera);
if (fragment instanceof CameraFragment) {
//TODO: https://wearezeta.atlassian.net/browse/AN-2311 Refactor camera into one view
getControllerFactory().getCameraController().closeCamera(((CameraFragment) fragment).getCameraContext());
return true;
} else if (fragment instanceof OnBackPressedListener) {
((OnBackPressedListener) fragment).onBackPressed();
return true;
}
fragment = getChildFragmentManager().findFragmentById(R.id.fl__root__giphy);
if (fragment instanceof GiphySharingPreviewFragment) {
if (!((GiphySharingPreviewFragment) fragment).onBackPressed()) {
getControllerFactory().getGiphyController().cancel();
}
return true;
}
fragment = getChildFragmentManager().findFragmentById(R.id.fl__root__sketch);
if (fragment instanceof OnBackPressedListener) {
((OnBackPressedListener) fragment).onBackPressed();
return true;
}
if (getControllerFactory().getPickUserController().isShowingPickUser(IPickUserController.Destination.CONVERSATION_LIST)) {
getControllerFactory().getPickUserController().hidePickUser(IPickUserController.Destination.CONVERSATION_LIST, true);
return true;
}
if (slidingPaneLayout != null && !slidingPaneLayout.isOpen()) {
slidingPaneLayout.openPane();
return true;
}
return false;
}
Aggregations