From d5cca395b2cb88078caa2bf4b82c0e5cfe9939e7 Mon Sep 17 00:00:00 2001 From: Jason Simmons Date: Thu, 13 Jul 2017 15:33:08 -0700 Subject: [PATCH] Invert the autocorrect flag (flutter/engine#3875) See https://github.com/flutter/engine/pull/3866 --- .../android/io/flutter/plugin/editing/TextInputPlugin.java | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/engine/src/flutter/shell/platform/android/io/flutter/plugin/editing/TextInputPlugin.java b/engine/src/flutter/shell/platform/android/io/flutter/plugin/editing/TextInputPlugin.java index 5d78c6787f..3eba406ec7 100644 --- a/engine/src/flutter/shell/platform/android/io/flutter/plugin/editing/TextInputPlugin.java +++ b/engine/src/flutter/shell/platform/android/io/flutter/plugin/editing/TextInputPlugin.java @@ -79,7 +79,7 @@ public class TextInputPlugin implements MethodCallHandler { private static int inputTypeFromTextInputType(String inputType, boolean obscureText, - boolean noAutoCorrect) { + boolean autocorrect) { if (inputType.equals("TextInputType.datetime")) return InputType.TYPE_CLASS_DATETIME; if (inputType.equals("TextInputType.number")) @@ -96,7 +96,7 @@ public class TextInputPlugin implements MethodCallHandler { // Note: both required. Some devices ignore TYPE_TEXT_FLAG_NO_SUGGESTIONS. textType |= InputType.TYPE_TEXT_FLAG_NO_SUGGESTIONS; textType |= InputType.TYPE_TEXT_VARIATION_PASSWORD; - } else if (!noAutoCorrect) { + } else if (autocorrect) { textType |= InputType.TYPE_TEXT_FLAG_AUTO_CORRECT; } return textType; @@ -110,7 +110,7 @@ public class TextInputPlugin implements MethodCallHandler { outAttrs.inputType = inputTypeFromTextInputType( mConfiguration.getString("inputType"), mConfiguration.optBoolean("obscureText"), - mConfiguration.optBoolean("noAutoCorrect")); + mConfiguration.optBoolean("autocorrect", true)); if (!mConfiguration.isNull("actionLabel")) outAttrs.actionLabel = mConfiguration.getString("actionLabel"); outAttrs.imeOptions = EditorInfo.IME_ACTION_DONE | EditorInfo.IME_FLAG_NO_FULLSCREEN;