diff options
Diffstat (limited to 'src/com/android/launcher3/Folder.java')
-rw-r--r-- | src/com/android/launcher3/Folder.java | 21 |
1 files changed, 14 insertions, 7 deletions
diff --git a/src/com/android/launcher3/Folder.java b/src/com/android/launcher3/Folder.java index 2e19f6eba..c1aa35669 100644 --- a/src/com/android/launcher3/Folder.java +++ b/src/com/android/launcher3/Folder.java @@ -124,7 +124,7 @@ public class Folder extends LinearLayout implements DragSource, View.OnClickList @Thunk FolderPagedView mContent; @Thunk View mContentWrapper; - FolderEditText mFolderName; + ExtendedEditText mFolderName; private View mFooter; private int mFooterHeight; @@ -196,8 +196,15 @@ public class Folder extends LinearLayout implements DragSource, View.OnClickList mContent = (FolderPagedView) findViewById(R.id.folder_content); mContent.setFolder(this); - mFolderName = (FolderEditText) findViewById(R.id.folder_name); - mFolderName.setFolder(this); + mFolderName = (ExtendedEditText) findViewById(R.id.folder_name); + mFolderName.setOnBackKeyListener(new ExtendedEditText.OnBackKeyListener() { + @Override + public boolean onBackKey() { + // Close the activity on back key press + doneEditingFolderName(true); + return false; + } + }); mFolderName.setOnFocusChangeListener(this); // We disable action mode for now since it messes up the view on phones @@ -275,7 +282,7 @@ public class Folder extends LinearLayout implements DragSource, View.OnClickList @Override public void enableAccessibleDrag(boolean enable) { - mLauncher.getSearchBar().enableAccessibleDrag(enable); + mLauncher.getSearchDropTargetBar().enableAccessibleDrag(enable); for (int i = 0; i < mContent.getChildCount(); i++) { mContent.getPageAt(i).enableAccessibleDrag(enable, CellLayout.FOLDER_ACCESSIBILITY_DRAG); } @@ -446,7 +453,7 @@ public class Folder extends LinearLayout implements DragSource, View.OnClickList Animator openFolderAnim = null; final Runnable onCompleteRunnable; - if (!Utilities.isLmpOrAbove()) { + if (!Utilities.ATLEAST_LOLLIPOP) { positionAndSizeAsIcon(); centerAboutIcon(); @@ -561,7 +568,7 @@ public class Folder extends LinearLayout implements DragSource, View.OnClickList public void onAnimationEnd(Animator animation) { mFolderName.animate().setDuration(FOLDER_NAME_ANIMATION_DURATION) .translationX(0) - .setInterpolator(Utilities.isLmpOrAbove() ? + .setInterpolator(Utilities.ATLEAST_LOLLIPOP ? AnimationUtils.loadInterpolator(mLauncher, android.R.interpolator.fast_out_slow_in) : new LogDecelerateInterpolator(100, 0)); @@ -1389,7 +1396,7 @@ public class Folder extends LinearLayout implements DragSource, View.OnClickList } // Compares item position based on rank and position giving priority to the rank. - private static final Comparator<ItemInfo> ITEM_POS_COMPARATOR = new Comparator<ItemInfo>() { + public static final Comparator<ItemInfo> ITEM_POS_COMPARATOR = new Comparator<ItemInfo>() { @Override public int compare(ItemInfo lhs, ItemInfo rhs) { |