summaryrefslogtreecommitdiffstats
path: root/src/com/android/browser/preferences
diff options
context:
space:
mode:
authorJohn Reck <jreck@google.com>2012-03-20 15:59:57 -0700
committerJohn Reck <jreck@google.com>2012-03-20 15:59:57 -0700
commit96998e27a38534626e7bca6054aa8ddb2f8ca4e2 (patch)
tree1789f3bf2c25d10301a8adfc6ad201a225710367 /src/com/android/browser/preferences
parent476c581443b88afcf18f969b9a2532fdc87078f1 (diff)
downloadpackages_apps_Browser-96998e27a38534626e7bca6054aa8ddb2f8ca4e2.zip
packages_apps_Browser-96998e27a38534626e7bca6054aa8ddb2f8ca4e2.tar.gz
packages_apps_Browser-96998e27a38534626e7bca6054aa8ddb2f8ca4e2.tar.bz2
Prevent flicker while dragging contrast slider
Change-Id: Ia7b99d4674d4013451477981f89de93b6b28b0ae
Diffstat (limited to 'src/com/android/browser/preferences')
-rw-r--r--src/com/android/browser/preferences/FontSizePreview.java2
-rw-r--r--src/com/android/browser/preferences/InvertedContrastPreview.java6
-rw-r--r--src/com/android/browser/preferences/WebViewPreview.java6
3 files changed, 8 insertions, 6 deletions
diff --git a/src/com/android/browser/preferences/FontSizePreview.java b/src/com/android/browser/preferences/FontSizePreview.java
index 91ecb00..8825f3d 100644
--- a/src/com/android/browser/preferences/FontSizePreview.java
+++ b/src/com/android/browser/preferences/FontSizePreview.java
@@ -54,7 +54,7 @@ public class FontSizePreview extends WebViewPreview {
}
@Override
- protected void updatePreview() {
+ protected void updatePreview(boolean forceReload) {
if (mWebView == null) return;
WebSettings ws = mWebView.getSettings();
diff --git a/src/com/android/browser/preferences/InvertedContrastPreview.java b/src/com/android/browser/preferences/InvertedContrastPreview.java
index ba00421..ed6eadf 100644
--- a/src/com/android/browser/preferences/InvertedContrastPreview.java
+++ b/src/com/android/browser/preferences/InvertedContrastPreview.java
@@ -74,7 +74,7 @@ public class InvertedContrastPreview extends WebViewPreview {
}
@Override
- protected void updatePreview() {
+ protected void updatePreview(boolean forceReload) {
if (mWebView == null) return;
WebSettingsClassic ws = WebViewClassic.fromWebView(mWebView).getSettings();
@@ -83,7 +83,9 @@ public class InvertedContrastPreview extends WebViewPreview {
bs.useInvertedRendering() ? "true" : "false");
ws.setProperty(WebViewProperties.gfxInvertedScreenContrast,
Float.toString(bs.getInvertedContrast()));
- mWebView.loadData(mHtml, "text/html", null);
+ if (forceReload) {
+ mWebView.loadData(mHtml, "text/html", null);
+ }
}
}
diff --git a/src/com/android/browser/preferences/WebViewPreview.java b/src/com/android/browser/preferences/WebViewPreview.java
index a3c19a4..1f938f0 100644
--- a/src/com/android/browser/preferences/WebViewPreview.java
+++ b/src/com/android/browser/preferences/WebViewPreview.java
@@ -53,7 +53,7 @@ public abstract class WebViewPreview extends Preference
setLayoutResource(R.layout.webview_preview);
}
- protected abstract void updatePreview();
+ protected abstract void updatePreview(boolean forceReload);
protected void setupWebView(WebView view) {}
@@ -77,7 +77,7 @@ public abstract class WebViewPreview extends Preference
protected void onBindView(View view) {
super.onBindView(view);
mWebView = (WebView) view.findViewById(R.id.webview);
- updatePreview();
+ updatePreview(true);
}
@Override
@@ -95,7 +95,7 @@ public abstract class WebViewPreview extends Preference
@Override
public void onSharedPreferenceChanged(
SharedPreferences sharedPreferences, String key) {
- updatePreview();
+ updatePreview(false);
}
}