Skip to content

Commit a6b5ecf

Browse files
committed
Tapping a media gallery span opens gallery editor.
1 parent 912f81a commit a6b5ecf

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

WordPressEditor/src/main/java/org/wordpress/android/editor/LegacyEditorFragment.java

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -69,6 +69,8 @@
6969
public class LegacyEditorFragment extends EditorFragmentAbstract implements TextWatcher,
7070
WPEditText.OnSelectionChangedListener, View.OnTouchListener {
7171
public static final int ACTIVITY_REQUEST_CODE_CREATE_LINK = 4;
72+
public static final String ACTION_MEDIA_GALLERY_TOUCHED = "MEDIA_GALLERY_TOUCHED";
73+
public static final String EXTRA_MEDIA_GALLERY = "EXTRA_MEDIA_GALLERY";
7274

7375
private static final int MIN_THUMBNAIL_WIDTH = 200;
7476
private static final int CONTENT_ANIMATION_DURATION = 250;
@@ -772,8 +774,9 @@ public boolean onEditorAction(TextView v, int actionId, KeyEvent event) {
772774
MediaGalleryImageSpan[] gallerySpans = spannable.getSpans(charPosition, charPosition, MediaGalleryImageSpan.class);
773775
if (gallerySpans.length > 0) {
774776
final MediaGalleryImageSpan gallerySpan = gallerySpans[0];
775-
// TODO: send action to create media gallery
776-
// startMediaGalleryActivity(gallerySpan.getMediaGallery());
777+
Intent intent = new Intent(ACTION_MEDIA_GALLERY_TOUCHED);
778+
intent.putExtra(EXTRA_MEDIA_GALLERY, gallerySpan.getMediaGallery());
779+
mActivity.sendBroadcast(intent);
777780
}
778781
}
779782
} else if (event.getAction() == 1) {

0 commit comments

Comments
 (0)