Hi can somebody help me with this error message ``...
# rx
i
Hi can somebody help me with this error message
Copy code
Error:(114, 36) None of the following functions can be called with the arguments supplied:
@CheckReturnValue @SchedulerSupport public final fun <T1 : Any!, T2 : Any!, R : Any!> combineLatest(p0: ((Observer<in String!>) -> Unit)!, p1: ((Observer<in String!>) -> Unit)!, p2: ((String, String) -> Boolean)!): Observable<Boolean!>! defined in io.reactivex.Observable
@CheckReturnValue @SchedulerSupport public final fun <T : Any!, R : Any!> combineLatest(p0: ((Array<(out) Any!>) -> ???)!, p1: Int, p2: Array<(out) ObservableSource<out (???..???)>!>!): Observable<(???..???)>! defined in io.reactivex.Observable
@CheckReturnValue @SchedulerSupport public open fun <T1 : Any!, T2 : Any!, R : Any!> combineLatest(p0: ObservableSource<out (???..???)>!, p1: ObservableSource<out (???..???)>!, p2: BiFunction<in (???..???), in (???..???), out (???..???)>!): Observable<(???..???)>! defined in io.reactivex.Observable
@CheckReturnValue @SchedulerSupport public open fun <T : Any!, R : Any!> combineLatest(p0: Function<in Array<(out) Any!>!, out (???..???)>!, p1: Int, vararg p2: ObservableSource<out (???..???)>!): Observable<(???..???)>! defined in io.reactivex.Observable
@CheckReturnValue @SchedulerSupport public final fun <T : Any!, R : Any!> combineLatest(p0: Array<(out) ObservableSource<out (???..???)>!>!, p1: ((Array<(out) Any!>) -> ???)!, p2: Int): Observable<(???..???)>! defined in io.reactivex.Observable
@CheckReturnValue @SchedulerSupport public open fun <T : Any!, R : Any!> combineLatest(p0: Array<(out) ObservableSource<out (???..???)>!>!, p1: Function<in Array<(out) Any!>!, out (???..???)>!, p2: Int): Observable<(???..???)>! defined in io.reactivex.Observable
@CheckReturnValue @SchedulerSupport public final fun <T : Any!, R : Any!> combineLatest(p0: (Mutable)Iterable<ObservableSource<out (???..???)>!>!, p1: ((Array<(out) Any!>) -> ???)!, p2: Int): Observable<(???..???)>! defined in io.reactivex.Observable
@CheckReturnValue @SchedulerSupport public open fun <T : Any!, R : Any!> combineLatest(p0: (Mutable)Iterable<ObservableSource<out (???..???)>!>!, p1: Function<in Array<(out) Any!>!, out (???..???)>!, p2: Int): Observable<(???..???)>! defined in io.reactivex.Observable
code sample:
Copy code
val usernameObservable = RxTextView.textChanges(et_username)
			.map { it -> Constants.emailPattern.matcher(it).matches() }
			.distinctUntilChanged()
			.subscribe()

		val passwordObservable = RxTextView.textChanges(et_password)
			.map { it -> it.isNotEmpty()}
			.distinctUntilChanged()
			.subscribe()

		val signInEnabledCondition = BiFunction({ username: CharSequence, password: CharSequence ->
			username.isNotEmpty() && password.isNotEmpty()
		})

		val isSignInEnabled = Observable.combineLatest(usernameObservable, passwordObservable, signInEnabledCondition)

		isSignInEnabled.distinctUntilChanged().subscribe { enabled: Boolean -> bt_sign_in.isEnabled = enabled }
b
you are subscribing to the original observables
Its better to use explicit types to avoid this kind of confusions
i
Can you please help me write correct code?
Copy code
val usernameObservable: Observable<CharSequence> = RxTextView.textChanges(et_username)
		val passwordObservable: Observable<CharSequence> = RxTextView.textChanges(et_password)

		val isSignInEnabled = Observable.combineLatest(usernameObservable, passwordObservable, BiFunction<CharSequence, CharSequence, Boolean> { username: CharSequence, password: CharSequence ->
			Constants.emailPattern.matcher(username).matches() && username.isNotEmpty() && password.isNotEmpty()
		})

		isSignInEnabled.distinctUntilChanged().subscribe { enabled: Boolean -> bt_sign_in.isEnabled = enabled }
this works now
thanks for help