summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--core/java/android/webkit/WebTextView.java24
1 files changed, 12 insertions, 12 deletions
diff --git a/core/java/android/webkit/WebTextView.java b/core/java/android/webkit/WebTextView.java
index 5ee1b8a..8aafc3d 100644
--- a/core/java/android/webkit/WebTextView.java
+++ b/core/java/android/webkit/WebTextView.java
@@ -16,14 +16,9 @@
package android.webkit;
-import com.android.internal.widget.EditableInputConnection;
-
import android.content.Context;
-import android.graphics.Canvas;
import android.graphics.Color;
-import android.graphics.ColorFilter;
import android.graphics.Paint;
-import android.graphics.PixelFormat;
import android.graphics.Rect;
import android.graphics.drawable.ColorDrawable;
import android.os.Bundle;
@@ -60,12 +55,12 @@ import android.widget.ArrayAdapter;
import android.widget.AutoCompleteTextView;
import android.widget.TextView;
+import junit.framework.Assert;
+
import java.net.MalformedURLException;
import java.net.URL;
import java.util.ArrayList;
-import junit.framework.Assert;
-
/**
* WebTextView is a specialized version of EditText used by WebView
* to overlay html textfields (and textareas) to use our standard
@@ -926,18 +921,23 @@ import junit.framework.Assert;
*/
/* package */ void setRect(int x, int y, int width, int height) {
LayoutParams lp = (LayoutParams) getLayoutParams();
+ boolean needsUpdate = false;
if (null == lp) {
lp = new LayoutParams(width, height, x, y);
} else {
- lp.x = x;
- lp.y = y;
- lp.width = width;
- lp.height = height;
+ if ((lp.x != x) || (lp.y != y) || (lp.width != width)
+ || (lp.height != height)) {
+ needsUpdate = true;
+ lp.x = x;
+ lp.y = y;
+ lp.width = width;
+ lp.height = height;
+ }
}
if (getParent() == null) {
// Insert the view so that it's drawn first (at index 0)
mWebView.addView(this, 0, lp);
- } else {
+ } else if (needsUpdate) {
setLayoutParams(lp);
}
// Set up a measure spec so a layout can always be recreated.