0

In trying to adapt some standard Android programming to RxBinding I'm stuck on RxFloatingActionButton. The class has one method, visibility(view), which returns a Consumer<Boolean>. Yet the Javadoc says "The created observable keeps a strong reference to {@code view}." Where is the "created observable"? A very brief usage example would help greatly. I assume that to detect clicks on the FAB, I would use the normal View click observable?

Robert Lewis
  • 1,847
  • 2
  • 18
  • 43
  • could you elaborate on your question? I don't seem to find any RxFloatingActionButton in Rx-Binding libraries. Would you please add the dependencies snippet? – seyed Jafari Jul 22 '18 at 04:43
  • This: `com.jakewharton.rxbinding2.support.design.widget.RxFloatingActionButton` – Robert Lewis Jul 22 '18 at 15:04

1 Answers1

0
fabEnabledObservable.subscribe(RxFloatingActionButton.visibility(fab), /*handle error*/)

fabEnabledObservable is Observable<Boolean> which decides if the button should be shown or hidden.

Yes for clicks RxView.clicks()

LordRaydenMK
  • 13,074
  • 5
  • 50
  • 56