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

button click fix

parent 60e9bf89
......@@ -11,4 +11,4 @@ interface FindFlatScreen : BigantoBaseContract<FindFlatScreenViewState> {
fun getFlat() : Observable<FlatRequestModel>
}
data class FlatRequestModel(val number:Int,val building:Int)
\ No newline at end of file
data class FlatRequestModel(val building:Int,val number:Int)
\ No newline at end of file
......@@ -16,6 +16,7 @@ import com.bluelinelabs.conductor.changehandler.FadeChangeHandler
import com.google.android.material.button.MaterialButton
import com.google.android.material.tabs.TabLayout
import com.google.android.material.textfield.TextInputLayout
import com.jakewharton.rxbinding3.view.clicks
import com.jakewharton.rxbinding3.view.keys
import io.reactivex.Observable
import io.reactivex.android.schedulers.AndroidSchedulers
......@@ -34,7 +35,8 @@ class FindFlatScreenController :
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() }
.map {
FlatRequestModel(
......@@ -44,7 +46,6 @@ class FindFlatScreenController :
}
.observeOn(AndroidSchedulers.mainThread())
override fun injectDependencies() {
getComponent()
}
......@@ -70,7 +71,7 @@ class FindFlatScreenController :
lateinit var flatNumberEditor: EditText
@BindView(R.id.findFlatButton)
lateinit var fubdFlatButton: MaterialButton
lateinit var findFlatButton: MaterialButton
@Inject
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