JakeWharton / RxBinding

RxJava binding APIs for Android's UI widgets.
Apache License 2.0
9.68k stars 971 forks source link

AndroidX Jetpack #450

Closed carmas123 closed 6 years ago

carmas123 commented 6 years ago

Any news about AndroidX support?

JakeWharton commented 6 years ago

Jetifier should handle it

nhaarman commented 6 years ago

I created an issue a while back on the Android tracker addressing some issues with Kotlin extension functions: https://issuetracker.google.com/issues/79443876

The 'rxbinding-design-kotlin' artifact provides the following two extension functions:

  • fun android.view.View.dismisses(): Observable
  • fun android.support.design.widget.Snackbar.dismisses(): Observable

Both functions reside in the same package: 'com.jakewharton.rxbinding2.support.design.widget'

The following code snippet does not compile:

  import com.google.android.material.snackbar.Snackbar
  import com.jakewharton.rxbinding2.support.design.widget.dismisses

  class Foo {

      fun bar(n: Snackbar) {
          n.dismisses().subscribe {}
      }
  }

The compiler error:

/app/src/main/java/com/example/issuerepro/Foo.kt: (9, 11): Unresolved reference. None of the following candidates is applicable because of receiver type mismatch:
public inline fun Snackbar.dismisses(): Observable<Int> defined in com.jakewharton.rxbinding2.support.design.widget
@CheckResult public inline fun View.dismisses(): Observable<View> defined in com.jakewharton.rxbinding2.support.design.widget

Unfortunately there is no activity on it yet..

carmas123 commented 6 years ago

When I try to use a simple RX binding like this:

RxSearchView.queryTextChangeEvents(searchView)

I got this error:

Type mismatch. Required: android.widget.SearchView Found: androidx.appcompat.widget.SearchView

carmas123 commented 6 years ago

Solved...thankyou

ko3ak1990 commented 6 years ago

@

Solved...thankyou

@carmas123 How did you solve it?

carmas123 commented 6 years ago

Try the alpha release

adamvietnam commented 5 years ago

When I try to use a simple RX binding like this:

RxSearchView.queryTextChangeEvents(searchView)

I got this error:

Type mismatch. Required: android.widget.SearchView Found: androidx.appcompat.widget.SearchView

Hi - I'm having the same issue. Do you recall how you resolved this please?