|
16 | 16 |
|
17 | 17 | package android.webkit; |
18 | 18 |
|
19 | | -import com.android.internal.widget.EditableInputConnection; |
20 | | - |
21 | 19 | import android.content.Context; |
22 | | -import android.graphics.Canvas; |
23 | 20 | import android.graphics.Color; |
24 | | -import android.graphics.ColorFilter; |
25 | 21 | import android.graphics.Paint; |
26 | | -import android.graphics.PixelFormat; |
27 | 22 | import android.graphics.Rect; |
28 | 23 | import android.graphics.drawable.ColorDrawable; |
29 | 24 | import android.os.Bundle; |
|
60 | 55 | import android.widget.AutoCompleteTextView; |
61 | 56 | import android.widget.TextView; |
62 | 57 |
|
| 58 | +import junit.framework.Assert; |
| 59 | + |
63 | 60 | import java.net.MalformedURLException; |
64 | 61 | import java.net.URL; |
65 | 62 | import java.util.ArrayList; |
66 | 63 |
|
67 | | -import junit.framework.Assert; |
68 | | - |
69 | 64 | /** |
70 | 65 | * WebTextView is a specialized version of EditText used by WebView |
71 | 66 | * to overlay html textfields (and textareas) to use our standard |
@@ -926,18 +921,23 @@ private void setMaxLength(int maxLength) { |
926 | 921 | */ |
927 | 922 | /* package */ void setRect(int x, int y, int width, int height) { |
928 | 923 | LayoutParams lp = (LayoutParams) getLayoutParams(); |
| 924 | + boolean needsUpdate = false; |
929 | 925 | if (null == lp) { |
930 | 926 | lp = new LayoutParams(width, height, x, y); |
931 | 927 | } else { |
932 | | - lp.x = x; |
933 | | - lp.y = y; |
934 | | - lp.width = width; |
935 | | - lp.height = height; |
| 928 | + if ((lp.x != x) || (lp.y != y) || (lp.width != width) |
| 929 | + || (lp.height != height)) { |
| 930 | + needsUpdate = true; |
| 931 | + lp.x = x; |
| 932 | + lp.y = y; |
| 933 | + lp.width = width; |
| 934 | + lp.height = height; |
| 935 | + } |
936 | 936 | } |
937 | 937 | if (getParent() == null) { |
938 | 938 | // Insert the view so that it's drawn first (at index 0) |
939 | 939 | mWebView.addView(this, 0, lp); |
940 | | - } else { |
| 940 | + } else if (needsUpdate) { |
941 | 941 | setLayoutParams(lp); |
942 | 942 | } |
943 | 943 | // Set up a measure spec so a layout can always be recreated. |
|
0 commit comments