From 0ab14eddd2f7cb84f5f609c750bf8ac974c7182f Mon Sep 17 00:00:00 2001 From: Jarvis Lin Date: Tue, 23 Jan 2024 11:39:02 +0800 Subject: [PATCH 01/33] Remove Stories --- .../org/wordpress/android/AppInitializer.kt | 6 - .../UserFlagsProviderHelper.kt | 1 - .../android/modules/AppComponent.java | 3 - .../android/modules/ViewModelModule.java | 6 - .../android/ui/ActivityLauncher.java | 82 ------------ .../wordpress/android/ui/RequestCodes.java | 1 - .../JetpackFeatureRemovalPhaseHelper.kt | 8 -- .../android/ui/main/MainActionListItem.kt | 1 - .../android/ui/main/WPMainActivity.java | 35 ----- .../android/ui/media/MediaBrowserType.java | 12 +- .../ui/mediapicker/MediaPickerActivity.kt | 10 -- .../ui/mediapicker/MediaPickerFragment.kt | 7 - .../ui/mediapicker/MediaPickerSetup.kt | 2 +- .../ui/mediapicker/MediaPickerTracker.kt | 5 - .../ui/mediapicker/MediaPickerViewModel.kt | 7 +- .../android/ui/mysite/MySiteFragment.kt | 17 --- .../android/ui/mysite/MySiteViewModel.kt | 10 -- .../android/ui/mysite/SiteNavigationAction.kt | 16 --- .../android/ui/mysite/SiteStoriesHandler.kt | 26 +--- .../ui/photopicker/MediaPickerConstants.kt | 2 - .../ui/photopicker/MediaPickerLauncher.kt | 23 +--- .../ui/photopicker/PhotoPickerActivity.java | 43 ++----- .../ui/photopicker/PhotoPickerFragment.kt | 3 +- .../ui/photopicker/PhotoPickerViewModel.kt | 22 +--- .../android/ui/posts/EditPostActivity.java | 2 +- .../android/ui/posts/PostActionHandler.kt | 4 - .../android/ui/posts/PostListAction.kt | 13 -- .../android/ui/posts/PostsListActivity.kt | 25 ---- .../wordpress/android/ui/prefs/AppPrefs.java | 11 -- .../android/ui/prefs/AppPrefsWrapper.kt | 4 - .../ui/stories/StoriesAnalyticsReceiver.kt | 14 -- .../StoriesMediaPickerResultHandler.kt | 120 ------------------ .../ui/stories/StoriesTrackerHelper.kt | 44 ------- .../ui/stories/StoryComposerActivity.kt | 14 -- .../intro/StoriesIntroDialogFragment.kt | 92 -------------- .../ui/stories/intro/StoriesIntroViewModel.kt | 63 --------- .../media/StoryMediaSaveUploadBridge.kt | 14 -- .../org/wordpress/android/util/SiteUtils.java | 5 - .../android/util/SiteUtilsWrapper.kt | 4 - .../viewmodel/main/WPMainActivityViewModel.kt | 32 +---- WordPress/src/main/res/values-ar/strings.xml | 2 - WordPress/src/main/res/values-cs/strings.xml | 2 - WordPress/src/main/res/values-de/strings.xml | 2 - .../src/main/res/values-en-rCA/strings.xml | 2 - .../src/main/res/values-en-rGB/strings.xml | 2 - .../src/main/res/values-es-rCO/strings.xml | 2 - .../src/main/res/values-es-rMX/strings.xml | 2 - .../src/main/res/values-es-rVE/strings.xml | 2 - WordPress/src/main/res/values-es/strings.xml | 2 - .../src/main/res/values-fr-rCA/strings.xml | 2 - WordPress/src/main/res/values-fr/strings.xml | 2 - WordPress/src/main/res/values-gl/strings.xml | 2 - WordPress/src/main/res/values-he/strings.xml | 2 - WordPress/src/main/res/values-id/strings.xml | 2 - WordPress/src/main/res/values-it/strings.xml | 2 - WordPress/src/main/res/values-ja/strings.xml | 2 - WordPress/src/main/res/values-kmr/strings.xml | 2 - WordPress/src/main/res/values-ko/strings.xml | 2 - WordPress/src/main/res/values-lv/strings.xml | 2 - WordPress/src/main/res/values-nb/strings.xml | 2 - WordPress/src/main/res/values-nl/strings.xml | 2 - WordPress/src/main/res/values-pl/strings.xml | 2 - .../src/main/res/values-pt-rBR/strings.xml | 2 - WordPress/src/main/res/values-ro/strings.xml | 2 - WordPress/src/main/res/values-ru/strings.xml | 2 - WordPress/src/main/res/values-sq/strings.xml | 2 - WordPress/src/main/res/values-sr/strings.xml | 2 - WordPress/src/main/res/values-sv/strings.xml | 2 - WordPress/src/main/res/values-tr/strings.xml | 2 - WordPress/src/main/res/values-vi/strings.xml | 2 - .../src/main/res/values-zh-rCN/strings.xml | 2 - .../src/main/res/values-zh-rHK/strings.xml | 2 - .../src/main/res/values-zh-rTW/strings.xml | 2 - WordPress/src/main/res/values/strings.xml | 3 - .../android/ui/mysite/MySiteViewModelTest.kt | 4 - .../ui/stories/StoriesIntroViewModelTest.kt | 95 -------------- .../wordpress/android/util/SiteUtilsTest.kt | 12 +- .../main/WPMainActivityViewModelTest.kt | 6 +- fastlane/resources/values/strings.xml | 3 - .../android/analytics/AnalyticsTracker.java | 13 -- .../analytics/AnalyticsTrackerNosara.java | 26 ---- 81 files changed, 44 insertions(+), 993 deletions(-) delete mode 100644 WordPress/src/main/java/org/wordpress/android/ui/stories/StoriesAnalyticsReceiver.kt delete mode 100644 WordPress/src/main/java/org/wordpress/android/ui/stories/StoriesMediaPickerResultHandler.kt delete mode 100644 WordPress/src/main/java/org/wordpress/android/ui/stories/StoriesTrackerHelper.kt delete mode 100644 WordPress/src/main/java/org/wordpress/android/ui/stories/intro/StoriesIntroDialogFragment.kt delete mode 100644 WordPress/src/main/java/org/wordpress/android/ui/stories/intro/StoriesIntroViewModel.kt delete mode 100644 WordPress/src/test/java/org/wordpress/android/ui/stories/StoriesIntroViewModelTest.kt diff --git a/WordPress/src/main/java/org/wordpress/android/AppInitializer.kt b/WordPress/src/main/java/org/wordpress/android/AppInitializer.kt index cd4fba1f5bd5..34819ebfb557 100644 --- a/WordPress/src/main/java/org/wordpress/android/AppInitializer.kt +++ b/WordPress/src/main/java/org/wordpress/android/AppInitializer.kt @@ -93,7 +93,6 @@ import org.wordpress.android.ui.posts.editor.ImageEditorTracker import org.wordpress.android.ui.prefs.AppPrefs import org.wordpress.android.ui.reader.tracker.ReaderTracker import org.wordpress.android.ui.stats.refresh.lists.widget.WidgetUpdater.StatsWidgetUpdaters -import org.wordpress.android.ui.stories.media.StoryMediaSaveUploadBridge import org.wordpress.android.ui.uploads.UploadService import org.wordpress.android.ui.uploads.UploadStarter import org.wordpress.android.util.AppLog @@ -171,9 +170,6 @@ class AppInitializer @Inject constructor( @Inject lateinit var imageEditorTracker: ImageEditorTracker - @Inject - lateinit var storyMediaSaveUploadBridge: StoryMediaSaveUploadBridge - @Inject lateinit var crashLogging: CrashLogging @@ -369,8 +365,6 @@ class AppInitializer @Inject constructor( ImageEditorInitializer.init(imageManager, imageEditorTracker, imageEditorFileUtils, appScope) storyNotificationTrackerProvider = StoryNotificationTrackerProvider() - storyMediaSaveUploadBridge.init(application) - ProcessLifecycleOwner.get().lifecycle.addObserver(storyMediaSaveUploadBridge) exPlat.forceRefresh() diff --git a/WordPress/src/main/java/org/wordpress/android/localcontentmigration/UserFlagsProviderHelper.kt b/WordPress/src/main/java/org/wordpress/android/localcontentmigration/UserFlagsProviderHelper.kt index fb11f809225b..491f8a0c9866 100644 --- a/WordPress/src/main/java/org/wordpress/android/localcontentmigration/UserFlagsProviderHelper.kt +++ b/WordPress/src/main/java/org/wordpress/android/localcontentmigration/UserFlagsProviderHelper.kt @@ -69,7 +69,6 @@ class UserFlagsProviderHelper @Inject constructor( UndeletablePrefKey.IMAGE_OPTIMIZE_PROMO_REQUIRED.name, UndeletablePrefKey.SWIPE_TO_NAVIGATE_NOTIFICATIONS.name, UndeletablePrefKey.SWIPE_TO_NAVIGATE_READER.name, - UndeletablePrefKey.SHOULD_SHOW_STORIES_INTRO.name, UndeletablePrefKey.SHOULD_SHOW_STORAGE_WARNING.name, UndeletablePrefKey.LAST_USED_USER_ID.name, contextProvider.getContext().getString(R.string.pref_key_app_theme), diff --git a/WordPress/src/main/java/org/wordpress/android/modules/AppComponent.java b/WordPress/src/main/java/org/wordpress/android/modules/AppComponent.java index 993703e791c2..23835c52b678 100644 --- a/WordPress/src/main/java/org/wordpress/android/modules/AppComponent.java +++ b/WordPress/src/main/java/org/wordpress/android/modules/AppComponent.java @@ -172,7 +172,6 @@ import org.wordpress.android.ui.stats.refresh.lists.widget.weeks.WeekWidgetBlockListProviderFactory; import org.wordpress.android.ui.stockmedia.StockMediaPickerActivity; import org.wordpress.android.ui.stories.StoryComposerActivity; -import org.wordpress.android.ui.stories.intro.StoriesIntroDialogFragment; import org.wordpress.android.ui.suggestion.SuggestionActivity; import org.wordpress.android.ui.suggestion.adapters.SuggestionAdapter; import org.wordpress.android.ui.themes.ThemeBrowserFragment; @@ -457,8 +456,6 @@ public interface AppComponent { void inject(StoryComposerActivity object); - void inject(StoriesIntroDialogFragment object); - void inject(ReaderDiscoverFragment object); void inject(ReaderSearchActivity object); diff --git a/WordPress/src/main/java/org/wordpress/android/modules/ViewModelModule.java b/WordPress/src/main/java/org/wordpress/android/modules/ViewModelModule.java index 1f8bb88b6ac3..b26b57e7a054 100644 --- a/WordPress/src/main/java/org/wordpress/android/modules/ViewModelModule.java +++ b/WordPress/src/main/java/org/wordpress/android/modules/ViewModelModule.java @@ -73,7 +73,6 @@ import org.wordpress.android.ui.stats.refresh.lists.widget.configuration.StatsWidgetConfigureViewModel; import org.wordpress.android.ui.stats.refresh.lists.widget.minified.StatsMinifiedWidgetConfigureViewModel; import org.wordpress.android.ui.stories.StoryComposerViewModel; -import org.wordpress.android.ui.stories.intro.StoriesIntroViewModel; import org.wordpress.android.ui.suggestion.SuggestionViewModel; import org.wordpress.android.ui.whatsnew.FeatureAnnouncementViewModel; import org.wordpress.android.viewmodel.ViewModelFactory; @@ -364,11 +363,6 @@ abstract class ViewModelModule { @ViewModelKey(StoryComposerViewModel.class) abstract ViewModel storyComposerViewModel(StoryComposerViewModel viewModel); - @Binds - @IntoMap - @ViewModelKey(StoriesIntroViewModel.class) - abstract ViewModel storiesIntroViewModel(StoriesIntroViewModel viewModel); - @Binds @IntoMap @ViewModelKey(PhotoPickerViewModel.class) diff --git a/WordPress/src/main/java/org/wordpress/android/ui/ActivityLauncher.java b/WordPress/src/main/java/org/wordpress/android/ui/ActivityLauncher.java index ab51fe1aad2e..901fad2adcb2 100644 --- a/WordPress/src/main/java/org/wordpress/android/ui/ActivityLauncher.java +++ b/WordPress/src/main/java/org/wordpress/android/ui/ActivityLauncher.java @@ -85,8 +85,6 @@ import org.wordpress.android.ui.pages.PageParentActivity; import org.wordpress.android.ui.pages.PagesActivity; import org.wordpress.android.ui.people.PeopleManagementActivity; -import org.wordpress.android.ui.photopicker.MediaPickerConstants; -import org.wordpress.android.ui.photopicker.PhotoPickerActivity; import org.wordpress.android.ui.plans.PlansActivity; import org.wordpress.android.ui.plugins.PluginBrowserActivity; import org.wordpress.android.ui.plugins.PluginDetailActivity; @@ -251,33 +249,6 @@ private static Intent createSitePickerIntent(Context context, SiteModel site, Si return intent; } - /** - * Use {@link org.wordpress.android.ui.photopicker.MediaPickerLauncher::showPhotoPickerForResult} instead - */ - @Deprecated - public static void showPhotoPickerForResult(Activity activity, - @NonNull MediaBrowserType browserType, - @Nullable SiteModel site, - @Nullable Integer localPostId) { - Intent intent = createShowPhotoPickerIntent(activity, browserType, site, localPostId); - activity.startActivityForResult(intent, RequestCodes.PHOTO_PICKER); - } - - private static Intent createShowPhotoPickerIntent(Context context, - @NonNull MediaBrowserType browserType, - @Nullable SiteModel site, - @Nullable Integer localPostId) { - Intent intent = new Intent(context, PhotoPickerActivity.class); - intent.putExtra(ARG_BROWSER_TYPE, browserType); - if (site != null) { - intent.putExtra(WordPress.SITE, site); - } - if (localPostId != null) { - intent.putExtra(MediaPickerConstants.LOCAL_POST_ID, localPostId.intValue()); - } - return intent; - } - /** * Use {@link org.wordpress.android.ui.photopicker.MediaPickerLauncher::showStockMediaPickerForResult} instead */ @@ -1020,57 +991,6 @@ public static void addNewPostForResult( activity.startActivityForResult(intent, RequestCodes.EDIT_POST); } - public static void addNewStoryForResult( - Activity activity, - SiteModel site, - PagePostCreationSourcesDetail source - ) { - if (site == null) { - return; - } - - Intent intent = new Intent(activity, StoryComposerActivity.class); - intent.putExtra(WordPress.SITE, site); - intent.putExtra(AnalyticsUtils.EXTRA_CREATION_SOURCE_DETAIL, source); - intent.putExtra(MediaPickerConstants.EXTRA_LAUNCH_WPSTORIES_CAMERA_REQUESTED, true); - activity.startActivityForResult(intent, RequestCodes.CREATE_STORY); - } - - public static void addNewStoryWithMediaIdsForResult( - Activity activity, - SiteModel site, - PagePostCreationSourcesDetail source, - long[] mediaIds - ) { - if (site == null) { - return; - } - - Intent intent = new Intent(activity, StoryComposerActivity.class); - intent.putExtra(WordPress.SITE, site); - intent.putExtra(MediaBrowserActivity.RESULT_IDS, mediaIds); - intent.putExtra(AnalyticsUtils.EXTRA_CREATION_SOURCE_DETAIL, source); - activity.startActivityForResult(intent, RequestCodes.CREATE_STORY); - } - - public static void addNewStoryWithMediaUrisForResult( - Activity activity, - SiteModel site, - PagePostCreationSourcesDetail source, - String[] mediaUris - ) { - if (site == null) { - return; - } - - Intent intent = new Intent(activity, StoryComposerActivity.class); - intent.putExtra(WordPress.SITE, site); - intent.putExtra(MediaPickerConstants.EXTRA_MEDIA_URIS, mediaUris); - intent.putExtra(AnalyticsUtils.EXTRA_CREATION_SOURCE_DETAIL, source); - activity.startActivityForResult(intent, RequestCodes.CREATE_STORY); - } - - public static void editStoryForResult( Activity activity, SiteModel site, @@ -1105,11 +1025,9 @@ public static void editEmptyStoryForResult( return; } - AnalyticsTracker.track(Stat.STORY_BLOCK_ADD_MEDIA_TAPPED); Intent intent = new Intent(activity, StoryComposerActivity.class); intent.putExtra(WordPress.SITE, site); intent.putExtra(KEY_LAUNCHED_FROM_GUTENBERG, true); - intent.putExtra(MediaPickerConstants.EXTRA_LAUNCH_WPSTORIES_MEDIA_PICKER_REQUESTED, true); intent.putExtra(KEY_POST_LOCAL_ID, localPostId.getValue()); intent.putExtra(KEY_STORY_INDEX, storyIndex); intent.putExtra(ARG_STORY_BLOCK_ID, storyBlockId); diff --git a/WordPress/src/main/java/org/wordpress/android/ui/RequestCodes.java b/WordPress/src/main/java/org/wordpress/android/ui/RequestCodes.java index e46b5cd8a090..231d07f8b9f6 100644 --- a/WordPress/src/main/java/org/wordpress/android/ui/RequestCodes.java +++ b/WordPress/src/main/java/org/wordpress/android/ui/RequestCodes.java @@ -72,7 +72,6 @@ public class RequestCodes { public static final int SELECTED_USER_MENTION = 7000; // Story creator - public static final int CREATE_STORY = 8000; public static final int EDIT_STORY = 8001; // Reader Interests diff --git a/WordPress/src/main/java/org/wordpress/android/ui/jetpackoverlay/JetpackFeatureRemovalPhaseHelper.kt b/WordPress/src/main/java/org/wordpress/android/ui/jetpackoverlay/JetpackFeatureRemovalPhaseHelper.kt index 878340d521d4..77f8d6512f34 100644 --- a/WordPress/src/main/java/org/wordpress/android/ui/jetpackoverlay/JetpackFeatureRemovalPhaseHelper.kt +++ b/WordPress/src/main/java/org/wordpress/android/ui/jetpackoverlay/JetpackFeatureRemovalPhaseHelper.kt @@ -86,14 +86,6 @@ class JetpackFeatureRemovalPhaseHelper @Inject constructor( } } - fun shouldShowStoryPost(): Boolean { - val currentPhase = getCurrentPhase() ?: return true - return when (currentPhase) { - is PhaseStaticPosters, PhaseFour, PhaseNewUsers, PhaseSelfHostedUsers -> false - else -> true - } - } - fun shouldShowJetpackPoweredEditorFeatures(): Boolean { val currentPhase = getCurrentPhase() ?: return true return when (currentPhase) { diff --git a/WordPress/src/main/java/org/wordpress/android/ui/main/MainActionListItem.kt b/WordPress/src/main/java/org/wordpress/android/ui/main/MainActionListItem.kt index cfbac905fc29..126808598e6c 100644 --- a/WordPress/src/main/java/org/wordpress/android/ui/main/MainActionListItem.kt +++ b/WordPress/src/main/java/org/wordpress/android/ui/main/MainActionListItem.kt @@ -13,7 +13,6 @@ sealed class MainActionListItem { CREATE_NEW_PAGE, CREATE_NEW_PAGE_FROM_PAGES_CARD, CREATE_NEW_POST, - CREATE_NEW_STORY, ANSWER_BLOGGING_PROMPT } diff --git a/WordPress/src/main/java/org/wordpress/android/ui/main/WPMainActivity.java b/WordPress/src/main/java/org/wordpress/android/ui/main/WPMainActivity.java index dc03af478cf0..da7b97106fca 100644 --- a/WordPress/src/main/java/org/wordpress/android/ui/main/WPMainActivity.java +++ b/WordPress/src/main/java/org/wordpress/android/ui/main/WPMainActivity.java @@ -135,7 +135,6 @@ import org.wordpress.android.ui.review.ReviewViewModel; import org.wordpress.android.ui.sitecreation.misc.SiteCreationSource; import org.wordpress.android.ui.stats.StatsTimeframe; -import org.wordpress.android.ui.stories.intro.StoriesIntroDialogFragment; import org.wordpress.android.ui.uploads.UploadActionUseCase; import org.wordpress.android.ui.uploads.UploadUtils; import org.wordpress.android.ui.uploads.UploadUtilsWrapper; @@ -179,7 +178,6 @@ import static androidx.lifecycle.Lifecycle.State.STARTED; import static org.wordpress.android.WordPress.SITE; -import static org.wordpress.android.editor.gutenberg.GutenbergEditorFragment.ARG_STORY_BLOCK_ID; import static org.wordpress.android.fluxc.store.SiteStore.CompleteQuickStartVariant.NEXT_STEPS; import static org.wordpress.android.login.LoginAnalyticsListener.CreatedAccountSource.EMAIL; import static org.wordpress.android.push.NotificationsProcessingService.ARG_NOTIFICATION_TYPE; @@ -702,9 +700,6 @@ private void initViewModel() { case CREATE_NEW_PAGE_FROM_PAGES_CARD: triggerCreatePageFlow(createAction); break; - case CREATE_NEW_STORY: - handleNewStoryAction(); - break; case ANSWER_BLOGGING_PROMPT: case NO_ACTION: break; // noop - we handle ANSWER_BLOGGING_PROMPT through live data event @@ -1269,25 +1264,6 @@ private void handleNewPostAction(PagePostCreationSourcesDetail source, ActivityLauncher.addNewPostForResult(this, getSelectedSite(), false, source, promptId, entryPoint); } - private void handleNewStoryAction() { - if (!mSiteStore.hasSite()) { - // No site yet - Move to My Sites fragment that shows the create new site screen - mBottomNav.setCurrentSelectedPage(PageType.MY_SITE); - return; - } - - SiteModel selectedSite = getSelectedSite(); - if (selectedSite != null) { - // TODO: evaluate to include the QuickStart logic like in the handleNewPostAction - if (AppPrefs.shouldShowStoriesIntro()) { - StoriesIntroDialogFragment.newInstance(selectedSite) - .show(getSupportFragmentManager(), StoriesIntroDialogFragment.TAG); - } else { - mMediaPickerLauncher.showStoriesPhotoPickerForResultAndTrack(this, selectedSite); - } - } - } - private void trackLastVisiblePage(PageType pageType, boolean trackAnalytics) { switch (pageType) { case MY_SITE: @@ -1387,17 +1363,6 @@ public void onActivityResult(int requestCode, int resultCode, Intent data) { ); } break; - case RequestCodes.CREATE_STORY: - SiteModel selectedSite = getSelectedSite(); - if (selectedSite != null) { - boolean isNewStory = data == null || data.getStringExtra(ARG_STORY_BLOCK_ID) == null; - mBloggingRemindersViewModel.onPublishingPost( - selectedSite.getId(), - isNewStory - ); - mReviewViewModel.onPublishingPost(isNewStory); - } - break; case RequestCodes.CREATE_SITE: QuickStartUtils.cancelQuickStartReminder(this); AppPrefs.setQuickStartNoticeRequired(false); diff --git a/WordPress/src/main/java/org/wordpress/android/ui/media/MediaBrowserType.java b/WordPress/src/main/java/org/wordpress/android/ui/media/MediaBrowserType.java index f30ab8f2ca27..c4995c671eb8 100644 --- a/WordPress/src/main/java/org/wordpress/android/ui/media/MediaBrowserType.java +++ b/WordPress/src/main/java/org/wordpress/android/ui/media/MediaBrowserType.java @@ -14,8 +14,7 @@ public enum MediaBrowserType { GUTENBERG_SINGLE_MEDIA_PICKER, // select a single image or video to insert into a post GUTENBERG_MEDIA_PICKER, // select multiple images or videos to insert into a post GUTENBERG_SINGLE_FILE_PICKER, // select a file to insert into a post - GUTENBERG_SINGLE_AUDIO_FILE_PICKER, // select an audio file to insert into a post - WP_STORIES_MEDIA_PICKER; // select multiple images or videos to insert as Story frames in a Story + GUTENBERG_SINGLE_AUDIO_FILE_PICKER; // select an audio file to insert into a post public boolean isPicker() { return this != BROWSER; @@ -42,7 +41,6 @@ public boolean isImagePicker() { || this == GUTENBERG_SINGLE_IMAGE_PICKER || this == GUTENBERG_SINGLE_MEDIA_PICKER || this == GUTENBERG_MEDIA_PICKER - || this == WP_STORIES_MEDIA_PICKER || this == GUTENBERG_SINGLE_FILE_PICKER; } @@ -53,7 +51,6 @@ public boolean isVideoPicker() { || this == GUTENBERG_SINGLE_VIDEO_PICKER || this == GUTENBERG_SINGLE_MEDIA_PICKER || this == GUTENBERG_MEDIA_PICKER - || this == WP_STORIES_MEDIA_PICKER || this == GUTENBERG_SINGLE_FILE_PICKER; } @@ -76,10 +73,6 @@ public boolean isGutenbergPicker() { || this == GUTENBERG_SINGLE_AUDIO_FILE_PICKER; } - public boolean isWPStoriesPicker() { - return this == WP_STORIES_MEDIA_PICKER; - } - public boolean isSingleFilePicker() { return this == GUTENBERG_SINGLE_FILE_PICKER; } @@ -96,8 +89,7 @@ public boolean canMultiselect() { return this == EDITOR_PICKER || this == AZTEC_EDITOR_PICKER || this == GUTENBERG_IMAGE_PICKER - || this == GUTENBERG_VIDEO_PICKER - || this == WP_STORIES_MEDIA_PICKER; + || this == GUTENBERG_VIDEO_PICKER; } public boolean canFilter() { diff --git a/WordPress/src/main/java/org/wordpress/android/ui/mediapicker/MediaPickerActivity.kt b/WordPress/src/main/java/org/wordpress/android/ui/mediapicker/MediaPickerActivity.kt index 46d141ac72c7..4f989fa1160a 100644 --- a/WordPress/src/main/java/org/wordpress/android/ui/mediapicker/MediaPickerActivity.kt +++ b/WordPress/src/main/java/org/wordpress/android/ui/mediapicker/MediaPickerActivity.kt @@ -27,7 +27,6 @@ import org.wordpress.android.ui.mediapicker.MediaPickerActivity.MediaPickerMedia import org.wordpress.android.ui.mediapicker.MediaPickerFragment.Companion.newInstance import org.wordpress.android.ui.mediapicker.MediaPickerFragment.MediaPickerAction import org.wordpress.android.ui.mediapicker.MediaPickerFragment.MediaPickerAction.OpenCameraForPhotos -import org.wordpress.android.ui.mediapicker.MediaPickerFragment.MediaPickerAction.OpenCameraForWPStories import org.wordpress.android.ui.mediapicker.MediaPickerFragment.MediaPickerAction.OpenSystemPicker import org.wordpress.android.ui.mediapicker.MediaPickerFragment.MediaPickerAction.SwitchMediaPicker import org.wordpress.android.ui.mediapicker.MediaPickerFragment.MediaPickerListener @@ -37,7 +36,6 @@ import org.wordpress.android.ui.mediapicker.MediaPickerSetup.DataSource.GIF_LIBR import org.wordpress.android.ui.mediapicker.MediaPickerSetup.DataSource.STOCK_LIBRARY import org.wordpress.android.ui.mediapicker.MediaPickerSetup.DataSource.WP_LIBRARY import org.wordpress.android.ui.photopicker.MediaPickerConstants -import org.wordpress.android.ui.photopicker.MediaPickerConstants.EXTRA_LAUNCH_WPSTORIES_CAMERA_REQUESTED import org.wordpress.android.ui.photopicker.MediaPickerConstants.EXTRA_MEDIA_ID import org.wordpress.android.ui.photopicker.MediaPickerConstants.EXTRA_MEDIA_QUEUED_URIS import org.wordpress.android.ui.photopicker.MediaPickerConstants.EXTRA_MEDIA_SOURCE @@ -251,13 +249,6 @@ class MediaPickerActivity : LocaleAwareActivity(), MediaPickerListener { WPMediaUtils.launchChooserWithContext(this, openSystemPicker, uiHelpers, MEDIA_LIBRARY) } - private fun launchWPStoriesCamera() { - val intent = Intent() - .putExtra(EXTRA_LAUNCH_WPSTORIES_CAMERA_REQUESTED, true) - setResult(Activity.RESULT_OK, intent) - finish() - } - private fun Intent.putUris( mediaUris: List ) { @@ -321,7 +312,6 @@ class MediaPickerActivity : LocaleAwareActivity(), MediaPickerListener { is OpenSystemPicker -> { launchChooserWithContext(action, uiHelpers) } - is OpenCameraForWPStories -> launchWPStoriesCamera() is SwitchMediaPicker -> { startActivityForResult(buildIntent(this, action.mediaPickerSetup, site, localPostId), PHOTO_PICKER) } diff --git a/WordPress/src/main/java/org/wordpress/android/ui/mediapicker/MediaPickerFragment.kt b/WordPress/src/main/java/org/wordpress/android/ui/mediapicker/MediaPickerFragment.kt index f5a87762415c..f976bc882eca 100644 --- a/WordPress/src/main/java/org/wordpress/android/ui/mediapicker/MediaPickerFragment.kt +++ b/WordPress/src/main/java/org/wordpress/android/ui/mediapicker/MediaPickerFragment.kt @@ -45,7 +45,6 @@ import org.wordpress.android.ui.mediapicker.MediaNavigationEvent.PreviewUrl import org.wordpress.android.ui.mediapicker.MediaPickerFragment.MediaPickerIconType.ANDROID_CHOOSE_FROM_DEVICE import org.wordpress.android.ui.mediapicker.MediaPickerFragment.MediaPickerIconType.CAPTURE_PHOTO import org.wordpress.android.ui.mediapicker.MediaPickerFragment.MediaPickerIconType.SWITCH_SOURCE -import org.wordpress.android.ui.mediapicker.MediaPickerFragment.MediaPickerIconType.WP_STORIES_CAPTURE import org.wordpress.android.ui.mediapicker.MediaPickerSetup.DataSource import org.wordpress.android.ui.mediapicker.MediaPickerViewModel.ActionModeUiModel import org.wordpress.android.ui.mediapicker.MediaPickerViewModel.BrowseMenuUiModel.BrowseAction.DEVICE @@ -86,7 +85,6 @@ class MediaPickerFragment : Fragment(), MenuProvider { enum class MediaPickerIconType { ANDROID_CHOOSE_FROM_DEVICE, SWITCH_SOURCE, - WP_STORIES_CAPTURE, CAPTURE_PHOTO; companion object { @@ -117,7 +115,6 @@ class MediaPickerFragment : Fragment(), MenuProvider { val allowMultipleSelection: Boolean ) : MediaPickerAction() - data class OpenCameraForWPStories(val allowMultipleSelection: Boolean) : MediaPickerAction() object OpenCameraForPhotos : MediaPickerAction() data class SwitchMediaPicker(val mediaPickerSetup: MediaPickerSetup) : MediaPickerAction() } @@ -128,8 +125,6 @@ class MediaPickerFragment : Fragment(), MenuProvider { ) : MediaPickerIcon(ANDROID_CHOOSE_FROM_DEVICE) data class SwitchSource(val dataSource: DataSource) : MediaPickerIcon(SWITCH_SOURCE) - - object WpStoriesCapture : MediaPickerIcon(WP_STORIES_CAPTURE) object CapturePhoto : MediaPickerIcon(CAPTURE_PHOTO) fun toBundle(bundle: Bundle) { @@ -145,7 +140,6 @@ class MediaPickerFragment : Fragment(), MenuProvider { bundle.putInt(KEY_LAST_TAPPED_ICON_DATA_SOURCE, this.dataSource.ordinal) } is CapturePhoto -> Unit // Do nothing - is WpStoriesCapture -> Unit // Do nothing } } @@ -164,7 +158,6 @@ class MediaPickerFragment : Fragment(), MenuProvider { }.toSet() ChooseFromAndroidDevice(allowedTypes) } - WP_STORIES_CAPTURE -> WpStoriesCapture CAPTURE_PHOTO -> CapturePhoto SWITCH_SOURCE -> { val ordinal = bundle.getInt(KEY_LAST_TAPPED_ICON_DATA_SOURCE, -1) diff --git a/WordPress/src/main/java/org/wordpress/android/ui/mediapicker/MediaPickerSetup.kt b/WordPress/src/main/java/org/wordpress/android/ui/mediapicker/MediaPickerSetup.kt index 5cb2ebf4c0ca..3752aee242d0 100644 --- a/WordPress/src/main/java/org/wordpress/android/ui/mediapicker/MediaPickerSetup.kt +++ b/WordPress/src/main/java/org/wordpress/android/ui/mediapicker/MediaPickerSetup.kt @@ -24,7 +24,7 @@ data class MediaPickerSetup( } enum class CameraSetup { - STORIES, ENABLED, HIDDEN + ENABLED, HIDDEN } fun toBundle(bundle: Bundle) { diff --git a/WordPress/src/main/java/org/wordpress/android/ui/mediapicker/MediaPickerTracker.kt b/WordPress/src/main/java/org/wordpress/android/ui/mediapicker/MediaPickerTracker.kt index 874a7687211c..79e2186af4e5 100644 --- a/WordPress/src/main/java/org/wordpress/android/ui/mediapicker/MediaPickerTracker.kt +++ b/WordPress/src/main/java/org/wordpress/android/ui/mediapicker/MediaPickerTracker.kt @@ -10,7 +10,6 @@ import org.wordpress.android.analytics.AnalyticsTracker.Stat.MEDIA_PICKER_OPEN_D import org.wordpress.android.analytics.AnalyticsTracker.Stat.MEDIA_PICKER_OPEN_GIF_LIBRARY import org.wordpress.android.analytics.AnalyticsTracker.Stat.MEDIA_PICKER_OPEN_STOCK_LIBRARY import org.wordpress.android.analytics.AnalyticsTracker.Stat.MEDIA_PICKER_OPEN_WP_MEDIA -import org.wordpress.android.analytics.AnalyticsTracker.Stat.MEDIA_PICKER_OPEN_WP_STORIES_CAPTURE import org.wordpress.android.analytics.AnalyticsTracker.Stat.MEDIA_PICKER_PREVIEW_OPENED import org.wordpress.android.analytics.AnalyticsTracker.Stat.MEDIA_PICKER_RECENT_MEDIA_SELECTED import org.wordpress.android.analytics.AnalyticsTracker.Stat.MEDIA_PICKER_SEARCH_COLLAPSED @@ -80,10 +79,6 @@ class MediaPickerTracker fun trackIconClick(icon: MediaPickerIcon, mediaPickerSetup: MediaPickerSetup) { when (icon) { - is MediaPickerIcon.WpStoriesCapture -> analyticsTrackerWrapper.track( - MEDIA_PICKER_OPEN_WP_STORIES_CAPTURE, - mediaPickerSetup.toProperties() - ) is MediaPickerIcon.ChooseFromAndroidDevice -> analyticsTrackerWrapper.track( MEDIA_PICKER_OPEN_DEVICE_LIBRARY, mediaPickerSetup.toProperties() diff --git a/WordPress/src/main/java/org/wordpress/android/ui/mediapicker/MediaPickerViewModel.kt b/WordPress/src/main/java/org/wordpress/android/ui/mediapicker/MediaPickerViewModel.kt index 78fd876ae461..829bd0f78252 100644 --- a/WordPress/src/main/java/org/wordpress/android/ui/mediapicker/MediaPickerViewModel.kt +++ b/WordPress/src/main/java/org/wordpress/android/ui/mediapicker/MediaPickerViewModel.kt @@ -25,17 +25,14 @@ import org.wordpress.android.ui.mediapicker.MediaNavigationEvent.PreviewUrl import org.wordpress.android.ui.mediapicker.MediaPickerFragment.ChooserContext import org.wordpress.android.ui.mediapicker.MediaPickerFragment.MediaPickerAction import org.wordpress.android.ui.mediapicker.MediaPickerFragment.MediaPickerAction.OpenCameraForPhotos -import org.wordpress.android.ui.mediapicker.MediaPickerFragment.MediaPickerAction.OpenCameraForWPStories import org.wordpress.android.ui.mediapicker.MediaPickerFragment.MediaPickerAction.OpenSystemPicker import org.wordpress.android.ui.mediapicker.MediaPickerFragment.MediaPickerAction.SwitchMediaPicker import org.wordpress.android.ui.mediapicker.MediaPickerFragment.MediaPickerIcon import org.wordpress.android.ui.mediapicker.MediaPickerFragment.MediaPickerIcon.CapturePhoto import org.wordpress.android.ui.mediapicker.MediaPickerFragment.MediaPickerIcon.ChooseFromAndroidDevice import org.wordpress.android.ui.mediapicker.MediaPickerFragment.MediaPickerIcon.SwitchSource -import org.wordpress.android.ui.mediapicker.MediaPickerFragment.MediaPickerIcon.WpStoriesCapture import org.wordpress.android.ui.mediapicker.MediaPickerSetup.CameraSetup.ENABLED import org.wordpress.android.ui.mediapicker.MediaPickerSetup.CameraSetup.HIDDEN -import org.wordpress.android.ui.mediapicker.MediaPickerSetup.CameraSetup.STORIES import org.wordpress.android.ui.mediapicker.MediaPickerSetup.DataSource.DEVICE import org.wordpress.android.ui.mediapicker.MediaPickerSetup.DataSource.GIF_LIBRARY import org.wordpress.android.ui.mediapicker.MediaPickerSetup.DataSource.STOCK_LIBRARY @@ -496,7 +493,7 @@ class MediaPickerViewModel @Inject constructor( private fun clickIcon(icon: MediaPickerIcon) { mediaPickerTracker.trackIconClick(icon, mediaPickerSetup) - if (icon is WpStoriesCapture || icon is CapturePhoto) { + if (icon is CapturePhoto) { if (!permissionsHandler.hasPermissionsToTakePhoto()) { _onCameraPermissionsRequested.value = Event(Unit) lastTappedIcon = icon @@ -510,7 +507,6 @@ class MediaPickerViewModel @Inject constructor( private fun clickOnCamera() { when (mediaPickerSetup.cameraSetup) { - STORIES -> clickIcon(WpStoriesCapture) ENABLED -> clickIcon(CapturePhoto) HIDDEN -> { // Do nothing @@ -547,7 +543,6 @@ class MediaPickerViewModel @Inject constructor( } OpenSystemPicker(context, types.toList(), canMultiselect) } - is WpStoriesCapture -> OpenCameraForWPStories(canMultiselect) is CapturePhoto -> OpenCameraForPhotos is SwitchSource -> { SwitchMediaPicker( diff --git a/WordPress/src/main/java/org/wordpress/android/ui/mysite/MySiteFragment.kt b/WordPress/src/main/java/org/wordpress/android/ui/mysite/MySiteFragment.kt index debb2b7b5aab..b468a9904a0b 100644 --- a/WordPress/src/main/java/org/wordpress/android/ui/mysite/MySiteFragment.kt +++ b/WordPress/src/main/java/org/wordpress/android/ui/mysite/MySiteFragment.kt @@ -255,9 +255,6 @@ class MySiteFragment : Fragment(R.layout.my_site_fragment), } } RequestCodes.STORIES_PHOTO_PICKER, - RequestCodes.PHOTO_PICKER -> if (resultCode == Activity.RESULT_OK) { - viewModel.handleStoriesPhotoPickerResult(data) - } UCrop.REQUEST_CROP -> { if (resultCode == UCrop.RESULT_ERROR) { AppLog.e( @@ -613,20 +610,6 @@ class MySiteFragment : Fragment(R.layout.my_site_fragment), is SiteNavigationAction.StartWPComLoginForJetpackStats -> ActivityLauncher.loginForJetpackStats(this@MySiteFragment) is SiteNavigationAction.OpenStories -> ActivityLauncher.viewStories(activity, action.site, action.event) - is SiteNavigationAction.AddNewStory -> - ActivityLauncher.addNewStoryForResult(activity, action.site, action.source) - is SiteNavigationAction.AddNewStoryWithMediaIds -> ActivityLauncher.addNewStoryWithMediaIdsForResult( - activity, - action.site, - action.source, - action.mediaIds.toLongArray() - ) - is SiteNavigationAction.AddNewStoryWithMediaUris -> ActivityLauncher.addNewStoryWithMediaUrisForResult( - activity, - action.site, - action.source, - action.mediaUris.toTypedArray() - ) is SiteNavigationAction.OpenDomains -> ActivityLauncher.viewDomainsDashboardActivity( activity, action.site diff --git a/WordPress/src/main/java/org/wordpress/android/ui/mysite/MySiteViewModel.kt b/WordPress/src/main/java/org/wordpress/android/ui/mysite/MySiteViewModel.kt index 2c51f7655bc6..3925474efcce 100644 --- a/WordPress/src/main/java/org/wordpress/android/ui/mysite/MySiteViewModel.kt +++ b/WordPress/src/main/java/org/wordpress/android/ui/mysite/MySiteViewModel.kt @@ -125,7 +125,6 @@ class MySiteViewModel @Inject constructor( private val accountStore: AccountStore, private val selectedSiteRepository: SelectedSiteRepository, private val siteIconUploadHandler: SiteIconUploadHandler, - private val siteStoriesHandler: SiteStoriesHandler, private val displayUtilsWrapper: DisplayUtilsWrapper, private val quickStartRepository: QuickStartRepository, private val quickStartCardBuilder: QuickStartCardBuilder, @@ -206,7 +205,6 @@ class MySiteViewModel @Inject constructor( } val onSnackbarMessage = merge( _onSnackbarMessage, - siteStoriesHandler.onSnackbar, quickStartRepository.onSnackbar, siteItemsViewModelSlice.onSnackbarMessage, bloggingPromptCardViewModelSlice.onSnackbarMessage, @@ -221,7 +219,6 @@ class MySiteViewModel @Inject constructor( val onNavigation = merge( _onNavigation, - siteStoriesHandler.onNavigation, blazeCardViewModelSlice.onNavigation, pagesCardViewModelSlice.onNavigation, todaysStatsViewModelSlice.onNavigation, @@ -781,19 +778,12 @@ class MySiteViewModel @Inject constructor( override fun onCleared() { siteIconUploadHandler.clear() - siteStoriesHandler.clear() quickStartRepository.clear() mySiteSourceManager.clear() dispatcher.unregister(this) super.onCleared() } - fun handleStoriesPhotoPickerResult(data: Intent) { - selectedSiteRepository.getSelectedSite()?.let { - siteStoriesHandler.handleStoriesResult(it, data, STORY_FROM_MY_SITE) - } - } - fun onSitePicked() { selectedSiteRepository.getSelectedSite()?.let { val siteLocalId = it.id.toLong() diff --git a/WordPress/src/main/java/org/wordpress/android/ui/mysite/SiteNavigationAction.kt b/WordPress/src/main/java/org/wordpress/android/ui/mysite/SiteNavigationAction.kt index 4fbfff996878..a762ef5834aa 100644 --- a/WordPress/src/main/java/org/wordpress/android/ui/mysite/SiteNavigationAction.kt +++ b/WordPress/src/main/java/org/wordpress/android/ui/mysite/SiteNavigationAction.kt @@ -46,22 +46,6 @@ sealed class SiteNavigationAction { data class OpenStats(val site: SiteModel) : SiteNavigationAction() data class ConnectJetpackForStats(val site: SiteModel) : SiteNavigationAction() data class OpenStories(val site: SiteModel, val event: StorySaveResult) : SiteNavigationAction() - data class AddNewStory( - val site: SiteModel, - val source: PagePostCreationSourcesDetail - ) : SiteNavigationAction() - - data class AddNewStoryWithMediaIds( - val site: SiteModel, - val source: PagePostCreationSourcesDetail, - val mediaIds: List - ) : SiteNavigationAction() - - data class AddNewStoryWithMediaUris( - val site: SiteModel, - val source: PagePostCreationSourcesDetail, - val mediaUris: List - ) : SiteNavigationAction() data class OpenDomainRegistration(val site: SiteModel) : SiteNavigationAction() data class OpenPaidDomainSearch(val site: SiteModel) : SiteNavigationAction() diff --git a/WordPress/src/main/java/org/wordpress/android/ui/mysite/SiteStoriesHandler.kt b/WordPress/src/main/java/org/wordpress/android/ui/mysite/SiteStoriesHandler.kt index 6c064d580b08..3c58c99c7f5d 100644 --- a/WordPress/src/main/java/org/wordpress/android/ui/mysite/SiteStoriesHandler.kt +++ b/WordPress/src/main/java/org/wordpress/android/ui/mysite/SiteStoriesHandler.kt @@ -11,13 +11,10 @@ import com.wordpress.stories.compose.story.StoryRepository import org.greenrobot.eventbus.Subscribe import org.greenrobot.eventbus.ThreadMode import org.wordpress.android.R -import org.wordpress.android.analytics.AnalyticsTracker.Stat.STORY_SAVE_ERROR_SNACKBAR_MANAGE_TAPPED import org.wordpress.android.fluxc.model.SiteModel import org.wordpress.android.ui.PagePostCreationSourcesDetail import org.wordpress.android.ui.mysite.SiteNavigationAction.OpenStories import org.wordpress.android.ui.pages.SnackbarMessageHolder -import org.wordpress.android.ui.stories.StoriesMediaPickerResultHandler -import org.wordpress.android.ui.stories.StoriesTrackerHelper import org.wordpress.android.ui.utils.UiString.UiStringRes import org.wordpress.android.ui.utils.UiString.UiStringText import org.wordpress.android.util.EventBusWrapper @@ -31,15 +28,12 @@ class SiteStoriesHandler @Inject constructor( private val eventBusWrapper: EventBusWrapper, private val resourceProvider: ResourceProvider, - private val storiesTrackerHelper: StoriesTrackerHelper, private val contextProvider: ContextProvider, private val selectedSiteRepository: SelectedSiteRepository, - private val storiesMediaPickerResultHandler: StoriesMediaPickerResultHandler ) { private val _onSnackbar = MutableLiveData>() - val onSnackbar = _onSnackbar as LiveData> private val _onNavigation = MutableLiveData>() - val onNavigation = merge(_onNavigation, storiesMediaPickerResultHandler.onNavigation) + val onNavigation = merge(_onNavigation) init { eventBusWrapper.register(this) @@ -73,10 +67,6 @@ class SiteStoriesHandler val selectedSite = selectedSiteRepository.getSelectedSite() ?: return@SnackbarMessageHolder _onNavigation.postValue(Event(OpenStories(selectedSite, event))) - storiesTrackerHelper.trackStorySaveResultEvent( - event, - STORY_SAVE_ERROR_SNACKBAR_MANAGE_TAPPED - ) }, onDismissAction = { } ) @@ -84,18 +74,4 @@ class SiteStoriesHandler ) } } - - @Subscribe(sticky = true, threadMode = ThreadMode.MAIN) - fun onStorySaveStart(event: StorySaveProcessStart) { - eventBusWrapper.removeStickyEvent(event) - val snackbarMessage = String.format( - resourceProvider.getString(R.string.story_saving_snackbar_started), - StoryRepository.getStoryAtIndex(event.storyIndex).title - ) - _onSnackbar.postValue(Event(SnackbarMessageHolder(UiStringText(snackbarMessage)))) - } - - fun handleStoriesResult(siteModel: SiteModel, data: Intent, source: PagePostCreationSourcesDetail) { - storiesMediaPickerResultHandler.handleMediaPickerResultForStories(data, siteModel, source) - } } diff --git a/WordPress/src/main/java/org/wordpress/android/ui/photopicker/MediaPickerConstants.kt b/WordPress/src/main/java/org/wordpress/android/ui/photopicker/MediaPickerConstants.kt index 86c2161cc617..7b964b8d8f7d 100644 --- a/WordPress/src/main/java/org/wordpress/android/ui/photopicker/MediaPickerConstants.kt +++ b/WordPress/src/main/java/org/wordpress/android/ui/photopicker/MediaPickerConstants.kt @@ -4,8 +4,6 @@ object MediaPickerConstants { const val EXTRA_MEDIA_URIS = "media_uris" const val EXTRA_MEDIA_QUEUED_URIS = "queued_media_uris" const val EXTRA_MEDIA_ID = "media_id" - const val EXTRA_LAUNCH_WPSTORIES_CAMERA_REQUESTED = "launch_wpstories_camera_requested" - const val EXTRA_LAUNCH_WPSTORIES_MEDIA_PICKER_REQUESTED = "launch_wpstories_media_picker_requested" const val EXTRA_SAVED_MEDIA_MODEL_LOCAL_IDS = "saved_media_model_local_ids" // the enum name of the source will be returned as a string in EXTRA_MEDIA_SOURCE diff --git a/WordPress/src/main/java/org/wordpress/android/ui/photopicker/MediaPickerLauncher.kt b/WordPress/src/main/java/org/wordpress/android/ui/photopicker/MediaPickerLauncher.kt index 5170e3b31ab1..f64ef2e2cae7 100644 --- a/WordPress/src/main/java/org/wordpress/android/ui/photopicker/MediaPickerLauncher.kt +++ b/WordPress/src/main/java/org/wordpress/android/ui/photopicker/MediaPickerLauncher.kt @@ -5,18 +5,14 @@ import android.content.Intent import androidx.annotation.StringRes import androidx.fragment.app.Fragment import org.wordpress.android.R -import org.wordpress.android.analytics.AnalyticsTracker.Stat import org.wordpress.android.fluxc.model.SiteModel -import org.wordpress.android.ui.ActivityLauncher import org.wordpress.android.ui.RequestCodes import org.wordpress.android.ui.media.MediaBrowserType import org.wordpress.android.ui.media.MediaBrowserType.FEATURED_IMAGE_PICKER -import org.wordpress.android.ui.media.MediaBrowserType.WP_STORIES_MEDIA_PICKER import org.wordpress.android.ui.mediapicker.MediaPickerActivity import org.wordpress.android.ui.mediapicker.MediaPickerSetup import org.wordpress.android.ui.mediapicker.MediaPickerSetup.CameraSetup.ENABLED import org.wordpress.android.ui.mediapicker.MediaPickerSetup.CameraSetup.HIDDEN -import org.wordpress.android.ui.mediapicker.MediaPickerSetup.CameraSetup.STORIES import org.wordpress.android.ui.mediapicker.MediaPickerSetup.DataSource.DEVICE import org.wordpress.android.ui.mediapicker.MediaPickerSetup.DataSource.GIF_LIBRARY import org.wordpress.android.ui.mediapicker.MediaPickerSetup.DataSource.STOCK_LIBRARY @@ -117,19 +113,6 @@ class MediaPickerLauncher @Inject constructor( activity.startActivityForResult(intent, RequestCodes.PHOTO_PICKER) } - fun showStoriesPhotoPickerForResultAndTrack(activity: Activity, site: SiteModel?) { - analyticsTrackerWrapper.track(Stat.MEDIA_PICKER_OPEN_FOR_STORIES) - showStoriesPhotoPickerForResult(activity, site) - } - - @Suppress("DEPRECATION") - fun showStoriesPhotoPickerForResult( - activity: Activity, - site: SiteModel? - ) { - ActivityLauncher.showPhotoPickerForResult(activity, WP_STORIES_MEDIA_PICKER, site, null) - } - @Suppress("DEPRECATION") fun showGravatarPicker(fragment: Fragment) { val mediaPickerSetup = MediaPickerSetup( @@ -299,12 +282,12 @@ class MediaPickerLauncher @Inject constructor( } return MediaPickerSetup( primaryDataSource = DEVICE, - availableDataSources = if (browserType.isWPStoriesPicker) setOf(WP_LIBRARY) else setOf(), + availableDataSources = setOf(), canMultiselect = browserType.canMultiselect(), requiresPhotosVideosPermissions = browserType.isImagePicker || browserType.isVideoPicker, requiresMusicAudioPermissions = browserType.isAudioPicker, allowedTypes = allowedTypes, - cameraSetup = if (browserType.isWPStoriesPicker) STORIES else HIDDEN, + cameraSetup = HIDDEN, systemPickerEnabled = true, editingEnabled = browserType.isImagePicker, queueResults = browserType == FEATURED_IMAGE_PICKER, @@ -337,7 +320,7 @@ class MediaPickerLauncher @Inject constructor( requiresPhotosVideosPermissions = false, requiresMusicAudioPermissions = false, allowedTypes = allowedTypes, - cameraSetup = if (browserType.isWPStoriesPicker) STORIES else HIDDEN, + cameraSetup = HIDDEN, systemPickerEnabled = false, editingEnabled = false, queueResults = false, diff --git a/WordPress/src/main/java/org/wordpress/android/ui/photopicker/PhotoPickerActivity.java b/WordPress/src/main/java/org/wordpress/android/ui/photopicker/PhotoPickerActivity.java index 74688c461e54..ecb826c1a67f 100644 --- a/WordPress/src/main/java/org/wordpress/android/ui/photopicker/PhotoPickerActivity.java +++ b/WordPress/src/main/java/org/wordpress/android/ui/photopicker/PhotoPickerActivity.java @@ -258,13 +258,6 @@ private void launchStockMediaPicker() { } } - private void launchWPStoriesCamera() { - Intent intent = new Intent() - .putExtra(MediaPickerConstants.EXTRA_LAUNCH_WPSTORIES_CAMERA_REQUESTED, true); - setResult(RESULT_OK, intent); - finish(); - } - private void doMediaUrisSelected(@NonNull List mediaUris, @NonNull PhotoPickerMediaSource source) { // if user chose a featured image, we need to upload it and return the uploaded media object if (mBrowserType == MediaBrowserType.FEATURED_IMAGE_PICKER) { @@ -289,12 +282,12 @@ public void doNext(Uri uri) { switch (queueImageResult) { case FILE_NOT_FOUND: Toast.makeText(getApplicationContext(), - R.string.file_not_found, Toast.LENGTH_SHORT) + R.string.file_not_found, Toast.LENGTH_SHORT) .show(); break; case INVALID_POST_ID: Toast.makeText(getApplicationContext(), - R.string.error_generic, Toast.LENGTH_SHORT) + R.string.error_generic, Toast.LENGTH_SHORT) .show(); break; case SUCCESS: @@ -319,24 +312,19 @@ public void doNext(Uri uri) { private void doMediaIdsSelected(ArrayList mediaIds, @NonNull PhotoPickerMediaSource source) { if (mediaIds != null && mediaIds.size() > 0) { - if (mBrowserType == MediaBrowserType.WP_STORIES_MEDIA_PICKER) { - // TODO WPSTORIES add TRACKS (see how it's tracked below? maybe do along the same lines) - getPickerFragment().mediaIdsSelectedFromWPMediaPicker(mediaIds); - } else { - // if user chose a featured image, track image picked event - if (mBrowserType == MediaBrowserType.FEATURED_IMAGE_PICKER) { - mFeaturedImageHelper.trackFeaturedImageEvent( - FeaturedImageHelper.TrackableEvent.IMAGE_PICKED_POST_SETTINGS, - mLocalPostId - ); - } - - Intent data = new Intent() - .putExtra(MediaPickerConstants.EXTRA_MEDIA_ID, mediaIds.get(0)) - .putExtra(MediaPickerConstants.EXTRA_MEDIA_SOURCE, source.name()); - setResult(RESULT_OK, data); - finish(); + // if user chose a featured image, track image picked event + if (mBrowserType == MediaBrowserType.FEATURED_IMAGE_PICKER) { + mFeaturedImageHelper.trackFeaturedImageEvent( + FeaturedImageHelper.TrackableEvent.IMAGE_PICKED_POST_SETTINGS, + mLocalPostId + ); } + + Intent data = new Intent() + .putExtra(MediaPickerConstants.EXTRA_MEDIA_ID, mediaIds.get(0)) + .putExtra(MediaPickerConstants.EXTRA_MEDIA_SOURCE, source.name()); + setResult(RESULT_OK, data); + finish(); } else { throw new IllegalArgumentException("call to doMediaIdsSelected with null or empty mediaIds array"); } @@ -367,9 +355,6 @@ public void onPhotoPickerIconClicked(@NonNull PhotoPickerFragment.PhotoPickerIco case STOCK_MEDIA: launchStockMediaPicker(); break; - case WP_STORIES_CAPTURE: - launchWPStoriesCamera(); - break; } } diff --git a/WordPress/src/main/java/org/wordpress/android/ui/photopicker/PhotoPickerFragment.kt b/WordPress/src/main/java/org/wordpress/android/ui/photopicker/PhotoPickerFragment.kt index dceb7c412570..54199ca408bb 100644 --- a/WordPress/src/main/java/org/wordpress/android/ui/photopicker/PhotoPickerFragment.kt +++ b/WordPress/src/main/java/org/wordpress/android/ui/photopicker/PhotoPickerFragment.kt @@ -57,8 +57,7 @@ class PhotoPickerFragment : Fragment(R.layout.photo_picker_fragment) { ANDROID_CHOOSE_PHOTO_OR_VIDEO(true), WP_MEDIA(false), STOCK_MEDIA(true), - GIF(true), - WP_STORIES_CAPTURE(true); + GIF(true); fun requiresUploadPermission(): Boolean { return mRequiresUploadPermission diff --git a/WordPress/src/main/java/org/wordpress/android/ui/photopicker/PhotoPickerViewModel.kt b/WordPress/src/main/java/org/wordpress/android/ui/photopicker/PhotoPickerViewModel.kt index f14ab93a5f90..5d776d26dd2c 100644 --- a/WordPress/src/main/java/org/wordpress/android/ui/photopicker/PhotoPickerViewModel.kt +++ b/WordPress/src/main/java/org/wordpress/android/ui/photopicker/PhotoPickerViewModel.kt @@ -13,7 +13,6 @@ import org.wordpress.android.analytics.AnalyticsTracker.Stat import org.wordpress.android.analytics.AnalyticsTracker.Stat.MEDIA_PICKER_OPEN_CAPTURE_MEDIA import org.wordpress.android.analytics.AnalyticsTracker.Stat.MEDIA_PICKER_OPEN_DEVICE_LIBRARY import org.wordpress.android.analytics.AnalyticsTracker.Stat.MEDIA_PICKER_OPEN_WP_MEDIA -import org.wordpress.android.analytics.AnalyticsTracker.Stat.MEDIA_PICKER_OPEN_WP_STORIES_CAPTURE import org.wordpress.android.analytics.AnalyticsTracker.Stat.MEDIA_PICKER_PREVIEW_OPENED import org.wordpress.android.analytics.AnalyticsTracker.Stat.MEDIA_PICKER_RECENT_MEDIA_SELECTED import org.wordpress.android.fluxc.model.SiteModel @@ -97,8 +96,8 @@ class PhotoPickerViewModel @Inject constructor( softAskRequest?.show == true, ), buildSoftAskView(softAskRequest), - FabUiModel(browserType.isWPStoriesPicker && selectedIds.isNullOrEmpty()) { - clickIcon(PhotoPickerFragment.PhotoPickerIcon.WP_STORIES_CAPTURE) + FabUiModel(selectedIds.isNullOrEmpty()) { + clickIcon(PhotoPickerFragment.PhotoPickerIcon.ANDROID_CAPTURE_PHOTO) }, buildActionModeUiModel(selectedIds), progressDialogModel ?: ProgressDialogUiModel.Hidden, @@ -205,7 +204,7 @@ class PhotoPickerViewModel @Inject constructor( } val insertEditTextBarVisible = count != 0 && browserType.isGutenbergPicker && !isVideoSelected - val showCamera = !browserType.isGutenbergPicker && !browserType.isWPStoriesPicker + val showCamera = !browserType.isGutenbergPicker return BottomBarUiModel( type = defaultBottomBar, insertEditTextBarVisible = insertEditTextBarVisible, @@ -319,8 +318,7 @@ class PhotoPickerViewModel @Inject constructor( @Suppress("DEPRECATION") fun clickIcon(icon: PhotoPickerFragment.PhotoPickerIcon) { if (icon == PhotoPickerFragment.PhotoPickerIcon.ANDROID_CAPTURE_PHOTO || - icon == PhotoPickerFragment.PhotoPickerIcon.ANDROID_CAPTURE_VIDEO || - icon == PhotoPickerFragment.PhotoPickerIcon.WP_STORIES_CAPTURE + icon == PhotoPickerFragment.PhotoPickerIcon.ANDROID_CAPTURE_VIDEO ) { if (!permissionsHandler.hasPermissionsToTakePhoto()) { _onCameraPermissionsRequested.value = Event(Unit) @@ -352,10 +350,6 @@ class PhotoPickerViewModel @Inject constructor( PhotoPickerFragment.PhotoPickerIcon.WP_MEDIA -> AnalyticsTracker.track(MEDIA_PICKER_OPEN_WP_MEDIA) PhotoPickerFragment.PhotoPickerIcon.STOCK_MEDIA -> Unit // Do nothing PhotoPickerFragment.PhotoPickerIcon.GIF -> Unit // Do nothing - PhotoPickerFragment.PhotoPickerIcon.WP_STORIES_CAPTURE -> AnalyticsTracker.track( - MEDIA_PICKER_OPEN_WP_STORIES_CAPTURE - ) - PhotoPickerFragment.PhotoPickerIcon.ANDROID_CHOOSE_PHOTO_OR_VIDEO -> Unit // Do nothing } _onIconClicked.postValue(Event(IconClickEvent(icon, browserType.canMultiselect()))) @@ -413,11 +407,9 @@ class PhotoPickerViewModel @Inject constructor( clickIcon(PhotoPickerFragment.PhotoPickerIcon.STOCK_MEDIA) }) // only show GIF picker from Tenor if this is NOT the WPStories picker - if (!browserType.isWPStoriesPicker) { - items.add(PopupMenuUiModel.PopupMenuItem(UiStringRes(R.string.photo_picker_gif)) { - clickIcon(PhotoPickerFragment.PhotoPickerIcon.GIF) - }) - } + items.add(PopupMenuUiModel.PopupMenuItem(UiStringRes(R.string.photo_picker_gif)) { + clickIcon(PhotoPickerFragment.PhotoPickerIcon.GIF) + }) } if (items.size == 1) { items[0].action() diff --git a/WordPress/src/main/java/org/wordpress/android/ui/posts/EditPostActivity.java b/WordPress/src/main/java/org/wordpress/android/ui/posts/EditPostActivity.java index a6884db857a2..5a4637715143 100644 --- a/WordPress/src/main/java/org/wordpress/android/ui/posts/EditPostActivity.java +++ b/WordPress/src/main/java/org/wordpress/android/ui/posts/EditPostActivity.java @@ -2513,7 +2513,7 @@ private GutenbergPropsBuilder getGutenbergPropsBuilder() { SiteUtils.supportsEmbedVariationFeature(mSite, SiteUtils.WP_INSTAGRAM_EMBED_JETPACK_VERSION), SiteUtils.supportsEmbedVariationFeature(mSite, SiteUtils.WP_LOOM_EMBED_JETPACK_VERSION), SiteUtils.supportsEmbedVariationFeature(mSite, SiteUtils.WP_SMARTFRAME_EMBED_JETPACK_VERSION), - SiteUtils.supportsStoriesFeature(mSite, mJetpackFeatureRemovalPhaseHelper), + false, mSite.isUsingWpComRestApi(), enableXPosts, isUnsupportedBlockEditorEnabled, diff --git a/WordPress/src/main/java/org/wordpress/android/ui/posts/PostActionHandler.kt b/WordPress/src/main/java/org/wordpress/android/ui/posts/PostActionHandler.kt index 3027f6a20bbc..4b441c744a09 100644 --- a/WordPress/src/main/java/org/wordpress/android/ui/posts/PostActionHandler.kt +++ b/WordPress/src/main/java/org/wordpress/android/ui/posts/PostActionHandler.kt @@ -153,10 +153,6 @@ class PostActionHandler( triggerPostListAction(PostListAction.NewPost(site)) } - fun newStoryPost() { - triggerPostListAction(PostListAction.NewStoryPost(site)) - } - fun handleEditPostResult(data: Intent?) { val localPostId = data?.getIntExtra(EditPostActivity.EXTRA_POST_LOCAL_ID, 0) if (localPostId == null || localPostId == 0) { diff --git a/WordPress/src/main/java/org/wordpress/android/ui/posts/PostListAction.kt b/WordPress/src/main/java/org/wordpress/android/ui/posts/PostListAction.kt index 6954fe44dca5..2243935050b1 100644 --- a/WordPress/src/main/java/org/wordpress/android/ui/posts/PostListAction.kt +++ b/WordPress/src/main/java/org/wordpress/android/ui/posts/PostListAction.kt @@ -8,19 +8,15 @@ import org.wordpress.android.ui.ActivityLauncher import org.wordpress.android.ui.PagePostCreationSourcesDetail.POST_FROM_POSTS_LIST import org.wordpress.android.ui.blaze.BlazeFeatureUtils import org.wordpress.android.ui.blaze.BlazeFlowSource -import org.wordpress.android.ui.photopicker.MediaPickerLauncher import org.wordpress.android.ui.posts.RemotePreviewLogicHelper.RemotePreviewType -import org.wordpress.android.ui.prefs.AppPrefs import org.wordpress.android.ui.reader.ReaderActivityLauncher import org.wordpress.android.ui.reader.ReaderPostPagerActivity -import org.wordpress.android.ui.stories.intro.StoriesIntroDialogFragment import org.wordpress.android.ui.uploads.UploadService import org.wordpress.android.viewmodel.helpers.ToastMessageHolder sealed class PostListAction { class EditPost(val site: SiteModel, val post: PostModel, val loadAutoSaveRevision: Boolean) : PostListAction() class NewPost(val site: SiteModel, val isPromo: Boolean = false) : PostListAction() - class NewStoryPost(val site: SiteModel) : PostListAction() class PreviewPost( val site: SiteModel, val post: PostModel, @@ -54,7 +50,6 @@ fun handlePostListAction( action: PostListAction, remotePreviewLogicHelper: RemotePreviewLogicHelper, previewStateHelper: PreviewStateHelper, - mediaPickerLauncher: MediaPickerLauncher, blazeFeatureUtils: BlazeFeatureUtils ) { when (action) { @@ -64,14 +59,6 @@ fun handlePostListAction( is PostListAction.NewPost -> { ActivityLauncher.addNewPostForResult(activity, action.site, action.isPromo, POST_FROM_POSTS_LIST, -1, null) } - is PostListAction.NewStoryPost -> { - if (AppPrefs.shouldShowStoriesIntro()) { - StoriesIntroDialogFragment.newInstance(action.site) - .show(activity.supportFragmentManager, StoriesIntroDialogFragment.TAG) - } else { - mediaPickerLauncher.showStoriesPhotoPickerForResultAndTrack(activity, action.site) - } - } is PostListAction.PreviewPost -> { val helperFunctions = previewStateHelper.getUploadStrategyFunctions(activity, action) remotePreviewLogicHelper.runPostPreviewLogic( diff --git a/WordPress/src/main/java/org/wordpress/android/ui/posts/PostsListActivity.kt b/WordPress/src/main/java/org/wordpress/android/ui/posts/PostsListActivity.kt index 007fa44e5b05..21dca99ca6b4 100644 --- a/WordPress/src/main/java/org/wordpress/android/ui/posts/PostsListActivity.kt +++ b/WordPress/src/main/java/org/wordpress/android/ui/posts/PostsListActivity.kt @@ -57,7 +57,6 @@ import org.wordpress.android.ui.posts.prepublishing.PrepublishingBottomSheetFrag import org.wordpress.android.ui.posts.prepublishing.home.PublishPost import org.wordpress.android.ui.posts.prepublishing.listeners.PrepublishingBottomSheetListener import org.wordpress.android.ui.review.ReviewViewModel -import org.wordpress.android.ui.stories.StoriesMediaPickerResultHandler import org.wordpress.android.ui.uploads.UploadActionUseCase import org.wordpress.android.ui.uploads.UploadUtilsWrapper import org.wordpress.android.ui.utils.UiHelpers @@ -122,9 +121,6 @@ class PostsListActivity : LocaleAwareActivity(), @Inject internal lateinit var mediaPickerLauncher: MediaPickerLauncher - @Inject - internal lateinit var storiesMediaPickerResultHandler: StoriesMediaPickerResultHandler - @Inject internal lateinit var bloggingRemindersViewModel: BloggingRemindersViewModel @@ -282,7 +278,6 @@ class PostsListActivity : LocaleAwareActivity(), action, remotePreviewLogicHelper, previewStateHelper, - mediaPickerLauncher, blazeFeatureUtils ) } @@ -475,26 +470,6 @@ class PostsListActivity : LocaleAwareActivity(), requestCode == RequestCodes.REMOTE_PREVIEW_POST -> { viewModel.handleRemotePreviewClosing() } - - requestCode == RequestCodes.PHOTO_PICKER && - resultCode == Activity.RESULT_OK && - data != null -> { - storiesMediaPickerResultHandler.handleMediaPickerResultForStories( - data, - this, - site, - STORY_FROM_POSTS_LIST - ) - } - - requestCode == RequestCodes.CREATE_STORY -> { - val isNewStory = data?.getStringExtra(GutenbergEditorFragment.ARG_STORY_BLOCK_ID) == null - bloggingRemindersViewModel.onPublishingPost( - site.id, - isNewStory - ) - reviewViewModel.onPublishingPost(isNewStory) - } } } diff --git a/WordPress/src/main/java/org/wordpress/android/ui/prefs/AppPrefs.java b/WordPress/src/main/java/org/wordpress/android/ui/prefs/AppPrefs.java index bfb0ae37d01a..f744d2d7be22 100644 --- a/WordPress/src/main/java/org/wordpress/android/ui/prefs/AppPrefs.java +++ b/WordPress/src/main/java/org/wordpress/android/ui/prefs/AppPrefs.java @@ -269,9 +269,6 @@ public enum UndeletablePrefKey implements PrefKey { // last app version code feature announcement was shown for LAST_FEATURE_ANNOUNCEMENT_APP_VERSION_CODE, - // Used to indicate whether or not the stories intro screen must be shown - SHOULD_SHOW_STORIES_INTRO, - // Used to indicate whether or not the device running out of storage warning should be shown SHOULD_SHOW_STORAGE_WARNING, @@ -1204,14 +1201,6 @@ public static void setReaderRecommendedTagsDeletedForLoggedOutUser(boolean delet setBoolean(DeletablePrefKey.READER_RECOMMENDED_TAGS_DELETED_FOR_LOGGED_OUT_USER, deleted); } - public static void setShouldShowStoriesIntro(boolean shouldShow) { - setBoolean(UndeletablePrefKey.SHOULD_SHOW_STORIES_INTRO, shouldShow); - } - - public static boolean shouldShowStoriesIntro() { - return getBoolean(UndeletablePrefKey.SHOULD_SHOW_STORIES_INTRO, true); - } - public static void setShouldShowStorageWarning(boolean shouldShow) { setBoolean(UndeletablePrefKey.SHOULD_SHOW_STORAGE_WARNING, shouldShow); } diff --git a/WordPress/src/main/java/org/wordpress/android/ui/prefs/AppPrefsWrapper.kt b/WordPress/src/main/java/org/wordpress/android/ui/prefs/AppPrefsWrapper.kt index 10b8ef20cd04..ade6434827df 100644 --- a/WordPress/src/main/java/org/wordpress/android/ui/prefs/AppPrefsWrapper.kt +++ b/WordPress/src/main/java/org/wordpress/android/ui/prefs/AppPrefsWrapper.kt @@ -71,10 +71,6 @@ class AppPrefsWrapper @Inject constructor() { get() = AppPrefs.getReaderCardsPageHandle() set(pageHandle) = AppPrefs.setReaderCardsPageHandle(pageHandle) - var shouldShowStoriesIntro: Boolean - get() = AppPrefs.shouldShowStoriesIntro() - set(shouldShow) = AppPrefs.setShouldShowStoriesIntro(shouldShow) - var shouldScheduleCreateSiteNotification: Boolean get() = AppPrefs.shouldScheduleCreateSiteNotification() set(shouldSchedule) = AppPrefs.setShouldScheduleCreateSiteNotification(shouldSchedule) diff --git a/WordPress/src/main/java/org/wordpress/android/ui/stories/StoriesAnalyticsReceiver.kt b/WordPress/src/main/java/org/wordpress/android/ui/stories/StoriesAnalyticsReceiver.kt deleted file mode 100644 index 1b64d844f8cd..000000000000 --- a/WordPress/src/main/java/org/wordpress/android/ui/stories/StoriesAnalyticsReceiver.kt +++ /dev/null @@ -1,14 +0,0 @@ -package org.wordpress.android.ui.stories - -import com.wordpress.stories.compose.StoriesAnalyticsListener -import org.wordpress.android.analytics.AnalyticsTracker -import org.wordpress.android.analytics.AnalyticsTracker.Stat - -/** - * Receives tracker-agnostic analytics events from the Stories library and forwards them to [AnalyticsTracker]. - */ -class StoriesAnalyticsReceiver : StoriesAnalyticsListener { - override fun trackStoryTextChanged(properties: Map) { - AnalyticsTracker.track(Stat.STORY_TEXT_CHANGED, properties) - } -} diff --git a/WordPress/src/main/java/org/wordpress/android/ui/stories/StoriesMediaPickerResultHandler.kt b/WordPress/src/main/java/org/wordpress/android/ui/stories/StoriesMediaPickerResultHandler.kt deleted file mode 100644 index fd6b57d8626b..000000000000 --- a/WordPress/src/main/java/org/wordpress/android/ui/stories/StoriesMediaPickerResultHandler.kt +++ /dev/null @@ -1,120 +0,0 @@ -package org.wordpress.android.ui.stories - -import android.app.Activity -import android.content.Intent -import androidx.lifecycle.LiveData -import androidx.lifecycle.MutableLiveData -import org.wordpress.android.fluxc.model.SiteModel -import org.wordpress.android.ui.ActivityLauncher -import org.wordpress.android.ui.PagePostCreationSourcesDetail -import org.wordpress.android.ui.media.MediaBrowserActivity -import org.wordpress.android.ui.media.MediaBrowserType -import org.wordpress.android.ui.mysite.SiteNavigationAction -import org.wordpress.android.ui.mysite.SiteNavigationAction.AddNewStory -import org.wordpress.android.ui.mysite.SiteNavigationAction.AddNewStoryWithMediaIds -import org.wordpress.android.ui.mysite.SiteNavigationAction.AddNewStoryWithMediaUris -import org.wordpress.android.ui.photopicker.MediaPickerConstants -import org.wordpress.android.util.AppLog -import org.wordpress.android.util.AppLog.T.UTILS -import org.wordpress.android.util.extensions.getSerializableExtraCompat -import org.wordpress.android.viewmodel.Event -import javax.inject.Inject - -class StoriesMediaPickerResultHandler -@Inject constructor() { - private val _onNavigation = MutableLiveData>() - val onNavigation = _onNavigation as LiveData> - - @Deprecated("Use rather the other handle method and the live data navigation.") - fun handleMediaPickerResultForStories( - data: Intent, - activity: Activity?, - selectedSite: SiteModel?, - source: PagePostCreationSourcesDetail - ): Boolean { - if (selectedSite == null) { - return false - } - when (val navigationAction = buildNavigationAction(data, selectedSite, source)) { - is AddNewStory -> ActivityLauncher.addNewStoryForResult( - activity, - navigationAction.site, - navigationAction.source - ) - is AddNewStoryWithMediaIds -> ActivityLauncher.addNewStoryWithMediaIdsForResult( - activity, - navigationAction.site, - navigationAction.source, - navigationAction.mediaIds.toLongArray() - ) - is AddNewStoryWithMediaUris -> ActivityLauncher.addNewStoryWithMediaUrisForResult( - activity, - navigationAction.site, - navigationAction.source, - navigationAction.mediaUris.toTypedArray() - ) - else -> { - return false - } - } - - return true - } - - fun handleMediaPickerResultForStories( - data: Intent, - selectedSite: SiteModel, - source: PagePostCreationSourcesDetail - ): Boolean { - val navigationAction = buildNavigationAction(data, selectedSite, source) - return if (navigationAction != null) { - _onNavigation.postValue(Event(navigationAction)) - true - } else { - false - } - } - - private fun buildNavigationAction( - data: Intent, - selectedSite: SiteModel, - source: PagePostCreationSourcesDetail - ): SiteNavigationAction? { - if (data.getBooleanExtra(MediaPickerConstants.EXTRA_LAUNCH_WPSTORIES_CAMERA_REQUESTED, false)) { - return AddNewStory(selectedSite, source) - } else if (isWPStoriesMediaBrowserTypeResult(data)) { - if (data.hasExtra(MediaBrowserActivity.RESULT_IDS)) { - val mediaIds = data.getLongArrayExtra(MediaBrowserActivity.RESULT_IDS)?.asList() ?: listOf() - return AddNewStoryWithMediaIds(selectedSite, source, mediaIds) - } else { - val mediaUriStringsArray = data.getStringArrayExtra( - MediaPickerConstants.EXTRA_MEDIA_URIS - ) - if (mediaUriStringsArray.isNullOrEmpty()) { - AppLog.e( - UTILS, - "Can't resolve picked or captured image" - ) - return null - } - val mediaUris = mediaUriStringsArray.asList() - return AddNewStoryWithMediaUris( - selectedSite, - source, - mediaUris = mediaUris - ) - } - } - return null - } - - private fun isWPStoriesMediaBrowserTypeResult(data: Intent): Boolean { - if (data.hasExtra(MediaBrowserActivity.ARG_BROWSER_TYPE)) { - val browserType = requireNotNull( - data.getSerializableExtraCompat(MediaBrowserActivity.ARG_BROWSER_TYPE) - ) - return browserType.isWPStoriesPicker - } - return false - } -} diff --git a/WordPress/src/main/java/org/wordpress/android/ui/stories/StoriesTrackerHelper.kt b/WordPress/src/main/java/org/wordpress/android/ui/stories/StoriesTrackerHelper.kt deleted file mode 100644 index 76771fed8ad1..000000000000 --- a/WordPress/src/main/java/org/wordpress/android/ui/stories/StoriesTrackerHelper.kt +++ /dev/null @@ -1,44 +0,0 @@ -package org.wordpress.android.ui.stories - -import com.wordpress.stories.compose.frame.StorySaveEvents.StorySaveResult -import org.wordpress.android.WordPress -import org.wordpress.android.analytics.AnalyticsTracker -import org.wordpress.android.analytics.AnalyticsTracker.Stat -import org.wordpress.android.fluxc.model.SiteModel -import org.wordpress.android.util.analytics.AnalyticsUtils -import org.wordpress.android.util.extensions.getSerializableCompat -import javax.inject.Inject - -class StoriesTrackerHelper @Inject constructor() { - fun trackStorySaveResultEvent(event: StorySaveResult) { - val stat = if (event.isSuccess()) Stat.STORY_SAVE_SUCCESSFUL else Stat.STORY_SAVE_ERROR - trackStorySaveResultEvent(event, stat) - } - - fun trackStoryPostSavedEvent(frameQty: Int, site: SiteModel, locallySaved: Boolean) { - val stat = if (locallySaved) Stat.STORY_POST_SAVE_LOCALLY else Stat.STORY_POST_SAVE_REMOTELY - val properties: HashMap = HashMap() - properties.put("slide_qty", frameQty) - AnalyticsUtils.trackWithSiteDetails(stat, site, properties) - } - - private fun getCommonProperties(event: StorySaveResult): HashMap { - val properties: HashMap = HashMap() - properties.put("is_retry", event.isRetry) - properties.put("slide_qty", event.frameSaveResult.size) - properties.put("elapsed_time", event.elapsedTime) - return properties - } - - fun trackStorySaveResultEvent(event: StorySaveResult, stat: Stat) { - val properties = getCommonProperties(event) - var siteModel: SiteModel? = null - event.metadata?.let { - siteModel = it.getSerializableCompat(WordPress.SITE) - } - - siteModel?.let { - AnalyticsUtils.trackWithSiteDetails(stat, it, properties) - } ?: AnalyticsTracker.track(stat, properties) - } -} diff --git a/WordPress/src/main/java/org/wordpress/android/ui/stories/StoryComposerActivity.kt b/WordPress/src/main/java/org/wordpress/android/ui/stories/StoryComposerActivity.kt index 4f6c7cdfa70e..b54878e3bd5b 100644 --- a/WordPress/src/main/java/org/wordpress/android/ui/stories/StoryComposerActivity.kt +++ b/WordPress/src/main/java/org/wordpress/android/ui/stories/StoryComposerActivity.kt @@ -188,7 +188,6 @@ class StoryComposerActivity : ComposeLoopFrameActivity(), setNotificationExtrasLoader(this) setMetadataProvider(this) setStoryDiscardListener(this) - setStoriesAnalyticsListener(StoriesAnalyticsReceiver()) setNotificationTrackerProvider((application as WordPress).storyNotificationTrackerProvider) setPrepublishingEventProvider(this) setPermissionDialogProvider(this) @@ -296,7 +295,6 @@ class StoryComposerActivity : ComposeLoopFrameActivity(), }) viewModel.submitButtonClicked.observeEvent(this, { - analyticsTrackerWrapper.track(Stat.STORY_POST_PUBLISH_TAPPED) processStorySaving() }) @@ -390,20 +388,12 @@ class StoryComposerActivity : ComposeLoopFrameActivity(), override fun setupRequestCodes(requestCodes: ExternalMediaPickerRequestCodesAndExtraKeys) { requestCodes.PHOTO_PICKER = RequestCodes.PHOTO_PICKER - requestCodes.EXTRA_LAUNCH_WPSTORIES_CAMERA_REQUESTED = - MediaPickerConstants.EXTRA_LAUNCH_WPSTORIES_CAMERA_REQUESTED - requestCodes.EXTRA_LAUNCH_WPSTORIES_MEDIA_PICKER_REQUESTED = - MediaPickerConstants.EXTRA_LAUNCH_WPSTORIES_MEDIA_PICKER_REQUESTED // we're handling EXTRA_MEDIA_URIS at the app level (not at the Stories library level) // hence we set the requestCode to UNUSED requestCodes.EXTRA_MEDIA_URIS = UNUSED_KEY } override fun showProvidedMediaPicker() { - mediaPickerLauncher.showStoriesPhotoPickerForResult( - this, - site - ) } override fun providerHandlesOnActivityResult(): Boolean { @@ -437,10 +427,6 @@ class StoryComposerActivity : ComposeLoopFrameActivity(), } storyEditorMedia.addExistingMediaToEditorAsync(WP_MEDIA_LIBRARY, ids) } - data.hasExtra(MediaPickerConstants.EXTRA_LAUNCH_WPSTORIES_CAMERA_REQUESTED) -> { - // when coming from this entry point, we can start the analytics session - viewModel.onStoryComposerStartAnalyticsSession() - } } } diff --git a/WordPress/src/main/java/org/wordpress/android/ui/stories/intro/StoriesIntroDialogFragment.kt b/WordPress/src/main/java/org/wordpress/android/ui/stories/intro/StoriesIntroDialogFragment.kt deleted file mode 100644 index 9067133bfc45..000000000000 --- a/WordPress/src/main/java/org/wordpress/android/ui/stories/intro/StoriesIntroDialogFragment.kt +++ /dev/null @@ -1,92 +0,0 @@ -package org.wordpress.android.ui.stories.intro - -import android.app.Dialog -import android.content.Context -import android.os.Bundle -import android.view.LayoutInflater -import android.view.View -import android.view.ViewGroup -import androidx.fragment.app.DialogFragment -import androidx.lifecycle.ViewModelProvider -import org.wordpress.android.R -import org.wordpress.android.WordPress -import org.wordpress.android.databinding.StoriesIntroDialogFragmentBinding -import org.wordpress.android.fluxc.model.SiteModel -import org.wordpress.android.ui.ActivityLauncher -import org.wordpress.android.ui.photopicker.MediaPickerLauncher -import org.wordpress.android.util.extensions.getSerializableCompat -import org.wordpress.android.util.extensions.setStatusBarAsSurfaceColor -import javax.inject.Inject - -class StoriesIntroDialogFragment : DialogFragment() { - @Inject - lateinit var viewModelFactory: ViewModelProvider.Factory - - @Inject - internal lateinit var mediaPickerLauncher: MediaPickerLauncher - - private lateinit var viewModel: StoriesIntroViewModel - - companion object { - const val TAG = "STORIES_INTRO_DIALOG_FRAGMENT" - - @JvmStatic - fun newInstance(site: SiteModel?): StoriesIntroDialogFragment { - val args = Bundle() - if (site != null) { - args.putSerializable(WordPress.SITE, site) - } - return StoriesIntroDialogFragment().apply { arguments = args } - } - } - - override fun getTheme(): Int { - return R.style.FeatureAnnouncementDialogFragment - } - - override fun onCreateDialog(savedInstanceState: Bundle?): Dialog { - val dialog = super.onCreateDialog(savedInstanceState) - viewModel = ViewModelProvider(this, viewModelFactory) - .get(StoriesIntroViewModel::class.java) - dialog.setStatusBarAsSurfaceColor() - return dialog - } - - override fun onCreateView(inflater: LayoutInflater, container: ViewGroup?, savedInstanceState: Bundle?): View? { - return inflater.inflate(R.layout.stories_intro_dialog_fragment, container, false) - } - - override fun onViewCreated(view: View, savedInstanceState: Bundle?) { - super.onViewCreated(view, savedInstanceState) - - val site = requireArguments().getSerializableCompat(WordPress.SITE) - with(StoriesIntroDialogFragmentBinding.bind(view)) { - createStoryIntroButton.setOnClickListener { viewModel.onCreateStoryButtonPressed() } - storiesIntroBackButton.setOnClickListener { viewModel.onBackButtonPressed() } - - storyImageFirst.setOnClickListener { viewModel.onStoryPreviewTapped1() } - storyImageSecond.setOnClickListener { viewModel.onStoryPreviewTapped2() } - } - viewModel.onCreateButtonClicked.observe(this) { - activity?.let { - mediaPickerLauncher.showStoriesPhotoPickerForResultAndTrack(it, site) - } - dismiss() - } - - viewModel.onDialogClosed.observe(this) { - dismiss() - } - - viewModel.onStoryOpenRequested.observe(this) { storyUrl -> - ActivityLauncher.openUrlExternal(context, storyUrl) - } - - viewModel.start() - } - - override fun onAttach(context: Context) { - super.onAttach(context) - (requireActivity().applicationContext as WordPress).component().inject(this) - } -} diff --git a/WordPress/src/main/java/org/wordpress/android/ui/stories/intro/StoriesIntroViewModel.kt b/WordPress/src/main/java/org/wordpress/android/ui/stories/intro/StoriesIntroViewModel.kt deleted file mode 100644 index 4b9f5ce45fd5..000000000000 --- a/WordPress/src/main/java/org/wordpress/android/ui/stories/intro/StoriesIntroViewModel.kt +++ /dev/null @@ -1,63 +0,0 @@ -package org.wordpress.android.ui.stories.intro - -import androidx.lifecycle.LiveData -import kotlinx.coroutines.CoroutineDispatcher -import org.wordpress.android.analytics.AnalyticsTracker.Stat -import org.wordpress.android.modules.UI_THREAD -import org.wordpress.android.ui.prefs.AppPrefsWrapper -import org.wordpress.android.util.analytics.AnalyticsTrackerWrapper -import org.wordpress.android.viewmodel.ScopedViewModel -import org.wordpress.android.viewmodel.SingleLiveEvent -import javax.inject.Inject -import javax.inject.Named - -class StoriesIntroViewModel @Inject constructor( - private val analyticsTrackerWrapper: AnalyticsTrackerWrapper, - private val appPrefsWrapper: AppPrefsWrapper, - @Named(UI_THREAD) private val mainDispatcher: CoroutineDispatcher -) : ScopedViewModel(mainDispatcher) { - private val _onDialogClosed = SingleLiveEvent() - val onDialogClosed: LiveData = _onDialogClosed - - private val _onCreateButtonClicked = SingleLiveEvent() - val onCreateButtonClicked: LiveData = _onCreateButtonClicked - - private val _onStoryOpenRequested = SingleLiveEvent() - val onStoryOpenRequested: LiveData = _onStoryOpenRequested - - private var isStarted = false - - fun start() { - if (isStarted) return - isStarted = true - - analyticsTrackerWrapper.track(Stat.STORY_INTRO_SHOWN) - } - - fun onBackButtonPressed() { - analyticsTrackerWrapper.track(Stat.STORY_INTRO_DISMISSED) - _onDialogClosed.call() - } - - fun onCreateStoryButtonPressed() { - analyticsTrackerWrapper.track(Stat.STORY_INTRO_CREATE_STORY_BUTTON_TAPPED) - - appPrefsWrapper.shouldShowStoriesIntro = false - - _onCreateButtonClicked.call() - } - - fun onStoryPreviewTapped1() { - _onStoryOpenRequested.value = STORY_URL_1 + STORY_FULLSCREEN_URL_PARAMS - } - - fun onStoryPreviewTapped2() { - _onStoryOpenRequested.value = STORY_URL_2 + STORY_FULLSCREEN_URL_PARAMS - } - - companion object { - private const val STORY_URL_1 = "https://wpstories.wordpress.com/2020/12/02/story-demo-01/" - private const val STORY_URL_2 = "https://wpstories.wordpress.com/2020/12/02/story-demo-02/" - private const val STORY_FULLSCREEN_URL_PARAMS = "?wp-story-load-in-fullscreen=true&wp-story-play-on-load=true" - } -} diff --git a/WordPress/src/main/java/org/wordpress/android/ui/stories/media/StoryMediaSaveUploadBridge.kt b/WordPress/src/main/java/org/wordpress/android/ui/stories/media/StoryMediaSaveUploadBridge.kt index cc84f6fad6d1..bd3e21b89747 100644 --- a/WordPress/src/main/java/org/wordpress/android/ui/stories/media/StoryMediaSaveUploadBridge.kt +++ b/WordPress/src/main/java/org/wordpress/android/ui/stories/media/StoryMediaSaveUploadBridge.kt @@ -26,7 +26,6 @@ import org.wordpress.android.ui.posts.SavePostToDbUseCase import org.wordpress.android.ui.posts.editor.media.AddLocalMediaToPostUseCase import org.wordpress.android.ui.posts.editor.media.EditorMediaListener import org.wordpress.android.ui.stories.SaveStoryGutenbergBlockUseCase -import org.wordpress.android.ui.stories.StoriesTrackerHelper import org.wordpress.android.ui.stories.StoryComposerActivity import org.wordpress.android.ui.stories.StoryRepositoryWrapper import org.wordpress.android.ui.stories.prefs.StoriesPrefs @@ -71,9 +70,6 @@ class StoryMediaSaveUploadBridge @Inject constructor( @Inject lateinit var editPostRepository: EditPostRepository - @Inject - lateinit var storiesTrackerHelper: StoriesTrackerHelper - @Inject lateinit var saveStoryGutenbergBlockUseCase: SaveStoryGutenbergBlockUseCase @@ -220,13 +216,6 @@ class StoryMediaSaveUploadBridge @Inject constructor( appContext, editPostRepository.id, true, "StoryMediaSaveUploadBridge#addNewMediaItemsInStoryFramesToPostAsync" ) - // SAVED_ONLINE - storiesTrackerHelper.trackStoryPostSavedEvent(uriList.size, site, false) - } else { - // SAVED_LOCALLY - storiesTrackerHelper.trackStoryPostSavedEvent(uriList.size, site, true) - // no op, when network is available the offline mode in WPAndroid will gather the queued Post - // and try to upload. } } } @@ -239,9 +228,6 @@ class StoryMediaSaveUploadBridge @Inject constructor( @Subscribe(sticky = true, threadMode = MAIN) fun onEventMainThread(event: StorySaveResult) { - // track event - storiesTrackerHelper.trackStorySaveResultEvent(event) - event.metadata?.let { val site = requireNotNull(it.getSerializableCompat(WordPress.SITE)) val story = storyRepositoryWrapper.getStoryAtIndex(event.storyIndex) diff --git a/WordPress/src/main/java/org/wordpress/android/util/SiteUtils.java b/WordPress/src/main/java/org/wordpress/android/util/SiteUtils.java index 416d19eb0cc4..b08e73c66731 100644 --- a/WordPress/src/main/java/org/wordpress/android/util/SiteUtils.java +++ b/WordPress/src/main/java/org/wordpress/android/util/SiteUtils.java @@ -319,11 +319,6 @@ public static boolean checkMinimalWordPressVersion(SiteModel site, String minVer return VersionUtils.checkMinimalVersion(site.getSoftwareVersion(), minVersion); } - public static boolean supportsStoriesFeature(SiteModel site, JetpackFeatureRemovalPhaseHelper helper) { - return site != null && (site.isWPCom() || checkMinimalJetpackVersion(site, WP_STORIES_JETPACK_VERSION)) - && helper.shouldShowStoryPost(); - } - public static boolean supportsContactInfoFeature(SiteModel site) { return site != null && (site.isWPCom() || checkMinimalJetpackVersion(site, WP_CONTACT_INFO_JETPACK_VERSION)); } diff --git a/WordPress/src/main/java/org/wordpress/android/util/SiteUtilsWrapper.kt b/WordPress/src/main/java/org/wordpress/android/util/SiteUtilsWrapper.kt index 9a44fe0ec0d3..5a4df6403e6e 100644 --- a/WordPress/src/main/java/org/wordpress/android/util/SiteUtilsWrapper.kt +++ b/WordPress/src/main/java/org/wordpress/android/util/SiteUtilsWrapper.kt @@ -4,7 +4,6 @@ import android.content.Context import androidx.annotation.DimenRes import dagger.Reusable import org.wordpress.android.fluxc.model.SiteModel -import org.wordpress.android.ui.jetpackoverlay.JetpackFeatureRemovalPhaseHelper import org.wordpress.android.ui.reader.utils.SiteAccessibilityInfo import javax.inject.Inject @@ -28,7 +27,4 @@ class SiteUtilsWrapper @Inject constructor(private val appContext: Context) { fun getSiteIconUrlOfResourceSize(site: SiteModel, @DimenRes sizeRes: Int): String { return SiteUtils.getSiteIconUrl(site, appContext.resources.getDimensionPixelSize(sizeRes)) } - fun supportsStoriesFeature(site: SiteModel?, helper: JetpackFeatureRemovalPhaseHelper): Boolean { - return SiteUtils.supportsStoriesFeature(site, helper) - } } diff --git a/WordPress/src/main/java/org/wordpress/android/viewmodel/main/WPMainActivityViewModel.kt b/WordPress/src/main/java/org/wordpress/android/viewmodel/main/WPMainActivityViewModel.kt index 9bb2b84343d1..cc194ffbcc69 100644 --- a/WordPress/src/main/java/org/wordpress/android/viewmodel/main/WPMainActivityViewModel.kt +++ b/WordPress/src/main/java/org/wordpress/android/viewmodel/main/WPMainActivityViewModel.kt @@ -27,7 +27,6 @@ import org.wordpress.android.ui.main.MainActionListItem.ActionType.ANSWER_BLOGGI import org.wordpress.android.ui.main.MainActionListItem.ActionType.CREATE_NEW_PAGE import org.wordpress.android.ui.main.MainActionListItem.ActionType.CREATE_NEW_PAGE_FROM_PAGES_CARD import org.wordpress.android.ui.main.MainActionListItem.ActionType.CREATE_NEW_POST -import org.wordpress.android.ui.main.MainActionListItem.ActionType.CREATE_NEW_STORY import org.wordpress.android.ui.main.MainActionListItem.ActionType.NO_ACTION import org.wordpress.android.ui.main.MainActionListItem.AnswerBloggingPromptAction import org.wordpress.android.ui.main.MainActionListItem.CreateAction @@ -204,16 +203,6 @@ class WPMainActivityViewModel @Inject constructor( onClickAction = null ) ) - if (siteUtilsWrapper.supportsStoriesFeature(site, jetpackFeatureRemovalPhaseHelper)) { - actionsList.add( - CreateAction( - actionType = CREATE_NEW_STORY, - iconRes = R.drawable.ic_story_icon_24dp, - labelRes = R.string.my_site_bottom_sheet_add_story, - onClickAction = ::onCreateActionClicked - ) - ) - } actionsList.add( CreateAction( actionType = CREATE_NEW_POST, @@ -277,11 +266,7 @@ class WPMainActivityViewModel @Inject constructor( _showQuickStarInBottomSheet.postValue(quickStartRepository.activeTask.value == PUBLISH_POST) - if (siteUtilsWrapper.supportsStoriesFeature( - site, - jetpackFeatureRemovalPhaseHelper) || - hasFullAccessToContent(site) - ) { + if (hasFullAccessToContent(site)) { launch { // The user has at least two create options available for this site (pages and/or story posts), // so we should show a bottom sheet. @@ -349,20 +334,7 @@ class WPMainActivityViewModel @Inject constructor( } fun getCreateContentMessageId(site: SiteModel?): Int { - return if (siteUtilsWrapper.supportsStoriesFeature(site, jetpackFeatureRemovalPhaseHelper)) { - getCreateContentMessageIdStoriesFlagOn(hasFullAccessToContent(site)) - } else { - getCreateContentMessageIdStoriesFlagOff(hasFullAccessToContent(site)) - } - } - - // create_post_page_fab_tooltip_stories_feature_flag_on - private fun getCreateContentMessageIdStoriesFlagOn(hasFullAccessToContent: Boolean): Int { - return if (hasFullAccessToContent) { - R.string.create_post_page_fab_tooltip_stories_enabled - } else { - R.string.create_post_page_fab_tooltip_contributors_stories_enabled - } + return getCreateContentMessageIdStoriesFlagOff(hasFullAccessToContent(site)) } private fun getCreateContentMessageIdStoriesFlagOff(hasFullAccessToContent: Boolean): Int { diff --git a/WordPress/src/main/res/values-ar/strings.xml b/WordPress/src/main/res/values-ar/strings.xml index 63ed0c049564..e91bb3300f28 100644 --- a/WordPress/src/main/res/values-ar/strings.xml +++ b/WordPress/src/main/res/values-ar/strings.xml @@ -1566,8 +1566,6 @@ Language: ar امنح قصتك عنواناً ابدأ بالاختيار من بين مجموعة متنوعة من تخطيطات الصفحات المعدَّة سابقًا. أو ما عليك سوى البدء بصفحة فارغة. اضغط على إنشاء ⁦%1$s⁩. ⁦%2$s⁩ بعدها، حدِّد <b>مقالة</b> - إنشاء مقالة، صفحة أو قصة - إنشاء مقالة أو قصة اختيار تخطيط مقالة قصة الاختيار من الجهاز diff --git a/WordPress/src/main/res/values-cs/strings.xml b/WordPress/src/main/res/values-cs/strings.xml index 5f6a969f43fc..105b02816972 100644 --- a/WordPress/src/main/res/values-cs/strings.xml +++ b/WordPress/src/main/res/values-cs/strings.xml @@ -1273,8 +1273,6 @@ Language: cs_CZ Vytvořit stránku Vytvořit prázdnou stránku Klepněte na %1$s Vytvořit. %2$s Poté vyberte <b>Blogový příspěvek</b> - Vytvořte příspěvek, stránku nebo příběh - Vytvořte příspěvek nebo příběh Dejte svému příběhu název Vyberte rozložení Začněte výběrem z široké škály předem připravených rozvržení stránky. Nebo jen začněte s prázdnou stránkou. diff --git a/WordPress/src/main/res/values-de/strings.xml b/WordPress/src/main/res/values-de/strings.xml index 6fcfc1a64ebf..a6d3000c8149 100644 --- a/WordPress/src/main/res/values-de/strings.xml +++ b/WordPress/src/main/res/values-de/strings.xml @@ -1578,8 +1578,6 @@ Language: de Beginne mit der Auswahl eines der vielen vorgefertigten Seitenlayouts. Oder beginne einfach mit einer leeren Seite. Layout auswählen Gib deiner Website einen Titel - Erstelle einen Beitrag oder eine Story - Erstelle einen Beitrag, eine Seite oder eine Story Tippe auf %1$s Erstellen. %2$s Wähle anschließend <b>Blogbeitrag</b> Von Gerät auswählen Story-Beitrag diff --git a/WordPress/src/main/res/values-en-rCA/strings.xml b/WordPress/src/main/res/values-en-rCA/strings.xml index f7bd101eab93..962e79d80364 100644 --- a/WordPress/src/main/res/values-en-rCA/strings.xml +++ b/WordPress/src/main/res/values-en-rCA/strings.xml @@ -1530,8 +1530,6 @@ Language: en_CA Create page Create blank page Give your story a title - Create a post or story - Create a post, page or story Sound Choose a layout Choose from device diff --git a/WordPress/src/main/res/values-en-rGB/strings.xml b/WordPress/src/main/res/values-en-rGB/strings.xml index e76a9f4e1c67..b47474248e52 100644 --- a/WordPress/src/main/res/values-en-rGB/strings.xml +++ b/WordPress/src/main/res/values-en-rGB/strings.xml @@ -1578,8 +1578,6 @@ Language: en_GB Get started by choosing from a wide variety of pre-made page layouts. Or just start with a blank page. Choose a layout Give your story a title - Create a post or story - Create a post, page, or story Tap %1$s Create. %2$s Then select <b>Blog post</b> Choose from device Story post diff --git a/WordPress/src/main/res/values-es-rCO/strings.xml b/WordPress/src/main/res/values-es-rCO/strings.xml index efe422874b90..960ea27a482f 100644 --- a/WordPress/src/main/res/values-es-rCO/strings.xml +++ b/WordPress/src/main/res/values-es-rCO/strings.xml @@ -1043,8 +1043,6 @@ Language: es_CO Empieza eligiendo entre una amplia variedad de diseños de página prefabricados. O simplemente empieza con una página en blanco. Elegir un diseño Pon un título a tu historia - Crear una entrada o historia - Crear una entrada, página o historia Toca crear %1$s. %2$s Después selecciona <b>Entrada del blog</b> Elegir el dispositivo Entrada de la historia diff --git a/WordPress/src/main/res/values-es-rMX/strings.xml b/WordPress/src/main/res/values-es-rMX/strings.xml index 6b0bfb2edaf0..23ee25541b3c 100644 --- a/WordPress/src/main/res/values-es-rMX/strings.xml +++ b/WordPress/src/main/res/values-es-rMX/strings.xml @@ -306,8 +306,6 @@ Language: es_MX Reintentar Diapositiva Empieza eligiendo entre una amplia variedad de layouts de página prefabricados. O simplemente empieza con una página en blanco. - Crear una entrada, página o historia - Crear una entrada o historia Elegir un layout Cuota de almacenamiento superada No se puede subir el archivo.\nSe ha superado la cuota de almacenamiento. diff --git a/WordPress/src/main/res/values-es-rVE/strings.xml b/WordPress/src/main/res/values-es-rVE/strings.xml index 6f74dca7181d..e8ece5041145 100644 --- a/WordPress/src/main/res/values-es-rVE/strings.xml +++ b/WordPress/src/main/res/values-es-rVE/strings.xml @@ -1063,8 +1063,6 @@ Language: es_VE Empieza eligiendo entre una amplia variedad de diseños de página prefabricados. O simplemente empieza con una página en blanco. Elegir un diseño Pon un título a tu historia - Crear una entrada o historia - Crear una entrada, página o historia Toca crear %1$s. %2$s Después selecciona <b>Entrada del blog</b> Elegir el dispositivo Entrada de la historia diff --git a/WordPress/src/main/res/values-es/strings.xml b/WordPress/src/main/res/values-es/strings.xml index 11c0929b8d81..0b8c0e103c1f 100644 --- a/WordPress/src/main/res/values-es/strings.xml +++ b/WordPress/src/main/res/values-es/strings.xml @@ -1578,8 +1578,6 @@ Language: es Empieza eligiendo entre una amplia variedad de diseños de página prefabricados. O simplemente empieza con una página en blanco. Elegir un diseño Pon un título a tu historia - Crear una entrada o historia - Crear una entrada, página o historia Toca crear %1$s. %2$s Después selecciona <b>Entrada del blog</b> Elegir el dispositivo Entrada de la historia diff --git a/WordPress/src/main/res/values-fr-rCA/strings.xml b/WordPress/src/main/res/values-fr-rCA/strings.xml index 2c530d75574a..c7fff589f28f 100644 --- a/WordPress/src/main/res/values-fr-rCA/strings.xml +++ b/WordPress/src/main/res/values-fr-rCA/strings.xml @@ -1568,8 +1568,6 @@ Language: fr Commencez en choisissant parmi une large variété de mises en page prédéfinies. Ou commencez simplement avec une page vide. Choisissez une mise en page Donnez un titre à votre story - Créez un article ou une story - Créez un article, une page ou une story Appuyez sur %1$s Créer. %2$s Puis sélectionnez <b>Article de blog</b> Choisir depuis l’appareil Publication de story diff --git a/WordPress/src/main/res/values-fr/strings.xml b/WordPress/src/main/res/values-fr/strings.xml index 2c530d75574a..c7fff589f28f 100644 --- a/WordPress/src/main/res/values-fr/strings.xml +++ b/WordPress/src/main/res/values-fr/strings.xml @@ -1568,8 +1568,6 @@ Language: fr Commencez en choisissant parmi une large variété de mises en page prédéfinies. Ou commencez simplement avec une page vide. Choisissez une mise en page Donnez un titre à votre story - Créez un article ou une story - Créez un article, une page ou une story Appuyez sur %1$s Créer. %2$s Puis sélectionnez <b>Article de blog</b> Choisir depuis l’appareil Publication de story diff --git a/WordPress/src/main/res/values-gl/strings.xml b/WordPress/src/main/res/values-gl/strings.xml index f64db893933f..85993bf6d486 100644 --- a/WordPress/src/main/res/values-gl/strings.xml +++ b/WordPress/src/main/res/values-gl/strings.xml @@ -1575,9 +1575,7 @@ Language: gl_ES Gardado en fotos Elixir un deseño Crear unha páxina en branco - Crear unha entrada ou historia Pon un título á túa historia - Crear unha entrada, páxina ou historia Toca %1$s Crear. %2$s Despois selecciona <b>Entrada do blog</b> Empeza elixindo entre unha ampla variedade de deseños de páxina prefabricados. Ou simplemente empeza cunha páxina en branco. Pechar diff --git a/WordPress/src/main/res/values-he/strings.xml b/WordPress/src/main/res/values-he/strings.xml index 44c01c1aac8f..b5c1d77ccd4c 100644 --- a/WordPress/src/main/res/values-he/strings.xml +++ b/WordPress/src/main/res/values-he/strings.xml @@ -1568,8 +1568,6 @@ Language: he_IL ניתן להתחיל באמצעות בחירה ממגוון רחב של פריסות עמוד שהוכנו מראש. או פשוט להתחיל מעמוד ריק. יש לבחור פריסה להגדיר שם לסטורי - ליצור פוסט או סטורי - ליצור פוסט, עמוד או סטורי יש להקיש על ⁦%1$s⁩ כדי ליצור. ⁦%2$s⁩ לאחר מכן, יש לבחור <b>פוסט בבלוג</b> לבחור מהמכשיר פוסט של סטורי diff --git a/WordPress/src/main/res/values-id/strings.xml b/WordPress/src/main/res/values-id/strings.xml index cb8caf5795c4..9281fa49bdde 100644 --- a/WordPress/src/main/res/values-id/strings.xml +++ b/WordPress/src/main/res/values-id/strings.xml @@ -1571,8 +1571,6 @@ Language: id Mulai dengan memilih satu tata letak halaman yang siap digunakan. Atau mulai dengan halaman kosong. Pilih tata letak Beri judul pada cerita Anda - Buat pos atau cerita - Buat pos, halaman, atau cerita Ketuk %1$s Buat. %2$s Lalu pilih <b>Pos blog</b> Pilih dari perangkat Pos cerita diff --git a/WordPress/src/main/res/values-it/strings.xml b/WordPress/src/main/res/values-it/strings.xml index 95f188dc473e..e38c9b99a436 100644 --- a/WordPress/src/main/res/values-it/strings.xml +++ b/WordPress/src/main/res/values-it/strings.xml @@ -1570,8 +1570,6 @@ Language: it Inizia scegliendo tra un\'ampia varietà di layout di pagina già pronti. Altrimenti, inizia semplicemente con una pagina bianca. Scegli un layout Dai un titolo alla tua storia - Crea un articolo o una storia - Crea un articolo, una pagina o una storia Tocca %1$s Crea. %2$s Quindi, seleziona <b>Articolo del blog</b> Scegli da dispositivo Articolo della storia diff --git a/WordPress/src/main/res/values-ja/strings.xml b/WordPress/src/main/res/values-ja/strings.xml index 508d95482994..006c029d6a8b 100644 --- a/WordPress/src/main/res/values-ja/strings.xml +++ b/WordPress/src/main/res/values-ja/strings.xml @@ -1570,8 +1570,6 @@ Language: ja_JP 事前に用意されたさまざまなページレイアウトを選ぶところから始めましょう。 空白ページから始めることもできます。 レイアウトを選択 ストーリーにタイトルを付ける - 投稿またはストーリーを作成 - 投稿、ページ、ストーリーを作成 「%1$s 作成」をタップします。%2$s 次に「<b>ブログ投稿</b>」を選択します 端末から選択 ストーリー投稿 diff --git a/WordPress/src/main/res/values-kmr/strings.xml b/WordPress/src/main/res/values-kmr/strings.xml index 39e76501d264..e57b15dc7b22 100644 --- a/WordPress/src/main/res/values-kmr/strings.xml +++ b/WordPress/src/main/res/values-kmr/strings.xml @@ -247,8 +247,6 @@ Language: ku_TR Rûpelekê biafirîne Rûpeleke vala biafirîne Sernavekî bide çîroka xwe - Şandî an jî çîrokekê biafirîne - Şandî, rûpel an jî çîrokekê biafirîne Bigire Parve bike bi: Li %1$s Biafirîne\'yê bitikîne. %2$s Piştre<b>Şandiya Blogê</b> hilbijêre diff --git a/WordPress/src/main/res/values-ko/strings.xml b/WordPress/src/main/res/values-ko/strings.xml index cbe602d77eec..86500ab09dc0 100644 --- a/WordPress/src/main/res/values-ko/strings.xml +++ b/WordPress/src/main/res/values-ko/strings.xml @@ -1570,8 +1570,6 @@ Language: ko_KR 넓고 다양한 이전에 만들어진 페이지 레이아웃에서 선택하여 시작하세요. 또는 빈 페이지로 시작하세요. 레이아웃을 선택하기 스토리에 제목을 부여하기 - 글 또는 스토리 만들기 - 글, 페이지 또는 스토리를 만들기 %1$s 만들기를 %2$s탭하세요. 다음 <b>블로그 글</b>을 선택하세요 장치에서 선택하기 스토리 글 diff --git a/WordPress/src/main/res/values-lv/strings.xml b/WordPress/src/main/res/values-lv/strings.xml index 62173746d229..2af57c7beed6 100644 --- a/WordPress/src/main/res/values-lv/strings.xml +++ b/WordPress/src/main/res/values-lv/strings.xml @@ -1432,8 +1432,6 @@ Language: lv Sāciet, izvēloties no dažādiem iepriekš sagatavotiem lapu izkārtojumiem. Vai vienkārši sāciet ar tukšu lapu. Izvēlieties izkārtojumu Piešķiriet savam stāstam nosaukumu - Izveidojiet ziņu vai stāstu - Izveidojiet ziņu, lapu vai stāstu Piesitiet %1$s Izveidojiet. %2$s Pēc tam atlasiet <b>Emuāra ziņa</b> Izvēlieties no ierīces Stāsta ziņa diff --git a/WordPress/src/main/res/values-nb/strings.xml b/WordPress/src/main/res/values-nb/strings.xml index 013567705df3..c631a9f9fef0 100644 --- a/WordPress/src/main/res/values-nb/strings.xml +++ b/WordPress/src/main/res/values-nb/strings.xml @@ -449,8 +449,6 @@ Language: nb_NO Lag tom side Velg et oppsett Gi din fortelling en tittel - Lag et innlegg eller en fortelling - Lag et innlegg, en side eller fortelling Trykk %1$s Lag. %2$s Velg så <b>blogginnlegg</b> Velg fra enheten Fortelling diff --git a/WordPress/src/main/res/values-nl/strings.xml b/WordPress/src/main/res/values-nl/strings.xml index b71d4cbded66..2c2ef5f2b2c2 100644 --- a/WordPress/src/main/res/values-nl/strings.xml +++ b/WordPress/src/main/res/values-nl/strings.xml @@ -1513,8 +1513,6 @@ Language: nl Ga aan de slag door te kiezen uit een breed scala aan vooraf gemaakte pagina lay-outs. Of begin gewoon met een lege pagina. Kies een lay-out Geef je verhaal een titel - Maak een bericht of verhaal - Maak een bericht, pagina of verhaal Tik op %1$s Maken. %2$s Selecteer vervolgens <b>Blog bericht</b> Kies van welk apparaat Verhaal plaatsen diff --git a/WordPress/src/main/res/values-pl/strings.xml b/WordPress/src/main/res/values-pl/strings.xml index c4ca4fcb25c2..15b0bcfc9b86 100644 --- a/WordPress/src/main/res/values-pl/strings.xml +++ b/WordPress/src/main/res/values-pl/strings.xml @@ -1051,8 +1051,6 @@ Language: pl Stuknij %1$s Utwórz. %2$s Następnie wybierz <b>Wpis na blogu</b> Udostępnij na Nadaj tytuł swojej relacji - Utwórz wpis lub relację - Utwórz wpis, stronę lub relację Zapisywanie Zapisano Spróbuj ponownie diff --git a/WordPress/src/main/res/values-pt-rBR/strings.xml b/WordPress/src/main/res/values-pt-rBR/strings.xml index eca58ce8915b..238b619064c7 100644 --- a/WordPress/src/main/res/values-pt-rBR/strings.xml +++ b/WordPress/src/main/res/values-pt-rBR/strings.xml @@ -1347,8 +1347,6 @@ Language: pt_BR Comece escolhendo entre uma grande variedade de modelos prontos ou crie uma página vazia. Escolher um modelo Adicione um título para seu story - Criar um post ou story - Criar um post, página ou story Toque em %1$s Criar. %2$s Então selecione <b>Post do blog</b> Escolher no dispositivo Story diff --git a/WordPress/src/main/res/values-ro/strings.xml b/WordPress/src/main/res/values-ro/strings.xml index 3a4aae53bae8..3c1ca6af2901 100644 --- a/WordPress/src/main/res/values-ro/strings.xml +++ b/WordPress/src/main/res/values-ro/strings.xml @@ -1578,8 +1578,6 @@ Language: ro Începe și alege dintr-o mare varietate de aranjamente gata pregătite. Sau începe cu o pagină goală. Alege un aranjament Dă-i un titlu narațiunii tale - Creează un articol sau o narațiune - Creează un articol, o pagină sau o narațiune Atinge Creează %1$s. %2$s Apoi selectează <b>Articol blog</b> Alege de pe dispozitiv Articol narațiune diff --git a/WordPress/src/main/res/values-ru/strings.xml b/WordPress/src/main/res/values-ru/strings.xml index e6e4dbe70ddf..11a0108ce982 100644 --- a/WordPress/src/main/res/values-ru/strings.xml +++ b/WordPress/src/main/res/values-ru/strings.xml @@ -1578,8 +1578,6 @@ Language: ru Начните с выбора заранее подготовленных вариантов макета, или начните с пустой страницы. Выберите макет Назовите вашу историю - Создать запись или страницу - Создать запись, страницу или историю Нажмите %1$s Создать. %2$s Затем выберите <b>Запись блога</b> Выбрать с устройства История diff --git a/WordPress/src/main/res/values-sq/strings.xml b/WordPress/src/main/res/values-sq/strings.xml index de4fd2a3942f..645932c2e9c7 100644 --- a/WordPress/src/main/res/values-sq/strings.xml +++ b/WordPress/src/main/res/values-sq/strings.xml @@ -1570,8 +1570,6 @@ Language: sq_AL Nisjani duke zgjedhur nga një larmi e madhe skemash të parapërgatitura faqesh. Ose thjesht fillojani me një faqe të zbrazët. Zgjidhni një skemë Jepini një titull shkrimit tuaj - Krijoni një postim ose një shkrim - Krijoni një postim, faqe ose shkrim Prekni %1$s Krijoni. %2$s Mandej përzgjidhni <b>Postim blogu</b> Zgjidhni nga pajisje Postim shkrimi diff --git a/WordPress/src/main/res/values-sr/strings.xml b/WordPress/src/main/res/values-sr/strings.xml index 4c94593801da..13c15dd02c56 100644 --- a/WordPress/src/main/res/values-sr/strings.xml +++ b/WordPress/src/main/res/values-sr/strings.xml @@ -316,9 +316,7 @@ Language: sr_RS одабрано није одабрано Напарвити страницу - Направити чланак или причу Направити празну страницу - Направите чланак, страницу или причу Слајд Покушај поново Сачувано diff --git a/WordPress/src/main/res/values-sv/strings.xml b/WordPress/src/main/res/values-sv/strings.xml index 02e796d929fe..8df9a336fd3c 100644 --- a/WordPress/src/main/res/values-sv/strings.xml +++ b/WordPress/src/main/res/values-sv/strings.xml @@ -1578,8 +1578,6 @@ Language: sv_SE Kom igång genom att välja någon av alla förberedda sidlayouter. Eller börja helt enkelt med en tom sida. Välj en layout Ge din berättelse en rubrik - Skapa ett inlägg eller en berättelse - Skapa ett inlägg, en sida eller en berättelse Tryck på %1$s Skapa. %2$s Välj sedan <b>Blogginlägg</b> Välj från enheten Berättelseinlägg diff --git a/WordPress/src/main/res/values-tr/strings.xml b/WordPress/src/main/res/values-tr/strings.xml index 731d4ede11df..322c714455ee 100644 --- a/WordPress/src/main/res/values-tr/strings.xml +++ b/WordPress/src/main/res/values-tr/strings.xml @@ -1575,8 +1575,6 @@ Language: tr Önceden hazırlanmış çeşitli sayfa düzenleri arasından seçim yaparak başlayın. Veya boş bir sayfayla başlayın. Bir düzen seç Öykünüze bir başlık koyun - Bir yazı veya öykü oluştur - Bir yazı, sayfa veya öykü oluştur %1$s Oluştur\'a dokunun. %2$s Ardından <b>Blog yayını</b>\'nı seçin Cihazdan seç Öykü yayını diff --git a/WordPress/src/main/res/values-vi/strings.xml b/WordPress/src/main/res/values-vi/strings.xml index 2a92fcc70b3a..42e26b7e0bb2 100644 --- a/WordPress/src/main/res/values-vi/strings.xml +++ b/WordPress/src/main/res/values-vi/strings.xml @@ -1022,8 +1022,6 @@ Language: vi_VN Bắt đầu bằng cách chọn một trong những bố cục cho sẵn. Hoặc tạo một trang trống. Chọn bố cục Đặt tựa đề story - Tạo bài viết hoặc story - Tạo bài viết, trang hoặc story Nhấn %1$s Tạo. %2$s Chọn tiếp <b>Bài viết</b> Chọn từ thiết bị Story diff --git a/WordPress/src/main/res/values-zh-rCN/strings.xml b/WordPress/src/main/res/values-zh-rCN/strings.xml index bc5bdbb1afe6..7e6ff4d96dcc 100644 --- a/WordPress/src/main/res/values-zh-rCN/strings.xml +++ b/WordPress/src/main/res/values-zh-rCN/strings.xml @@ -1565,8 +1565,6 @@ Language: zh_CN 从种类繁多的预设页面布局中选择心仪的布局,开始打造自己的页面。 或者,您也可以从一个空白页面开始。 选择布局 为您的故事设定标题 - 创建文章或故事 - 创建文章、页面或故事 轻点%1$s创建。 %2$s 然后选择<b>博文</b> 从设备中选择 故事文章 diff --git a/WordPress/src/main/res/values-zh-rHK/strings.xml b/WordPress/src/main/res/values-zh-rHK/strings.xml index 611c79eab4e0..64a8172024be 100644 --- a/WordPress/src/main/res/values-zh-rHK/strings.xml +++ b/WordPress/src/main/res/values-zh-rHK/strings.xml @@ -1570,8 +1570,6 @@ Language: zh_TW 首先請從各種預先製作的頁面版面配置挑選。 或從空白頁面開始也可以。 選擇版面配置 新增故事標題 - 建立文章或限時動態 - 建立文章、頁面或限時動態 點選 %1$s「建立」。 %2$s 然後選取<b>「網誌文章」</b> 從裝置中選擇 故事文章 diff --git a/WordPress/src/main/res/values-zh-rTW/strings.xml b/WordPress/src/main/res/values-zh-rTW/strings.xml index 611c79eab4e0..64a8172024be 100644 --- a/WordPress/src/main/res/values-zh-rTW/strings.xml +++ b/WordPress/src/main/res/values-zh-rTW/strings.xml @@ -1570,8 +1570,6 @@ Language: zh_TW 首先請從各種預先製作的頁面版面配置挑選。 或從空白頁面開始也可以。 選擇版面配置 新增故事標題 - 建立文章或限時動態 - 建立文章、頁面或限時動態 點選 %1$s「建立」。 %2$s 然後選取<b>「網誌文章」</b> 從裝置中選擇 故事文章 diff --git a/WordPress/src/main/res/values/strings.xml b/WordPress/src/main/res/values/strings.xml index e9449d4c778d..5602c2999fd0 100644 --- a/WordPress/src/main/res/values/strings.xml +++ b/WordPress/src/main/res/values/strings.xml @@ -3438,9 +3438,6 @@ Create a page Create a post or story - Create a post, page or story - Create a post or story - Create Site %1$d of %2$d diff --git a/WordPress/src/test/java/org/wordpress/android/ui/mysite/MySiteViewModelTest.kt b/WordPress/src/test/java/org/wordpress/android/ui/mysite/MySiteViewModelTest.kt index ae5a750bb83f..4aef3a118e49 100644 --- a/WordPress/src/test/java/org/wordpress/android/ui/mysite/MySiteViewModelTest.kt +++ b/WordPress/src/test/java/org/wordpress/android/ui/mysite/MySiteViewModelTest.kt @@ -145,9 +145,6 @@ class MySiteViewModelTest : BaseUnitTest() { @Mock lateinit var siteIconUploadHandler: SiteIconUploadHandler - @Mock - lateinit var siteStoriesHandler: SiteStoriesHandler - @Mock lateinit var displayUtilsWrapper: DisplayUtilsWrapper @@ -443,7 +440,6 @@ class MySiteViewModelTest : BaseUnitTest() { accountStore, selectedSiteRepository, siteIconUploadHandler, - siteStoriesHandler, displayUtilsWrapper, quickStartRepository, quickStartCardBuilder, diff --git a/WordPress/src/test/java/org/wordpress/android/ui/stories/StoriesIntroViewModelTest.kt b/WordPress/src/test/java/org/wordpress/android/ui/stories/StoriesIntroViewModelTest.kt deleted file mode 100644 index 683f06c1408d..000000000000 --- a/WordPress/src/test/java/org/wordpress/android/ui/stories/StoriesIntroViewModelTest.kt +++ /dev/null @@ -1,95 +0,0 @@ -package org.wordpress.android.ui.stories - -import androidx.lifecycle.Observer -import kotlinx.coroutines.ExperimentalCoroutinesApi -import kotlinx.coroutines.InternalCoroutinesApi -import org.junit.Before -import org.junit.Test -import org.mockito.Mock -import org.mockito.kotlin.any -import org.mockito.kotlin.anyOrNull -import org.mockito.kotlin.eq -import org.mockito.kotlin.reset -import org.mockito.kotlin.verify -import org.wordpress.android.BaseUnitTest -import org.wordpress.android.analytics.AnalyticsTracker.Stat -import org.wordpress.android.ui.prefs.AppPrefsWrapper -import org.wordpress.android.ui.stories.intro.StoriesIntroViewModel -import org.wordpress.android.util.NoDelayCoroutineDispatcher -import org.wordpress.android.util.analytics.AnalyticsTrackerWrapper - -@InternalCoroutinesApi -@ExperimentalCoroutinesApi -class StoriesIntroViewModelTest : BaseUnitTest() { - private lateinit var viewModel: StoriesIntroViewModel - - @Mock - lateinit var onDialogClosedObserver: Observer - - @Mock - lateinit var onCreateButtonClickedObserver: Observer - - @Mock - lateinit var onStoryOpenRequestedObserver: Observer - - @Mock - lateinit var analyticsTrackerWrapper: AnalyticsTrackerWrapper - - @Mock - private lateinit var appPrefsWrapper: AppPrefsWrapper - - @Before - fun setUp() = test { - viewModel = StoriesIntroViewModel( - analyticsTrackerWrapper, - appPrefsWrapper, - NoDelayCoroutineDispatcher() - ) - viewModel.onDialogClosed.observeForever(onDialogClosedObserver) - viewModel.onCreateButtonClicked.observeForever(onCreateButtonClickedObserver) - viewModel.onStoryOpenRequested.observeForever(onStoryOpenRequestedObserver) - } - - @Test - fun `pressing back button closes the dialog`() { - viewModel.onBackButtonPressed() - verify(onDialogClosedObserver).onChanged(anyOrNull()) - } - - @Test - fun `pressing create button triggers appropriate event`() { - viewModel.onCreateStoryButtonPressed() - verify(onCreateButtonClickedObserver).onChanged(anyOrNull()) - } - - @Test - fun `tapping preview images triggers request for opening story in browser`() { - viewModel.onStoryPreviewTapped1() - verify(onStoryOpenRequestedObserver).onChanged(any()) - - reset(onStoryOpenRequestedObserver) - - viewModel.onStoryPreviewTapped2() - verify(onStoryOpenRequestedObserver).onChanged(any()) - } - - @Test - fun `opening is tracked when view model starts`() { - viewModel.start() - verify(analyticsTrackerWrapper).track(eq(Stat.STORY_INTRO_SHOWN)) - } - - @Test - fun `closing is tracked when view is dismissed`() { - viewModel.onBackButtonPressed() - verify(analyticsTrackerWrapper).track(eq(Stat.STORY_INTRO_DISMISSED)) - } - - @Test - fun `pref is updated when user taps create story button`() { - viewModel.onCreateStoryButtonPressed() - verify(appPrefsWrapper).shouldShowStoriesIntro = false - - verify(analyticsTrackerWrapper).track(eq(Stat.STORY_INTRO_CREATE_STORY_BUTTON_TAPPED)) - } -} diff --git a/WordPress/src/test/java/org/wordpress/android/util/SiteUtilsTest.kt b/WordPress/src/test/java/org/wordpress/android/util/SiteUtilsTest.kt index 477f03537081..a26ab3917489 100644 --- a/WordPress/src/test/java/org/wordpress/android/util/SiteUtilsTest.kt +++ b/WordPress/src/test/java/org/wordpress/android/util/SiteUtilsTest.kt @@ -186,7 +186,8 @@ class SiteUtilsTest { setIsWPCom(true) } - val supportsStoriesFeature = SiteUtils.supportsStoriesFeature(site, jetpackFeatureRemovalPhaseHelper) + val supportsStoriesFeature = SiteUtils.supportsStoriesFeature( + ) assertTrue(supportsStoriesFeature) } @@ -198,7 +199,8 @@ class SiteUtilsTest { jetpackVersion = SiteUtils.WP_STORIES_JETPACK_VERSION } - val supportsStoriesFeature = SiteUtils.supportsStoriesFeature(site, jetpackFeatureRemovalPhaseHelper) + val supportsStoriesFeature = SiteUtils.supportsStoriesFeature( + ) assertTrue(supportsStoriesFeature) } @@ -209,7 +211,8 @@ class SiteUtilsTest { jetpackVersion = (SiteUtils.WP_STORIES_JETPACK_VERSION.toFloat() - 1).toString() } - val supportsStoriesFeature = SiteUtils.supportsStoriesFeature(site, jetpackFeatureRemovalPhaseHelper) + val supportsStoriesFeature = SiteUtils.supportsStoriesFeature( + ) assertFalse(supportsStoriesFeature) } @@ -222,7 +225,8 @@ class SiteUtilsTest { } whenever(jetpackFeatureRemovalPhaseHelper.shouldShowStoryPost()).thenReturn(false) - val supportsStoriesFeature = SiteUtils.supportsStoriesFeature(site, jetpackFeatureRemovalPhaseHelper) + val supportsStoriesFeature = SiteUtils.supportsStoriesFeature( + ) assertFalse(supportsStoriesFeature) } diff --git a/WordPress/src/test/java/org/wordpress/android/viewmodel/main/WPMainActivityViewModelTest.kt b/WordPress/src/test/java/org/wordpress/android/viewmodel/main/WPMainActivityViewModelTest.kt index 494f13d07c45..af85c11d4478 100644 --- a/WordPress/src/test/java/org/wordpress/android/viewmodel/main/WPMainActivityViewModelTest.kt +++ b/WordPress/src/test/java/org/wordpress/android/viewmodel/main/WPMainActivityViewModelTest.kt @@ -167,7 +167,7 @@ class WPMainActivityViewModelTest : BaseUnitTest() { whenever(quickStartRepository.activeTask).thenReturn(activeTask) whenever(bloggingPromptsSettingsHelper.shouldShowPromptsFeature()).thenReturn(false) whenever(bloggingPromptsStore.getPromptForDate(any(), any())).thenReturn(flowOf(bloggingPrompt)) - whenever(siteUtilsWrapper.supportsStoriesFeature(any(), any())).thenReturn(true) + whenever(siteUtilsWrapper.supportsStoriesFeature()).thenReturn(true) whenever(shouldAskPrivacyConsent()).thenReturn(false) viewModel = WPMainActivityViewModel( featureAnnouncementProvider, @@ -426,7 +426,7 @@ class WPMainActivityViewModelTest : BaseUnitTest() { @Test fun `new post action is triggered from FAB when no full access to content if stories unavailable`() { startViewModelWithDefaultParameters() - whenever(siteUtilsWrapper.supportsStoriesFeature(any(), any())).thenReturn(false) + whenever(siteUtilsWrapper.supportsStoriesFeature()).thenReturn(false) viewModel.onFabClicked(site = initSite(hasFullAccessToContent = false, isWpcomOrJpSite = false)) assertThat(viewModel.isBottomSheetShowing.value).isNull() assertThat(viewModel.createAction.value).isEqualTo(CREATE_NEW_POST) @@ -494,7 +494,7 @@ class WPMainActivityViewModelTest : BaseUnitTest() { @Test fun `onResume set expected content message when user has not full access to content`() { startViewModelWithDefaultParameters() - whenever(siteUtilsWrapper.supportsStoriesFeature(any(), any())).thenReturn(true) + whenever(siteUtilsWrapper.supportsStoriesFeature()).thenReturn(true) viewModel.onResume(site = initSite(hasFullAccessToContent = false), isOnMySitePageWithValidSite = true) assertThat(fabUiState!!.CreateContentMessageId) diff --git a/fastlane/resources/values/strings.xml b/fastlane/resources/values/strings.xml index f7865454b8b2..5262b65d52c4 100644 --- a/fastlane/resources/values/strings.xml +++ b/fastlane/resources/values/strings.xml @@ -3434,9 +3434,6 @@ Create a page Create a post or story - Create a post, page or story - Create a post or story - Create Site %1$d of %2$d diff --git a/libs/analytics/src/main/java/org/wordpress/android/analytics/AnalyticsTracker.java b/libs/analytics/src/main/java/org/wordpress/android/analytics/AnalyticsTracker.java index fbc2df7a413e..fa34b24f61a3 100644 --- a/libs/analytics/src/main/java/org/wordpress/android/analytics/AnalyticsTracker.java +++ b/libs/analytics/src/main/java/org/wordpress/android/analytics/AnalyticsTracker.java @@ -169,8 +169,6 @@ public enum Stat { MEDIA_PICKER_OPEN_WP_MEDIA, MEDIA_PICKER_OPEN_STOCK_LIBRARY, MEDIA_PICKER_OPEN_GIF_LIBRARY, - MEDIA_PICKER_OPEN_WP_STORIES_CAPTURE, - MEDIA_PICKER_OPEN_FOR_STORIES, MEDIA_PICKER_RECENT_MEDIA_SELECTED, MEDIA_PICKER_PREVIEW_OPENED, MEDIA_PICKER_SEARCH_EXPANDED, @@ -747,17 +745,6 @@ public enum Stat { FEATURED_IMAGE_REMOVE_CLICKED_POST_SETTINGS, MEDIA_EDITOR_SHOWN, MEDIA_EDITOR_USED, - STORY_SAVE_SUCCESSFUL, - STORY_SAVE_ERROR, - STORY_POST_SAVE_LOCALLY, - STORY_POST_SAVE_REMOTELY, - STORY_SAVE_ERROR_SNACKBAR_MANAGE_TAPPED, - STORY_POST_PUBLISH_TAPPED, - STORY_TEXT_CHANGED, - STORY_INTRO_SHOWN, - STORY_INTRO_DISMISSED, - STORY_INTRO_CREATE_STORY_BUTTON_TAPPED, - STORY_BLOCK_ADD_MEDIA_TAPPED, PREPUBLISHING_BOTTOM_SHEET_OPENED, PREPUBLISHING_BOTTOM_SHEET_DISMISSED, FEATURE_ANNOUNCEMENT_SHOWN_ON_APP_UPGRADE, diff --git a/libs/analytics/src/main/java/org/wordpress/android/analytics/AnalyticsTrackerNosara.java b/libs/analytics/src/main/java/org/wordpress/android/analytics/AnalyticsTrackerNosara.java index 1ea594ddff90..4beaaf831e35 100644 --- a/libs/analytics/src/main/java/org/wordpress/android/analytics/AnalyticsTrackerNosara.java +++ b/libs/analytics/src/main/java/org/wordpress/android/analytics/AnalyticsTrackerNosara.java @@ -1633,10 +1633,6 @@ public static String getEventNameForStat(AnalyticsTracker.Stat stat) { return "media_picker_open_stock_library"; case MEDIA_PICKER_OPEN_GIF_LIBRARY: return "media_picker_open_gif_library"; - case MEDIA_PICKER_OPEN_WP_STORIES_CAPTURE: - return "media_picker_stories_capture_opened"; - case MEDIA_PICKER_OPEN_FOR_STORIES: - return "media_picker_open_for_stories"; case MEDIA_PICKER_RECENT_MEDIA_SELECTED: return "media_picker_recent_media_selected"; case MEDIA_PICKER_PREVIEW_OPENED: @@ -1988,28 +1984,6 @@ public static String getEventNameForStat(AnalyticsTracker.Stat stat) { return "media_editor_shown"; case MEDIA_EDITOR_USED: return "media_editor_used"; - case STORY_SAVE_SUCCESSFUL: - return "story_save_successful"; - case STORY_SAVE_ERROR: - return "story_save_error"; - case STORY_POST_SAVE_LOCALLY: - return "story_post_save_locally"; - case STORY_POST_SAVE_REMOTELY: - return "story_post_save_remotely"; - case STORY_SAVE_ERROR_SNACKBAR_MANAGE_TAPPED: - return "story_post_error_snackbar_manage_tapped"; - case STORY_POST_PUBLISH_TAPPED: - return "story_post_publish_tapped"; - case STORY_TEXT_CHANGED: - return "story_text_changed"; - case STORY_INTRO_SHOWN: - return "story_intro_shown"; - case STORY_INTRO_DISMISSED: - return "story_intro_dismissed"; - case STORY_INTRO_CREATE_STORY_BUTTON_TAPPED: - return "story_intro_create_story_button_tapped"; - case STORY_BLOCK_ADD_MEDIA_TAPPED: - return "story_block_add_media_tapped"; case FEATURE_ANNOUNCEMENT_SHOWN_ON_APP_UPGRADE: case FEATURE_ANNOUNCEMENT_SHOWN_FROM_APP_SETTINGS: return "feature_announcement_shown"; From e4eded38b808007c48aa9001500e63c80e3f86d7 Mon Sep 17 00:00:00 2001 From: Jarvis Lin Date: Wed, 24 Jan 2024 16:57:51 +0800 Subject: [PATCH 02/33] Remove code related to Stories --- WordPress/src/main/AndroidManifest.xml | 8 -- .../android/modules/AppComponent.java | 4 - .../android/ui/ActivityLauncher.java | 70 ----------------- .../wordpress/android/ui/RequestCodes.java | 3 - .../android/ui/mysite/MySiteFragment.kt | 1 - .../android/ui/mysite/SiteNavigationAction.kt | 2 - .../android/ui/mysite/SiteStoriesHandler.kt | 77 ------------------- .../android/ui/posts/EditPostActivity.java | 22 +----- .../ui/posts/editor/StoriesEventListener.kt | 26 +------ .../ui/stories/StoryComposerActivity.kt | 7 +- .../media/StoryMediaSaveUploadBridge.kt | 2 - WordPress/src/main/res/values-v27/styles.xml | 8 -- WordPress/src/main/res/values/styles.xml | 6 -- .../gutenberg/GutenbergEditorFragment.java | 18 ----- 14 files changed, 7 insertions(+), 247 deletions(-) delete mode 100644 WordPress/src/main/java/org/wordpress/android/ui/mysite/SiteStoriesHandler.kt diff --git a/WordPress/src/main/AndroidManifest.xml b/WordPress/src/main/AndroidManifest.xml index c866c2b082f2..fe411ee17cff 100644 --- a/WordPress/src/main/AndroidManifest.xml +++ b/WordPress/src/main/AndroidManifest.xml @@ -249,14 +249,6 @@ android:value=".ui.posts.PostsListActivity" /> - - - - ActivityLauncher.loginForJetpackStats(this@MySiteFragment) - is SiteNavigationAction.OpenStories -> ActivityLauncher.viewStories(activity, action.site, action.event) is SiteNavigationAction.OpenDomains -> ActivityLauncher.viewDomainsDashboardActivity( activity, action.site diff --git a/WordPress/src/main/java/org/wordpress/android/ui/mysite/SiteNavigationAction.kt b/WordPress/src/main/java/org/wordpress/android/ui/mysite/SiteNavigationAction.kt index a762ef5834aa..138701feb962 100644 --- a/WordPress/src/main/java/org/wordpress/android/ui/mysite/SiteNavigationAction.kt +++ b/WordPress/src/main/java/org/wordpress/android/ui/mysite/SiteNavigationAction.kt @@ -45,8 +45,6 @@ sealed class SiteNavigationAction { object StartWPComLoginForJetpackStats : SiteNavigationAction() data class OpenStats(val site: SiteModel) : SiteNavigationAction() data class ConnectJetpackForStats(val site: SiteModel) : SiteNavigationAction() - data class OpenStories(val site: SiteModel, val event: StorySaveResult) : SiteNavigationAction() - data class OpenDomainRegistration(val site: SiteModel) : SiteNavigationAction() data class OpenPaidDomainSearch(val site: SiteModel) : SiteNavigationAction() data class OpenFreeDomainSearch(val site: SiteModel) : SiteNavigationAction() diff --git a/WordPress/src/main/java/org/wordpress/android/ui/mysite/SiteStoriesHandler.kt b/WordPress/src/main/java/org/wordpress/android/ui/mysite/SiteStoriesHandler.kt deleted file mode 100644 index 3c58c99c7f5d..000000000000 --- a/WordPress/src/main/java/org/wordpress/android/ui/mysite/SiteStoriesHandler.kt +++ /dev/null @@ -1,77 +0,0 @@ -package org.wordpress.android.ui.mysite - -import android.content.Intent -import androidx.lifecycle.LiveData -import androidx.lifecycle.MutableLiveData -import com.wordpress.stories.compose.frame.FrameSaveNotifier -import com.wordpress.stories.compose.frame.StorySaveEvents -import com.wordpress.stories.compose.frame.StorySaveEvents.StorySaveProcessStart -import com.wordpress.stories.compose.frame.StorySaveEvents.StorySaveResult -import com.wordpress.stories.compose.story.StoryRepository -import org.greenrobot.eventbus.Subscribe -import org.greenrobot.eventbus.ThreadMode -import org.wordpress.android.R -import org.wordpress.android.fluxc.model.SiteModel -import org.wordpress.android.ui.PagePostCreationSourcesDetail -import org.wordpress.android.ui.mysite.SiteNavigationAction.OpenStories -import org.wordpress.android.ui.pages.SnackbarMessageHolder -import org.wordpress.android.ui.utils.UiString.UiStringRes -import org.wordpress.android.ui.utils.UiString.UiStringText -import org.wordpress.android.util.EventBusWrapper -import org.wordpress.android.util.merge -import org.wordpress.android.viewmodel.ContextProvider -import org.wordpress.android.viewmodel.Event -import org.wordpress.android.viewmodel.ResourceProvider -import javax.inject.Inject - -class SiteStoriesHandler -@Inject constructor( - private val eventBusWrapper: EventBusWrapper, - private val resourceProvider: ResourceProvider, - private val contextProvider: ContextProvider, - private val selectedSiteRepository: SelectedSiteRepository, -) { - private val _onSnackbar = MutableLiveData>() - private val _onNavigation = MutableLiveData>() - val onNavigation = merge(_onNavigation) - - init { - eventBusWrapper.register(this) - } - - fun clear() { - eventBusWrapper.unregister(this) - } - - @Subscribe(sticky = true, threadMode = ThreadMode.MAIN) - fun onEventMainThread(event: StorySaveResult) { - eventBusWrapper.removeStickyEvent(event) - if (!event.isSuccess()) { - // note: no tracking added here as we'll perform tracking in StoryMediaSaveUploadBridge - val errorText = String.format( - resourceProvider.getString(R.string.story_saving_snackbar_finished_with_error), - StoryRepository.getStoryAtIndex(event.storyIndex).title - ) - val snackbarMessage = FrameSaveNotifier.buildSnackbarErrorMessage( - contextProvider.getContext(), - StorySaveEvents.allErrorsInResult(event.frameSaveResult).size, - errorText - ) - - _onSnackbar.postValue( - Event( - SnackbarMessageHolder( - UiStringText(snackbarMessage), - UiStringRes(R.string.story_saving_failed_quick_action_manage), - buttonAction = { - val selectedSite = selectedSiteRepository.getSelectedSite() - ?: return@SnackbarMessageHolder - _onNavigation.postValue(Event(OpenStories(selectedSite, event))) - }, - onDismissAction = { } - ) - ) - ) - } - } -} diff --git a/WordPress/src/main/java/org/wordpress/android/ui/posts/EditPostActivity.java b/WordPress/src/main/java/org/wordpress/android/ui/posts/EditPostActivity.java index 5a4637715143..60e66b9991f5 100644 --- a/WordPress/src/main/java/org/wordpress/android/ui/posts/EditPostActivity.java +++ b/WordPress/src/main/java/org/wordpress/android/ui/posts/EditPostActivity.java @@ -71,12 +71,12 @@ import org.wordpress.android.editor.EditorMediaUtils; import org.wordpress.android.editor.EditorThemeUpdateListener; import org.wordpress.android.editor.ExceptionLogger; -import org.wordpress.android.editor.savedinstance.SavedInstanceDatabase; import org.wordpress.android.editor.gutenberg.DialogVisibility; import org.wordpress.android.editor.gutenberg.GutenbergEditorFragment; import org.wordpress.android.editor.gutenberg.GutenbergPropsBuilder; import org.wordpress.android.editor.gutenberg.GutenbergWebViewAuthorizationData; import org.wordpress.android.editor.gutenberg.StorySaveMediaListener; +import org.wordpress.android.editor.savedinstance.SavedInstanceDatabase; import org.wordpress.android.fluxc.Dispatcher; import org.wordpress.android.fluxc.action.AccountAction; import org.wordpress.android.fluxc.generated.AccountActionBuilder; @@ -89,7 +89,6 @@ import org.wordpress.android.fluxc.model.CauseOfOnPostChanged.RemoteAutoSavePost; import org.wordpress.android.fluxc.model.EditorTheme; import org.wordpress.android.fluxc.model.EditorThemeSupport; -import org.wordpress.android.fluxc.model.LocalOrRemoteId.LocalId; import org.wordpress.android.fluxc.model.MediaModel; import org.wordpress.android.fluxc.model.MediaModel.MediaUploadState; import org.wordpress.android.fluxc.model.PostImmutableModel; @@ -447,7 +446,6 @@ enum RestartEditorOptions { private SiteModel mSite; private SiteSettingsInterface mSiteSettings; private boolean mIsJetpackSsoEnabled; - private boolean mStoryEditingCancelled = false; private boolean mNetworkErrorOnLastMediaFetchAttempt = false; @@ -2386,7 +2384,6 @@ public Fragment getItem(int position) { mIsNewPost, gutenbergWebViewAuthorizationData, gutenbergPropsBuilder, - RequestCodes.EDIT_STORY, mJetpackFeatureRemovalPhaseHelper.shouldShowJetpackPoweredEditorFeatures() ); } else { @@ -2815,23 +2812,12 @@ public void onActivityResult(int requestCode, int resultCode, Intent data) { case RequestCodes.STOCK_MEDIA_PICKER_SINGLE_SELECT_FOR_GUTENBERG_BLOCK: mEditorFragment.mediaSelectionCancelled(); return; - case RequestCodes.EDIT_STORY: - mStoryEditingCancelled = true; - return; default: // noop return; } } - if (requestCode == RequestCodes.EDIT_STORY) { - mStoryEditingCancelled = false; - if (mEditorFragment instanceof GutenbergEditorFragment) { - mEditorFragment.onActivityResult(requestCode, resultCode, data); - return; - } - } - if (data != null || ((requestCode == RequestCodes.TAKE_PHOTO || requestCode == RequestCodes.TAKE_VIDEO || requestCode == RequestCodes.PHOTO_PICKER))) { switch (requestCode) { @@ -3505,7 +3491,7 @@ public void onEditorFragmentContentReady( // don't start listening for Story events just now if we're waiting for a block to be replaced, // unless the user cancelled editing in which case we should continue as normal and attach the listener - if (!replaceBlockActionWaiting || mStoryEditingCancelled) { + if (!replaceBlockActionWaiting) { mStoriesEventListener.startListening(); } @@ -3588,10 +3574,8 @@ public void onTrackableEvent(TrackableEvent event, Map propertie updateAndSavePostAsync(updatePostResult -> { boolean noSlidesLoaded = mStoriesEventListener.onRequestMediaFilesEditorLoad( EditPostActivity.this, - new LocalId(mEditPostRepository.getId()), mNetworkErrorOnLastMediaFetchAttempt, - mediaFiles, - blockId + mediaFiles ); if (mNetworkErrorOnLastMediaFetchAttempt && noSlidesLoaded) { diff --git a/WordPress/src/main/java/org/wordpress/android/ui/posts/editor/StoriesEventListener.kt b/WordPress/src/main/java/org/wordpress/android/ui/posts/editor/StoriesEventListener.kt index 38d07bf8ee6b..46d21b0545bc 100644 --- a/WordPress/src/main/java/org/wordpress/android/ui/posts/editor/StoriesEventListener.kt +++ b/WordPress/src/main/java/org/wordpress/android/ui/posts/editor/StoriesEventListener.kt @@ -29,7 +29,6 @@ import org.wordpress.android.fluxc.model.MediaModel import org.wordpress.android.fluxc.model.MediaModel.MediaUploadState.UPLOADED import org.wordpress.android.fluxc.model.SiteModel import org.wordpress.android.fluxc.store.MediaStore -import org.wordpress.android.ui.ActivityLauncher import org.wordpress.android.ui.posts.EditPostRepository import org.wordpress.android.ui.posts.editor.media.EditorMedia import org.wordpress.android.ui.posts.editor.media.EditorMediaListener @@ -251,36 +250,17 @@ class StoriesEventListener @Inject constructor( // Editor load / cancel events fun onRequestMediaFilesEditorLoad( activity: Activity, - postId: LocalId, networkErrorOnLastMediaFetchAttempt: Boolean, - mediaFiles: ArrayList, - blockId: String + mediaFiles: ArrayList ): Boolean { if (mediaFiles.isEmpty()) { - ActivityLauncher.editEmptyStoryForResult( - activity, - site, - postId, - storyRepositoryWrapper.getCurrentStoryIndex(), - blockId - ) + // do nothing? return false } val reCreateStoryResult = loadStoryFromStoriesPrefsUseCase .loadStoryFromMemoryOrRecreateFromPrefs(site, mediaFiles) - if (!reCreateStoryResult.noSlidesLoaded) { - // Story instance loaded or re-created! Load it onto the StoryComposer for editing now - ActivityLauncher.editStoryForResult( - activity, - site, - postId, - reCreateStoryResult.storyIndex, - reCreateStoryResult.allStorySlidesAreEditable, - true, - blockId - ) - } else { + if (reCreateStoryResult.noSlidesLoaded) { // unfortunately we couldn't even load the remote media Ids indicated by the StoryBlock so we can't allow // editing at this time :( if (networkErrorOnLastMediaFetchAttempt) { diff --git a/WordPress/src/main/java/org/wordpress/android/ui/stories/StoryComposerActivity.kt b/WordPress/src/main/java/org/wordpress/android/ui/stories/StoryComposerActivity.kt index b54878e3bd5b..9b3bd395bd35 100644 --- a/WordPress/src/main/java/org/wordpress/android/ui/stories/StoryComposerActivity.kt +++ b/WordPress/src/main/java/org/wordpress/android/ui/stories/StoryComposerActivity.kt @@ -40,9 +40,7 @@ import org.greenrobot.eventbus.Subscribe import org.greenrobot.eventbus.ThreadMode import org.wordpress.android.R import org.wordpress.android.WordPress -import org.wordpress.android.analytics.AnalyticsTracker.Stat import org.wordpress.android.analytics.AnalyticsTracker.Stat.PREPUBLISHING_BOTTOM_SHEET_OPENED -import org.wordpress.android.editor.gutenberg.GutenbergEditorFragment.ARG_STORY_BLOCK_ID import org.wordpress.android.editor.gutenberg.GutenbergEditorFragment.ARG_STORY_BLOCK_UPDATED_CONTENT import org.wordpress.android.fluxc.model.LocalOrRemoteId.LocalId import org.wordpress.android.fluxc.model.LocalOrRemoteId.RemoteId @@ -62,11 +60,11 @@ import org.wordpress.android.ui.posts.EditPostActivity.OnPostUpdatedFromUIListen import org.wordpress.android.ui.posts.EditPostRepository import org.wordpress.android.ui.posts.EditPostSettingsFragment.EditPostActivityHook import org.wordpress.android.ui.posts.PostEditorAnalyticsSession -import org.wordpress.android.ui.posts.prepublishing.PrepublishingBottomSheetFragment import org.wordpress.android.ui.posts.ProgressDialogHelper import org.wordpress.android.ui.posts.ProgressDialogUiState import org.wordpress.android.ui.posts.editor.media.AddExistingMediaSource.WP_MEDIA_LIBRARY import org.wordpress.android.ui.posts.editor.media.EditorMediaListener +import org.wordpress.android.ui.posts.prepublishing.PrepublishingBottomSheetFragment import org.wordpress.android.ui.posts.prepublishing.home.PublishPost import org.wordpress.android.ui.posts.prepublishing.listeners.PrepublishingBottomSheetListener import org.wordpress.android.ui.stories.SaveStoryGutenbergBlockUseCase.Companion.TEMPORARY_ID_PREFIX @@ -181,7 +179,6 @@ class StoryComposerActivity : ComposeLoopFrameActivity(), // convert our WPAndroid KEY_LAUNCHED_FROM_GUTENBERG flag into Stories general purpose EDIT_MODE flag intent.putExtra(KEY_STORY_EDIT_MODE, intent.getBooleanExtra(KEY_LAUNCHED_FROM_GUTENBERG, false)) setMediaPickerProvider(this) - (application as WordPress).component().inject(this) initSite(savedInstanceState) setSnackbarProvider(this) setAuthenticationProvider(this) @@ -585,8 +582,6 @@ class StoryComposerActivity : ComposeLoopFrameActivity(), processStorySaving() val savedContentIntent = Intent() - val blockId = intent.extras?.getString(ARG_STORY_BLOCK_ID) - savedContentIntent.putExtra(ARG_STORY_BLOCK_ID, blockId) // check if story index has been passed through intent var storyIndex = intent.getIntExtra(KEY_STORY_INDEX, DEFAULT_NONE_SELECTED) diff --git a/WordPress/src/main/java/org/wordpress/android/ui/stories/media/StoryMediaSaveUploadBridge.kt b/WordPress/src/main/java/org/wordpress/android/ui/stories/media/StoryMediaSaveUploadBridge.kt index bd3e21b89747..dc44b9ce5cb9 100644 --- a/WordPress/src/main/java/org/wordpress/android/ui/stories/media/StoryMediaSaveUploadBridge.kt +++ b/WordPress/src/main/java/org/wordpress/android/ui/stories/media/StoryMediaSaveUploadBridge.kt @@ -26,7 +26,6 @@ import org.wordpress.android.ui.posts.SavePostToDbUseCase import org.wordpress.android.ui.posts.editor.media.AddLocalMediaToPostUseCase import org.wordpress.android.ui.posts.editor.media.EditorMediaListener import org.wordpress.android.ui.stories.SaveStoryGutenbergBlockUseCase -import org.wordpress.android.ui.stories.StoryComposerActivity import org.wordpress.android.ui.stories.StoryRepositoryWrapper import org.wordpress.android.ui.stories.prefs.StoriesPrefs import org.wordpress.android.ui.stories.prefs.StoriesPrefs.TempId @@ -244,7 +243,6 @@ class StoryMediaSaveUploadBridge @Inject constructor( // only remove it if it was successful - we want to keep it and show a snackbar once when the user // comes back to the app if it wasn't, see MySiteFragment for details. eventBusWrapper.removeStickyEvent(event) - editPostRepository.loadPostByLocalPostId(it.getInt(StoryComposerActivity.KEY_POST_LOCAL_ID)) // media upload tracking already in addLocalMediaToPostUseCase.addNewMediaToEditorAsync addNewStoryFrameMediaItemsToPostAndUploadAsync(site, event) } diff --git a/WordPress/src/main/res/values-v27/styles.xml b/WordPress/src/main/res/values-v27/styles.xml index 957f1123a827..6961aa8c41e9 100644 --- a/WordPress/src/main/res/values-v27/styles.xml +++ b/WordPress/src/main/res/values-v27/styles.xml @@ -4,12 +4,4 @@ @android:color/white true - - - diff --git a/WordPress/src/main/res/values/styles.xml b/WordPress/src/main/res/values/styles.xml index ca9a20a35bc6..de302586699b 100644 --- a/WordPress/src/main/res/values/styles.xml +++ b/WordPress/src/main/res/values/styles.xml @@ -210,12 +210,6 @@ @color/black - -