Search in sources :

Example 1 with FileBrowserFragment

use of com.orgzly.android.ui.fragments.browser.FileBrowserFragment in project orgzly-android by orgzly.

the class ReposActivity method onSimpleOneLinerDialogValue.

@Override
public void onSimpleOneLinerDialogValue(int id, String value, Bundle bundle) {
    String currentDir = bundle.getString(DIALOG_CREATE_DIRECTORY_ARG_DIRECTORY);
    File file = new File(currentDir, value);
    if (file.mkdir()) {
        Fragment f = getSupportFragmentManager().findFragmentByTag(FileBrowserFragment.FRAGMENT_TAG);
        if (f != null) {
            FileBrowserFragment fragment = (FileBrowserFragment) f;
            fragment.refresh();
        }
    } else {
        String message = getResources().getString(R.string.failed_creating_directory, file.toString());
        showSimpleSnackbarLong(message);
    }
}
Also used : FileBrowserFragment(com.orgzly.android.ui.fragments.browser.FileBrowserFragment) File(java.io.File) DropboxRepoFragment(com.orgzly.android.ui.fragments.DropboxRepoFragment) ReposFragment(com.orgzly.android.ui.fragments.ReposFragment) FileBrowserFragment(com.orgzly.android.ui.fragments.browser.FileBrowserFragment) Fragment(android.support.v4.app.Fragment) DirectoryRepoFragment(com.orgzly.android.ui.fragments.DirectoryRepoFragment)

Aggregations

Fragment (android.support.v4.app.Fragment)1 DirectoryRepoFragment (com.orgzly.android.ui.fragments.DirectoryRepoFragment)1 DropboxRepoFragment (com.orgzly.android.ui.fragments.DropboxRepoFragment)1 ReposFragment (com.orgzly.android.ui.fragments.ReposFragment)1 FileBrowserFragment (com.orgzly.android.ui.fragments.browser.FileBrowserFragment)1 File (java.io.File)1