mirror of
https://github.com/nextcloud/android.git
synced 2024-11-27 09:39:25 +03:00
Fix local state if fragment is initialized before services
Signed-off-by: Unpublished <unpublished@gmx.net>
This commit is contained in:
parent
53a4844ab2
commit
bdbeb5bc27
1 changed files with 7 additions and 8 deletions
|
@ -101,9 +101,7 @@ public class OCFileListAdapter extends RecyclerView.Adapter<RecyclerView.ViewHol
|
||||||
implements DisplayUtils.AvatarGenerationListener {
|
implements DisplayUtils.AvatarGenerationListener {
|
||||||
|
|
||||||
private static final int showFilenameColumnThreshold = 4;
|
private static final int showFilenameColumnThreshold = 4;
|
||||||
private final FileDownloader.FileDownloaderBinder downloaderBinder;
|
private final ComponentsGetter transferServiceGetter;
|
||||||
private final FileUploader.FileUploaderBinder uploaderBinder;
|
|
||||||
private final OperationsService.OperationsServiceBinder operationsServiceBinder;
|
|
||||||
private final String userId;
|
private final String userId;
|
||||||
private Context mContext;
|
private Context mContext;
|
||||||
private AppPreferences preferences;
|
private AppPreferences preferences;
|
||||||
|
@ -152,9 +150,7 @@ public class OCFileListAdapter extends RecyclerView.Adapter<RecyclerView.ViewHol
|
||||||
this.gridView = gridView;
|
this.gridView = gridView;
|
||||||
checkedFiles = new HashSet<>();
|
checkedFiles = new HashSet<>();
|
||||||
|
|
||||||
downloaderBinder = transferServiceGetter.getFileDownloaderBinder();
|
this.transferServiceGetter = transferServiceGetter;
|
||||||
uploaderBinder = transferServiceGetter.getFileUploaderBinder();
|
|
||||||
operationsServiceBinder = transferServiceGetter.getOperationsServiceBinder();
|
|
||||||
|
|
||||||
if (account != null) {
|
if (account != null) {
|
||||||
AccountManager platformAccountManager = AccountManager.get(mContext);
|
AccountManager platformAccountManager = AccountManager.get(mContext);
|
||||||
|
@ -442,17 +438,20 @@ public class OCFileListAdapter extends RecyclerView.Adapter<RecyclerView.ViewHol
|
||||||
|
|
||||||
gridViewHolder.localFileIndicator.setVisibility(View.INVISIBLE); // default first
|
gridViewHolder.localFileIndicator.setVisibility(View.INVISIBLE); // default first
|
||||||
|
|
||||||
|
OperationsService.OperationsServiceBinder operationsServiceBinder = transferServiceGetter.getOperationsServiceBinder();
|
||||||
|
FileDownloader.FileDownloaderBinder fileDownloaderBinder = transferServiceGetter.getFileDownloaderBinder();
|
||||||
|
FileUploader.FileUploaderBinder fileUploaderBinder = transferServiceGetter.getFileUploaderBinder();
|
||||||
if (operationsServiceBinder != null && operationsServiceBinder.isSynchronizing(account, file)) {
|
if (operationsServiceBinder != null && operationsServiceBinder.isSynchronizing(account, file)) {
|
||||||
//synchronizing
|
//synchronizing
|
||||||
gridViewHolder.localFileIndicator.setImageResource(R.drawable.ic_synchronizing);
|
gridViewHolder.localFileIndicator.setImageResource(R.drawable.ic_synchronizing);
|
||||||
gridViewHolder.localFileIndicator.setVisibility(View.VISIBLE);
|
gridViewHolder.localFileIndicator.setVisibility(View.VISIBLE);
|
||||||
|
|
||||||
} else if (downloaderBinder != null && downloaderBinder.isDownloading(account, file)) {
|
} else if (fileDownloaderBinder != null && fileDownloaderBinder.isDownloading(account, file)) {
|
||||||
// downloading
|
// downloading
|
||||||
gridViewHolder.localFileIndicator.setImageResource(R.drawable.ic_synchronizing);
|
gridViewHolder.localFileIndicator.setImageResource(R.drawable.ic_synchronizing);
|
||||||
gridViewHolder.localFileIndicator.setVisibility(View.VISIBLE);
|
gridViewHolder.localFileIndicator.setVisibility(View.VISIBLE);
|
||||||
|
|
||||||
} else if (uploaderBinder != null && uploaderBinder.isUploading(account, file)) {
|
} else if (fileUploaderBinder != null && fileUploaderBinder.isUploading(account, file)) {
|
||||||
//uploading
|
//uploading
|
||||||
gridViewHolder.localFileIndicator.setImageResource(R.drawable.ic_synchronizing);
|
gridViewHolder.localFileIndicator.setImageResource(R.drawable.ic_synchronizing);
|
||||||
gridViewHolder.localFileIndicator.setVisibility(View.VISIBLE);
|
gridViewHolder.localFileIndicator.setVisibility(View.VISIBLE);
|
||||||
|
|
Loading…
Reference in a new issue