From b28f00765e8e1cbd53d1a1f425c2c40bea8f0cba Mon Sep 17 00:00:00 2001 From: Andrew Dolgov Date: Wed, 1 Feb 2012 14:25:35 +0300 Subject: [PATCH] use proper link colors in webview (bump version) --- AndroidManifest.xml | 4 ++-- res/values-v11/style.xml | 2 ++ res/values-v14/style.xml | 2 ++ res/values/attrs.xml | 1 + res/values/style.xml | 2 ++ src/org/fox/ttrss/ArticleFragment.java | 15 ++++++--------- src/org/fox/ttrss/OfflineArticleFragment.java | 14 +++++--------- 7 files changed, 20 insertions(+), 20 deletions(-) diff --git a/AndroidManifest.xml b/AndroidManifest.xml index 95d87da9..d341dc1b 100644 --- a/AndroidManifest.xml +++ b/AndroidManifest.xml @@ -1,8 +1,8 @@ + android:versionCode="56" + android:versionName="0.4.8" > diff --git a/res/values-v11/style.xml b/res/values-v11/style.xml index 53563ab1..931bf629 100644 --- a/res/values-v11/style.xml +++ b/res/values-v11/style.xml @@ -20,6 +20,7 @@ @android:color/primary_text_light @android:color/secondary_text_light @android:color/secondary_text_light + #5858F8 \ No newline at end of file diff --git a/res/values-v14/style.xml b/res/values-v14/style.xml index 7cac2d5f..afef40b4 100644 --- a/res/values-v14/style.xml +++ b/res/values-v14/style.xml @@ -19,6 +19,7 @@ @android:color/primary_text_light @android:color/secondary_text_light @android:color/secondary_text_light + #30B0E0 \ No newline at end of file diff --git a/res/values/attrs.xml b/res/values/attrs.xml index 10b06a8f..e257bc5b 100644 --- a/res/values/attrs.xml +++ b/res/values/attrs.xml @@ -19,4 +19,5 @@ + \ No newline at end of file diff --git a/res/values/style.xml b/res/values/style.xml index 709d848e..39103f11 100644 --- a/res/values/style.xml +++ b/res/values/style.xml @@ -20,6 +20,7 @@ @android:color/primary_text_light @android:color/secondary_text_light @android:color/secondary_text_light + #5858F8 \ No newline at end of file diff --git a/src/org/fox/ttrss/ArticleFragment.java b/src/org/fox/ttrss/ArticleFragment.java index 455799a0..c40b6936 100644 --- a/src/org/fox/ttrss/ArticleFragment.java +++ b/src/org/fox/ttrss/ArticleFragment.java @@ -15,6 +15,7 @@ import android.preference.PreferenceManager; import android.support.v4.app.Fragment; import android.text.Html; import android.text.method.LinkMovementMethod; +import android.util.Log; import android.util.TypedValue; import android.view.LayoutInflater; import android.view.View; @@ -102,23 +103,19 @@ public class ArticleFragment extends Fragment { ws.setSupportZoom(true); ws.setBuiltInZoomControls(true); - TypedValue tv = new TypedValue(); - - if (m_prefs.getString("theme", "THEME_DARK").equals("THEME_DARK")) { - getActivity().getTheme().resolveAttribute(android.R.attr.textColorLink, tv, true); + TypedValue tv = new TypedValue(); + getActivity().getTheme().resolveAttribute(R.attr.linkColor, tv, true); + if (m_prefs.getString("theme", "THEME_DARK").equals("THEME_DARK")) { cssOverride = "body { background : black; color : #e0e0e0}"; view.setBackgroundColor(android.R.color.black); web.setBackgroundColor(android.R.color.black); } else { - getActivity().getTheme().resolveAttribute(android.R.attr.textColorLinkInverse, tv, true); - cssOverride = ""; } - int linkColor = tv.data; - String hexColor = String.format("#%06X", (0xFFFFFF & linkColor)); - + + String hexColor = String.format("#%06X", (0xFFFFFF & tv.data)); cssOverride += " a:link {color: "+hexColor+";} a:visited { color: "+hexColor+";}"; String articleContent = m_article.content != null ? m_article.content : ""; diff --git a/src/org/fox/ttrss/OfflineArticleFragment.java b/src/org/fox/ttrss/OfflineArticleFragment.java index 95bbb121..f759d83b 100644 --- a/src/org/fox/ttrss/OfflineArticleFragment.java +++ b/src/org/fox/ttrss/OfflineArticleFragment.java @@ -107,23 +107,19 @@ public class OfflineArticleFragment extends Fragment { ws.setSupportZoom(true); ws.setBuiltInZoomControls(true); - TypedValue tv = new TypedValue(); - - if (m_prefs.getString("theme", "THEME_DARK").equals("THEME_DARK")) { - getActivity().getTheme().resolveAttribute(android.R.attr.textColorLink, tv, true); + TypedValue tv = new TypedValue(); + getActivity().getTheme().resolveAttribute(R.attr.linkColor, tv, true); + if (m_prefs.getString("theme", "THEME_DARK").equals("THEME_DARK")) { cssOverride = "body { background : black; color : #e0e0e0}"; view.setBackgroundColor(android.R.color.black); web.setBackgroundColor(android.R.color.black); } else { - getActivity().getTheme().resolveAttribute(android.R.attr.textColorLinkInverse, tv, true); - cssOverride = ""; } - int linkColor = tv.data; - String hexColor = String.format("#%06X", (0xFFFFFF & linkColor)); - + + String hexColor = String.format("#%06X", (0xFFFFFF & tv.data)); cssOverride += " a:link {color: "+hexColor+";} a:visited { color: "+hexColor+";}"; String articleContent = m_cursor.getString(m_cursor.getColumnIndex("content"));