diff options
Diffstat (limited to 'src/com/android/launcher2/Folder.java')
-rw-r--r-- | src/com/android/launcher2/Folder.java | 15 |
1 files changed, 13 insertions, 2 deletions
diff --git a/src/com/android/launcher2/Folder.java b/src/com/android/launcher2/Folder.java index 960fa551c..90d20900c 100644 --- a/src/com/android/launcher2/Folder.java +++ b/src/com/android/launcher2/Folder.java @@ -99,6 +99,8 @@ public class Folder extends LinearLayout implements DragSource, OnItemLongClickL private Alarm mOnExitAlarm = new Alarm(); private TextView mFolderName; private int mFolderNameHeight; + private static String sDefaultFolderName; + private Rect mHitRect = new Rect(); private boolean mIsEditingName = false; private InputMethodManager mInputMethodManager; @@ -122,6 +124,10 @@ public class Folder extends LinearLayout implements DragSource, OnItemLongClickL Resources res = getResources(); mExpandDuration = res.getInteger(R.integer.config_folderAnimDuration); + + if (sDefaultFolderName == null) { + sDefaultFolderName = res.getString(R.string.folder_name); + } } @Override @@ -142,6 +148,7 @@ public class Folder extends LinearLayout implements DragSource, OnItemLongClickL mFolderName.setCustomSelectionActionModeCallback(mActionModeCallback); mFolderName.setCursorVisible(false); mFolderName.setOnEditorActionListener(this); + mFolderName.setSelectAllOnFocus(true); } private ActionMode.Callback mActionModeCallback = new ActionMode.Callback() { @@ -183,7 +190,6 @@ public class Folder extends LinearLayout implements DragSource, OnItemLongClickL } } - private Rect mHitRect = new Rect(); public boolean onInterceptTouchEvent(MotionEvent ev) { if (ev.getAction() == MotionEvent.ACTION_DOWN) { mFolderName.getHitRect(mHitRect); @@ -322,7 +328,12 @@ public class Folder extends LinearLayout implements DragSource, OnItemLongClickL } mItemsInvalidated = true; mInfo.addListener(this); - mFolderName.setText(mInfo.title); + + if (sDefaultFolderName != mInfo.title) { + mFolderName.setText(mInfo.title); + } else { + mFolderName.setText(""); + } } /** |