Search in sources :

Example 1 with OperationsServiceBinder

use of com.owncloud.android.services.OperationsService.OperationsServiceBinder in project android by owncloud.

the class FileMenuFilter method anyFileSynchronizing.

private boolean anyFileSynchronizing() {
    boolean synchronizing = false;
    if (mComponentsGetter != null && !mFiles.isEmpty() && mAccount != null) {
        OperationsServiceBinder opsBinder = mComponentsGetter.getOperationsServiceBinder();
        FileUploaderBinder uploaderBinder = mComponentsGetter.getFileUploaderBinder();
        FileDownloaderBinder downloaderBinder = mComponentsGetter.getFileDownloaderBinder();
        synchronizing = (// comparing local and remote
        anyFileSynchronizing(opsBinder) || anyFileDownloading(downloaderBinder) || anyFileUploading(uploaderBinder));
    }
    return synchronizing;
}
Also used : OperationsServiceBinder(com.owncloud.android.services.OperationsService.OperationsServiceBinder) FileUploaderBinder(com.owncloud.android.files.services.FileUploader.FileUploaderBinder) FileDownloaderBinder(com.owncloud.android.files.services.FileDownloader.FileDownloaderBinder)

Example 2 with OperationsServiceBinder

use of com.owncloud.android.services.OperationsService.OperationsServiceBinder in project android by owncloud.

the class FileListListAdapter method setIconPinAccordingToFilesLocalState.

private void setIconPinAccordingToFilesLocalState(ImageView localStateView, OCFile file) {
    // local state
    localStateView.bringToFront();
    final FileDownloaderBinder downloaderBinder = mTransferServiceGetter.getFileDownloaderBinder();
    final FileUploaderBinder uploaderBinder = mTransferServiceGetter.getFileUploaderBinder();
    final OperationsServiceBinder opsBinder = mTransferServiceGetter.getOperationsServiceBinder();
    // default first
    localStateView.setVisibility(View.INVISIBLE);
    if (opsBinder != null && opsBinder.isSynchronizing(mAccount, file)) {
        // syncing
        localStateView.setImageResource(R.drawable.sync_pin);
        localStateView.setVisibility(View.VISIBLE);
    } else if (downloaderBinder != null && downloaderBinder.isDownloading(mAccount, file)) {
        // downloading
        localStateView.setImageResource(R.drawable.sync_pin);
        localStateView.setVisibility(View.VISIBLE);
    } else if (uploaderBinder != null && uploaderBinder.isUploading(mAccount, file)) {
        // uploading
        localStateView.setImageResource(R.drawable.sync_pin);
        localStateView.setVisibility(View.VISIBLE);
    } else if (file.getEtagInConflict() != null) {
        // conflict
        localStateView.setImageResource(R.drawable.error_pin);
        localStateView.setVisibility(View.VISIBLE);
    } else {
        if (file.isDown()) {
            localStateView.setVisibility(View.VISIBLE);
            localStateView.setImageResource(R.drawable.downloaded_pin);
        }
        if (file.isAvailableOffline()) {
            localStateView.setVisibility(View.VISIBLE);
            localStateView.setImageResource(R.drawable.offline_available_pin);
        }
    }
}
Also used : OperationsServiceBinder(com.owncloud.android.services.OperationsService.OperationsServiceBinder) FileDownloaderBinder(com.owncloud.android.files.services.FileDownloader.FileDownloaderBinder) FileUploaderBinder(com.owncloud.android.files.services.FileUploader.FileUploaderBinder)

Example 3 with OperationsServiceBinder

use of com.owncloud.android.services.OperationsService.OperationsServiceBinder in project android by nextcloud.

the class FileMenuFilter method anyFileSynchronizing.

private boolean anyFileSynchronizing() {
    boolean synchronizing = false;
    if (componentsGetter != null && !files.isEmpty() && user != null) {
        OperationsServiceBinder opsBinder = componentsGetter.getOperationsServiceBinder();
        FileUploaderBinder uploaderBinder = componentsGetter.getFileUploaderBinder();
        FileDownloaderBinder downloaderBinder = componentsGetter.getFileDownloaderBinder();
        synchronizing = // comparing local and remote
        anyFileSynchronizing(opsBinder) || anyFileDownloading(downloaderBinder) || anyFileUploading(uploaderBinder);
    }
    return synchronizing;
}
Also used : OperationsServiceBinder(com.owncloud.android.services.OperationsService.OperationsServiceBinder) FileUploaderBinder(com.owncloud.android.files.services.FileUploader.FileUploaderBinder) FileDownloaderBinder(com.owncloud.android.files.services.FileDownloader.FileDownloaderBinder)

Aggregations

FileDownloaderBinder (com.owncloud.android.files.services.FileDownloader.FileDownloaderBinder)3 FileUploaderBinder (com.owncloud.android.files.services.FileUploader.FileUploaderBinder)3 OperationsServiceBinder (com.owncloud.android.services.OperationsService.OperationsServiceBinder)3