SlimAdapter
SlimAdapter copied to clipboard
Add containerClick
trafficstars
Many times, we need to support click on whole element, so if it's possible, could you add methods .click and .longClick without additional ID parameter, and pass that to whole injected view?
SlimAdapter.create()
.register(R.layout.recycler_item, new SlimInjector<Foo>() {
@Override
public void onInject(Foo data, IViewInjector injector) {
injector.clicked(R.id.YOUR_ID_ROOT_ELEMENT, view -> {
//Some Action
});
}
})
.attachTo(mRecycler);
@miszmaniac Try to put ID in your root element. I guess that's what you want.
I know that I can do that this way, it's just cumbersome, and in Kotlin it prevents for use of {}
@miszmaniac Just call 'clicked' passing a listener. I'll wait your feedback, if all things are ok make a pull request.
Replace these files. DefaultViewInjector.txt IViewInjector.txt