|
|
|
@ -204,7 +204,8 @@ public class ImageViewerController extends Controller implements ImageViewerPres |
|
|
|
|
public void onFloatingMenuItemClicked(FloatingMenu menu, FloatingMenuItem item) { |
|
|
|
|
for (ImageSearch imageSearch : ImageSearch.engines) { |
|
|
|
|
if (((Integer) item.getId()) == imageSearch.getId()) { |
|
|
|
|
AndroidUtils.openLinkInBrowser((Activity) context, imageSearch.getUrl(presenter.getCurrentPostImage().imageUrl)); |
|
|
|
|
final String searchImageUrl = getSearchImageUrl(presenter.getCurrentPostImage()); |
|
|
|
|
AndroidUtils.openLinkInBrowser((Activity) context, imageSearch.getUrl(searchImageUrl)); |
|
|
|
|
break; |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
@ -534,4 +535,13 @@ public class ImageViewerController extends Controller implements ImageViewerPres |
|
|
|
|
public interface GoPostCallback { |
|
|
|
|
ImageViewerCallback goToPost(PostImage postImage); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
/** |
|
|
|
|
* Send thumbnail image of movie posts because none of the image search providers support movies (such as webm) directly |
|
|
|
|
* @param postImage |
|
|
|
|
* @return url of an image to be searched |
|
|
|
|
*/ |
|
|
|
|
private String getSearchImageUrl(final PostImage postImage) { |
|
|
|
|
return postImage.type == PostImage.Type.MOVIE ? postImage.thumbnailUrl : postImage.imageUrl; |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|