Skip to content

Commit

Permalink
Merge pull request #17738 from wordpress-mobile/issue/17339-jetpack-f…
Browse files Browse the repository at this point in the history
…ocus-create-page-p4

Jetpack Focus: Handle create page flow for phase four
  • Loading branch information
AjeshRPai authored Jan 13, 2023
2 parents 07adff0 + b2feee0 commit 4e37f62
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -90,6 +90,7 @@
import org.wordpress.android.ui.jetpackoverlay.JetpackFeatureFullScreenOverlayFragment;
import org.wordpress.android.ui.jetpackoverlay.JetpackFeatureRemovalOverlayUtil;
import org.wordpress.android.ui.jetpackoverlay.JetpackFeatureRemovalOverlayUtil.JetpackFeatureCollectionOverlaySource;
import org.wordpress.android.ui.jetpackoverlay.JetpackFeatureRemovalPhaseHelper;
import org.wordpress.android.ui.main.WPMainNavigationView.OnPageListener;
import org.wordpress.android.ui.main.WPMainNavigationView.PageType;
import org.wordpress.android.ui.mlp.ModalLayoutPickerFragment;
Expand Down Expand Up @@ -269,6 +270,7 @@ public class WPMainActivity extends LocaleAwareActivity implements
@Inject OpenWebLinksWithJetpackFlowFeatureConfig mOpenWebLinksWithJetpackFlowFeatureConfig;
@Inject QRCodeAuthFlowFeatureConfig mQrCodeAuthFlowFeatureConfig;
@Inject JetpackFeatureRemovalOverlayUtil mJetpackFeatureRemovalOverlayUtil;
@Inject JetpackFeatureRemovalPhaseHelper mJetpackFeatureRemovalPhaseHelper;

@Inject BuildConfigWrapper mBuildConfigWrapper;

Expand Down Expand Up @@ -609,7 +611,8 @@ private void initViewModel() {
handleNewPostAction(PagePostCreationSourcesDetail.POST_FROM_MY_SITE, -1, null);
break;
case CREATE_NEW_PAGE:
if (mMLPViewModel.canShowModalLayoutPicker()) {
if (mMLPViewModel.canShowModalLayoutPicker()
&& !mJetpackFeatureRemovalPhaseHelper.shouldRemoveJetpackFeatures()) {
mMLPViewModel.createPageFlowTriggered();
} else {
handleNewPageAction("", "", null,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@ import org.wordpress.android.ui.ActivityLauncher
import org.wordpress.android.ui.PagePostCreationSourcesDetail.PAGE_FROM_PAGES_LIST
import org.wordpress.android.ui.RequestCodes
import org.wordpress.android.ui.ScrollableViewInitializedListener
import org.wordpress.android.ui.jetpackoverlay.JetpackFeatureRemovalPhaseHelper
import org.wordpress.android.ui.mlp.ModalLayoutPickerFragment
import org.wordpress.android.ui.mlp.ModalLayoutPickerFragment.Companion.MODAL_LAYOUT_PICKER_TAG
import org.wordpress.android.ui.posts.EditPostActivity
Expand Down Expand Up @@ -109,6 +110,9 @@ class PagesFragment : Fragment(R.layout.pages_fragment), ScrollableViewInitializ
@Inject
lateinit var uploadUtilsWrapper: UploadUtilsWrapper

@Inject
lateinit var jetpackFeatureRemovalPhaseHelper: JetpackFeatureRemovalPhaseHelper

@Suppress("DEPRECATION")
private var progressDialog: ProgressDialog? = null

Expand Down Expand Up @@ -371,7 +375,8 @@ class PagesFragment : Fragment(R.layout.pages_fragment), ScrollableViewInitializ
})

viewModel.createNewPage.observe(viewLifecycleOwner, {
if (mlpViewModel.canShowModalLayoutPicker()) {
if (mlpViewModel.canShowModalLayoutPicker()
&& !jetpackFeatureRemovalPhaseHelper.shouldRemoveJetpackFeatures()) {
mlpViewModel.createPageFlowTriggered()
} else {
createNewPage()
Expand Down

0 comments on commit 4e37f62

Please sign in to comment.