aboutsummaryrefslogtreecommitdiffstats
path: root/java/src/com/android/inputmethod/latin/LatinIME.java
diff options
context:
space:
mode:
Diffstat (limited to 'java/src/com/android/inputmethod/latin/LatinIME.java')
-rw-r--r--java/src/com/android/inputmethod/latin/LatinIME.java29
1 files changed, 20 insertions, 9 deletions
diff --git a/java/src/com/android/inputmethod/latin/LatinIME.java b/java/src/com/android/inputmethod/latin/LatinIME.java
index 0594c68cc..84558ca24 100644
--- a/java/src/com/android/inputmethod/latin/LatinIME.java
+++ b/java/src/com/android/inputmethod/latin/LatinIME.java
@@ -367,6 +367,12 @@ public class LatinIME extends InputMethodService implements KeyboardActionListen
if (latinIme != null) {
executePendingImsCallback(latinIme, editorInfo, restarting);
latinIme.onStartInputInternal(editorInfo, restarting);
+ if (ProductionFlag.USES_CURSOR_ANCHOR_MONITOR) {
+ // Currently we need to call this every time when the IME is attached to
+ // new application.
+ // TODO: Consider if we can do this automatically in the framework.
+ InputMethodServiceCompatUtils.setCursorAnchorMonitorMode(latinIme, 1);
+ }
}
}
}
@@ -651,9 +657,6 @@ public class LatinIME extends InputMethodService implements KeyboardActionListen
mInputLogic.commitTyped(mSettings.getCurrent(), LastComposedWord.NOT_A_SEPARATOR);
mInputLogic.mConnection.finishComposingText();
mInputLogic.mConnection.endBatchEdit();
- if (isShowingOptionDialog()) {
- mOptionsDialog.dismiss();
- }
}
PersonalizationDictionarySessionRegistrar.onConfigurationChanged(this, conf,
mInputLogic.mSuggest.mDictionaryFacilitator);
@@ -931,6 +934,14 @@ public class LatinIME extends InputMethodService implements KeyboardActionListen
mSubtypeState.currentSubtypeUsed();
}
+ @Override
+ public void onUpdateCursor(Rect rect) {
+ if (DEBUG) {
+ Log.i(TAG, "onUpdateCursor:" + rect.toShortString());
+ }
+ super.onUpdateCursor(rect);
+ }
+
/**
* This is called when the user has clicked on the extracted text view,
* when running in fullscreen mode. The default implementation hides
@@ -976,7 +987,7 @@ public class LatinIME extends InputMethodService implements KeyboardActionListen
}
if (TRACE) Debug.stopMethodTracing();
- if (mOptionsDialog != null && mOptionsDialog.isShowing()) {
+ if (isShowingOptionDialog()) {
mOptionsDialog.dismiss();
mOptionsDialog = null;
}
@@ -1172,7 +1183,7 @@ public class LatinIME extends InputMethodService implements KeyboardActionListen
// Implement {@link ImportantNoticeDialog.ImportantNoticeDialogListener}
@Override
- public void onDismissImportantNoticeDialog(final int nextVersion) {
+ public void onUserAcknowledgmentOfImportantNoticeDialog(final int nextVersion) {
setNeutralSuggestionStrip();
}
@@ -1680,7 +1691,10 @@ public class LatinIME extends InputMethodService implements KeyboardActionListen
final AlertDialog.Builder builder = new AlertDialog.Builder(
DialogUtils.getPlatformDialogThemeContext(this));
builder.setItems(items, listener).setTitle(title);
- showOptionDialog(builder.create());
+ final AlertDialog dialog = builder.create();
+ dialog.setCancelable(true /* cancelable */);
+ dialog.setCanceledOnTouchOutside(true /* cancelable */);
+ showOptionDialog(dialog);
}
// TODO: Move this method out of {@link LatinIME}.
@@ -1690,9 +1704,6 @@ public class LatinIME extends InputMethodService implements KeyboardActionListen
return;
}
- dialog.setCancelable(true /* cancelable */);
- dialog.setCanceledOnTouchOutside(true /* cancelable */);
-
final Window window = dialog.getWindow();
final WindowManager.LayoutParams lp = window.getAttributes();
lp.token = windowToken;