fix webview flicker

This commit is contained in:
Andrew Dolgov 2013-05-24 00:42:57 +04:00
parent 764b990de7
commit 8c9e027f7b
2 changed files with 8 additions and 8 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="174" android:versionCode="175"
android:versionName="1.7.11" > android:versionName="1.7.12" >
<uses-sdk <uses-sdk
android:minSdkVersion="8" android:minSdkVersion="8"

View File

@ -97,10 +97,15 @@ public class ArticleFragment extends Fragment implements GestureDetector.OnDoubl
final View view = inflater.inflate(R.layout.article_fragment, container, false); final View view = inflater.inflate(R.layout.article_fragment, container, false);
View content = view.findViewById(R.id.content); WebView content = (WebView) view.findViewById(R.id.content);
if (content != null) content.setVisibility(View.INVISIBLE); if (content != null) content.setVisibility(View.INVISIBLE);
// prevent flicker in ics
if (android.os.Build.VERSION.SDK_INT >= 11) {
content.setLayerType(View.LAYER_TYPE_SOFTWARE, null);
}
new Handler().postDelayed(new Runnable() { new Handler().postDelayed(new Runnable() {
@Override @Override
public void run() { public void run() {
@ -205,11 +210,6 @@ public class ArticleFragment extends Fragment implements GestureDetector.OnDoubl
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
if (android.os.Build.VERSION.SDK_INT >= 11) {
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 : transparent; color : #e0e0e0}"; cssOverride = "body { background : transparent; color : #e0e0e0}";
} else if (m_prefs.getString("theme", "THEME_DARK").equals("THEME_DARK_GRAY")) { } else if (m_prefs.getString("theme", "THEME_DARK").equals("THEME_DARK_GRAY")) {