diff --git a/res/layout/user_folder.xml b/res/layout/user_folder.xml index 7e25f356e6..06d79ef702 100644 --- a/res/layout/user_folder.xml +++ b/res/layout/user_folder.xml @@ -32,8 +32,8 @@ android:layout_height="wrap_content" android:cacheColorHint="#ff333333" android:hapticFeedbackEnabled="false" - launcher:widthGap="@dimen/workspace_width_gap" - launcher:heightGap="@dimen/workspace_height_gap" + launcher:widthGap="@dimen/folder_width_gap" + launcher:heightGap="@dimen/folder_height_gap" launcher:cellWidth="@dimen/workspace_cell_width" launcher:cellHeight="@dimen/workspace_cell_height" launcher:xAxisStartPadding="0dip" diff --git a/res/values/dimens.xml b/res/values/dimens.xml index 141df0615a..763ed19cef 100644 --- a/res/values/dimens.xml +++ b/res/values/dimens.xml @@ -97,4 +97,6 @@ 4dp 18dp 10dp + 0dp + 0dp diff --git a/src/com/android/launcher2/Folder.java b/src/com/android/launcher2/Folder.java index 960fa551c4..90d20900c6 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(""); + } } /**