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

Gb/upload media file #8879

Merged
merged 24 commits into from
Jan 18, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
24 commits
Select commit Hold shift + click to select a range
575d48a
Propagate add photo clicked action
marecar3 Dec 28, 2018
6b9c931
Update gutenber-mobile submodule hash to branch feature/upload_media_…
marecar3 Dec 28, 2018
ec91a4d
Update gutenberg-mobile submodule hash
marecar3 Dec 28, 2018
c2bd366
Removed extra empty line
marecar3 Dec 28, 2018
548e6c9
Fixed checkstyle tests
marecar3 Dec 28, 2018
36b8eaf
Updated gutenberg submodule
marecar3 Dec 28, 2018
c450b92
Updated gutenberg submodule
marecar3 Dec 28, 2018
a57e0b4
Update gutenberg-mobile submodule
marecar3 Dec 28, 2018
da94295
User renamed android glue methods
marecar3 Dec 28, 2018
59ef29b
Merge branch 'develop' into gb/upload_media_file
marecar3 Jan 16, 2019
ecb68ef
Make verb used in callback methods to be a conjugation in the past tense
marecar3 Jan 16, 2019
e7bdda1
Updated gutenberg mobile submodule
marecar3 Jan 16, 2019
0070fc2
Updated gutenberg mobile submodule
marecar3 Jan 16, 2019
2240fc0
Merge branch 'gb/feature_upload_media_file' into gb/upload_media_file
marecar3 Jan 16, 2019
4132004
Updated gutenberg mobile submodule
marecar3 Jan 16, 2019
4e672d5
Merge branch 'develop' into gb/upload_media_file
marecar3 Jan 16, 2019
a82541a
Update gutenberg mobile submodule
marecar3 Jan 17, 2019
49a46e0
Merge branch 'gb/feature_upload_media_file' into gb/upload_media_file
marecar3 Jan 17, 2019
e7edbdf
Merge branch 'gb/feature_upload_media_file' into gb/upload_media_file
marecar3 Jan 17, 2019
ec0ff70
Update gutenberg mobile submodule
marecar3 Jan 17, 2019
3a10330
Update gutenberg mobile submodule
marecar3 Jan 17, 2019
4f3dbe3
Updated gutenberg mobile submodule
marecar3 Jan 17, 2019
2caa09b
Updated gutenberg mobile submodule
marecar3 Jan 18, 2019
4e49661
Merge branch 'gb/feature_upload_media_file' into gb/upload_media_file
marecar3 Jan 18, 2019
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 @@ -3181,6 +3181,11 @@ public void onAddMediaClicked() {
}
}

@Override
public void onAddPhotoClicked() {
onPhotoPickerIconClicked(PhotoPickerIcon.ANDROID_CHOOSE_PHOTO);
}

@Override
public void onMediaDropped(final ArrayList<Uri> mediaUris) {
mDroppedMediaUris = mediaUris;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -179,6 +179,7 @@ public interface EditorFragmentListener {
void onEditorFragmentInitialized();
void onSettingsClicked();
void onAddMediaClicked();
void onAddPhotoClicked();
boolean onMediaRetryClicked(String mediaId);
void onMediaUploadCancelClicked(String mediaId);
void onMediaDeleted(String mediaId);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@
import android.view.ViewGroup;
import android.view.WindowManager;
import android.view.inputmethod.InputMethodManager;
import android.webkit.URLUtil;

import com.android.volley.toolbox.ImageLoader;

Expand Down Expand Up @@ -108,9 +109,14 @@ public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle sa
view.findViewById(R.id.gutenberg),
mHtmlModeEnabled,
new OnMediaLibraryButtonListener() {
@Override public void onMediaLibraryButtonClick() {
@Override public void onMediaLibraryButtonClicked() {
onToolbarMediaButtonClicked();
}

@Override
public void onUploadMediaButtonClicked() {
mEditorFragmentListener.onAddPhotoClicked();
}
},
getActivity().getApplication(),
BuildConfig.DEBUG,
Expand Down Expand Up @@ -444,7 +450,11 @@ public void appendMediaFile(final MediaFile mediaFile, final String mediaUrl, Im
return;
}

mWPAndroidGlueCode.appendMediaFile(mediaUrl);
if (URLUtil.isNetworkUrl(mediaUrl)) {
mWPAndroidGlueCode.appendMediaFile(mediaUrl);
} else {
mWPAndroidGlueCode.appendUploadMediaFile(String.valueOf(mediaFile.getId()), "file://" + mediaUrl);
}
}

@Override
Expand Down Expand Up @@ -496,15 +506,18 @@ public void onMediaUploadRetry(String localId, MediaType mediaType) {

@Override
public void onMediaUploadSucceeded(final String localMediaId, final MediaFile mediaFile) {
mWPAndroidGlueCode.mediaFileUploadSucceeded(localMediaId, mediaFile.getFileURL());
}

@Override
public void onMediaUploadProgress(final String localMediaId, final float progress) {
mWPAndroidGlueCode.mediaFileUploadProgress(localMediaId, progress);
}

@Override
public void onMediaUploadFailed(final String localMediaId, final MediaType
mediaType, final String errorMessage) {
mWPAndroidGlueCode.mediaFileUploadFailed(localMediaId);
}

@Override
Expand Down