diff options
author | Adam Cohen <adamcohen@google.com> | 2011-09-28 20:45:37 -0700 |
---|---|---|
committer | Adam Cohen <adamcohen@google.com> | 2011-09-29 11:53:57 -0700 |
commit | ac56cff1860b71d3f164aedd268703936e08fdc0 (patch) | |
tree | f92d07dce2afd7f2e2743e58935eac12c24bb04b /src/com/android/launcher2/FolderEditText.java | |
parent | ae0432fec3d9d614e8cdbf3d1b4187fdd7411f87 (diff) | |
download | android_packages_apps_Trebuchet-ac56cff1860b71d3f164aedd268703936e08fdc0.tar.gz android_packages_apps_Trebuchet-ac56cff1860b71d3f164aedd268703936e08fdc0.tar.bz2 android_packages_apps_Trebuchet-ac56cff1860b71d3f164aedd268703936e08fdc0.zip |
Adding keyboard support to folders and fixing renaming rough edges
Change-Id: I62e1a5699e4c7e8d53f5f7d6331a854270a83aa1
Diffstat (limited to 'src/com/android/launcher2/FolderEditText.java')
-rw-r--r-- | src/com/android/launcher2/FolderEditText.java | 36 |
1 files changed, 36 insertions, 0 deletions
diff --git a/src/com/android/launcher2/FolderEditText.java b/src/com/android/launcher2/FolderEditText.java new file mode 100644 index 000000000..13169bd51 --- /dev/null +++ b/src/com/android/launcher2/FolderEditText.java @@ -0,0 +1,36 @@ +package com.android.launcher2; + +import android.content.Context; +import android.util.AttributeSet; +import android.view.KeyEvent; +import android.widget.EditText; + +public class FolderEditText extends EditText { + + private Folder mFolder; + + public FolderEditText(Context context) { + super(context); + } + + public FolderEditText(Context context, AttributeSet attrs) { + super(context, attrs); + } + + public FolderEditText(Context context, AttributeSet attrs, int defStyle) { + super(context, attrs, defStyle); + } + + public void setFolder(Folder folder) { + mFolder = folder; + } + + @Override + public boolean onKeyPreIme(int keyCode, KeyEvent event) { + // Catch the back button on the soft keyboard so that we can just close the activity + if (event.getKeyCode() == android.view.KeyEvent.KEYCODE_BACK) { + mFolder.doneEditingFolderName(true); + } + return super.onKeyPreIme(keyCode, event); + } +} |