Search in sources :

Example 1 with OCFileListFragment

use of com.owncloud.android.ui.fragment.OCFileListFragment in project android by owncloud.

the class UploadPathActivity method onAccountSet.

/**
     * Called when the ownCloud {@link Account} associated to the Activity was
     * just updated.
     */
@Override
protected void onAccountSet(boolean stateWasRecovered) {
    super.onAccountSet(stateWasRecovered);
    if (getAccount() != null) {
        updateFileFromDB();
        OCFile folder = getFile();
        if (folder == null || !folder.isFolder()) {
            // fall back to root folder
            setFile(getStorageManager().getFileByPath(OCFile.ROOT_PATH));
            folder = getFile();
        }
        onBrowsedDownTo(folder);
        if (!stateWasRecovered) {
            OCFileListFragment listOfFolders = getListOfFilesFragment();
            // TODO Enable when "On Device" is recovered ?
            listOfFolders.listDirectory(folder);
            startSyncFolderOperation(folder, false);
        }
        updateNavigationElementsInActionBar();
    }
}
Also used : OCFile(com.owncloud.android.datamodel.OCFile) OCFileListFragment(com.owncloud.android.ui.fragment.OCFileListFragment)

Example 2 with OCFileListFragment

use of com.owncloud.android.ui.fragment.OCFileListFragment in project android by owncloud.

the class FileDisplayActivity method getListOfFilesFragment.

private OCFileListFragment getListOfFilesFragment() {
    Fragment listOfFiles = getSupportFragmentManager().findFragmentByTag(FileDisplayActivity.TAG_LIST_OF_FILES);
    if (listOfFiles != null) {
        return (OCFileListFragment) listOfFiles;
    }
    Log_OC.e(TAG, "Access to unexisting list of files fragment!!");
    return null;
}
Also used : OCFileListFragment(com.owncloud.android.ui.fragment.OCFileListFragment) OCFileListFragment(com.owncloud.android.ui.fragment.OCFileListFragment) TaskRetainerFragment(com.owncloud.android.ui.fragment.TaskRetainerFragment) Fragment(android.support.v4.app.Fragment) PreviewAudioFragment(com.owncloud.android.ui.preview.PreviewAudioFragment) FileFragment(com.owncloud.android.ui.fragment.FileFragment) PreviewImageFragment(com.owncloud.android.ui.preview.PreviewImageFragment) PreviewVideoFragment(com.owncloud.android.ui.preview.PreviewVideoFragment) PreviewTextFragment(com.owncloud.android.ui.preview.PreviewTextFragment) FileDetailFragment(com.owncloud.android.ui.fragment.FileDetailFragment)

Example 3 with OCFileListFragment

use of com.owncloud.android.ui.fragment.OCFileListFragment in project android by owncloud.

the class FolderPickerActivity method browseToRoot.

public void browseToRoot() {
    OCFileListFragment listOfFiles = getListOfFilesFragment();
    if (listOfFiles != null) {
        // should never be null, indeed
        OCFile root = getStorageManager().getFileByPath(OCFile.ROOT_PATH);
        listOfFiles.listDirectory(root);
        // TODO Enable when "On Device" is recovered ?
        // listOfFiles.listDirectory(root, false);
        setFile(listOfFiles.getCurrentFile());
        updateNavigationElementsInActionBar();
        startSyncFolderOperation(root, false);
    }
}
Also used : OCFile(com.owncloud.android.datamodel.OCFile) OCFileListFragment(com.owncloud.android.ui.fragment.OCFileListFragment)

Example 4 with OCFileListFragment

use of com.owncloud.android.ui.fragment.OCFileListFragment in project android by owncloud.

the class FolderPickerActivity method getListOfFilesFragment.

protected OCFileListFragment getListOfFilesFragment() {
    Fragment listOfFiles = getSupportFragmentManager().findFragmentByTag(FolderPickerActivity.TAG_LIST_OF_FOLDERS);
    if (listOfFiles != null) {
        return (OCFileListFragment) listOfFiles;
    }
    Log_OC.e(TAG, "Access to unexisting list of files fragment!!");
    return null;
}
Also used : OCFileListFragment(com.owncloud.android.ui.fragment.OCFileListFragment) CreateFolderDialogFragment(com.owncloud.android.ui.dialog.CreateFolderDialogFragment) OCFileListFragment(com.owncloud.android.ui.fragment.OCFileListFragment) Fragment(android.support.v4.app.Fragment) FileFragment(com.owncloud.android.ui.fragment.FileFragment)

Example 5 with OCFileListFragment

use of com.owncloud.android.ui.fragment.OCFileListFragment in project android by owncloud.

the class FolderPickerActivity method onBackPressed.

@Override
public void onBackPressed() {
    OCFileListFragment listOfFiles = getListOfFilesFragment();
    if (listOfFiles != null) {
        // should never be null, indeed
        int levelsUp = listOfFiles.onBrowseUp();
        if (levelsUp == 0) {
            finish();
            return;
        }
        setFile(listOfFiles.getCurrentFile());
        updateNavigationElementsInActionBar();
    }
}
Also used : OCFileListFragment(com.owncloud.android.ui.fragment.OCFileListFragment)

Aggregations

OCFileListFragment (com.owncloud.android.ui.fragment.OCFileListFragment)14 OCFile (com.owncloud.android.datamodel.OCFile)6 Fragment (android.support.v4.app.Fragment)3 FileFragment (com.owncloud.android.ui.fragment.FileFragment)3 FragmentTransaction (android.support.v4.app.FragmentTransaction)2 FileDetailFragment (com.owncloud.android.ui.fragment.FileDetailFragment)2 TaskRetainerFragment (com.owncloud.android.ui.fragment.TaskRetainerFragment)2 PreviewAudioFragment (com.owncloud.android.ui.preview.PreviewAudioFragment)2 PreviewImageFragment (com.owncloud.android.ui.preview.PreviewImageFragment)2 PreviewTextFragment (com.owncloud.android.ui.preview.PreviewTextFragment)2 PreviewVideoFragment (com.owncloud.android.ui.preview.PreviewVideoFragment)2 SuppressLint (android.annotation.SuppressLint)1 RefreshFolderOperation (com.owncloud.android.operations.RefreshFolderOperation)1 SyncOperation (com.owncloud.android.operations.common.SyncOperation)1 CreateFolderDialogFragment (com.owncloud.android.ui.dialog.CreateFolderDialogFragment)1