diff options
Diffstat (limited to 'org.fox.ttrss/src/main/java/org/fox/ttrss/ArticleImagesPagerActivity.java')
-rwxr-xr-x | org.fox.ttrss/src/main/java/org/fox/ttrss/ArticleImagesPagerActivity.java | 35 |
1 files changed, 2 insertions, 33 deletions
diff --git a/org.fox.ttrss/src/main/java/org/fox/ttrss/ArticleImagesPagerActivity.java b/org.fox.ttrss/src/main/java/org/fox/ttrss/ArticleImagesPagerActivity.java index 39aa8fe4..d3bc3c0a 100755 --- a/org.fox.ttrss/src/main/java/org/fox/ttrss/ArticleImagesPagerActivity.java +++ b/org.fox.ttrss/src/main/java/org/fox/ttrss/ArticleImagesPagerActivity.java @@ -413,39 +413,7 @@ public class ArticleImagesPagerActivity extends CommonActivity implements Gestur // TODO: this needs access to article text, I'm afraid case R.id.article_img_view_caption: if (url != null) { - - // Android doesn't give us an easy way to access title tags; - // we'll use Jsoup on the body text to grab the title text - // from the first image tag with this url. This will show - // the wrong text if an image is used multiple times. - Document doc = Jsoup.parse(m_content); - Elements es = doc.getElementsByAttributeValue("src", url); - if (es.size() > 0) { - if (es.get(0).hasAttr("title")) { - Dialog dia = new Dialog(this); - if (es.get(0).hasAttr("alt")) { - dia.setTitle(es.get(0).attr("alt")); - } else { - dia.setTitle(es.get(0).attr("title")); - } - TextView titleText = new TextView(this); - - if (android.os.Build.VERSION.SDK_INT >= android.os.Build.VERSION_CODES.JELLY_BEAN) { - titleText.setPaddingRelative(24, 24, 24, 24); - } else { - titleText.setPadding(24, 24, 24, 24); - } - - titleText.setTextSize(16); - titleText.setText(es.get(0).attr("title")); - dia.setContentView(titleText); - dia.show(); - } else { - toast(R.string.no_caption_to_display); - } - } else { - toast(R.string.no_caption_to_display); - } + displayImageCaption(url, m_content); } return true; default: @@ -453,4 +421,5 @@ public class ArticleImagesPagerActivity extends CommonActivity implements Gestur return super.onContextItemSelected(item); } } + } |