From 3a7273972b66812cec982895644c871b4de54704 Mon Sep 17 00:00:00 2001 From: Andrew Dolgov Date: Fri, 3 Feb 2012 09:05:42 +0300 Subject: [PATCH] set webview acceleration to software to prevent background flicker on ics --- AndroidManifest.xml | 4 ++-- src/org/fox/ttrss/ArticleFragment.java | 11 ++++++----- src/org/fox/ttrss/OfflineArticleFragment.java | 11 ++++++----- 3 files changed, 14 insertions(+), 12 deletions(-) diff --git a/AndroidManifest.xml b/AndroidManifest.xml index d341dc1b..55f46404 100644 --- a/AndroidManifest.xml +++ b/AndroidManifest.xml @@ -1,8 +1,8 @@ + android:versionCode="57" + android:versionName="0.4.9" > diff --git a/src/org/fox/ttrss/ArticleFragment.java b/src/org/fox/ttrss/ArticleFragment.java index c40b6936..3809d0ab 100644 --- a/src/org/fox/ttrss/ArticleFragment.java +++ b/src/org/fox/ttrss/ArticleFragment.java @@ -98,23 +98,24 @@ public class ArticleFragment extends Fragment { String content; String cssOverride = ""; - WebSettings ws = web.getSettings(); ws.setSupportZoom(true); ws.setBuiltInZoomControls(true); TypedValue tv = new TypedValue(); getActivity().getTheme().resolveAttribute(R.attr.linkColor, tv, true); + + // prevent flicker in ics + web.setLayerType(View.LAYER_TYPE_SOFTWARE, null); 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); + cssOverride = "body { background : transparent; color : #e0e0e0}"; + //view.setBackgroundColor(android.R.color.black); + web.setBackgroundColor(android.R.color.transparent); } else { cssOverride = ""; } - String hexColor = String.format("#%06X", (0xFFFFFF & tv.data)); cssOverride += " a:link {color: "+hexColor+";} a:visited { color: "+hexColor+";}"; diff --git a/src/org/fox/ttrss/OfflineArticleFragment.java b/src/org/fox/ttrss/OfflineArticleFragment.java index f759d83b..79b7df92 100644 --- a/src/org/fox/ttrss/OfflineArticleFragment.java +++ b/src/org/fox/ttrss/OfflineArticleFragment.java @@ -102,23 +102,24 @@ public class OfflineArticleFragment extends Fragment { String content; String cssOverride = ""; - WebSettings ws = web.getSettings(); ws.setSupportZoom(true); ws.setBuiltInZoomControls(true); TypedValue tv = new TypedValue(); getActivity().getTheme().resolveAttribute(R.attr.linkColor, tv, true); + + // prevent flicker in ics + web.setLayerType(View.LAYER_TYPE_SOFTWARE, null); 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); + cssOverride = "body { background : transparent; color : #e0e0e0}"; + //view.setBackgroundColor(android.R.color.black); + web.setBackgroundColor(android.R.color.transparent); } else { cssOverride = ""; } - String hexColor = String.format("#%06X", (0xFFFFFF & tv.data)); cssOverride += " a:link {color: "+hexColor+";} a:visited { color: "+hexColor+";}";