summaryrefslogtreecommitdiffstats
path: root/src/com/android/launcher2/Folder.java
diff options
context:
space:
mode:
authorAdam Cohen <adamcohen@google.com>2011-09-30 20:06:58 -0700
committerAdam Cohen <adamcohen@google.com>2011-09-30 20:06:58 -0700
commitea0818d475df26d498ce08105bc2bc5582fce5a9 (patch)
tree30f5abcc25d898cc3a096af48b4f6226af6e19b4 /src/com/android/launcher2/Folder.java
parent82ebbd2a2f9ae5cb0a9d47f2f3a4293e4d0292d7 (diff)
downloadandroid_packages_apps_Trebuchet-ea0818d475df26d498ce08105bc2bc5582fce5a9.tar.gz
android_packages_apps_Trebuchet-ea0818d475df26d498ce08105bc2bc5582fce5a9.tar.bz2
android_packages_apps_Trebuchet-ea0818d475df26d498ce08105bc2bc5582fce5a9.zip
Small fix in Folder text editing
Change-Id: I65c6862cbbc125b197bb6afa4951b267373832e9
Diffstat (limited to 'src/com/android/launcher2/Folder.java')
-rw-r--r--src/com/android/launcher2/Folder.java20
1 files changed, 9 insertions, 11 deletions
diff --git a/src/com/android/launcher2/Folder.java b/src/com/android/launcher2/Folder.java
index 1b863de14..8a198f875 100644
--- a/src/com/android/launcher2/Folder.java
+++ b/src/com/android/launcher2/Folder.java
@@ -53,7 +53,8 @@ import java.util.ArrayList;
* Represents a set of icons chosen by the user or generated by the system.
*/
public class Folder extends LinearLayout implements DragSource, View.OnClickListener,
- View.OnLongClickListener, DropTarget, FolderListener, TextView.OnEditorActionListener {
+ View.OnLongClickListener, DropTarget, FolderListener, TextView.OnEditorActionListener,
+ View.OnFocusChangeListener {
private static final String TAG = "Launcher.Folder";
@@ -148,6 +149,7 @@ public class Folder extends LinearLayout implements DragSource, View.OnClickList
mContent.setGridSize(0, 0);
mFolderName = (FolderEditText) findViewById(R.id.folder_name);
mFolderName.setFolder(this);
+ mFolderName.setOnFocusChangeListener(this);
// We find out how tall the text view wants to be (it is set to wrap_content), so that
// we can allocate the appropriate amount of space for it.
@@ -193,16 +195,6 @@ public class Folder extends LinearLayout implements DragSource, View.OnClickList
}
}
- public boolean onInterceptTouchEvent(MotionEvent ev) {
- if (ev.getAction() == MotionEvent.ACTION_DOWN) {
- mFolderName.getHitRect(mHitRect);
- if (mHitRect.contains((int) ev.getX(), (int) ev.getY()) && !mIsEditingName) {
- startEditingFolderName();
- }
- }
- return false;
- }
-
public boolean onLongClick(View v) {
Object tag = v.getTag();
if (tag instanceof ShortcutInfo) {
@@ -1024,4 +1016,10 @@ public class Folder extends LinearLayout implements DragSource, View.OnClickList
public void getLocationInDragLayer(int[] loc) {
mLauncher.getDragLayer().getLocationInDragLayer(this, loc);
}
+
+ public void onFocusChange(View v, boolean hasFocus) {
+ if (v == mFolderName && hasFocus) {
+ startEditingFolderName();
+ }
+ }
}