Skip to content

Commit

Permalink
Merge pull request #5721 from nextcloud/backport/5695/stable-3.11
Browse files Browse the repository at this point in the history
[stable-3.11] fix activity image loading
  • Loading branch information
AndyScherzinger authored Mar 23, 2020
2 parents cf8581c + c1bef3c commit e990622
Show file tree
Hide file tree
Showing 4 changed files with 22 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@
import android.widget.ProgressBar;
import android.widget.TextView;

import com.nextcloud.client.network.ClientFactory;
import com.nextcloud.common.NextcloudClient;
import com.owncloud.android.R;
import com.owncloud.android.datamodel.FileDataStorageManager;
Expand Down Expand Up @@ -100,6 +101,7 @@ public class ActivitiesActivity extends FileActivity implements ActivityListInte
private ActivitiesContract.ActionListener mActionListener;
@Inject ActivitiesRepository activitiesRepository;
@Inject FilesRepository filesRepository;
@Inject ClientFactory clientFactory;

@Override
protected void onCreate(Bundle savedInstanceState) {
Expand Down Expand Up @@ -169,8 +171,13 @@ private void setupContent() {
PorterDuff.Mode.SRC_IN);

FileDataStorageManager storageManager = new FileDataStorageManager(getAccount(), getContentResolver());
adapter = new ActivityListAdapter(this, getUserAccountManager(), this, storageManager,
getCapabilities(), false);
adapter = new ActivityListAdapter(this,
getUserAccountManager(),
this,
storageManager,
getCapabilities(),
clientFactory,
false);
recyclerView.setAdapter(adapter);

LinearLayoutManager layoutManager = new LinearLayoutManager(this);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@
import android.widget.TextView;

import com.nextcloud.client.account.CurrentAccountProvider;
import com.nextcloud.client.network.ClientFactory;
import com.nextcloud.common.NextcloudClient;
import com.owncloud.android.R;
import com.owncloud.android.datamodel.FileDataStorageManager;
Expand Down Expand Up @@ -62,9 +63,10 @@ public ActivityAndVersionListAdapter(
ActivityListInterface activityListInterface,
VersionListInterface.View versionListInterface,
FileDataStorageManager storageManager,
OCCapability capability
OCCapability capability,
ClientFactory clientFactory
) {
super(context, currentAccountProvider, activityListInterface, storageManager, capability, true);
super(context, currentAccountProvider, activityListInterface, storageManager, capability, clientFactory, true);

this.versionListInterface = versionListInterface;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -107,6 +107,7 @@ public ActivityListAdapter(
ActivityListInterface activityListInterface,
FileDataStorageManager storageManager,
OCCapability capability,
ClientFactory clientFactory,
boolean isDetailView
) {
this.values = new ArrayList<>();
Expand All @@ -115,6 +116,7 @@ public ActivityListAdapter(
this.activityListInterface = activityListInterface;
this.storageManager = storageManager;
this.capability = capability;
this.clientFactory = clientFactory;
px = getThumbnailDimension();
this.isDetailView = isDetailView;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -256,9 +256,14 @@ private void setupView() {
PorterDuff.Mode.SRC_IN);
emptyContentIcon.setImageDrawable(getResources().getDrawable(R.drawable.ic_activity_light_grey));

adapter = new ActivityAndVersionListAdapter(getContext(), accountManager, this, this,
adapter = new ActivityAndVersionListAdapter(getContext(),
accountManager,
this,
this,
storageManager,
capability);
capability,
clientFactory
);
recyclerView.setAdapter(adapter);

LinearLayoutManager layoutManager = new LinearLayoutManager(getContext());
Expand Down

0 comments on commit e990622

Please sign in to comment.