Commit 0bae18e9 authored by Vladislav Bogdashkin's avatar Vladislav Bogdashkin 🎣

button click fix

parent 60e9bf89
...@@ -11,4 +11,4 @@ interface FindFlatScreen : BigantoBaseContract<FindFlatScreenViewState> { ...@@ -11,4 +11,4 @@ interface FindFlatScreen : BigantoBaseContract<FindFlatScreenViewState> {
fun getFlat() : Observable<FlatRequestModel> fun getFlat() : Observable<FlatRequestModel>
} }
data class FlatRequestModel(val number:Int,val building:Int) data class FlatRequestModel(val building:Int,val number:Int)
\ No newline at end of file \ No newline at end of file
...@@ -16,6 +16,7 @@ import com.bluelinelabs.conductor.changehandler.FadeChangeHandler ...@@ -16,6 +16,7 @@ import com.bluelinelabs.conductor.changehandler.FadeChangeHandler
import com.google.android.material.button.MaterialButton import com.google.android.material.button.MaterialButton
import com.google.android.material.tabs.TabLayout import com.google.android.material.tabs.TabLayout
import com.google.android.material.textfield.TextInputLayout import com.google.android.material.textfield.TextInputLayout
import com.jakewharton.rxbinding3.view.clicks
import com.jakewharton.rxbinding3.view.keys import com.jakewharton.rxbinding3.view.keys
import io.reactivex.Observable import io.reactivex.Observable
import io.reactivex.android.schedulers.AndroidSchedulers import io.reactivex.android.schedulers.AndroidSchedulers
...@@ -34,7 +35,8 @@ class FindFlatScreenController : ...@@ -34,7 +35,8 @@ class FindFlatScreenController :
override fun getFlat(): Observable<FlatRequestModel> = override fun getFlat(): Observable<FlatRequestModel> =
flatNumberEditor.keys { it.keyCode == KeyEvent.KEYCODE_ENTER } Observable.merge(
flatNumberEditor.keys { it.keyCode == KeyEvent.KEYCODE_ENTER },findFlatButton.clicks())
.doOnNext { flatNumberEditor.hideKeyboard() } .doOnNext { flatNumberEditor.hideKeyboard() }
.map { .map {
FlatRequestModel( FlatRequestModel(
...@@ -44,7 +46,6 @@ class FindFlatScreenController : ...@@ -44,7 +46,6 @@ class FindFlatScreenController :
} }
.observeOn(AndroidSchedulers.mainThread()) .observeOn(AndroidSchedulers.mainThread())
override fun injectDependencies() { override fun injectDependencies() {
getComponent() getComponent()
} }
...@@ -70,7 +71,7 @@ class FindFlatScreenController : ...@@ -70,7 +71,7 @@ class FindFlatScreenController :
lateinit var flatNumberEditor: EditText lateinit var flatNumberEditor: EditText
@BindView(R.id.findFlatButton) @BindView(R.id.findFlatButton)
lateinit var fubdFlatButton: MaterialButton lateinit var findFlatButton: MaterialButton
@Inject @Inject
override lateinit var injectedPresenter: FindFlatScreenPresenter override lateinit var injectedPresenter: FindFlatScreenPresenter
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment