Skip to content

Commit

Permalink
Tapping a media gallery span opens gallery editor.
Browse files Browse the repository at this point in the history
  • Loading branch information
tonyr59h committed Mar 12, 2015
1 parent 912f81a commit a6b5ecf
Showing 1 changed file with 5 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,8 @@
public class LegacyEditorFragment extends EditorFragmentAbstract implements TextWatcher,
WPEditText.OnSelectionChangedListener, View.OnTouchListener {
public static final int ACTIVITY_REQUEST_CODE_CREATE_LINK = 4;
public static final String ACTION_MEDIA_GALLERY_TOUCHED = "MEDIA_GALLERY_TOUCHED";
public static final String EXTRA_MEDIA_GALLERY = "EXTRA_MEDIA_GALLERY";

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

0 comments on commit a6b5ecf

Please sign in to comment.