summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJon Miranda <jonmiranda@google.com>2017-02-25 00:54:04 +0000
committerandroid-build-merger <android-build-merger@google.com>2017-02-25 00:54:04 +0000
commita68a719eb428342a821354ea2e6ef92e55405578 (patch)
tree3d55fe8d88aa11674d280d59da374146efdceba4
parentcffb862c93eb1ff9009fd2af8f75bcd181f8e546 (diff)
parent54d4e645b3c2b2c153e97f776e33685b292f8c2b (diff)
downloadandroid_packages_apps_Trebuchet-a68a719eb428342a821354ea2e6ef92e55405578.tar.gz
android_packages_apps_Trebuchet-a68a719eb428342a821354ea2e6ef92e55405578.tar.bz2
android_packages_apps_Trebuchet-a68a719eb428342a821354ea2e6ef92e55405578.zip
Enable suggestions for Folder names.
am: 54d4e645b3 Change-Id: I81b94e1437e47985e61da4245dc6c40c682796af
-rw-r--r--src/com/android/launcher3/ExtendedEditText.java14
-rw-r--r--src/com/android/launcher3/folder/Folder.java9
2 files changed, 19 insertions, 4 deletions
diff --git a/src/com/android/launcher3/ExtendedEditText.java b/src/com/android/launcher3/ExtendedEditText.java
index d05673ccc..596aa8f7b 100644
--- a/src/com/android/launcher3/ExtendedEditText.java
+++ b/src/com/android/launcher3/ExtendedEditText.java
@@ -29,6 +29,7 @@ import android.widget.EditText;
public class ExtendedEditText extends EditText {
private boolean mShowImeAfterFirstLayout;
+ private boolean mForceDisableSuggestions = false;
/**
* Implemented by listeners of the back key.
@@ -107,4 +108,17 @@ public class ExtendedEditText extends EditText {
mBackKeyListener.onBackKey();
}
}
+
+ /**
+ * Set to true when you want isSuggestionsEnabled to return false.
+ * Use this to disable the red underlines that appear under typos when suggestions is enabled.
+ */
+ public void forceDisableSuggestions(boolean forceDisableSuggestions) {
+ mForceDisableSuggestions = forceDisableSuggestions;
+ }
+
+ @Override
+ public boolean isSuggestionsEnabled() {
+ return !mForceDisableSuggestions && super.isSuggestionsEnabled();
+ }
}
diff --git a/src/com/android/launcher3/folder/Folder.java b/src/com/android/launcher3/folder/Folder.java
index 269559467..67b8e6d95 100644
--- a/src/com/android/launcher3/folder/Folder.java
+++ b/src/com/android/launcher3/folder/Folder.java
@@ -56,7 +56,6 @@ import com.android.launcher3.FolderInfo.FolderListener;
import com.android.launcher3.ItemInfo;
import com.android.launcher3.Launcher;
import com.android.launcher3.LauncherAnimUtils;
-import com.android.launcher3.LauncherModel;
import com.android.launcher3.LauncherSettings;
import com.android.launcher3.LogDecelerateInterpolator;
import com.android.launcher3.OnAlarmListener;
@@ -74,7 +73,6 @@ import com.android.launcher3.dragndrop.DragController.DragListener;
import com.android.launcher3.dragndrop.DragLayer;
import com.android.launcher3.dragndrop.DragOptions;
import com.android.launcher3.pageindicators.PageIndicatorDots;
-import com.android.launcher3.userevent.nano.LauncherLogProto;
import com.android.launcher3.userevent.nano.LauncherLogProto.ContainerType;
import com.android.launcher3.userevent.nano.LauncherLogProto.Target;
import com.android.launcher3.util.CircleRevealOutlineProvider;
@@ -249,8 +247,11 @@ public class Folder extends AbstractFloatingView implements DragSource, View.OnC
}
mFolderName.setOnEditorActionListener(this);
mFolderName.setSelectAllOnFocus(true);
- mFolderName.setInputType(mFolderName.getInputType() |
- InputType.TYPE_TEXT_FLAG_NO_SUGGESTIONS | InputType.TYPE_TEXT_FLAG_CAP_WORDS);
+ mFolderName.setInputType(mFolderName.getInputType()
+ & ~InputType.TYPE_TEXT_FLAG_AUTO_CORRECT
+ & ~InputType.TYPE_TEXT_FLAG_NO_SUGGESTIONS
+ | InputType.TYPE_TEXT_FLAG_CAP_WORDS);
+ mFolderName.forceDisableSuggestions(true);
mFooter = findViewById(R.id.folder_footer);