idanatz / OneAdapter

A Viewholderless Adapter for RecyclerView, who supports builtin diffing, states (paging, empty...), events (clicking, swiping...), and more.
MIT License
470 stars 45 forks source link

Does not work in Java #27

Closed saiid2020 closed 4 years ago

saiid2020 commented 4 years ago

I only know Java, please support Java as well

idanatz commented 4 years ago

Did you check the sample project? it has a Java activity https://github.com/ironSource/OneAdapter/blob/develop/sample/app/src/main/java/com/idanatz/sample/examples/BasicJavaExampleActivity.java

saiid2020 commented 4 years ago
 Pagination does not work in Java 

static class Pagation extends PagingModule {

    public Pagation(OnLoadMore onLoadMore ) {
        config(builder->{
            builder.setLayoutResource(R.layout.item_progress);
            builder.setVisibleThreshold(10);
            return null;

        });
        onLoadMore(mo->{
            onLoadMore.onloadmore(mo);
            return null;

        });

    }

}
    oneAdapter = new OneAdapter(recycler_product)
            .attachPagingModule(new Pagation(onLoadMore))
    .attachItemModule(new Productadaptermodel(onItemClickListener));
idanatz commented 4 years ago

I've updated the java sample with paging module and it working great https://github.com/ironSource/OneAdapter/blob/develop/sample/app/src/main/java/com/idanatz/sample/examples/BasicJavaExampleActivity.java

saiid2020 commented 4 years ago

I found a problem when I set the linearlayout after oneadapter, pagination does not work