rx-binding

Rx SearchView needs to cancel on going request with less priority

孤街浪徒 提交于 2019-12-25 04:14:17
问题 I am using RxSearchView.queryTextChangeEvents to detect the events of “Search As You Type” and also when you submit a search, SAYT is to get suggestions and when you do a submit, it executes a full search. There are 2 problems I am having at the moment. When you are typing, and getting suggestions, but suddenly you click submit then it executes the full search but the problem is that if there is an on going suggestion request there might be the case that they appear on screen when they should

RecyclerView item click using RxJava2 + RxBinding not working after Fragment replacements

房东的猫 提交于 2019-12-24 09:36:02
问题 I have a RecyclerView in Fragment, item clicks are handled using RxJava2 as explained in this SO answer, It's working fine in non fragments. private PublishSubject<Place> itemViewClickSubject = PublishSubject.create(); @Override public ViewHolder onCreateViewHolder(ViewGroup parent, int viewType) { View view = LayoutInflater.from(parent.getContext()).inflate(R.layout.search_result_view, parent, false); ViewHolder viewHolder = new ViewHolder(view); // convert click events into reactive stream

Should I unsubscribe when using rxbinding?

て烟熏妆下的殇ゞ 提交于 2019-12-21 09:09:10
问题 There is how I use RxBinding with Kotlin: override fun onViewCreated(view: View?, savedInstanceState: Bundle?) { super.onViewCreated(view, savedInstanceState) reset_password_text_view.clicks().subscribe { presenter.showConfirmSecretQuestionBeforeResetPassword() } password_edit_text.textChanges().skip(1).subscribe { presenter.onPasswordChanged(it.toString()) } password_edit_text.editorActionEvents().subscribe { presenter.done(password_edit_text.text.toString()) } } Observable.subscribe(action)

Updating fragment from Activity Using Rxjava Android

女生的网名这么多〃 提交于 2019-12-21 07:24:09
问题 I have a simple use case where: Activity1 create a fragment1 fragment1 after creation notify to activity that it is created and update its activity1 views. activity1 after getting notification update fragment1 views. I am using rxandroid , sublibrary rxlifecycle components and android , but i am still in learning phase , there was not even rx-lifecycle tag on stackoverflow , so i am still struggling to understand the flow of this library.. Edit I prefer not to use EventBus , it's just like

RxBindings For Spinner?

﹥>﹥吖頭↗ 提交于 2019-12-05 15:04:14
问题 i am new android and rxjava. i have been through many examples where we listen for events with rxbindings. such as this RxView.clicks(b).subscribe(new Action1<Void>() { @Override public void call(Void aVoid) { // do some work here } }); or RxTextView.textChanges(name) .subscribe(new Action1<String>() { @Override public void call(String value) { // do some work with the updated text } }); now i am trying to do the same for android spinner. i want to listen for itemselected event. can anyone

Should I unsubscribe when using rxbinding?

邮差的信 提交于 2019-12-04 02:07:18
There is how I use RxBinding with Kotlin: override fun onViewCreated(view: View?, savedInstanceState: Bundle?) { super.onViewCreated(view, savedInstanceState) reset_password_text_view.clicks().subscribe { presenter.showConfirmSecretQuestionBeforeResetPassword() } password_edit_text.textChanges().skip(1).subscribe { presenter.onPasswordChanged(it.toString()) } password_edit_text.editorActionEvents().subscribe { presenter.done(password_edit_text.text.toString()) } } Observable.subscribe(action) returns Subscription . Should I keep it as reference and unsubscribe onPause() or onDestroy() ? Like

RxBindings For Spinner?

百般思念 提交于 2019-12-04 00:43:15
i am new android and rxjava. i have been through many examples where we listen for events with rxbindings. such as this RxView.clicks(b).subscribe(new Action1<Void>() { @Override public void call(Void aVoid) { // do some work here } }); or RxTextView.textChanges(name) .subscribe(new Action1<String>() { @Override public void call(String value) { // do some work with the updated text } }); now i am trying to do the same for android spinner. i want to listen for itemselected event. can anyone help? The items in the Spinner come from the Adapter associated with this view. See the Spinners guide.

Observable.combineLatest type inference in kotlin

为君一笑 提交于 2019-11-30 08:20:58
I'm using RxJava2, Kotlin-1.1 along with RxBindings in my project. I have simple login screen with 'login' button disabled by default, I want to enable the button only when username and password edittext fields are not empty. LoginActivity.java Observable<Boolean> isFormEnabled = Observable.combineLatest(mUserNameObservable, mPasswordObservable, (userName, password) -> userName.length() > 0 && password.length() > 0) .distinctUntilChanged(); I'm unable to translate the above code from Java to Kotlin: LoginActivity.kt class LoginActivity : AppCompatActivity() { val disposable =

Observable.combineLatest type inference in kotlin

白昼怎懂夜的黑 提交于 2019-11-29 11:03:59
问题 I'm using RxJava2, Kotlin-1.1 along with RxBindings in my project. I have simple login screen with 'login' button disabled by default, I want to enable the button only when username and password edittext fields are not empty. LoginActivity.java Observable<Boolean> isFormEnabled = Observable.combineLatest(mUserNameObservable, mPasswordObservable, (userName, password) -> userName.length() > 0 && password.length() > 0) .distinctUntilChanged(); I'm unable to translate the above code from Java to

How to implement search feature with SearchView, Retrofit and RxJava (RxBindings)?

断了今生、忘了曾经 提交于 2019-11-29 01:32:54
问题 When the user types into the SearchView widget, the app should make an API call ( in background thread ) to fetch search results from server, and display them ( in UI thread ) in RecyclerView. I use the following code in my fragment: @Override public void onCreateOptionsMenu(Menu menu, MenuInflater inflater) { inflater.inflate(R.menu.my_fragment, menu); SearchView searchView = (SearchView) menu.findItem(R.id.action_search).getActionView(); SearchManager searchManager = (SearchManager)