JakeWharton / RxBinding

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

RxtextView textChangeEvents calls onNext twice for every change #415

Closed topeomot2 closed 7 years ago

topeomot2 commented 7 years ago

Hello, below is the code I am testing RxTextView.textChangeEvents(searchEditText) .subscribe({t: TextViewTextChangeEvent? -> Logger.i("onNext")}, {t: Throwable? -> Logger.i("onError")},{Logger.i("onComplete")})

In logcat I get "onNext" printed in the logs for every change in the editView. Is this how it is suppose to work?

JakeWharton commented 7 years ago

Does it happen when not using RxBinding?

On Thu, Oct 19, 2017 at 8:25 PM topeomot notifications@github.com wrote:

Hello, below is the code I am testing RxTextView.textChangeEvents(searchEditText) .subscribe({t: TextViewTextChangeEvent? -> Logger.i("onNext")}, {t: Throwable? -> Logger.i("onError")},{Logger.i("onComplete")})

In logcat I get "onNext" printed in the logs for every change in the editView. Is this how it is suppose to work?

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/JakeWharton/RxBinding/issues/415, or mute the thread https://github.com/notifications/unsubscribe-auth/AAEEEeBw9EJs83nh80Yu05W1ycLa1QjQks5st-iCgaJpZM4QACO0 .

topeomot2 commented 7 years ago

Yes, it happened when I used a normal textwatcher with the addTextChangedListener. I am using Anko DSL for my layouts, I will go through my code and see where the issue is. Thanks

topeomot2 commented 7 years ago

I am using orhanobut/logger for logging. When I changed it to the normal Java Logger the issue stopped. Thanks for your help.