Search in sources :

Example 1 with ImageSettingsDialogFragment

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();
    }
}
Also used : ImageSettingsDialogFragment(org.wordpress.android.editor.ImageSettingsDialogFragment) EditorFragment(org.wordpress.android.editor.EditorFragment) PhotoChooserFragment(org.wordpress.android.ui.posts.photochooser.PhotoChooserFragment) LegacyEditorFragment(org.wordpress.android.editor.LegacyEditorFragment) Fragment(android.app.Fragment) ImageSettingsDialogFragment(org.wordpress.android.editor.ImageSettingsDialogFragment) AztecEditorFragment(org.wordpress.android.editor.AztecEditorFragment)

Aggregations

Fragment (android.app.Fragment)1 AztecEditorFragment (org.wordpress.android.editor.AztecEditorFragment)1 EditorFragment (org.wordpress.android.editor.EditorFragment)1 ImageSettingsDialogFragment (org.wordpress.android.editor.ImageSettingsDialogFragment)1 LegacyEditorFragment (org.wordpress.android.editor.LegacyEditorFragment)1 PhotoChooserFragment (org.wordpress.android.ui.posts.photochooser.PhotoChooserFragment)1