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();
}
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");
}
}
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();
}
}
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");
}
}
}
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();
}
Aggregations