use of org.wordpress.android.editor.ImageSettingsDialogFragment in project WordPress-Android by wordpress-mobile.
the class EditPostActivity method onBackPressed.
@Override
public void onBackPressed() {
if (isPhotoChooserShowing()) {
hidePhotoChooser();
return;
}
Fragment imageSettingsFragment = getFragmentManager().findFragmentByTag(ImageSettingsDialogFragment.IMAGE_SETTINGS_DIALOG_TAG);
if (imageSettingsFragment != null && imageSettingsFragment.isVisible()) {
((ImageSettingsDialogFragment) imageSettingsFragment).dismissFragment();
return;
}
if (mViewPager.getCurrentItem() > PAGE_CONTENT) {
if (mViewPager.getCurrentItem() == PAGE_SETTINGS) {
mPost.setFeaturedImageId(mEditPostSettingsFragment.getFeaturedImageId());
mEditorFragment.setFeaturedImageId(mPost.getFeaturedImageId());
}
mViewPager.setCurrentItem(PAGE_CONTENT);
invalidateOptionsMenu();
return;
}
if (mEditorFragment != null && !mEditorFragment.onBackPressed()) {
saveAndFinish();
}
}
Aggregations