Skip to content

Gb/upload captured photo#9085

Merged
marecar3 merged 47 commits intogb/feature_upload_media_filefrom
gb/upload_captured_photo
Jan 25, 2019
Merged

Gb/upload captured photo#9085
marecar3 merged 47 commits intogb/feature_upload_media_filefrom
gb/upload_captured_photo

Conversation

@marecar3
Copy link
Copy Markdown
Contributor

Description :
This PR introduces upload of captured image from camera through Gutenberg Editor which implementation is based on this issue.

Following PR's :
gutenberg-mobile
gutenberg

ezgif com-video-to-gif 2

Pass upload media file callback data
# Conflicts:
#	libs/gutenberg-mobile
@marecar3 marecar3 added the Gutenberg Editing and display of Gutenberg blocks. label Jan 23, 2019
@marecar3 marecar3 self-assigned this Jan 23, 2019
@marecar3 marecar3 requested a review from mzorz January 23, 2019 21:38
@wpmobilebot
Copy link
Copy Markdown
Contributor

1 Warning
⚠️ PR is not assigned to a milestone.

Generated by 🚫 Danger

…hoto

# Conflicts:
#	libs/editor/WordPressEditor/src/main/java/org/wordpress/android/editor/GutenbergEditorFragment.java
#	libs/gutenberg-mobile
return view;
}

private void requestCameraandStoragePermissions() {
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

There's a typo here, should be requestCameraAndStoragePermissions

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Fixed.


private static boolean mIsToolbarExpanded = false;

private static final String[] sPermissions = new String[]{Manifest.permission.CAMERA,
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Let's rename this variable here to something more descriptive like sCameraAndExternalStoragePermissions

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Fixed.


@Override
public void onCapturePhotoButtonClicked() {
if (!hasPermissions(sPermissions)) {
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Just looking into our codebase, - we can get rid of this private method hasPermissions and requestCameraandStoragePermissions() entirely and use the method checkAndRequestCameraAndStoragePermissions() from our PermissionUtils class, here.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Fixed. thanks!

# Conflicts:
#	libs/gutenberg-mobile
# Conflicts:
#	WordPress/src/main/java/org/wordpress/android/ui/posts/EditPostActivity.java
#	libs/editor/WordPressEditor/src/main/java/org/wordpress/android/editor/EditorFragmentAbstract.java
#	libs/editor/WordPressEditor/src/main/java/org/wordpress/android/editor/GutenbergEditorFragment.java
#	libs/gutenberg-mobile
Copy link
Copy Markdown
Contributor

@SergioEstevao SergioEstevao left a comment

Choose a reason for hiding this comment

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

Looking great!

@marecar3 marecar3 merged commit 3cce148 into gb/feature_upload_media_file Jan 25, 2019
@marecar3 marecar3 deleted the gb/upload_captured_photo branch January 25, 2019 12:33
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Gutenberg Editing and display of Gutenberg blocks.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants