-
Notifications
You must be signed in to change notification settings - Fork 4.3k
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
[Android] Image block - upload multiple #24346
Merged
Merged
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This was referenced Aug 4, 2020
Size Change: 0 B Total Size: 1.21 MB ℹ️ View Unchanged
|
geriux
reviewed
Aug 12, 2020
...ative-bridge/android/src/main/java/org/wordpress/mobile/WPAndroidGlue/WPAndroidGlueCode.java
Show resolved
Hide resolved
6 tasks
geriux
approved these changes
Nov 4, 2020
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM! Nice work!
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Labels
[Block] Image
Affects the Image Block
[Feature] Media
Anything that impacts the experience of managing media
Mobile App - i.e. Android or iOS
Native mobile impl of the block editor. (Note: used in scripts, ping mobile folks to change)
[Status] In Progress
Tracking issues with work in progress
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Related PRs
gutenberg-mobile
: wordpress-mobile/gutenberg-mobile#2530WordPress-Android
: wordpress-mobile/WordPress-Android#12591Description
This PR is a first step towards resolving the Android part of this issue: wordpress-mobile/gutenberg-mobile#2255
Some background for context
Before multiple media uploading was available in the block editor, adding media did not allow multiple selection of images from the device, but for image block, multiple (already uploaded) images could be selected from the media library, and at one point in time, all but the first image of this selection would be discarded when confirming the selection. Behavior was added to allow appending these additional images as "sibling blocks".
As other media containing blocks were added, this behavior was restricted to Image blocks, since it wasn't expected that a Cover block or Media & Text block would have multiple respective Cover or Media & Text blocks appended in that scenario. Also, appending blocks would not be correct for Gallery block, where mutiple selected images should be included all in one block. A "multiple" flag was introduced to distinguish when multiple media items should be selected for a given flow, or only a single item. To preserve the behavior for image block which allowed selection of mutlple media library images to be appended at once, this flag has been ignored for that particular flow. I.e. when the multple flag is false for image block, the media library picker still allows multiple images to be selected.
In order to distinguish this behavior for the media library for blocks that don't respect the "multple" flag (currently only Image block), we currently utilize the
mAppendsMultipleSelectedToSiblingBlocks
flag. When this flag is set, then when the multiple flag is not set but multiple images are selected anyway (i.e. image block), the additional images will be appended as image blocks. Otherwise, the additional images will be discarded.This PR enables multiple uploads for the image block by passing
true
as the multiple selection parameter for the media selection activity (the device picker), and setting themAppendsMultipleSelectedToSiblingBlocks
flag, which makes the uploading flow consistent with the media library flow for image block in allowing multiple image selection.How has this been tested?
Test via: wordpress-mobile/gutenberg-mobile#2530 (comment)
Types of changes
New feature (non-breaking change which adds functionality)
Checklist: