different workaround for webview flicker

This commit is contained in:
Andrew Dolgov 2013-10-16 20:22:55 +04:00
parent 5c9c2a8ca8
commit da483e12a6
2 changed files with 7 additions and 2 deletions

View File

@ -18,6 +18,7 @@ import android.annotation.SuppressLint;
import android.app.Activity; import android.app.Activity;
import android.content.Intent; import android.content.Intent;
import android.content.SharedPreferences; import android.content.SharedPreferences;
import android.graphics.Color;
import android.net.Uri; import android.net.Uri;
import android.os.Bundle; import android.os.Bundle;
import android.preference.PreferenceManager; import android.preference.PreferenceManager;
@ -209,7 +210,9 @@ public class ArticleFragment extends Fragment implements GestureDetector.OnDoubl
} else { } else {
cssOverride = "body { background : transparent; }"; cssOverride = "body { background : transparent; }";
} }
web.setBackgroundColor(getResources().getColor(android.R.color.transparent));
// seriously?
web.setBackgroundColor(Color.argb(1, 0, 0, 0));
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

@ -19,6 +19,7 @@ import android.app.Activity;
import android.content.Intent; import android.content.Intent;
import android.content.SharedPreferences; import android.content.SharedPreferences;
import android.database.Cursor; import android.database.Cursor;
import android.graphics.Color;
import android.net.Uri; import android.net.Uri;
import android.os.Bundle; import android.os.Bundle;
import android.preference.PreferenceManager; import android.preference.PreferenceManager;
@ -224,7 +225,8 @@ public class OfflineArticleFragment extends Fragment implements GestureDetector.
} else { } else {
cssOverride = "body { background : transparent; }"; cssOverride = "body { background : transparent; }";
} }
web.setBackgroundColor(getResources().getColor(android.R.color.transparent)); // seriously?
web.setBackgroundColor(Color.argb(1, 0, 0, 0));
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+";}";