Search in sources :

Example 1 with UploadListFragment

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

the class UploadListActivity method createUploadListFragment.

private void createUploadListFragment() {
    UploadListFragment uploadList = new UploadListFragment();
    FragmentTransaction transaction = getSupportFragmentManager().beginTransaction();
    transaction.add(R.id.upload_list_fragment, uploadList, TAG_UPLOAD_LIST_FRAGMENT);
    transaction.commit();
}
Also used : UploadListFragment(com.owncloud.android.ui.fragment.UploadListFragment) FragmentTransaction(android.support.v4.app.FragmentTransaction)

Example 2 with UploadListFragment

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

the class UploadListActivity method onOptionsItemSelected.

@Override
public boolean onOptionsItemSelected(MenuItem item) {
    boolean retval = true;
    UploadsStorageManager storageManager = null;
    UploadListFragment uploadListFragment = (UploadListFragment) getSupportFragmentManager().findFragmentByTag(TAG_UPLOAD_LIST_FRAGMENT);
    switch(item.getItemId()) {
        case android.R.id.home:
            if (isDrawerOpen()) {
                closeDrawer();
            } else {
                openDrawer();
            }
        case R.id.action_retry_uploads:
            FileUploader.UploadRequester requester = new FileUploader.UploadRequester();
            requester.retryFailedUploads(this, null, null);
            break;
        case R.id.action_clear_failed_uploads:
            storageManager = new UploadsStorageManager(getContentResolver());
            storageManager.clearFailedButNotDelayedForWifiUploads();
            uploadListFragment.updateUploads();
            break;
        case R.id.action_clear_successfull_uploads:
            storageManager = new UploadsStorageManager(getContentResolver());
            storageManager.clearSuccessfulUploads();
            uploadListFragment.updateUploads();
            break;
        case R.id.action_clear_finished_uploads:
            storageManager = new UploadsStorageManager(getContentResolver());
            storageManager.clearAllFinishedButNotDelayedForWifiUploads();
            uploadListFragment.updateUploads();
            break;
        default:
            retval = super.onOptionsItemSelected(item);
    }
    return retval;
}
Also used : UploadListFragment(com.owncloud.android.ui.fragment.UploadListFragment) FileUploader(com.owncloud.android.files.services.FileUploader) UploadsStorageManager(com.owncloud.android.datamodel.UploadsStorageManager)

Aggregations

UploadListFragment (com.owncloud.android.ui.fragment.UploadListFragment)2 FragmentTransaction (android.support.v4.app.FragmentTransaction)1 UploadsStorageManager (com.owncloud.android.datamodel.UploadsStorageManager)1 FileUploader (com.owncloud.android.files.services.FileUploader)1