From c1bef3c9c19bfad73161a16ce49ab4cff1af066e Mon Sep 17 00:00:00 2001 From: tobiasKaminsky Date: Thu, 19 Mar 2020 20:33:48 +0100 Subject: [PATCH] fix activity image loading Signed-off-by: tobiasKaminsky --- .../android/ui/activities/ActivitiesActivity.java | 11 +++++++++-- .../ui/adapter/ActivityAndVersionListAdapter.java | 6 ++++-- .../android/ui/adapter/ActivityListAdapter.java | 2 ++ .../ui/fragment/FileDetailActivitiesFragment.java | 9 +++++++-- 4 files changed, 22 insertions(+), 6 deletions(-) diff --git a/src/main/java/com/owncloud/android/ui/activities/ActivitiesActivity.java b/src/main/java/com/owncloud/android/ui/activities/ActivitiesActivity.java index 586abdd74e9e..c1da53023847 100644 --- a/src/main/java/com/owncloud/android/ui/activities/ActivitiesActivity.java +++ b/src/main/java/com/owncloud/android/ui/activities/ActivitiesActivity.java @@ -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; @@ -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) { @@ -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); diff --git a/src/main/java/com/owncloud/android/ui/adapter/ActivityAndVersionListAdapter.java b/src/main/java/com/owncloud/android/ui/adapter/ActivityAndVersionListAdapter.java index 1f96921bdecf..8f3d3f793e99 100644 --- a/src/main/java/com/owncloud/android/ui/adapter/ActivityAndVersionListAdapter.java +++ b/src/main/java/com/owncloud/android/ui/adapter/ActivityAndVersionListAdapter.java @@ -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; @@ -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; } diff --git a/src/main/java/com/owncloud/android/ui/adapter/ActivityListAdapter.java b/src/main/java/com/owncloud/android/ui/adapter/ActivityListAdapter.java index fa48e990a66e..ad510103c648 100644 --- a/src/main/java/com/owncloud/android/ui/adapter/ActivityListAdapter.java +++ b/src/main/java/com/owncloud/android/ui/adapter/ActivityListAdapter.java @@ -107,6 +107,7 @@ public ActivityListAdapter( ActivityListInterface activityListInterface, FileDataStorageManager storageManager, OCCapability capability, + ClientFactory clientFactory, boolean isDetailView ) { this.values = new ArrayList<>(); @@ -115,6 +116,7 @@ public ActivityListAdapter( this.activityListInterface = activityListInterface; this.storageManager = storageManager; this.capability = capability; + this.clientFactory = clientFactory; px = getThumbnailDimension(); this.isDetailView = isDetailView; } diff --git a/src/main/java/com/owncloud/android/ui/fragment/FileDetailActivitiesFragment.java b/src/main/java/com/owncloud/android/ui/fragment/FileDetailActivitiesFragment.java index 5d55620882e6..df35d0bd3e73 100644 --- a/src/main/java/com/owncloud/android/ui/fragment/FileDetailActivitiesFragment.java +++ b/src/main/java/com/owncloud/android/ui/fragment/FileDetailActivitiesFragment.java @@ -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());