Skip to content

1628 mediapicker#2317

Merged
maxme merged 91 commits intodevelopfrom
1628-mediapicker
Mar 10, 2015
Merged

1628 mediapicker#2317
maxme merged 91 commits intodevelopfrom
1628-mediapicker

Conversation

@tonyr59h
Copy link
Copy Markdown
Contributor

Woo, time to get some eyes on this branch! I've been fiddling with it and have some notes provided below for things to work on. I'm not too sure about the look and feel of the icons, would definitely like some design feedback.

Added:

  • Post editor image icon launches MediaPickerActivity with two tabs.
  • Blog images take some time to load as they are added to the adapter after they are verified (to handle deleted media)
  • Clicking an item will select only that item and return to the Post editor
  • Long pressing an item will enable Action Mode for multi-select
  • A gallery is created when the gallery icon is selected; local images are first uploaded then their ID is added to the gallery
  • Simply confirming selection will add each item individually to the Post
  • Pressing the back arrow will destroy Action Mode but stay in the MediaPickerActivity, back again will return to the editor
  • VideoPress thumbnails!
  • Parallelized background thumbnail generation
  • Progress indicator when uploading media
  • Placeholder image to fallback on when a thumbnail can't be retrieved
  • WPCollectionSpan for condensing multi-selected media in the Post editor; can be modified when tapped
  • If the user removes all but one item from a collection in the post it replaces the WPCollectionSpan with a WPImageSpan
  • ^^ Likewise if the user removes all of the items from a collection it removes the span

In-progress

  • @maxme pointed out that inserting images can sometimes remove previous images; investigating
  • If the user removes the first item from a WPCollectionSpan it should generate a new thumbnail from the available content

Used to return a MediaGallery, now just returns the selected items with a different result code.
Check for deletion involves attempting to GET media and checking for a 404 error.
Uploads local media then creates gallery from selected media IDs.
Local images would not update until web images we downloaded. Need to fix thread priority to follow LIFO protocol.
Users now alerted of problems with the provided file via Toasts.
@maxme
Copy link
Copy Markdown
Contributor

maxme commented Mar 4, 2015

Unfortunately we can't show N placeholder images while they are loading due to issues with deleted media. After requesting all the images for a blog we actually have to perform an HTTP GET to verify that we don't receive a 404 on a particular image. That's the main reason for the delay you see when loading blog images.

IMHO, that's really a weird user experience. When on a slow network, I have the impression I don't have any images in my media library. How the media library is handling this 404 issue?

Another comment, the more I test it, the more I think we shouldn't mix local and media library pictures. The main reason: I have a huge list of local pics and searching for a media library items make me scroll a loooong way to see them. Second argument: even with the "W" logo, it's not super explicit. I'm not against it, but I would like to hear from other devs/designers/users about this.

@tonyr59h
Copy link
Copy Markdown
Contributor Author

tonyr59h commented Mar 4, 2015

When on a slow network, I have the impression I don't have any images in my media library. How the media library is handling this 404 issue?

MediaSourceWPImages queries each of the images and verifies a 200 return code. After all the checks are complete it updates the adapter with all the verified images via notifyDataSetChanged.

the more I test it, the more I think we shouldn't mix local and media library pictures. The main reason: I have a huge list of local pics and searching for a media library items make me scroll a loooong way to see them.

I've noticed this as well. I have ~100 images to scroll through when I want to get to my library images, it's a hassle. I'm gonna switch it to four tabs for now; Device Images, Device Video, Blog Images, Blog Video.

@maxme
Copy link
Copy Markdown
Contributor

maxme commented Mar 5, 2015

Before the merge:

  • move tab titles to strings.xml
  • loading indicator for "site image/video"
  • reverse sort order
  • adding a "site image" doesn't work
  • create new post, add 2 (or more) images from the device, back, back (local draft saved), then edit the post again: it's empty.
  • create new post, add 2 (or more) images, publish: the published post is empty (no images).

Next iteration:

  • empty views
  • work on pre-loading / caching / updating the media library

@tonyr59h
Copy link
Copy Markdown
Contributor Author

tonyr59h commented Mar 6, 2015

Here's a video of adding two local and two blog images to a new post then publishing it. Local images still need to be queued for upload then the last bullet point will be satisfied.

@tonyr59h
Copy link
Copy Markdown
Contributor Author

tonyr59h commented Mar 6, 2015

Removing the WPCollectionSpan on your branch fixes all the issues. There's still the problem (#2406) of too many items lagging the UI but as discussed on Slack that is likely an edge case.

EDIT: We should merge in your branch, @maxme then all the issues listed above will be resolved.

@maxme
Copy link
Copy Markdown
Contributor

maxme commented Mar 10, 2015

Tested again, and looks ok!

Encountered a crash, but I'm pretty sure it wasn't introduced in this pr:

03-10 11:30:34.651    8847-8948/org.wordpress.android.beta E/AndroidRuntime﹕ FATAL EXCEPTION: AsyncTask #4
    Process: org.wordpress.android.beta, PID: 8847
    java.lang.RuntimeException: An error occured while executing doInBackground()
            at android.os.AsyncTask$3.done(AsyncTask.java:300)
            at java.util.concurrent.FutureTask.finishCompletion(FutureTask.java:355)
            at java.util.concurrent.FutureTask.setException(FutureTask.java:222)
            at java.util.concurrent.FutureTask.run(FutureTask.java:242)
            at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1112)
            at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:587)
            at java.lang.Thread.run(Thread.java:818)
     Caused by: java.lang.NullPointerException: Attempt to invoke virtual method 'android.content.res.Resources android.content.Context.getResources()' on a null object reference
            at org.wordpress.android.util.HtmlToSpannedConverter.startImg(WPHtml.java:810)
            at org.wordpress.android.util.HtmlToSpannedConverter.handleStartTag(WPHtml.java:652)
            at org.wordpress.android.util.HtmlToSpannedConverter.startElement(WPHtml.java:992)
            at org.ccil.cowan.tagsoup.Parser.push(Parser.java:794)
            at org.ccil.cowan.tagsoup.Parser.rectify(Parser.java:1061)
            at org.ccil.cowan.tagsoup.Parser.stage(Parser.java:1026)
            at org.ccil.cowan.tagsoup.HTMLScanner.scan(HTMLScanner.java:632)
            at org.ccil.cowan.tagsoup.Parser.parse(Parser.java:449)
            at org.wordpress.android.util.HtmlToSpannedConverter.convert(WPHtml.java:552)
            at org.wordpress.android.util.WPHtml.fromHtml(WPHtml.java:159)
            at org.wordpress.android.util.WPHtml.fromHtml(WPHtml.java:122)
            at org.wordpress.android.ui.posts.EditPostPreviewFragment$LoadPostPreviewTask.doInBackground(EditPostPreviewFragment.java:78)
            at org.wordpress.android.ui.posts.EditPostPreviewFragment$LoadPostPreviewTask.doInBackground(EditPostPreviewFragment.java:62)
            at android.os.AsyncTask$2.call(AsyncTask.java:288)
            at java.util.concurrent.FutureTask.run(FutureTask.java:237)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1112)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:587)
at java.lang.Thread.run(Thread.java:818)

@maxme
Copy link
Copy Markdown
Contributor

maxme commented Mar 10, 2015

Filled this new issue for empty views: #2414

@maxme
Copy link
Copy Markdown
Contributor

maxme commented Mar 10, 2015

:shipit:
🎆

maxme added a commit that referenced this pull request Mar 10, 2015
@maxme maxme merged commit fb940ec into develop Mar 10, 2015
@maxme maxme deleted the 1628-mediapicker branch March 10, 2015 16:55
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants