|
1 | 1 | package com.morihacky.android.rxjava.fragments; |
2 | 2 |
|
| 3 | +import static android.text.TextUtils.isEmpty; |
| 4 | +import static android.util.Patterns.EMAIL_ADDRESS; |
| 5 | + |
3 | 6 | import android.os.Bundle; |
4 | 7 | import android.support.annotation.Nullable; |
5 | 8 | import android.view.LayoutInflater; |
|
9 | 12 | import android.widget.TextView; |
10 | 13 | import butterknife.BindView; |
11 | 14 | import butterknife.ButterKnife; |
12 | | - |
| 15 | +import butterknife.Unbinder; |
13 | 16 | import com.jakewharton.rxbinding2.widget.RxTextView; |
14 | 17 | import com.morihacky.android.rxjava.R; |
15 | | - |
16 | | -import butterknife.Unbinder; |
17 | 18 | import io.reactivex.BackpressureStrategy; |
18 | 19 | import io.reactivex.Flowable; |
19 | 20 | import io.reactivex.subscribers.DisposableSubscriber; |
20 | 21 | import timber.log.Timber; |
21 | 22 |
|
22 | | -import static android.text.TextUtils.isEmpty; |
23 | | -import static android.util.Patterns.EMAIL_ADDRESS; |
24 | | - |
25 | 23 | public class FormValidationCombineLatestFragment extends BaseFragment { |
26 | 24 |
|
27 | 25 | @BindView(R.id.btn_demo_form_valid) |
@@ -48,9 +46,12 @@ public View onCreateView( |
48 | 46 | View layout = inflater.inflate(R.layout.fragment_form_validation_comb_latest, container, false); |
49 | 47 | unbinder = ButterKnife.bind(this, layout); |
50 | 48 |
|
51 | | - _emailChangeObservable = RxTextView.textChanges(_email).skip(1).toFlowable(BackpressureStrategy.LATEST); |
52 | | - _passwordChangeObservable = RxTextView.textChanges(_password).skip(1).toFlowable(BackpressureStrategy.LATEST); |
53 | | - _numberChangeObservable = RxTextView.textChanges(_number).skip(1).toFlowable(BackpressureStrategy.LATEST); |
| 49 | + _emailChangeObservable = |
| 50 | + RxTextView.textChanges(_email).skip(1).toFlowable(BackpressureStrategy.LATEST); |
| 51 | + _passwordChangeObservable = |
| 52 | + RxTextView.textChanges(_password).skip(1).toFlowable(BackpressureStrategy.LATEST); |
| 53 | + _numberChangeObservable = |
| 54 | + RxTextView.textChanges(_number).skip(1).toFlowable(BackpressureStrategy.LATEST); |
54 | 55 |
|
55 | 56 | _combineLatestEvents(); |
56 | 57 |
|
|