fix activity image loading

Signed-off-by: tobiasKaminsky <tobias@kaminsky.me>
This commit is contained in:
tobiasKaminsky 2020-03-19 20:33:48 +01:00
parent fac23bf2ea
commit c0c631fe64
No known key found for this signature in database
GPG key ID: 0E00D4D47D0C5AF7
4 changed files with 22 additions and 6 deletions

View file

@ -28,6 +28,7 @@ import android.widget.LinearLayout;
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 @@ public class ActivitiesActivity extends FileActivity implements ActivityListInte
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);

View file

@ -32,6 +32,7 @@ import android.widget.ImageView;
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 class ActivityAndVersionListAdapter extends ActivityListAdapter {
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;
}

View file

@ -107,6 +107,7 @@ public class ActivityListAdapter extends RecyclerView.Adapter<RecyclerView.ViewH
ActivityListInterface activityListInterface,
FileDataStorageManager storageManager,
OCCapability capability,
ClientFactory clientFactory,
boolean isDetailView
) {
this.values = new ArrayList<>();
@ -115,6 +116,7 @@ public class ActivityListAdapter extends RecyclerView.Adapter<RecyclerView.ViewH
this.activityListInterface = activityListInterface;
this.storageManager = storageManager;
this.capability = capability;
this.clientFactory = clientFactory;
px = getThumbnailDimension();
this.isDetailView = isDetailView;
}

View file

@ -256,9 +256,14 @@ public class FileDetailActivitiesFragment extends Fragment implements
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());