diff --git a/RELEASE-NOTES.txt b/RELEASE-NOTES.txt
index 01454109f51d..39e50203e72b 100644
--- a/RELEASE-NOTES.txt
+++ b/RELEASE-NOTES.txt
@@ -2,6 +2,9 @@
24.4
-----
+* [***] [Jetpack-only] Improved Notifications experience with richer UI elements and interactions [https://github.com/wordpress-mobile/WordPress-Android/pull/20072]
+* [**] [Jetpack-only] Block editor: Introduce VideoPress v5 support, to fix issues using video block with dotcom and Jetpack sites [https://github.com/wordpress-mobile/gutenberg-mobile/pull/6634]
+* [**] [internal] Removed the Stories from the codebase [https://github.com/wordpress-mobile/WordPress-Android/pull/20016]
[***] [Jetpack-only] Stats: Introducing Traffic tab, delivering improved graphs, and combining Days/Weeks/Months/Years tabs into one, behind a feature flag. [https://github.com/wordpress-mobile/WordPress-Android/pull/19942]
[***] [Jetpack-only] Improved Notifications experience with richer UI elements and interactions [https://github.com/wordpress-mobile/WordPress-Android/pull/20072]
* [**] [Jetpack-only] Block editor: Introduce VideoPress v5 support, to fix issues using video block with dotcom and Jetpack sites [https://github.com/wordpress-mobile/gutenberg-mobile/pull/6634]
diff --git a/WordPress/build.gradle b/WordPress/build.gradle
index 1a7c673ac696..6329c75f8e74 100644
--- a/WordPress/build.gradle
+++ b/WordPress/build.gradle
@@ -38,7 +38,6 @@ repositories {
includeGroup "org.wordpress.gutenberg-mobile"
includeGroupByRegex "org.wordpress.react-native-libraries.*"
includeGroup "com.automattic"
- includeGroup "com.automattic.stories"
includeGroup "com.automattic.tracks"
}
}
@@ -375,11 +374,6 @@ dependencies {
exclude group: 'org.wordpress', module: 'utils'
}
implementation "$gradle.ext.aboutAutomatticBinaryPath:$automatticAboutVersion"
- implementation ("$gradle.ext.storiesAndroidPath:$automatticStoriesVersion") {
- exclude group: 'androidx.navigation', module: 'navigation-fragment-ktx'
- exclude group: 'androidx.navigation', module: 'navigation-ui-ktx'
- }
- implementation "$gradle.ext.storiesAndroidMp4ComposePath:$automatticStoriesVersion"
implementation("$gradle.ext.tracksBinaryPath") {
version {
@@ -470,8 +464,6 @@ dependencies {
implementation "com.google.dagger:hilt-android:$gradle.ext.daggerVersion"
kapt "com.google.dagger:hilt-compiler:$gradle.ext.daggerVersion"
- testImplementation "$gradle.ext.storiesAndroidPhotoEditorPath:$automatticStoriesVersion"
-
testImplementation("androidx.arch.core:core-testing:$androidxArchCoreVersion", {
exclude group: 'com.android.support', module: 'support-compat'
exclude group: 'com.android.support', module: 'support-annotations'
diff --git a/WordPress/src/main/AndroidManifest.xml b/WordPress/src/main/AndroidManifest.xml
index 28599bd22e30..bcb7a2b06e5a 100644
--- a/WordPress/src/main/AndroidManifest.xml
+++ b/WordPress/src/main/AndroidManifest.xml
@@ -250,14 +250,6 @@
android:value=".ui.posts.PostsListActivity" />
-
-
-
-
NotificationType.STORY_SAVE_SUCCESS
- STORY_SAVE_ERROR -> NotificationType.STORY_SAVE_ERROR
- STORY_FRAME_SAVE_SUCCESS -> NotificationType.STORY_FRAME_SAVE_SUCCESS
- STORY_FRAME_SAVE_ERROR -> NotificationType.STORY_FRAME_SAVE_ERROR
- }
- }
-
- override fun trackShownNotification(storyNotificationType: StoryNotificationType) {
- systemNotificationsTracker.trackShownNotification(translateNotificationTypes(storyNotificationType))
- }
-
- override fun trackTappedNotification(storyNotificationType: StoryNotificationType) {
- systemNotificationsTracker.trackTappedNotification(translateNotificationTypes(storyNotificationType))
- }
-
- override fun trackDismissedNotification(storyNotificationType: StoryNotificationType) {
- systemNotificationsTracker.trackDismissedNotification(translateNotificationTypes(storyNotificationType))
- }
- }
-
private fun updateNotificationSettings() {
if (!jetpackFeatureRemovalPhaseHelper.shouldShowNotifications()) {
NotificationsUtils.cancelAllNotifications(application)
diff --git a/WordPress/src/main/java/org/wordpress/android/WordPress.kt b/WordPress/src/main/java/org/wordpress/android/WordPress.kt
index 6918015aae05..928455ca34c0 100644
--- a/WordPress/src/main/java/org/wordpress/android/WordPress.kt
+++ b/WordPress/src/main/java/org/wordpress/android/WordPress.kt
@@ -4,7 +4,6 @@ import android.app.Application
import android.content.Context
import com.android.volley.RequestQueue
import dagger.hilt.EntryPoints
-import org.wordpress.android.AppInitializer.StoryNotificationTrackerProvider
import org.wordpress.android.fluxc.tools.FluxCImageLoader
import org.wordpress.android.modules.AppComponent
@@ -13,9 +12,6 @@ import org.wordpress.android.modules.AppComponent
* application. Containing public static variables and methods to be accessed by other classes.
*/
abstract class WordPress : Application() {
- val storyNotificationTrackerProvider: StoryNotificationTrackerProvider
- get() = initializer().storyNotificationTrackerProvider
-
abstract fun initializer(): AppInitializer
fun component(): AppComponent = EntryPoints.get(this, AppComponent::class.java)
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 839474dc2f14..5d8a75087824 100644
--- a/WordPress/src/main/java/org/wordpress/android/localcontentmigration/UserFlagsProviderHelper.kt
+++ b/WordPress/src/main/java/org/wordpress/android/localcontentmigration/UserFlagsProviderHelper.kt
@@ -68,7 +68,6 @@ class UserFlagsProviderHelper @Inject constructor(
UndeletablePrefKey.BOOKMARKS_SAVED_LOCALLY_DIALOG_SHOWN.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 f1f8aadc6697..2384e438dd45 100644
--- a/WordPress/src/main/java/org/wordpress/android/modules/AppComponent.java
+++ b/WordPress/src/main/java/org/wordpress/android/modules/AppComponent.java
@@ -173,8 +173,6 @@
import org.wordpress.android.ui.stats.refresh.lists.widget.weeks.WeekViewsWidgetListProvider;
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;
@@ -458,11 +456,6 @@ public interface AppComponent {
void inject(FeatureAnnouncementDialogFragment object);
void inject(FeatureAnnouncementListAdapter object);
-
- 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..cbd2ff792a84 100644
--- a/WordPress/src/main/java/org/wordpress/android/modules/ViewModelModule.java
+++ b/WordPress/src/main/java/org/wordpress/android/modules/ViewModelModule.java
@@ -72,8 +72,6 @@
import org.wordpress.android.ui.stats.refresh.lists.widget.configuration.StatsSiteSelectionViewModel;
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;
@@ -359,16 +357,6 @@ abstract class ViewModelModule {
@ViewModelKey(PrepublishingPublishSettingsViewModel.class)
abstract ViewModel prepublishingPublishSettingsViewModel(PrepublishingPublishSettingsViewModel viewModel);
- @Binds
- @IntoMap
- @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/push/NotificationType.kt b/WordPress/src/main/java/org/wordpress/android/push/NotificationType.kt
index 63f9f2155910..f4c6b971bbcc 100644
--- a/WordPress/src/main/java/org/wordpress/android/push/NotificationType.kt
+++ b/WordPress/src/main/java/org/wordpress/android/push/NotificationType.kt
@@ -22,10 +22,6 @@ enum class NotificationType {
MEDIA_UPLOAD_SUCCESS,
MEDIA_UPLOAD_ERROR,
POST_PUBLISHED,
- STORY_SAVE_SUCCESS,
- STORY_SAVE_ERROR,
- STORY_FRAME_SAVE_SUCCESS,
- STORY_FRAME_SAVE_ERROR,
BLOGGING_REMINDERS,
CREATE_SITE,
WEEKLY_ROUNDUP,
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 860e6e865a35..58120cf6a227 100644
--- a/WordPress/src/main/java/org/wordpress/android/ui/ActivityLauncher.java
+++ b/WordPress/src/main/java/org/wordpress/android/ui/ActivityLauncher.java
@@ -16,16 +16,12 @@
import androidx.core.app.TaskStackBuilder;
import androidx.fragment.app.Fragment;
-import com.wordpress.stories.compose.frame.FrameSaveNotifier;
-import com.wordpress.stories.compose.frame.StorySaveEvents.StorySaveResult;
-
import org.wordpress.android.BuildConfig;
import org.wordpress.android.R;
import org.wordpress.android.WordPress;
import org.wordpress.android.analytics.AnalyticsTracker;
import org.wordpress.android.analytics.AnalyticsTracker.Stat;
import org.wordpress.android.datasets.ReaderPostTable;
-import org.wordpress.android.fluxc.model.LocalOrRemoteId.LocalId;
import org.wordpress.android.fluxc.model.PostImmutableModel;
import org.wordpress.android.fluxc.model.PostModel;
import org.wordpress.android.fluxc.model.SiteModel;
@@ -85,8 +81,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;
@@ -124,7 +118,6 @@
import org.wordpress.android.ui.stats.refresh.lists.sections.insights.management.InsightsManagementActivity;
import org.wordpress.android.ui.stats.refresh.utils.StatsLaunchedFrom;
import org.wordpress.android.ui.stockmedia.StockMediaPickerActivity;
-import org.wordpress.android.ui.stories.StoryComposerActivity;
import org.wordpress.android.ui.suggestion.SuggestionActivity;
import org.wordpress.android.ui.suggestion.SuggestionType;
import org.wordpress.android.ui.themes.ThemeBrowserActivity;
@@ -145,14 +138,11 @@
import java.util.List;
import java.util.Map;
-import static com.wordpress.stories.util.BundleUtilsKt.KEY_STORY_INDEX;
-import static com.wordpress.stories.util.BundleUtilsKt.KEY_STORY_SAVE_RESULT;
import static org.wordpress.android.analytics.AnalyticsTracker.ACTIVITY_LOG_ACTIVITY_ID_KEY;
import static org.wordpress.android.analytics.AnalyticsTracker.Stat.POST_LIST_ACCESS_ERROR;
import static org.wordpress.android.analytics.AnalyticsTracker.Stat.READER_ARTICLE_DETAIL_REBLOGGED;
import static org.wordpress.android.analytics.AnalyticsTracker.Stat.READER_ARTICLE_REBLOGGED;
import static org.wordpress.android.analytics.AnalyticsTracker.Stat.STATS_ACCESS_ERROR;
-import static org.wordpress.android.editor.gutenberg.GutenbergEditorFragment.ARG_STORY_BLOCK_ID;
import static org.wordpress.android.imageeditor.preview.PreviewImageFragment.ARG_EDIT_IMAGE_DATA;
import static org.wordpress.android.login.LoginMode.JETPACK_LOGIN_ONLY;
import static org.wordpress.android.login.LoginMode.WPCOM_LOGIN_ONLY;
@@ -168,9 +158,6 @@
import static org.wordpress.android.ui.media.MediaBrowserActivity.ARG_BROWSER_TYPE;
import static org.wordpress.android.ui.pages.PagesActivityKt.EXTRA_PAGE_LIST_TYPE_KEY;
import static org.wordpress.android.ui.pages.PagesActivityKt.EXTRA_PAGE_REMOTE_ID_KEY;
-import static org.wordpress.android.ui.stories.StoryComposerActivity.KEY_ALL_UNFLATTENED_LOADED_SLIDES;
-import static org.wordpress.android.ui.stories.StoryComposerActivity.KEY_LAUNCHED_FROM_GUTENBERG;
-import static org.wordpress.android.ui.stories.StoryComposerActivity.KEY_POST_LOCAL_ID;
import static org.wordpress.android.viewmodel.activitylog.ActivityLogDetailViewModelKt.ACTIVITY_LOG_ARE_BUTTONS_VISIBLE_KEY;
import static org.wordpress.android.viewmodel.activitylog.ActivityLogDetailViewModelKt.ACTIVITY_LOG_ID_KEY;
import static org.wordpress.android.viewmodel.activitylog.ActivityLogDetailViewModelKt.ACTIVITY_LOG_IS_DASHBOARD_CARD_ENTRY_KEY;
@@ -253,33 +240,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
*/
@@ -1028,102 +988,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,
- LocalId localPostId,
- int storyIndex,
- boolean allStorySlidesAreEditable,
- boolean launchedFromGutenberg,
- String storyBlockId
- ) {
- if (site == null) {
- return;
- }
-
- Intent intent = new Intent(activity, StoryComposerActivity.class);
- intent.putExtra(WordPress.SITE, site);
- intent.putExtra(KEY_POST_LOCAL_ID, localPostId.getValue());
- intent.putExtra(KEY_STORY_INDEX, storyIndex);
- intent.putExtra(KEY_LAUNCHED_FROM_GUTENBERG, launchedFromGutenberg);
- intent.putExtra(KEY_ALL_UNFLATTENED_LOADED_SLIDES, allStorySlidesAreEditable);
- intent.putExtra(ARG_STORY_BLOCK_ID, storyBlockId);
- activity.startActivityForResult(intent, RequestCodes.EDIT_STORY);
- }
-
- public static void editEmptyStoryForResult(
- Activity activity,
- SiteModel site,
- LocalId localPostId,
- int storyIndex,
- String storyBlockId
- ) {
- if (site == null) {
- 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);
- activity.startActivityForResult(intent, RequestCodes.EDIT_STORY);
- }
-
public static void editPostOrPageForResult(Activity activity, SiteModel site, PostModel post) {
editPostOrPageForResult(new Intent(activity, EditPostActivity.class), activity, site, post.getId(), false);
}
@@ -1382,22 +1246,6 @@ public static void viewNotificationsSettings(Activity activity) {
activity.startActivity(intent);
}
- public static void viewStories(Activity activity, SiteModel site, StorySaveResult event) {
- Intent intent = new Intent(activity, StoryComposerActivity.class);
- intent.putExtra(KEY_STORY_SAVE_RESULT, event);
- intent.putExtra(WordPress.SITE, site);
-
- // we need to have a way to cancel the related error notification when the user comes
- // from tapping on MANAGE on the snackbar (otherwise they'll be able to discard the
- // errored story but the error notification will remain existing in the system dashboard)
- intent.setAction(String.valueOf(FrameSaveNotifier.getNotificationIdForError(
- StoryComposerActivity.BASE_FRAME_MEDIA_ERROR_NOTIFICATION_ID,
- event.getStoryIndex()
- )));
-
- activity.startActivity(intent);
- }
-
public static void viewJetpackSecuritySettingsForResult(Activity activity, SiteModel site) {
AnalyticsTracker.track(Stat.SITE_SETTINGS_JETPACK_SECURITY_SETTINGS_VIEWED);
Intent intent = new Intent(activity, JetpackSecuritySettingsActivity.class);
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..41de68d08d9c 100644
--- a/WordPress/src/main/java/org/wordpress/android/ui/RequestCodes.java
+++ b/WordPress/src/main/java/org/wordpress/android/ui/RequestCodes.java
@@ -71,10 +71,6 @@ public class RequestCodes {
// Other
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
public static final int READER_INTERESTS = 9001;
diff --git a/WordPress/src/main/java/org/wordpress/android/ui/compose/components/buttons/ImageButton.kt b/WordPress/src/main/java/org/wordpress/android/ui/compose/components/buttons/ImageButton.kt
index b48e648319ac..8ec3f0f00af8 100644
--- a/WordPress/src/main/java/org/wordpress/android/ui/compose/components/buttons/ImageButton.kt
+++ b/WordPress/src/main/java/org/wordpress/android/ui/compose/components/buttons/ImageButton.kt
@@ -39,10 +39,10 @@ fun PreviewDrawButton() {
Color.Gray,
shape = RoundedCornerShape(6.dp)
),
- drawableLeft = Drawable(R.drawable.ic_story_icon_24dp),
- drawableRight = Drawable(R.drawable.ic_story_icon_24dp),
- drawableTop = Drawable(R.drawable.ic_story_icon_24dp),
- drawableBottom = Drawable(R.drawable.ic_story_icon_24dp),
+ drawableLeft = Drawable(R.drawable.ic_pages_white_24dp),
+ drawableRight = Drawable(R.drawable.ic_pages_white_24dp),
+ drawableTop = Drawable(R.drawable.ic_pages_white_24dp),
+ drawableBottom = Drawable(R.drawable.ic_pages_white_24dp),
button = Button(text = UiString.UiStringText("Button Text")),
onClick = {}
)
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 49ec25df3d7f..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,9 +86,6 @@ class JetpackFeatureRemovalPhaseHelper @Inject constructor(
}
}
- @Suppress("FunctionOnlyReturningConstant")
- fun shouldShowStoryPost(): Boolean = false
-
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 6c2e4bf43a3d..25afd022eb4a 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
@@ -139,7 +139,6 @@
import org.wordpress.android.ui.sitecreation.misc.SiteCreationSource;
import org.wordpress.android.ui.stats.StatsTimeframe;
import org.wordpress.android.ui.stats.refresh.utils.StatsLaunchedFrom;
-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;
@@ -187,7 +186,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;
@@ -721,9 +719,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
@@ -1302,25 +1297,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(@NonNull final PageType pageType) {
switch (pageType) {
case MY_SITE:
@@ -1412,17 +1388,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 ed8f46b9fed8..e616663ca474 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
@@ -256,9 +256,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(
@@ -618,21 +615,6 @@ class MySiteFragment : Fragment(R.layout.my_site_fragment),
ActivityLauncher.viewConnectJetpackForStats(activity, action.site)
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..bc6134e7308a 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
@@ -2,7 +2,6 @@
package org.wordpress.android.ui.mysite
-import android.content.Intent
import android.net.Uri
import androidx.annotation.StringRes
import androidx.lifecycle.LiveData
@@ -20,8 +19,8 @@ import org.wordpress.android.R
import org.wordpress.android.analytics.AnalyticsTracker.Stat
import org.wordpress.android.fluxc.Dispatcher
import org.wordpress.android.fluxc.model.SiteModel
-import org.wordpress.android.fluxc.model.dashboard.CardModel.DynamicCardsModel
import org.wordpress.android.fluxc.model.dashboard.CardModel.ActivityCardModel
+import org.wordpress.android.fluxc.model.dashboard.CardModel.DynamicCardsModel
import org.wordpress.android.fluxc.model.dashboard.CardModel.PagesCardModel
import org.wordpress.android.fluxc.model.dashboard.CardModel.PostsCardModel
import org.wordpress.android.fluxc.model.dashboard.CardModel.TodaysStatsCardModel
@@ -35,7 +34,6 @@ import org.wordpress.android.localcontentmigration.ContentMigrationAnalyticsTrac
import org.wordpress.android.models.JetpackPoweredScreen
import org.wordpress.android.modules.BG_THREAD
import org.wordpress.android.modules.UI_THREAD
-import org.wordpress.android.ui.PagePostCreationSourcesDetail.STORY_FROM_MY_SITE
import org.wordpress.android.ui.jetpackoverlay.JetpackFeatureRemovalOverlayUtil
import org.wordpress.android.ui.jetpackoverlay.JetpackFeatureRemovalOverlayUtil.JetpackFeatureCollectionOverlaySource.FEATURE_CARD
import org.wordpress.android.ui.jetpackoverlay.JetpackFeatureRemovalPhaseHelper
@@ -125,7 +123,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 +203,6 @@ class MySiteViewModel @Inject constructor(
}
val onSnackbarMessage = merge(
_onSnackbarMessage,
- siteStoriesHandler.onSnackbar,
quickStartRepository.onSnackbar,
siteItemsViewModelSlice.onSnackbarMessage,
bloggingPromptCardViewModelSlice.onSnackbarMessage,
@@ -221,7 +217,6 @@ class MySiteViewModel @Inject constructor(
val onNavigation = merge(
_onNavigation,
- siteStoriesHandler.onNavigation,
blazeCardViewModelSlice.onNavigation,
pagesCardViewModelSlice.onNavigation,
todaysStatsViewModelSlice.onNavigation,
@@ -781,19 +776,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 95fe3002cd46..422a82a81a4c 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
@@ -1,11 +1,9 @@
package org.wordpress.android.ui.mysite
import androidx.annotation.StringRes
-import com.wordpress.stories.compose.frame.StorySaveEvents.StorySaveResult
import org.wordpress.android.fluxc.model.SiteModel
import org.wordpress.android.fluxc.store.QuickStartStore.QuickStartTaskType
import org.wordpress.android.models.ReaderTag
-import org.wordpress.android.ui.PagePostCreationSourcesDetail
import org.wordpress.android.ui.blaze.BlazeFlowSource
import org.wordpress.android.ui.blaze.blazecampaigns.campaigndetail.CampaignDetailPageSource
import org.wordpress.android.ui.blaze.blazecampaigns.campaignlisting.CampaignListingPageSource
@@ -45,24 +43,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 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()
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 6c064d580b08..000000000000
--- a/WordPress/src/main/java/org/wordpress/android/ui/mysite/SiteStoriesHandler.kt
+++ /dev/null
@@ -1,101 +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.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
-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 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)
-
- 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)))
- storiesTrackerHelper.trackStorySaveResultEvent(
- event,
- STORY_SAVE_ERROR_SNACKBAR_MANAGE_TAPPED
- )
- },
- onDismissAction = { }
- )
- )
- )
- }
- }
-
- @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/mysite/menu/MenuActivity.kt b/WordPress/src/main/java/org/wordpress/android/ui/mysite/menu/MenuActivity.kt
index 77ac0aa5d5c1..d35ba2380565 100644
--- a/WordPress/src/main/java/org/wordpress/android/ui/mysite/menu/MenuActivity.kt
+++ b/WordPress/src/main/java/org/wordpress/android/ui/mysite/menu/MenuActivity.kt
@@ -425,7 +425,7 @@ fun MySiteListItemPreviewWithSecondaryImage() {
MenuItemState.MenuListItem(
primaryIcon = R.drawable.ic_posts_white_24dp,
primaryText = UiString.UiStringText("Plans"),
- secondaryIcon = R.drawable.ic_story_icon_24dp,
+ secondaryIcon = R.drawable.ic_pages_white_24dp,
secondaryText = null,
showFocusPoint = false,
onClick = ListItemInteraction.create { onClick() },
diff --git a/WordPress/src/main/java/org/wordpress/android/ui/notifications/SystemNotificationsTracker.kt b/WordPress/src/main/java/org/wordpress/android/ui/notifications/SystemNotificationsTracker.kt
index 5ec418cecfe7..c0d8fa1e5177 100644
--- a/WordPress/src/main/java/org/wordpress/android/ui/notifications/SystemNotificationsTracker.kt
+++ b/WordPress/src/main/java/org/wordpress/android/ui/notifications/SystemNotificationsTracker.kt
@@ -23,10 +23,6 @@ import org.wordpress.android.push.NotificationType.POST_PUBLISHED
import org.wordpress.android.push.NotificationType.POST_UPLOAD_ERROR
import org.wordpress.android.push.NotificationType.POST_UPLOAD_SUCCESS
import org.wordpress.android.push.NotificationType.QUICK_START_REMINDER
-import org.wordpress.android.push.NotificationType.STORY_FRAME_SAVE_ERROR
-import org.wordpress.android.push.NotificationType.STORY_FRAME_SAVE_SUCCESS
-import org.wordpress.android.push.NotificationType.STORY_SAVE_ERROR
-import org.wordpress.android.push.NotificationType.STORY_SAVE_SUCCESS
import org.wordpress.android.push.NotificationType.TEST_NOTE
import org.wordpress.android.push.NotificationType.UNKNOWN_NOTE
import org.wordpress.android.push.NotificationType.WEEKLY_ROUNDUP
@@ -104,10 +100,6 @@ class SystemNotificationsTracker
MEDIA_UPLOAD_SUCCESS -> MEDIA_UPLOAD_SUCCESS_TYPE_VALUE
MEDIA_UPLOAD_ERROR -> MEDIA_UPLOAD_ERROR_TYPE_VALUE
POST_PUBLISHED -> POST_PUBLISHED_TYPE_VALUE
- STORY_SAVE_SUCCESS -> STORY_SAVE_SUCCESS_TYPE_VALUE
- STORY_SAVE_ERROR -> STORY_SAVE_ERROR_TYPE_VALUE
- STORY_FRAME_SAVE_SUCCESS -> STORY_FRAME_SAVE_SUCCESS_TYPE_VALUE
- STORY_FRAME_SAVE_ERROR -> STORY_FRAME_SAVE_ERROR_TYPE_VALUE
PENDING_DRAFTS -> PENDING_DRAFT_TYPE_VALUE
ZENDESK -> ZENDESK_MESSAGE_TYPE_VALUE
BLOGGING_REMINDERS -> BLOGGING_REMINDERS_TYPE_VALUE
@@ -139,10 +131,6 @@ class SystemNotificationsTracker
private const val MEDIA_UPLOAD_SUCCESS_TYPE_VALUE = "media_upload_success"
private const val MEDIA_UPLOAD_ERROR_TYPE_VALUE = "media_upload_error"
private const val POST_PUBLISHED_TYPE_VALUE = "post_published"
- private const val STORY_SAVE_SUCCESS_TYPE_VALUE = "story_save_success"
- private const val STORY_SAVE_ERROR_TYPE_VALUE = "story_save_error"
- private const val STORY_FRAME_SAVE_SUCCESS_TYPE_VALUE = "story_frame_save_success"
- private const val STORY_FRAME_SAVE_ERROR_TYPE_VALUE = "story_frame_save_error"
private const val PENDING_DRAFT_TYPE_VALUE = "pending_draft"
private const val ZENDESK_MESSAGE_TYPE_VALUE = "zendesk_message"
private const val BLOGGING_REMINDERS_TYPE_VALUE = "blogging_reminders"
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..ab52b8e2bb43 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
@@ -26,12 +22,9 @@ import org.wordpress.android.ui.mediapicker.MediaType.AUDIO
import org.wordpress.android.ui.mediapicker.MediaType.DOCUMENT
import org.wordpress.android.ui.mediapicker.MediaType.IMAGE
import org.wordpress.android.ui.mediapicker.MediaType.VIDEO
-import org.wordpress.android.util.analytics.AnalyticsTrackerWrapper
import javax.inject.Inject
-class MediaPickerLauncher @Inject constructor(
- private val analyticsTrackerWrapper: AnalyticsTrackerWrapper
-) {
+class MediaPickerLauncher @Inject constructor() {
fun showFeaturedImagePicker(
activity: Activity,
site: SiteModel?,
@@ -117,19 +110,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 +279,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 +317,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 extends Uri> 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..37400630c2df 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
@@ -204,7 +203,6 @@ class PhotoPickerFragment : Fragment(R.layout.photo_picker_fragment) {
) {
isShowingActionMode = false
}
- setupFab(uiState.fabUiModel)
setupPartialAccessPrompt(uiState.isPartialMediaAccessPromptVisible)
}
}
@@ -256,18 +254,6 @@ class PhotoPickerFragment : Fragment(R.layout.photo_picker_fragment) {
}
}
- @Suppress("DEPRECATION")
- private fun PhotoPickerFragmentBinding.setupFab(fabUiModel: PhotoPickerViewModel.FabUiModel) {
- if (fabUiModel.show) {
- wpStoriesTakePicture.visibility = View.VISIBLE
- wpStoriesTakePicture.setOnClickListener {
- fabUiModel.action()
- }
- } else {
- wpStoriesTakePicture.visibility = View.GONE
- }
- }
-
private fun PhotoPickerFragmentBinding.setupPartialAccessPrompt(isVisible: Boolean) {
partialMediaAccessPrompt.root.isVisible = isVisible
partialMediaAccessPrompt.partialAccessPromptSelectMoreButton.setOnClickListener {
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..1c73533f5935 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,9 +96,6 @@ class PhotoPickerViewModel @Inject constructor(
softAskRequest?.show == true,
),
buildSoftAskView(softAskRequest),
- FabUiModel(browserType.isWPStoriesPicker && selectedIds.isNullOrEmpty()) {
- clickIcon(PhotoPickerFragment.PhotoPickerIcon.WP_STORIES_CAPTURE)
- },
buildActionModeUiModel(selectedIds),
progressDialogModel ?: ProgressDialogUiModel.Hidden,
showPartialAccessPrompt ?: false,
@@ -205,7 +201,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 +315,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 +347,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())))
@@ -412,12 +403,9 @@ class PhotoPickerViewModel @Inject constructor(
items.add(PopupMenuUiModel.PopupMenuItem(UiStringRes(R.string.photo_picker_stock_media)) {
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()
@@ -535,7 +523,6 @@ class PhotoPickerViewModel @Inject constructor(
val photoListUiModel: PhotoListUiModel,
val bottomBarUiModel: BottomBarUiModel,
val softAskViewUiModel: SoftAskViewUiModel,
- val fabUiModel: FabUiModel,
val actionModeUiModel: ActionModeUiModel,
val progressDialogUiModel: ProgressDialogUiModel,
val isPartialMediaAccessPromptVisible: Boolean,
@@ -572,8 +559,6 @@ class PhotoPickerViewModel @Inject constructor(
object Hidden : SoftAskViewUiModel()
}
- data class FabUiModel(val show: Boolean, val action: () -> Unit)
-
sealed class ActionModeUiModel {
data class Visible(
val actionModeTitle: UiString? = null,
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 81623b8f49c6..20d861c576fd 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
@@ -76,7 +76,6 @@
import org.wordpress.android.editor.gutenberg.GutenbergNetworkConnectionListener;
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;
@@ -90,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;
@@ -169,7 +167,6 @@
import org.wordpress.android.ui.posts.editor.StorePostViewModel.ActivityFinishState;
import org.wordpress.android.ui.posts.editor.StorePostViewModel.UpdateFromEditor;
import org.wordpress.android.ui.posts.editor.StorePostViewModel.UpdateFromEditor.PostFields;
-import org.wordpress.android.ui.posts.editor.StoriesEventListener;
import org.wordpress.android.ui.posts.editor.XPostsCapabilityChecker;
import org.wordpress.android.ui.posts.editor.media.AddExistingMediaSource;
import org.wordpress.android.ui.posts.editor.media.EditorMedia;
@@ -184,9 +181,6 @@
import org.wordpress.android.ui.prefs.AppPrefs;
import org.wordpress.android.ui.prefs.SiteSettingsInterface;
import org.wordpress.android.ui.reader.utils.ReaderUtilsWrapper;
-import org.wordpress.android.ui.stories.StoryRepositoryWrapper;
-import org.wordpress.android.ui.stories.prefs.StoriesPrefs;
-import org.wordpress.android.ui.stories.usecase.LoadStoryFromStoriesPrefsUseCase;
import org.wordpress.android.ui.suggestion.SuggestionActivity;
import org.wordpress.android.ui.suggestion.SuggestionType;
import org.wordpress.android.ui.uploads.PostEvents;
@@ -285,6 +279,7 @@
import static org.wordpress.android.ui.posts.EditPostActivityConstants.EXTRA_UPLOAD_NOT_STARTED;
import static org.wordpress.android.ui.posts.EditPostActivityConstants.STATE_KEY_DROPPED_MEDIA_URIS;
import static org.wordpress.android.ui.posts.EditPostActivityConstants.STATE_KEY_EDITOR_FRAGMENT;
+import static org.wordpress.android.ui.posts.EditPostActivityConstants.STATE_KEY_EDITOR_SESSION_DATA;
import static org.wordpress.android.ui.posts.EditPostActivityConstants.STATE_KEY_GUTENBERG_IS_SHOWN;
import static org.wordpress.android.ui.posts.EditPostActivityConstants.STATE_KEY_HTML_MODE_ON;
import static org.wordpress.android.ui.posts.EditPostActivityConstants.STATE_KEY_IS_NEW_POST;
@@ -296,7 +291,6 @@
import static org.wordpress.android.ui.posts.EditPostActivityConstants.STATE_KEY_REDO;
import static org.wordpress.android.ui.posts.EditPostActivityConstants.STATE_KEY_REVISION;
import static org.wordpress.android.ui.posts.EditPostActivityConstants.STATE_KEY_UNDO;
-import static org.wordpress.android.ui.stories.StoryComposerActivity.STATE_KEY_EDITOR_SESSION_DATA;
public class EditPostActivity extends LocaleAwareActivity implements
EditorFragmentActivity,
@@ -423,10 +417,6 @@ enum RestartEditorOptions {
@Inject XPostsCapabilityChecker mXpostsCapabilityChecker;
@Inject CrashLogging mCrashLogging;
@Inject MediaPickerLauncher mMediaPickerLauncher;
- @Inject StoryRepositoryWrapper mStoryRepositoryWrapper;
- @Inject LoadStoryFromStoriesPrefsUseCase mLoadStoryFromStoriesPrefsUseCase;
- @Inject StoriesPrefs mStoriesPrefs;
- @Inject StoriesEventListener mStoriesEventListener;
@Inject UpdateFeaturedImageUseCase mUpdateFeaturedImageUseCase;
@Inject GlobalStyleSupportFeatureConfig mGlobalStyleSupportFeatureConfig;
@Inject ZendeskHelper mZendeskHelper;
@@ -442,7 +432,6 @@ enum RestartEditorOptions {
private SiteModel mSite;
private SiteSettingsInterface mSiteSettings;
private boolean mIsJetpackSsoEnabled;
- private boolean mStoryEditingCancelled = false;
private boolean mNetworkErrorOnLastMediaFetchAttempt = false;
@@ -730,10 +719,6 @@ public void handleOnBackPressed() {
if (mEditorFragment instanceof EditorMediaUploadListener) {
mEditorMediaUploadListener = (EditorMediaUploadListener) mEditorFragment;
}
-
- if (mEditorFragment instanceof StorySaveMediaListener) {
- mStoriesEventListener.setSaveMediaListener((StorySaveMediaListener) mEditorFragment);
- }
}
if (mSite == null) {
@@ -785,13 +770,6 @@ public void handleOnBackPressed() {
}
if (!mIsNewPost) {
- // if we are opening an existing Post, and it contains a Story block, pre-fetch the media in case
- // the user wants to edit the block (we'll need to download it first if the slides images weren't
- // created on this device)
- if (PostUtils.contentContainsWPStoryGutenbergBlocks(mEditPostRepository.getPost().getContent())) {
- fetchMediaList();
- }
-
// if we are opening a Post for which an error notification exists, we need to remove it from the dashboard
// to prevent the user from tapping RETRY on a Post that is being currently edited
UploadService.cancelFinalNotification(this, mEditPostRepository.getPost());
@@ -812,8 +790,6 @@ public void handleOnBackPressed() {
setupPrepublishingBottomSheetRunnable();
- mStoriesEventListener.start(this.getLifecycle(), mSite, mEditPostRepository, this);
-
// The check on savedInstanceState should allow to show the dialog only on first start
// (even in cases when the VM could be re-created like when activity is destroyed in the background)
mStorageUtilsViewModel.start(savedInstanceState == null);
@@ -1503,30 +1479,12 @@ private boolean handleBackPressed() {
} else if (mEditorPhotoPicker.isPhotoPickerShowing()) {
mEditorPhotoPicker.hidePhotoPicker();
} else {
- performWhenNoStoriesBeingSaved(new DoWhenNoStoriesBeingSavedCallback() {
- @Override public void doWhenNoStoriesBeingSaved() {
- savePostAndOptionallyFinish(true, false);
- }
- });
+ savePostAndOptionallyFinish(true, false);
}
return true;
}
- interface DoWhenNoStoriesBeingSavedCallback {
- void doWhenNoStoriesBeingSaved();
- }
-
- private void performWhenNoStoriesBeingSaved(DoWhenNoStoriesBeingSavedCallback callback) {
- if (mStoriesEventListener.getStoriesSavingInProgress().isEmpty()) {
- callback.doWhenNoStoriesBeingSaved();
- } else {
- // Oops! A story is still being saved, let's wait
- ToastUtils.showToast(EditPostActivity.this,
- getString(R.string.toast_edit_story_update_in_progress_title));
- }
- }
-
private RemotePreviewLogicHelper.RemotePreviewHelperFunctions getEditPostActivityStrategyFunctions() {
return new RemotePreviewLogicHelper.RemotePreviewHelperFunctions() {
@Override
@@ -1689,7 +1647,7 @@ private boolean performSecondaryAction() {
case PUBLISH_NOW:
mAnalyticsTrackerWrapper.track(Stat.EDITOR_POST_PUBLISH_TAPPED);
mPublishPostImmediatelyUseCase.updatePostToPublishImmediately(mEditPostRepository, mIsNewPost);
- checkNoStorySaveOperationInProgressAndShowPrepublishingNudgeBottomSheet();
+ showPrepublishingNudgeBottomSheet();
return true;
case NONE:
throw new IllegalStateException("Switch in `secondaryAction` shouldn't go through the NONE case");
@@ -1787,13 +1745,13 @@ private void performPrimaryAction() {
switch (getPrimaryAction()) {
case PUBLISH_NOW:
mAnalyticsTrackerWrapper.track(Stat.EDITOR_POST_PUBLISH_TAPPED);
- checkNoStorySaveOperationInProgressAndShowPrepublishingNudgeBottomSheet();
+ showPrepublishingNudgeBottomSheet();
return;
case UPDATE:
case CONTINUE:
case SCHEDULE:
case SUBMIT_FOR_REVIEW:
- checkNoStorySaveOperationInProgressAndShowPrepublishingNudgeBottomSheet();
+ showPrepublishingNudgeBottomSheet();
return;
case SAVE:
uploadPost(false);
@@ -1851,13 +1809,6 @@ private void onUploadSuccess(MediaModel media) {
if (!media.getMarkedLocallyAsFeatured() && mEditorMediaUploadListener != null) {
mEditorMediaUploadListener.onMediaUploadSucceeded(String.valueOf(media.getId()),
FluxCUtils.mediaFileFromMediaModel(media));
- if (PostUtils.contentContainsWPStoryGutenbergBlocks(mEditPostRepository.getContent())) {
- // make sure to sync the local post object with the UI and save
- // then post the event for StoriesEventListener to process
- updateAndSavePostAsync(
- updatePostResult -> mStoriesEventListener.postStoryMediaUploadedEvent(media)
- );
- }
} else if (media.getMarkedLocallyAsFeatured() && media.getLocalPostId() == mEditPostRepository
.getId()) {
setFeaturedImageId(media.getMediaId(), false, false);
@@ -2156,20 +2107,12 @@ private void setupPrepublishingBottomSheetRunnable() {
PrepublishingBottomSheetFragment.TAG);
if (fragment == null) {
PrepublishingBottomSheetFragment prepublishingFragment =
- PrepublishingBottomSheetFragment.newInstance(getSite(), mIsPage, false);
+ PrepublishingBottomSheetFragment.newInstance(getSite(), mIsPage);
prepublishingFragment.show(getSupportFragmentManager(), PrepublishingBottomSheetFragment.TAG);
}
};
}
- private void checkNoStorySaveOperationInProgressAndShowPrepublishingNudgeBottomSheet() {
- performWhenNoStoriesBeingSaved(new DoWhenNoStoriesBeingSavedCallback() {
- @Override public void doWhenNoStoriesBeingSaved() {
- showPrepublishingNudgeBottomSheet();
- }
- });
- }
-
private void showPrepublishingNudgeBottomSheet() {
mViewPager.setCurrentItem(PAGE_CONTENT);
ActivityUtils.hideKeyboard(this);
@@ -2381,7 +2324,6 @@ public Fragment getItem(int position) {
mIsNewPost,
gutenbergWebViewAuthorizationData,
gutenbergPropsBuilder,
- RequestCodes.EDIT_STORY,
mJetpackFeatureRemovalPhaseHelper.shouldShowJetpackPoweredEditorFeatures()
);
} else {
@@ -2419,10 +2361,6 @@ public Fragment getItem(int position) {
reattachUploadingMediaForAztec();
}
-
- if (mEditorFragment instanceof StorySaveMediaListener) {
- mStoriesEventListener.setSaveMediaListener((StorySaveMediaListener) mEditorFragment);
- }
break;
case PAGE_SETTINGS:
mEditPostSettingsFragment = (EditPostSettingsFragment) fragment;
@@ -2810,23 +2748,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) {
@@ -3486,30 +3413,11 @@ public void onEditorFragmentContentReady(
mPostEditorAnalyticsSession.start(unsupportedBlocksList, themeSupportsGalleryWithImageBlocks(), entryPoint);
presentNewPageNoticeIfNeeded();
- // 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) {
- mStoriesEventListener.startListening();
- }
-
// Start VM, load prompt and populate Editor with content after edit IS ready.
final int promptId = getIntent().getIntExtra(EXTRA_PROMPT_ID, -1);
mEditorBloggingPromptsViewModel.start(mSite, promptId);
}
- @Override
- public void onReplaceStoryEditedBlockActionSent() {
- // when a replaceBlock signal has been sent, it uses the DeferredEventEmitter so we have to wait for
- // the block replacement to be completed before we can start throwing block-related events at it
- // otherwise these events will miss their target
- mStoriesEventListener.pauseListening();
- }
-
- @Override
- public void onReplaceStoryEditedBlockActionReceived() {
- mStoriesEventListener.startListening();
- }
-
private void logTemplateSelection() {
final String template = getIntent().getStringExtra(EXTRA_PAGE_TEMPLATE);
if (template == null) {
@@ -3566,36 +3474,6 @@ public void onTrackableEvent(TrackableEvent event, Map propertie
mEditorTracker.trackEditorEvent(event, mEditorFragment.getEditorName(), properties);
}
- @Override public void onStoryComposerLoadRequested(ArrayList