use of com.waz.zclient.pages.main.profile.camera.CameraFragment 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