Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit f17d20a3 authored by Tony Huang's avatar Tony Huang
Browse files

Fix raname behavior

To follow FbG behavior, we should only clear selection after rename
finished.

Fix: 122083449
Test: manual
Test: atest DocumentsUIGoogleTests
Change-Id: I9d1effac1d9e7c5eb49f391789e3ccef48c4ddf6
parent 8dafe614
Loading
Loading
Loading
Loading
+0 −3
Original line number Diff line number Diff line
@@ -726,9 +726,6 @@ public class DirectoryFragment extends Fragment implements SwipeRefreshLayout.On

            case R.id.action_menu_rename:
            case R.id.dir_menu_rename:
                // Exit selection mode first, so we avoid deselecting deleted
                // (renamed) documents.
                mActionModeController.finishActionMode();
                renameDocuments(selection);
                return true;

+1 −0
Original line number Diff line number Diff line
@@ -230,6 +230,7 @@ public class RenameDocumentFragment extends DialogFragment {
            if (mDialog != null) {
                mDialog.dismiss();
            }
            mActivity.getInjector().selectionMgr.clearSelection();
            mActivity.reloadDocumentsIfNeeded();
        }
    }
+2 −0
Original line number Diff line number Diff line
@@ -132,6 +132,8 @@ public class RenameDocumentUiTest extends ActivityTest<FilesActivity> {
        bots.directory.assertDocumentsPresent(fileName1);
        bots.directory.assertDocumentsAbsent(newName);
        bots.directory.assertDocumentsCount(4);

        bots.directory.assertSelection(1);
    }

    public void testRenameDir() throws Exception {