use of com.odysee.app.adapter.CollectionListAdapter in project odysee-android by OdyseeTeam.
the class AddToListsDialogFragment method onPlaylistsLoaded.
private void onPlaylistsLoaded(List<OdyseeCollection> collections) {
Helper.setViewVisibility(loadProgress, View.INVISIBLE);
CollectionListAdapter adapter = new CollectionListAdapter(collections, getContext());
adapter.setListener(new CollectionListAdapter.CollectionListItemCheckChangedListener() {
@Override
public void onCheckedChanged(OdyseeCollection collection, boolean checked) {
if (!Helper.isNullOrEmpty(url)) {
Context context = getContext();
if (context instanceof MainActivity) {
MainActivity activity = (MainActivity) context;
if (checked) {
activity.handleAddUrlToList(url, collection, false);
} else {
activity.handleRemoveUrlFromList(url, collection);
}
}
}
}
});
if (collectionList != null) {
collectionList.setAdapter(adapter);
}
}
Aggregations