the platform and support libraries. • by Jake Wharton • https://github.com/JakeWharton/RxBinding • Renamed from NotRxAndroid. • WidgetObservable and ViewObservable have been rolled from RxAndroid into (and improved in) it.
Observable.OnSubscribe<Boolean> { private val subscriptions = CompositeSubscription() override fun call(subscriber: Subscriber<in Boolean>) { toggleButton.isChecked = initial subscriptions.add(toggleButton.checkedChanges() .skip(1) // Emit initial value in RxBinding, skip it. .subscribe { // do something in common doSomething() subscriber.onNext(it) }) subscriber.add(subscriptions) } } fun ToggleButton.updatedEvents(initial: Boolean) = Observable.create(FollowToggleButtonOnSubscribe(this, initial))