Hello friends to improve the code below; Is there a way to directly "bind" the "event.position" value without having to subscribe? Or better?
var index: BehaviorRelay<Int> = BehaviorRelay.createDefault(0)
mainViewPager.pageScrollEvents().subscribe(
{ event ->
index.accept(event.position)
}
)
I think I'm looking for something like the following (This code will not work, just an example);
mainViewPager.pageScrollEvents().position.bind(index)