Merge "Add logic for selecting filename in RenameDocumentFragment - different selection for directory. Prevent test from creating directories in Documents folder." into nyc-dev
This commit is contained in:
@@ -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);
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -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");
|
||||
|
||||
Reference in New Issue
Block a user