Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Gutenberg] Audio block - Consolidated & Normal Media Picker Integration #13612

Merged
Merged
Show file tree
Hide file tree
Changes from 30 commits
Commits
Show all changes
41 commits
Select commit Hold shift + click to select a range
1e75b68
Added GUTENBERG_SINGLE_AUDIO_FILE_PICKER to the MediaBrowserType
jd-alexander Dec 16, 2020
08bd4aa
Added support for selecting Audio from Media Library or Local Device.
jd-alexander Dec 16, 2020
9c89fa3
wired media pickers to the click actions of the Audio block.
jd-alexander Dec 16, 2020
6b389c4
Updated gutenberg ref.
jd-alexander Dec 16, 2020
10992e1
Trigger Build
jd-alexander Dec 17, 2020
4163371
Changed location of prepare picture intent and fixed multiselect params
jd-alexander Jan 7, 2021
b286de9
Added prepareAudioLibraryIntent method.
jd-alexander Jan 7, 2021
b73c139
Added prepareAudioLibraryIntent and did refactoring of duplicate logic.
jd-alexander Jan 7, 2021
ff71990
added showMediaPicker for file and audio.
jd-alexander Jan 7, 2021
203de09
created a function that allows the audio file picker to be launched.
jd-alexander Jan 7, 2021
a8a1e82
added the editor_audio_file_added event to track audio files.
jd-alexander Jan 7, 2021
408cf6d
Integrated the Audio Library Request Code in the necessary activities.
jd-alexander Jan 7, 2021
e4039c0
Refactored the initOtherMediaFileOptions to support both audio and file.
jd-alexander Jan 7, 2021
f278d14
Updated the FluxC hash to include the audio mime type behavior.
jd-alexander Jan 7, 2021
c724657
Removed audio from the file resource variable.
jd-alexander Jan 7, 2021
bff3d36
removed unused imports.
jd-alexander Jan 7, 2021
7149d57
Merge branch 'develop' into gutenberg/audio_block_consolidated_media_…
jd-alexander Jan 7, 2021
903229e
Updated ref.
jd-alexander Jan 7, 2021
554bb06
sync stories submodule with develop.
jd-alexander Jan 7, 2021
5f70822
Update gb ref.
jd-alexander Jan 7, 2021
ed598e6
updated FluxC hash.
jd-alexander Jan 7, 2021
55f8c92
Fixed issue where the file library intent was prepared instead of audio
jd-alexander Jan 7, 2021
55b5345
added the Audio Picking BrowserType to the MediaBrowser's Filter.
jd-alexander Jan 8, 2021
a881acf
Added use audio to the action mode title logic
jd-alexander Jan 8, 2021
3ca76e1
Refactored the name of the MediaPicker function to FilePicker.
jd-alexander Jan 8, 2021
66199d8
Removed unneeded trailing comma and R. import.
jd-alexander Jan 8, 2021
a286d91
removed the additional audioFileLibrary method and reused the file one.
jd-alexander Jan 8, 2021
fbc51cf
Added a string value for choosing audio files and refactored launchFile
jd-alexander Jan 8, 2021
b87c11e
Added a method for GUTENBERG_SINGLE_AUDIO_FILE_PICKER to filter the grid
jd-alexander Jan 8, 2021
97abd5a
refactored the launchFileLibrary to work for audio and file intents.
jd-alexander Jan 8, 2021
8262169
Added the audio picker to the single selection.
jd-alexander Jan 13, 2021
aedea20
Added AUDIO to the ChooserContext
jd-alexander Jan 13, 2021
beb48b7
Added AUDIO to the populateIconClickEvent
jd-alexander Jan 13, 2021
7815032
Added test for Audio System Picker
jd-alexander Jan 13, 2021
1e5aa6d
removed multiSelect intent param and utilized true.
jd-alexander Jan 14, 2021
3309187
Put the .SingleAudioFilePicker call in the appropriate group.
jd-alexander Jan 14, 2021
adbb939
Merge branch 'develop' into gutenberg/audio_block_consolidated_media_…
jd-alexander Jan 14, 2021
9f745ae
Updated fluxC hash.
jd-alexander Jan 14, 2021
a75a1b3
Updated gb ref.
jd-alexander Jan 14, 2021
21e7726
Merge branch 'develop' into gutenberg/audio_block_consolidated_media_…
jd-alexander Jan 15, 2021
8025aaf
Merge branch 'develop' into gutenberg/audio_block_consolidated_media_…
jd-alexander Jan 15, 2021
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@ public class RequestCodes {
public static final int VIDEO_LIBRARY = 2200;
public static final int MEDIA_LIBRARY = 2210;
public static final int FILE_LIBRARY = 2220;
public static final int AUDIO_LIBRARY = 2230;
public static final int TAKE_VIDEO = 2300;
public static final int CROP_PHOTO = 2400;
public static final int PICTURE_LIBRARY_OR_CAPTURE = 2500;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -213,6 +213,8 @@ public void onCreate(Bundle savedInstanceState) {
filter = MediaFilter.FILTER_IMAGES;
} else if (mBrowserType == MediaBrowserType.GUTENBERG_VIDEO_PICKER) {
filter = MediaFilter.FILTER_VIDEOS;
} else if (mBrowserType == MediaBrowserType.GUTENBERG_SINGLE_AUDIO_FILE_PICKER) {
filter = MediaFilter.FILTER_AUDIO;
} else if (savedInstanceState != null) {
filter = (MediaFilter) savedInstanceState.getSerializable(ARG_FILTER);
} else {
Expand Down Expand Up @@ -474,6 +476,7 @@ public void onActivityResult(int requestCode, int resultCode, Intent data) {
case RequestCodes.PICTURE_LIBRARY:
case RequestCodes.VIDEO_LIBRARY:
case RequestCodes.FILE_LIBRARY:
case RequestCodes.AUDIO_LIBRARY:
if (resultCode == Activity.RESULT_OK && data != null) {
if (mConsolidatedMediaPickerFeatureConfig.isEnabled()) {
if (data.hasExtra(MediaPickerConstants.EXTRA_MEDIA_URIS)) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +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

public boolean isPicker() {
Expand Down Expand Up @@ -57,7 +58,7 @@ public boolean isVideoPicker() {
}

public boolean isAudioPicker() {
return this == GUTENBERG_SINGLE_FILE_PICKER;
return this == GUTENBERG_SINGLE_FILE_PICKER || this == GUTENBERG_SINGLE_AUDIO_FILE_PICKER;
}

public boolean isDocumentPicker() {
Expand All @@ -71,7 +72,8 @@ public boolean isGutenbergPicker() {
|| this == GUTENBERG_SINGLE_VIDEO_PICKER
|| this == GUTENBERG_SINGLE_MEDIA_PICKER
|| this == GUTENBERG_MEDIA_PICKER
|| this == GUTENBERG_SINGLE_FILE_PICKER;
|| this == GUTENBERG_SINGLE_FILE_PICKER
|| this == GUTENBERG_SINGLE_AUDIO_FILE_PICKER;
}

public boolean isWPStoriesPicker() {
Expand All @@ -82,6 +84,10 @@ public boolean isSingleFilePicker() {
return this == GUTENBERG_SINGLE_FILE_PICKER;
}

public boolean isSingleAudioFilePicker() {
return this == GUTENBERG_SINGLE_AUDIO_FILE_PICKER;
}

public boolean isSingleMediaPicker() {
return this == GUTENBERG_SINGLE_MEDIA_PICKER;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -386,7 +386,8 @@ List<MediaModel> getFilteredMedia() {
} else if (mBrowserType.isSingleImagePicker()) {
mediaList = mMediaStore.getSiteImages(mSite);
} else if (mBrowserType.canFilter() || mBrowserType.canOnlyDoInitialFilter() || mBrowserType
.isSingleFilePicker()) {
.isSingleFilePicker() || mBrowserType
.isSingleAudioFilePicker()) {
mediaList = getMediaList();
} else {
List<MediaModel> allMedia = mMediaStore.getAllSiteMedia(mSite);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -287,10 +287,13 @@ class MediaPickerViewModel @Inject constructor(
else -> {
val isImagePicker = mediaPickerSetup.allowedTypes.contains(IMAGE)
val isVideoPicker = mediaPickerSetup.allowedTypes.contains(VIDEO)
val isAudioPicker = mediaPickerSetup.allowedTypes.contains(AUDIO)
if (isImagePicker && isVideoPicker) {
UiStringRes(R.string.photo_picker_use_media)
} else if (isVideoPicker) {
UiStringRes(R.string.photo_picker_use_video)
} else if (isAudioPicker) {
UiStringRes(R.string.photo_picker_use_audio)
} else {
UiStringRes(R.string.photo_picker_use_photo)
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ package org.wordpress.android.ui.photopicker

import android.app.Activity
import android.content.Intent
import androidx.annotation.StringRes
import androidx.fragment.app.Fragment
import org.wordpress.android.R
import org.wordpress.android.R.string
Expand Down Expand Up @@ -184,8 +185,33 @@ class MediaPickerLauncher @Inject constructor(
}

fun showFilePicker(activity: Activity, canMultiselect: Boolean = true) {
showFilePicker(
activity,
canMultiselect,
mutableSetOf(IMAGE, VIDEO, AUDIO, DOCUMENT),
RequestCodes.FILE_LIBRARY,
string.photo_picker_choose_file
)
}

fun showAudioFilePicker(activity: Activity, canMultiselect: Boolean = false) {
showFilePicker(
activity,
canMultiselect,
mutableSetOf(AUDIO),
RequestCodes.AUDIO_LIBRARY,
string.photo_picker_choose_audio
)
}

private fun showFilePicker(
activity: Activity,
canMultiselect: Boolean = false,
allowedTypes: Set<MediaType>,
requestCode: Int,
@StringRes title: Int
) {
if (consolidatedMediaPickerFeatureConfig.isEnabled()) {
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I am not sure if this approach is fine. What I did here was I duplicated the showFilePicker method because I need the allowTypes to be different for the file and audio pickers. At first, I thought of making this property a default one in the method params but this doesn't work with Java. Is this behavior okay? Or should I do some form of method override? Let me know.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Also, I didn't bother to bring the Normal Picker behavior up to speed here because it seems like the consolidated media picker will be the only one in use for the near future so I thought I would waste time building it out and there's a high possibility we won't do a rollback. Was that the right judgment call? ? I did make modifications in the past to support the File Block's file selection behavior on the normal and consolidated picker hence my question.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What I would consider doing here is creating a private fun that incorporates the common code and that accepts (activity, canMultiselect, allowedTypes) then the publicly exposed methods (showFilePicker, showAudioFilePicker) can call this private fun passing the desired allowedTypes (I would not expose the allowedTypes as public fun params though so the calling function should not worry about it). This in a way also ease the second item:

Also, I didn't bother to bring the Normal Picker behavior up to speed here because it seems like the consolidated media picker will be the only one in use for the near future so I thought I would waste time building it out and there's a high possibility we won't do a rollback.

I think the rationale here was as you mention to allow an easy rollback (doing it by remote) in case of any issues with the consolidated media picker. To allow this we need to have the standard media picker fallback in place. I agree it's pretty unlikely we should rollback since the media picker has been released in 16.2 already, but until we do not remove this duplicated approach (probably in other couple of release or so) I would keep this consistent. wdyt?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is great insight @develric I am going to do this implementation and then share my findings with you.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

val allowedTypes = mutableSetOf(IMAGE, VIDEO, AUDIO, DOCUMENT)
val mediaPickerSetup = MediaPickerSetup(
primaryDataSource = DEVICE,
availableDataSources = setOf(),
Expand All @@ -197,18 +223,18 @@ class MediaPickerLauncher @Inject constructor(
editingEnabled = true,
queueResults = false,
defaultSearchView = false,
title = R.string.photo_picker_choose_file
title = title
)
val intent = MediaPickerActivity.buildIntent(
activity,
mediaPickerSetup
)
activity.startActivityForResult(
intent,
RequestCodes.FILE_LIBRARY
requestCode
)
} else {
WPMediaUtils.launchFileLibrary(activity, canMultiselect)
WPMediaUtils.launchFileLibrary(activity, canMultiselect, requestCode)
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2757,6 +2757,7 @@ postId, getSite(), mediaUri,
}
break;
case RequestCodes.FILE_LIBRARY:
case RequestCodes.AUDIO_LIBRARY:
if (mConsolidatedMediaPickerFeatureConfig.isEnabled()) {
if (data.hasExtra(MediaPickerConstants.EXTRA_MEDIA_URIS)) {
List<Uri> uriResults = convertStringArrayIntoUrisList(
Expand All @@ -2768,7 +2769,16 @@ postId, getSite(), mediaUri,
}
} else {
uris = WPMediaUtils.retrieveMediaUris(data);
mAnalyticsTrackerWrapper.track(Stat.EDITOR_ADDED_FILE_VIA_LIBRARY);

switch (requestCode) {
case RequestCodes.FILE_LIBRARY:
mAnalyticsTrackerWrapper.track(Stat.EDITOR_ADDED_FILE_VIA_LIBRARY);
break;
case RequestCodes.AUDIO_LIBRARY:
mAnalyticsTrackerWrapper.track(Stat.EDITOR_ADDED_AUDIO_FILE_VIA_LIBRARY);
break;
}

for (Uri item : uris) {
mEditorMedia.addNewMediaToEditorAsync(item, false);
}
Expand Down Expand Up @@ -2979,6 +2989,11 @@ public void onAddLibraryMediaClicked(boolean allowMultipleSelection) {
.viewWPMediaLibraryPickerForResult(this, mSite, MediaBrowserType.GUTENBERG_SINGLE_FILE_PICKER);
}

@Override public void onAddLibraryAudioFileClicked(boolean allowMultipleSelection) {
mMediaPickerLauncher
.viewWPMediaLibraryPickerForResult(this, mSite, MediaBrowserType.GUTENBERG_SINGLE_AUDIO_FILE_PICKER);
}

@Override
public void onAddPhotoClicked(boolean allowMultipleSelection) {
if (allowMultipleSelection) {
Expand Down Expand Up @@ -3032,6 +3047,10 @@ public void onAddFileClicked(boolean allowMultipleSelection) {
mMediaPickerLauncher.showFilePicker(this, allowMultipleSelection);
}

@Override public void onAddAudioFileClicked(boolean allowMultipleSelection) {
mMediaPickerLauncher.showAudioFilePicker(this, allowMultipleSelection);
}

@Override
public void onPerformFetch(String path, Consumer<String> onResult, Consumer<Bundle> onError) {
if (mSite != null) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@

import androidx.annotation.NonNull;
import androidx.annotation.Nullable;
import androidx.annotation.StringRes;
import androidx.appcompat.app.AlertDialog;
import androidx.core.content.ContextCompat;
import androidx.core.content.FileProvider;
Expand Down Expand Up @@ -241,9 +242,15 @@ public static void launchMediaLibrary(Activity activity, boolean multiSelect) {
RequestCodes.MEDIA_LIBRARY);
}

public static void launchFileLibrary(Activity activity, boolean multiSelect) {
activity.startActivityForResult(prepareFileLibraryIntent(activity, multiSelect),
RequestCodes.FILE_LIBRARY);
public static void launchFileLibrary(Activity activity, boolean multiSelect, int requestCode) {
switch (requestCode) {
case RequestCodes.FILE_LIBRARY:
activity.startActivityForResult(prepareFileLibraryIntent(activity, multiSelect), requestCode);
break;
case RequestCodes.AUDIO_LIBRARY:
activity.startActivityForResult(prepareAudioLibraryIntent(activity, multiSelect), requestCode);
break;
}
}

public static void launchChooserWithContext(
Expand All @@ -256,34 +263,40 @@ public static void launchChooserWithContext(
requestCode);
}

private static Intent preparePictureLibraryIntent(Context context, boolean multiSelect) {
return prepareIntent(context, multiSelect, Intent.ACTION_GET_CONTENT, "image/*",
new MimeTypes().getImageTypesOnly(), R.string.pick_photo);
}

private static Intent prepareVideoLibraryIntent(Context context, boolean multiSelect) {
Intent intent = new Intent(Intent.ACTION_GET_CONTENT);
intent.setType("video/*");
intent.putExtra(Intent.EXTRA_MIME_TYPES, new MimeTypes().getVideoTypesOnly());
if (multiSelect) {
intent.putExtra(Intent.EXTRA_ALLOW_MULTIPLE, true);
jd-alexander marked this conversation as resolved.
Show resolved Hide resolved
}
return Intent.createChooser(intent, context.getString(R.string.pick_video));
return prepareIntent(context, multiSelect, Intent.ACTION_GET_CONTENT, "video/*",
new MimeTypes().getVideoTypesOnly(), R.string.pick_video);
}

private static Intent prepareMediaLibraryIntent(Context context, boolean multiSelect) {
Intent intent = new Intent(Intent.ACTION_GET_CONTENT);
intent.setType("*/*");
intent.putExtra(Intent.EXTRA_MIME_TYPES, new MimeTypes().getVideoAndImageTypesOnly());
if (multiSelect) {
intent.putExtra(Intent.EXTRA_ALLOW_MULTIPLE, true);
}
return Intent.createChooser(intent, context.getString(R.string.pick_media));
return prepareIntent(context, multiSelect, Intent.ACTION_GET_CONTENT, "*/*",
new MimeTypes().getVideoAndImageTypesOnly(), R.string.pick_media);
}

private static Intent prepareFileLibraryIntent(Context context, boolean multiSelect) {
Intent intent = new Intent(Intent.ACTION_OPEN_DOCUMENT);
intent.setType("*/*");
intent.putExtra(Intent.EXTRA_MIME_TYPES, new MimeTypes().getAllTypes());
return prepareIntent(context, multiSelect, Intent.ACTION_OPEN_DOCUMENT, "*/*",
new MimeTypes().getAllTypes(), R.string.pick_file);
}

private static Intent prepareAudioLibraryIntent(Context context, boolean multiSelect) {
return prepareIntent(context, multiSelect, Intent.ACTION_GET_CONTENT, "*/*",
new MimeTypes().getAudioTypesOnly(), R.string.pick_audio);
}

private static Intent prepareIntent(Context context, boolean multiSelect, String action, String intentType,
String[] mimeTypes, @StringRes int title) {
Intent intent = new Intent(action);
intent.setType(intentType);
intent.putExtra(Intent.EXTRA_MIME_TYPES, mimeTypes);
if (multiSelect) {
intent.putExtra(Intent.EXTRA_ALLOW_MULTIPLE, true);
intent.putExtra(Intent.EXTRA_ALLOW_MULTIPLE, multiSelect);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

tbh I would rather keep the true, it's like more obvious we actually want the only possible value to be true (in fact we check for if (multiselect) and we don't want to have a false value there (but rather no value at all) when we don't want to multiselect. wdyt?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Oh yes, good spotting that!

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good catch. Resolved here 1e5aa6d

}
return Intent.createChooser(intent, context.getString(R.string.pick_file));
return Intent.createChooser(intent, context.getString(title));
}

private static Intent prepareChooserIntent(
Expand Down Expand Up @@ -311,19 +324,10 @@ private static Intent prepareVideoCameraIntent() {

public static void launchPictureLibrary(Activity activity, boolean multiSelect) {
activity.startActivityForResult(
preparePictureLibraryIntent(activity.getString(R.string.pick_photo), multiSelect),
preparePictureLibraryIntent(activity, multiSelect),
RequestCodes.PICTURE_LIBRARY);
}

private static Intent preparePictureLibraryIntent(String title, boolean multiSelect) {
Intent intent = new Intent(Intent.ACTION_GET_CONTENT);
intent.setType("image/*");
intent.putExtra(Intent.EXTRA_MIME_TYPES, new MimeTypes().getImageTypesOnly());
if (multiSelect) {
intent.putExtra(Intent.EXTRA_ALLOW_MULTIPLE, true);
}
return Intent.createChooser(intent, title);
}

private static Intent prepareGalleryIntent(String title) {
Intent intent = new Intent(Intent.ACTION_PICK);
Expand Down
3 changes: 3 additions & 0 deletions WordPress/src/main/res/values/strings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -141,6 +141,7 @@
<string name="wp_media_title">WordPress media</string>
<string name="pick_photo">Select photo</string>
<string name="pick_video">Select video</string>
<string name="pick_audio">Select audio</string>
<string name="pick_media">Add image or video</string>
<string name="pick_file">Add file</string>
<string name="capture_or_pick_photo">Capture or select photo</string>
Expand Down Expand Up @@ -2434,6 +2435,7 @@
<string name="photo_picker_choose_photo">Choose photo from device</string>
<string name="photo_picker_choose_video">Choose video from device</string>
<string name="photo_picker_choose_file">Choose from device</string>
<string name="photo_picker_choose_audio">Choose audio from device</string>
<string name="photo_picker_capture_photo">Take photo</string>
<string name="photo_picker_capture_video">Take video</string>
<string name="photo_picker_stock_media">Choose from Free Photo Library</string>
Expand All @@ -2444,6 +2446,7 @@
<string name="photo_picker_soft_ask_permissions_denied">%1$s was denied access to your photos. To fix this, edit your permissions and turn on %2$s.</string>
<string name="photo_picker_use_photo">Use this photo</string>
<string name="photo_picker_use_video">Use this video</string>
<string name="photo_picker_use_audio">Use this audio</string>
<string name="photo_picker_use_media">Use this media</string>
<string name="photo_picker_use_gif">Use this GIF</string>
<string name="photo_picker_image_thumbnail_content_description">Image Thumbnail</string>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -345,6 +345,20 @@ class MediaPickerViewModelTest : BaseUnitTest() {
)
}

@Test
fun `action mode title is Use Audio when audio browser type`() = test {
setupViewModel(listOf(firstItem, secondItem), buildMediaPickerSetup(false, setOf(AUDIO)))

viewModel.refreshData(false)

selectItem(0)

assertActionModeVisible(
UiStringRes(R.string.photo_picker_use_audio),
EditActionUiModel(isVisible = true, isCounterBadgeVisible = false)
)
}

@Test
fun `action mode title is Select N items when multi selection available`() = test {
whenever(resourceProvider.getString(R.string.cab_selected)).thenReturn("%d selected")
Expand Down
2 changes: 1 addition & 1 deletion build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -136,7 +136,7 @@ ext {
androidxWorkVersion = "2.4.0"

daggerVersion = '2.29.1'
fluxCVersion = '1.8.0-beta-8'
fluxCVersion = '505923e4a797f677f8aa883251a54e84e548af26'

appCompatVersion = '1.0.2'
coreVersion = '1.2.0'
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -144,6 +144,7 @@ public enum Stat {
EDITOR_ADDED_VIDEO_VIA_WP_MEDIA_LIBRARY,
EDITOR_ADDED_PHOTO_VIA_STOCK_MEDIA_LIBRARY,
EDITOR_ADDED_FILE_VIA_LIBRARY,
EDITOR_ADDED_AUDIO_FILE_VIA_LIBRARY,
MEDIA_PHOTO_OPTIMIZED,
MEDIA_PHOTO_OPTIMIZE_ERROR,
MEDIA_VIDEO_OPTIMIZED,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -809,6 +809,8 @@ public static String getEventNameForStat(AnalyticsTracker.Stat stat) {
return "editor_photo_added";
case EDITOR_ADDED_FILE_VIA_LIBRARY:
return "editor_file_added";
case EDITOR_ADDED_AUDIO_FILE_VIA_LIBRARY:
return "editor_audio_file_added";
case MEDIA_PHOTO_OPTIMIZED:
return "media_photo_optimized";
case MEDIA_PHOTO_OPTIMIZE_ERROR:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -183,6 +183,7 @@ public interface EditorFragmentListener extends DialogVisibilityProvider {
void onAddMediaVideoClicked(boolean allowMultipleSelection);
void onAddLibraryMediaClicked(boolean allowMultipleSelection);
void onAddLibraryFileClicked(boolean allowMultipleSelection);
void onAddLibraryAudioFileClicked(boolean allowMultipleSelection);
void onAddPhotoClicked(boolean allowMultipleSelection);
void onCapturePhotoClicked();
void onAddVideoClicked(boolean allowMultipleSelection);
Expand All @@ -201,6 +202,7 @@ public interface EditorFragmentListener extends DialogVisibilityProvider {
void onAddStockMediaClicked(boolean allowMultipleSelection);
void onAddGifClicked(boolean allowMultipleSelection);
void onAddFileClicked(boolean allowMultipleSelection);
void onAddAudioFileClicked(boolean allowMultipleSelection);
void onPerformFetch(String path, Consumer<String> onResult, Consumer<Bundle> onError);
void onGutenbergEditorSessionTemplateApplyTracked(String template);
void onGutenbergEditorSessionTemplatePreviewTracked(String template);
Expand Down
Loading