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

Commit 568b3b36 authored by Aga Wronska's avatar Aga Wronska
Browse files

Add logic for selecting filename in RenameDocumentFragment - different selection for directory.

Prevent test from creating directories in Documents folder.

Change-Id: Ib656f8d69cba27b201b5fe67bcb11fa1dec04953
parent 71138720
Loading
Loading
Loading
Loading
+2 −1
Original line number Diff line number Diff line
@@ -163,7 +163,8 @@ public class RenameDocumentFragment extends DialogFragment {
    private void selectFileName(EditText editText) {
        String text = editText.getText().toString();
        int separatorIndex = text.indexOf(".");
        editText.setSelection(0, separatorIndex == -1 ? text.length() : separatorIndex);
        editText.setSelection(0,
                (separatorIndex == -1 || mDocument.isDirectory()) ? text.length() : separatorIndex);
    }

    /**
+2 −0
Original line number Diff line number Diff line
@@ -92,6 +92,8 @@ public class FilesActivityUiTest extends ActivityTest<FilesActivity> {
    public void testCreateDirectory() throws Exception {
        initTestFiles();

        bots.roots.openRoot(ROOT_0_ID);

        bots.main.openOverflowMenu();
        bots.main.menuNewFolder().click();
        bots.main.setDialogText("Kung Fu Panda");