RxBinding4 issue, unsure how to implement clicks on a floating action button

324 Views Asked by At

So I've upgraded to RxBinding4 and want to use the same process from RxBinding2 where i can click a fab button to save a task in a Todo List App the two ways which dont work are like this:

private fun saveTaskIntent(): Observable<SaveTask> {
    return view.clicks(fab).map{SaveTask(argumentTaskID, title.text.toString()!!, description.text.toString()!!)}
}

private fun saveTaskIntent2(): Observable<SaveTask> {
    return RxView.clicks(fab).map {SaveTask(argumentTaskID, title.text.toString()!!, description.text.toString()!!)}
} 

Any idea of how i would do this using 'com.jakewharton.rxbinding4:rxbinding:4.0.0'

Thanks in advance.

Repo GitHub

1

There are 1 best solutions below

0
Aleon Q On

That seems to have been converted to Kolin extensions. Use fab.map() to get the observable now.