summaryrefslogtreecommitdiffstats
path: root/core/java
diff options
context:
space:
mode:
authorLeon Scroggins <scroggo@google.com>2009-12-10 07:04:57 -0800
committerAndroid Git Automerger <android-git-automerger@android.com>2009-12-10 07:04:57 -0800
commit5b214e0f9670af7dad5dc40189778f9f4e6d41a8 (patch)
tree79c5dd2b5b4b7c12deda1afaa3adc405f6fb0576 /core/java
parent8ea486788fe5e77111ab9d6e1834cc6e6a3edc76 (diff)
parent9f1ea0d47f5aa18cf949593e6bfd36af9c6a55be (diff)
downloadframeworks_base-5b214e0f9670af7dad5dc40189778f9f4e6d41a8.zip
frameworks_base-5b214e0f9670af7dad5dc40189778f9f4e6d41a8.tar.gz
frameworks_base-5b214e0f9670af7dad5dc40189778f9f4e6d41a8.tar.bz2
am 9f1ea0d4: am 6be3bf23: Some fixes for positioning the WebTextView.
Merge commit '9f1ea0d47f5aa18cf949593e6bfd36af9c6a55be' * commit '9f1ea0d47f5aa18cf949593e6bfd36af9c6a55be': Some fixes for positioning the WebTextView.
Diffstat (limited to 'core/java')
-rw-r--r--core/java/android/webkit/WebTextView.java1
-rw-r--r--core/java/android/webkit/WebView.java17
2 files changed, 4 insertions, 14 deletions
diff --git a/core/java/android/webkit/WebTextView.java b/core/java/android/webkit/WebTextView.java
index 924398e..608c8a2 100644
--- a/core/java/android/webkit/WebTextView.java
+++ b/core/java/android/webkit/WebTextView.java
@@ -789,7 +789,6 @@ import java.util.ArrayList;
// Set up a measure spec so a layout can always be recreated.
mWidthSpec = MeasureSpec.makeMeasureSpec(width, MeasureSpec.EXACTLY);
mHeightSpec = MeasureSpec.makeMeasureSpec(height, MeasureSpec.EXACTLY);
- requestFocus();
}
/**
diff --git a/core/java/android/webkit/WebView.java b/core/java/android/webkit/WebView.java
index 3be6a3f..7c79fd9 100644
--- a/core/java/android/webkit/WebView.java
+++ b/core/java/android/webkit/WebView.java
@@ -3205,6 +3205,8 @@ public class WebView extends AbsoluteLayout
// Note that sendOurVisibleRect calls viewToContent, so the coordinates
// should be in content coordinates.
Rect bounds = nativeFocusCandidateNodeBounds();
+ Rect vBox = contentToViewRect(bounds);
+ mWebTextView.setRect(vBox.left, vBox.top, vBox.width(), vBox.height());
if (!Rect.intersects(bounds, visibleRect)) {
mWebTextView.bringIntoView();
}
@@ -3215,25 +3217,14 @@ public class WebView extends AbsoluteLayout
// i.e. In the case of opening/closing the screen.
// In that case, we need to set the dimensions, but not the other
// aspects.
- // We also need to restore the selection, which gets wrecked by
- // calling setTextEntryRect.
- Spannable spannable = (Spannable) mWebTextView.getText();
- int start = Selection.getSelectionStart(spannable);
- int end = Selection.getSelectionEnd(spannable);
// If the text has been changed by webkit, update it. However, if
// there has been more UI text input, ignore it. We will receive
// another update when that text is recognized.
- if (text != null && !text.equals(spannable.toString())
+ if (text != null && !text.equals(mWebTextView.getText().toString())
&& nativeTextGeneration() == mTextGeneration) {
mWebTextView.setTextAndKeepSelection(text);
- } else {
- // FIXME: Determine whether this is necessary.
- Selection.setSelection(spannable, start, end);
}
} else {
- Rect vBox = contentToViewRect(bounds);
- mWebTextView.setRect(vBox.left, vBox.top, vBox.width(),
- vBox.height());
mWebTextView.setGravity(nativeFocusCandidateIsRtlText() ?
Gravity.RIGHT : Gravity.NO_GRAVITY);
// This needs to be called before setType, which may call
@@ -3247,8 +3238,8 @@ public class WebView extends AbsoluteLayout
text = "";
}
mWebTextView.setTextAndKeepSelection(text);
- mWebTextView.requestFocus();
}
+ mWebTextView.requestFocus();
}
/**