I’m trying to use FlexibleAdapter with Fire. FlexibleAdapter makes it very easy to create RecyclerView based UITableView and UICollectionView-like Android counterparts.
The problem is, I can’t override some methods in the attached project, because I get the Generic parameter doesn’t fulfill constraint compile time error.
I have a class defined as:
public class TableViewHeader: AbstractHeaderItem<TableViewItemHolder>
where I have to override bindViewHolder and createViewHolder methods in order to be able to use it.
Two problems:
First, for both methods Fire CC offers me the following definitions:
VH kind of makes sense because IFlexible is defined as:
public interface IFlexible<VH extends RecyclerView.ViewHolder>
However, the compiler complains about VH being unknown type. IMHO it would make more sense for the CC to replace VH with TableViewItemHolder given the TableViewHeader definition above.
This brings us to the second issue. If I replace VH with TableViewItemHolder, the compiler says Generic parameter doesn't fulfill constraint which shouldn’t be because TableViewItemHolder is descendant of RecyclerView.ViewHolder.
ignoring those, can reproduced your error. it seems you’re missing a constraint? but I logged an issue, as this is inscrutable for me, so at the very pleats this needs better messages…
AFAIK RecyclerView.ViewHolder is the constraint and TableViewItemHolder descends from it, so I can’t figure out what else I might be missing. I tried many things but nothing worked.
Android Studio version of this project compiles fine and Kotlin version of the methods, as suggested by Android Studio CC, looks pretty clean:
IIRC it worked in .2525, but I didn’t change my code then, I just compiled the test project. I did some code refactoring now, tried to compile, and it didn’t work - my code and the test project.