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

Feature/photo picker for all editors #5644

Merged
merged 16 commits into from
Apr 25, 2017

Conversation

nbradbury
Copy link
Contributor

Enables the new photo picker for all editors (prior to this PR, it was only enabled for the Aztec editor), which finally does away with the seven-item menu monstrosity 🎉

A simple way to test this is to manually change these two variables.

cc: @daniloercoli

@daniloercoli
Copy link
Contributor

@mzorz or @aforcier - Would you mind to review this PR since I'm AFK for few days?

@aforcier aforcier self-assigned this Apr 13, 2017
@aforcier
Copy link
Contributor

Haven't dived into the code yet, but I have a few broad concerns about this removing features that already exist in the legacy/hybrid editor (though not, yet, in Aztec):

  1. This seems to remove gallery creation from the editor entirely - shouldn't we wait to have that implemented in the new picker before dropping the existing monstrosity?
  2. While the overlay part of the photo picker seems to show both photos and videos, there doesn't seem to be a way to launch the native picker (using the middle bottom bar icon) to include video (as the third option in the monstrosity did)
  3. Similar to above (but far less important imo), we're unable to launch the camera for video capture (fourth option in monstrosity)

@nbradbury
Copy link
Contributor Author

there doesn't seem to be a way to launch the native picker (using the middle bottom bar icon) to include video

Oof, I hadn't noticed that. I guess we have two options here:

  1. Add a separate icon for picking a video
  2. When the middle icon is tapped, show a popup with "Choose photo" and "Choose video."

I'm not wild about either of those, but I think I'd go with the second option. What do you think?

@aforcier
Copy link
Contributor

I guess we have two options here:

  1. Add a separate icon for picking a video
  2. When the middle icon is tapped, show a popup with "Choose photo" and "Choose video."

I'm not wild about either of those, but I think I'd go with the second option. What do you think?

I'd say the second option sounds better too, but I'm not wild about either one either. What do you think we should do here @bysl?

Whatever we decide, should we do the same for the camera (still photo vs video)?

@@ -855,62 +840,6 @@ public void onClick(DialogInterface dialog, int id) {
return false;
}

@Override
public void openContextMenu(View view) {
Copy link
Contributor

Choose a reason for hiding this comment

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

With the context menu removed, we should also drop now-dead calls to registerForContextMenu() and getActivity().openContextMenu() in all three editor fragments.

@aforcier
Copy link
Contributor

Should we disable the rest of the format bar while in media mode for the visual and legacy editors (as we do for Aztec)?

@aforcier
Copy link
Contributor

This is very minor and should be a separate (low priority) issue:

With the media picker visible the editor screen is grayed, which suggests that I can't input any text, but with a hardware keyboard I can keep typing. If possible we should probably prevent that.

@nbradbury
Copy link
Contributor Author

there doesn't seem to be a way to launch the native picker (using the middle bottom bar icon) to include video

I corrected this in 8f2633e. Now tapping the camera or picker icons shows a popup which enables choosing between photos and videos.

screenshot_1492217276

Should we disable the rest of the format bar while in media mode for the visual and legacy editors (as we do for Aztec)?

I think we're okay not doing this since those editors won't be with us much longer. Note that this PR hides the picker when the link or html buttons are pressed, and pressing any of the other buttons doesn't really impact the picker.

With the media picker visible the editor screen is grayed, which suggests that I can't input any text, but with a hardware keyboard I can keep typing.

Blah, hadn't thought about that. If it's okay with you, I'd like to open a separate issue for that.

@aforcier
Copy link
Contributor

aforcier commented Apr 17, 2017

Now tapping the camera or picker icons shows a popup which enables choosing between photos and videos.

Looks great @nbradbury!

Should we disable the rest of the format bar while in media mode for the visual and legacy editors (as we do for Aztec)?

I think we're okay not doing this since those editors won't be with us much longer. Note that this PR hides the picker when the link or html buttons are pressed, and pressing any of the other buttons doesn't really impact the picker.

I can live with that 👍

With the media picker visible the editor screen is grayed, which suggests that I can't input any text, but with a hardware keyboard I can keep typing.

Blah, hadn't thought about that. If it's okay with you, I'd like to open a separate issue for that.

Absolutely 👍

@aforcier
Copy link
Contributor

To summarize, I think there are just three things left for this PR:

  1. In the WP media library screen, enable multi-select and use that to create a gallery, so we're not dropping support for it (as we discussed)
  2. This small cleanup nit
  3. Some design input on the photo/video popup behavior you added (and the coming gallery implementation) (cc @bysl)

@aforcier
Copy link
Contributor

I found a crash when launching the camera, taking a photo, and attempting to use it:

java.lang.SecurityException: Permission Denial: opening provider android.support.v4.content.FileProvider from ProcessRecord{43a76ae8 13380:com.sec.android.app.camera/u0a10083} (pid=13380, uid=10083) that is not exported from uid 10159
at android.os.Parcel.readException(Parcel.java:1431)
at android.os.Parcel.readException(Parcel.java:1385)
at android.app.ActivityManagerProxy.getContentProvider(ActivityManagerNative.java:2906)
at android.app.ActivityThread.acquireProvider(ActivityThread.java:4755)
at android.app.ContextImpl$ApplicationContentResolver.acquireUnstableProvider(ContextImpl.java:2495)
at android.content.ContentResolver.acquireUnstableProvider(ContentResolver.java:1152)
at android.content.ContentResolver.openAssetFileDescriptor(ContentResolver.java:667)
at android.content.ContentResolver.openOutputStream(ContentResolver.java:540)
at android.content.ContentResolver.openOutputStream(ContentResolver.java:516)
at com.sec.android.app.camera.Camera$LastContentUriCallback.onCompleted(Camera.java:5908)
at com.sec.android.app.camera.Camera.onLaunchGallery(Camera.java:5799)
at com.sec.android.app.camera.Camera.onImageStoringCompleted(Camera.java:5167)
at com.sec.android.app.camera.CameraEngine.imageStoringCompleted(CameraEngine.java:2326)
at com.sec.android.app.camera.CeStateInitialized.handleMessage(CeStateInitialized.java:47)
at com.sec.android.app.camera.CameraEngine$StateMessageHandler.handleMessage(CameraEngine.java:253)

This was on a Samsung S3 API18, and also on an API16 emulator.

@aforcier
Copy link
Contributor

Related to permissions, I tried disabling permissions on my Pixel and then trying to use the picker. I get two permissions pop-ups, one for storage and one for camera.

If I grant the storage permission but deny the camera permission, I get a Permissions required in order to access media toast and can't use the picker.

Shouldn't we instead launch the picker but re-prompt for permission if and when the user taps the camera button? Or even only ask for storage permission the first time and hold off on camera until it's needed (I'm not sure if that might get complicated with the middle, native picker button though).

@sonderingheights
Copy link

Some design input on the photo/video popup behavior you added (and the coming gallery implementation) (cc @bysl)

This looks okay to me. Prefer it over another icon where it would be less clear than the text.

@nbradbury
Copy link
Contributor Author

nbradbury commented Apr 22, 2017

I found a crash when launching the camera, taking a photo, and attempting to use it:

@aforcier I'm not able to reproduce this, but I don't think it's an issue specific to this PR because I didn't change anything with the camera (it uses pre-existing code). Does the same problem occur in develop?

Related to permissions, I tried disabling permissions on my Pixel and then trying to use the picker. I get two permissions pop-ups, one for storage and one for camera.

This is also pre-existing code. We should open an issue for this, but we want to ping @kwonye since he's working on soft asks and this is related.

In the WP media library screen, enable multi-select and use that to create a gallery, so we're not dropping support for it (as we discussed)

Addressed separately in #5721.

With the context menu removed, we should also drop now-dead calls to registerForContextMenu() and getActivity().openContextMenu() in all three editor fragments.

Addressed in 762ef92

@aforcier
Copy link
Contributor

I found a crash when launching the camera, taking a photo, and attempting to use it:

@aforcier I'm not able to reproduce this, but I don't think it's an issue specific to this PR because I didn't change anything with the camera (it uses pre-existing code). Does the same problem occur in develop?

Hmm you're right, I can reproduce in develop - could've sworn this flow has been tested before. I'll look into it a bit more and open an issue for that - nothing to do in this PR. (For the record, this was using the Genymotion API16 emulator, which might make a difference.)

Related to permissions, I tried disabling permissions on my Pixel and then trying to use the picker. I get two permissions pop-ups, one for storage and one for camera.

This is also pre-existing code. We should open an issue for this, but we want to ping @kwonye since he's working on soft asks and this is related.

👍

@aforcier
Copy link
Contributor

Looks good! Once #5721 is merged (and the rotation issue mentioned there also fixed) and this branch is updated I'll give it a final pass.

@aforcier
Copy link
Contributor

I think we're good to go @nbradbury - if you could merge develop in one more time I'll give it a final pass.

@nbradbury
Copy link
Contributor Author

If you could merge develop in one more time I'll give it a final pass.

Done!

@aforcier
Copy link
Contributor

:shipit: 🎖 🎈 🍺

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants