From ccb815ec4a395dfdcad87c178aafc6310a68aa5d Mon Sep 17 00:00:00 2001 From: Andrew Dolgov Date: Mon, 24 Jun 2013 13:14:20 +0400 Subject: [PATCH] article webview: set base url to properly display protocol relative images --- src/org/fox/ttrss/ArticleFragment.java | 2 +- src/org/fox/ttrss/offline/OfflineArticleFragment.java | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/src/org/fox/ttrss/ArticleFragment.java b/src/org/fox/ttrss/ArticleFragment.java index 4a99377f..3d1b6075 100644 --- a/src/org/fox/ttrss/ArticleFragment.java +++ b/src/org/fox/ttrss/ArticleFragment.java @@ -286,7 +286,7 @@ public class ArticleFragment extends Fragment implements GestureDetector.OnDoubl content += "

 

 

 

 

"; try { - web.loadDataWithBaseURL(null, content, "text/html", "utf-8", null); + web.loadDataWithBaseURL(m_article.link, content, "text/html", "utf-8", null); } catch (RuntimeException e) { e.printStackTrace(); } diff --git a/src/org/fox/ttrss/offline/OfflineArticleFragment.java b/src/org/fox/ttrss/offline/OfflineArticleFragment.java index 7010bb34..05d69cc2 100644 --- a/src/org/fox/ttrss/offline/OfflineArticleFragment.java +++ b/src/org/fox/ttrss/offline/OfflineArticleFragment.java @@ -133,6 +133,8 @@ public class OfflineArticleFragment extends Fragment implements GestureDetector. if (m_cursor.isFirst()) { TextView title = (TextView)view.findViewById(R.id.title); + + final String link = m_cursor.getString(m_cursor.getColumnIndex("link")); if (title != null) { @@ -143,8 +145,6 @@ public class OfflineArticleFragment extends Fragment implements GestureDetector. else titleStr = m_cursor.getString(m_cursor.getColumnIndex("title")); - final String link = m_cursor.getString(m_cursor.getColumnIndex("link")); - title.setText(titleStr); //title.setPaintFlags(title.getPaintFlags() | Paint.UNDERLINE_TEXT_FLAG); title.setOnClickListener(new OnClickListener() { @@ -281,7 +281,7 @@ public class OfflineArticleFragment extends Fragment implements GestureDetector. "" + articleContent + "

 

 

 

 

"; try { - web.loadDataWithBaseURL(null, content, "text/html", "utf-8", null); + web.loadDataWithBaseURL(link, content, "text/html", "utf-8", null); } catch (RuntimeException e) { e.printStackTrace(); }