am 23c5861c: Merge "Scroll textfield onscreen when the IME shows." into honeycomb-mr1
* commit '23c5861cde7efef568fa3c61e0f1fa4fe97c7cfa': Scroll textfield onscreen when the IME shows.
This commit is contained in:
@@ -26,14 +26,15 @@ import android.graphics.Paint;
|
||||
import android.graphics.PixelFormat;
|
||||
import android.graphics.Rect;
|
||||
import android.graphics.drawable.Drawable;
|
||||
import android.os.Bundle;
|
||||
import android.os.Handler;
|
||||
import android.os.Message;
|
||||
import android.os.ResultReceiver;
|
||||
import android.text.BoringLayout.Metrics;
|
||||
import android.text.DynamicLayout;
|
||||
import android.text.Editable;
|
||||
import android.text.InputFilter;
|
||||
import android.text.Layout;
|
||||
import android.text.Layout.Alignment;
|
||||
import android.text.Selection;
|
||||
import android.text.Spannable;
|
||||
import android.text.TextPaint;
|
||||
@@ -136,6 +137,23 @@ import junit.framework.Assert;
|
||||
// Used to determine whether onFocusChanged was called as a result of
|
||||
// calling remove().
|
||||
private boolean mInsideRemove;
|
||||
private class MyResultReceiver extends ResultReceiver {
|
||||
@Override
|
||||
protected void onReceiveResult(int resultCode, Bundle resultData) {
|
||||
if (resultCode == InputMethodManager.RESULT_SHOWN
|
||||
&& mWebView != null) {
|
||||
mWebView.revealSelection();
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* @param handler
|
||||
*/
|
||||
public MyResultReceiver(Handler handler) {
|
||||
super(handler);
|
||||
}
|
||||
}
|
||||
private MyResultReceiver mReceiver;
|
||||
|
||||
// Types used with setType. Keep in sync with CachedInput.h
|
||||
private static final int NORMAL_TEXT_FIELD = 0;
|
||||
@@ -184,7 +202,7 @@ import junit.framework.Assert;
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
mReceiver = new MyResultReceiver(mHandler);
|
||||
}
|
||||
|
||||
public void setAutoFillable(int queryId) {
|
||||
@@ -362,6 +380,8 @@ import junit.framework.Assert;
|
||||
}
|
||||
}
|
||||
|
||||
/* package */ ResultReceiver getResultReceiver() { return mReceiver; }
|
||||
|
||||
/**
|
||||
* Determine whether this WebTextView currently represents the node
|
||||
* represented by ptr.
|
||||
|
||||
@@ -4270,7 +4270,7 @@ public class WebView extends AbsoluteLayout
|
||||
if (isTextView) {
|
||||
rebuildWebTextView();
|
||||
if (inEditingMode()) {
|
||||
imm.showSoftInput(mWebTextView, 0);
|
||||
imm.showSoftInput(mWebTextView, 0, mWebTextView.getResultReceiver());
|
||||
if (zoom) {
|
||||
didUpdateWebTextViewDimensions(INTERSECTS_SCREEN);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user