set webview acceleration to software to prevent background flicker on

ics
This commit is contained in:
Andrew Dolgov 2012-02-03 09:05:42 +03:00
parent 7cff2fe3c0
commit 3a7273972b
3 changed files with 14 additions and 12 deletions

View File

@ -1,8 +1,8 @@
<?xml version="1.0" encoding="utf-8"?> <?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android" <manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="org.fox.ttrss" package="org.fox.ttrss"
android:versionCode="56" android:versionCode="57"
android:versionName="0.4.8" > android:versionName="0.4.9" >
<uses-sdk android:minSdkVersion="7" /> <uses-sdk android:minSdkVersion="7" />

View File

@ -98,7 +98,6 @@ public class ArticleFragment extends Fragment {
String content; String content;
String cssOverride = ""; String cssOverride = "";
WebSettings ws = web.getSettings(); WebSettings ws = web.getSettings();
ws.setSupportZoom(true); ws.setSupportZoom(true);
ws.setBuiltInZoomControls(true); ws.setBuiltInZoomControls(true);
@ -106,15 +105,17 @@ public class ArticleFragment extends Fragment {
TypedValue tv = new TypedValue(); TypedValue tv = new TypedValue();
getActivity().getTheme().resolveAttribute(R.attr.linkColor, tv, true); 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")) { if (m_prefs.getString("theme", "THEME_DARK").equals("THEME_DARK")) {
cssOverride = "body { background : black; color : #e0e0e0}"; cssOverride = "body { background : transparent; color : #e0e0e0}";
view.setBackgroundColor(android.R.color.black); //view.setBackgroundColor(android.R.color.black);
web.setBackgroundColor(android.R.color.black); web.setBackgroundColor(android.R.color.transparent);
} else { } else {
cssOverride = ""; cssOverride = "";
} }
String hexColor = String.format("#%06X", (0xFFFFFF & tv.data)); String hexColor = String.format("#%06X", (0xFFFFFF & tv.data));
cssOverride += " a:link {color: "+hexColor+";} a:visited { color: "+hexColor+";}"; cssOverride += " a:link {color: "+hexColor+";} a:visited { color: "+hexColor+";}";

View File

@ -102,7 +102,6 @@ public class OfflineArticleFragment extends Fragment {
String content; String content;
String cssOverride = ""; String cssOverride = "";
WebSettings ws = web.getSettings(); WebSettings ws = web.getSettings();
ws.setSupportZoom(true); ws.setSupportZoom(true);
ws.setBuiltInZoomControls(true); ws.setBuiltInZoomControls(true);
@ -110,15 +109,17 @@ public class OfflineArticleFragment extends Fragment {
TypedValue tv = new TypedValue(); TypedValue tv = new TypedValue();
getActivity().getTheme().resolveAttribute(R.attr.linkColor, tv, true); 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")) { if (m_prefs.getString("theme", "THEME_DARK").equals("THEME_DARK")) {
cssOverride = "body { background : black; color : #e0e0e0}"; cssOverride = "body { background : transparent; color : #e0e0e0}";
view.setBackgroundColor(android.R.color.black); //view.setBackgroundColor(android.R.color.black);
web.setBackgroundColor(android.R.color.black); web.setBackgroundColor(android.R.color.transparent);
} else { } else {
cssOverride = ""; cssOverride = "";
} }
String hexColor = String.format("#%06X", (0xFFFFFF & tv.data)); String hexColor = String.format("#%06X", (0xFFFFFF & tv.data));
cssOverride += " a:link {color: "+hexColor+";} a:visited { color: "+hexColor+";}"; cssOverride += " a:link {color: "+hexColor+";} a:visited { color: "+hexColor+";}";