зеркало из https://github.com/mozilla/pjs.git
Bug 617552: keep mEditable around and updating it selectively to fix a handful of input bugs, r=blassey, a=blocking-fennec=2.0b4 by dougt
This commit is contained in:
Родитель
4be9f319d2
Коммит
4e772fcca1
|
@ -488,7 +488,7 @@ public class GeckoInputConnection
|
|||
//Log.d("GeckoAppJava", "IME: notifyTextChange");
|
||||
|
||||
if (!text.contentEquals(GeckoApp.surfaceView.mEditable))
|
||||
GeckoApp.surfaceView.setupEditable(text);
|
||||
GeckoApp.surfaceView.setEditable(text);
|
||||
|
||||
if (mUpdateRequest == null)
|
||||
return;
|
||||
|
|
|
@ -87,7 +87,7 @@ class GeckoSurfaceView
|
|||
mSurfaceLock = new ReentrantLock();
|
||||
|
||||
mEditableFactory = Editable.Factory.getInstance();
|
||||
setupEditable("");
|
||||
initEditable("");
|
||||
mIMEState = IME_STATE_DISABLED;
|
||||
mIMETypeHint = "";
|
||||
mIMEActionHint = "";
|
||||
|
@ -375,7 +375,15 @@ class GeckoSurfaceView
|
|||
return inputConnection;
|
||||
}
|
||||
|
||||
public void setupEditable(String contents)
|
||||
public void setEditable(String contents)
|
||||
{
|
||||
mEditable.removeSpan(inputConnection);
|
||||
mEditable.replace(0, mEditable.length(), contents);
|
||||
mEditable.setSpan(inputConnection, 0, contents.length(), Spanned.SPAN_INCLUSIVE_INCLUSIVE);
|
||||
Selection.setSelection(mEditable, contents.length());
|
||||
}
|
||||
|
||||
public void initEditable(String contents)
|
||||
{
|
||||
mEditable = mEditableFactory.newEditable(contents);
|
||||
mEditable.setSpan(inputConnection, 0, contents.length(), Spanned.SPAN_INCLUSIVE_INCLUSIVE);
|
||||
|
|
Загрузка…
Ссылка в новой задаче