Search in sources :

Example 6 with OCFileListFragment

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

the class FolderPickerActivity method startSyncFolderOperation.

public void startSyncFolderOperation(OCFile folder, boolean ignoreETag) {
    mSyncInProgress = true;
    // perform folder synchronization
    SyncOperation synchFolderOp = new RefreshFolderOperation(folder, getFileOperationsHelper().isSharedSupported(), ignoreETag, getAccount(), getApplicationContext());
    synchFolderOp.execute(getStorageManager(), this, null, null);
    OCFileListFragment fileListFragment = getListOfFilesFragment();
    if (fileListFragment != null) {
        fileListFragment.setProgressBarAsIndeterminate(true);
    }
    setBackgroundText();
}
Also used : SyncOperation(com.owncloud.android.operations.common.SyncOperation) RefreshFolderOperation(com.owncloud.android.operations.RefreshFolderOperation) OCFileListFragment(com.owncloud.android.ui.fragment.OCFileListFragment)

Example 7 with OCFileListFragment

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

the class FileDisplayActivity method setBackgroundText.

/**
     * Show a text message on screen view for notifying user if content is
     * loading or folder is empty
     */
private void setBackgroundText() {
    OCFileListFragment ocFileListFragment = getListOfFilesFragment();
    if (ocFileListFragment != null) {
        int message = R.string.file_list_loading;
        if (!mSyncInProgress) {
            // In case file list is empty
            message = R.string.file_list_empty;
        }
        ocFileListFragment.setMessageForEmptyList(getString(message));
    } else {
        Log_OC.e(TAG, "OCFileListFragment is null");
    }
}
Also used : OCFileListFragment(com.owncloud.android.ui.fragment.OCFileListFragment) SuppressLint(android.annotation.SuppressLint)

Example 8 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 9 with OCFileListFragment

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

the class FileDisplayActivity method initFragmentsWithFile.

private void initFragmentsWithFile() {
    if (getAccount() != null && getFile() != null) {
        /// First fragment
        OCFileListFragment listOfFiles = getListOfFilesFragment();
        if (listOfFiles != null) {
            listOfFiles.listDirectory(getCurrentDir());
        // TODO Enable when "On Device" is recovered
        // listOfFiles.listDirectory(getCurrentDir(), MainApp.getOnlyOnDevice());
        } else {
            Log_OC.e(TAG, "Still have a chance to lose the initializacion of list fragment >(");
        }
        /// Second fragment
        OCFile file = getFile();
        Fragment secondFragment = chooseInitialSecondFragment(file);
        if (secondFragment != null) {
            setSecondFragment(secondFragment);
            updateFragmentsVisibility(true);
            updateActionBarTitleAndHomeButton(file);
        } else {
            cleanSecondFragment();
        }
    } else {
        Log_OC.e(TAG, "initFragments() called with invalid NULLs!");
        if (getAccount() == null) {
            Log_OC.e(TAG, "\t account is NULL");
        }
        if (getFile() == null) {
            Log_OC.e(TAG, "\t file is NULL");
        }
    }
}
Also used : OCFile(com.owncloud.android.datamodel.OCFile) 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 10 with OCFileListFragment

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

the class FileDisplayActivity method createMinFragments.

private void createMinFragments() {
    OCFileListFragment listOfFiles = OCFileListFragment.newInstance(false, false, true);
    FragmentTransaction transaction = getSupportFragmentManager().beginTransaction();
    transaction.add(R.id.left_fragment_container, listOfFiles, TAG_LIST_OF_FILES);
    transaction.commit();
}
Also used : FragmentTransaction(android.support.v4.app.FragmentTransaction) 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