Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -131,7 +131,7 @@ public class OCFileListAdapter extends RecyclerView.Adapter<RecyclerView.ViewHol
private final long footerId = UUID.randomUUID().getLeastSignificantBits();
private final long headerId = UUID.randomUUID().getLeastSignificantBits();

private ArrayList<OCFile> recommendedFiles = new ArrayList<>();
private List<OCFile> recommendedFiles = new ArrayList<>();
private RecommendedFilesAdapter recommendedFilesAdapter;
private final OCFileListAdapterHelper helper = new OCFileListAdapterHelper();
private final OverlayManager overlayManager;
Expand Down Expand Up @@ -703,14 +703,10 @@ private void setVisibilityOfMoreOption(Object holder) {
}

@SuppressLint("NotifyDataSetChanged")
public void updateRecommendedFiles(ArrayList<OCFile> recommendedFiles) {
this.recommendedFiles = recommendedFiles;

if (recommendedFiles == null || recommendedFiles.isEmpty()) {
notifyDataSetChanged();
} else {
notifyItemChanged(0);
}
public void updateRecommendedFiles(@NonNull List<OCFile> value) {
recommendedFiles.clear();
recommendedFiles.addAll(value);
notifyDataSetChanged();
}

private void applyChipVisuals(Chip chip, Tag tag) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ import com.owncloud.android.datamodel.OCFile

class RecommendedFilesAdapter(
private val fileListAdapter: OCFileListAdapter,
private val recommendations: ArrayList<OCFile>
private val recommendations: List<OCFile>
) : RecyclerView.Adapter<OCFileListRecommendedItemViewHolder>() {

fun getItemPosition(file: OCFile): Int = recommendations.indexOf(file)
Expand Down
Loading