Commit 58e4df01 authored by Vladislav Bogdashkin's avatar Vladislav Bogdashkin 🎣

Merge branch 'feature/flat_fix' into develop

parents 5d7e5a33 5b1541a9
......@@ -63,24 +63,22 @@ class AuthScreenController :
super.onAttach(view)
detachDisposable.addAll(
loginInput.editText?.textChanges()
?.doOnNext { Timber.d("loginInput.isErrorEnabled ${loginInput.isErrorEnabled}")}
?.filter { loginInput.isErrorEnabled }
?.subscribe {
Timber.d("got key $it")
loginInput.isErrorEnabled = false
loginInput.error = null
signInButton.isEnabled=true
},
pwdInput.editText?.textChanges()
?.filter { pwdInput.isErrorEnabled }
?.subscribe { pwdInput.isErrorEnabled = false
?.subscribe {
pwdInput.isErrorEnabled = false
pwdInput.error = null
signInButton.isEnabled=true
}
)
}
@Inject
lateinit var bottomNavigation: IBottomNavigation
......@@ -97,9 +95,6 @@ class AuthScreenController :
.create(RoomParkApplication.component,activity as RoomParkMainActivity)
.inject(this)
// @Inject
// lateinit var ac: RoomParkMainActivity
override fun render(viewState: AuthScreenViewState) {
super.render(viewState)
Timber.d("Render state $viewState")
......@@ -115,7 +110,11 @@ class AuthScreenController :
}
private fun render(viewState: AuthScreenViewState.Idle){
loginInput.isErrorEnabled = false
loginInput.error = null
pwdInput.isErrorEnabled = false
pwdInput.error = null
signInButton.isEnabled=true
}
private fun render(viewState: AuthScreenViewState.Authorization){
......@@ -154,9 +153,10 @@ class AuthScreenController :
}
private fun render(viewState: AuthScreenViewState.SomeError) =
private fun render(viewState: AuthScreenViewState.SomeError) {
showError(viewState.exception)
signInButton.isEnabled=true
}
override fun getLayoutId(): Int = R.layout.authentication_screen
......
......@@ -19,24 +19,11 @@ class AuthScreenPresenter @Inject constructor(
)
: BigantoBasePresenter<AuthScreen, AuthScreenViewState>() {
override fun attachView(view: AuthScreen) {
super.attachView(view)
Timber.d("on AttachView")
restoreStateObservable.accept(AuthScreenViewState.Idle())
}
override fun detachView() {
super.detachView()
Timber.d("on DetachView")
restoreStateObservable }
override fun defaultErrorViewStateHandler() =
{e:ExceptionString -> AuthScreenViewState.SomeError(e)}
override fun vsByCode(code: Int): (ExceptionString) -> AuthScreenViewState =
when (code) {
101 -> {e:ExceptionString -> AuthScreenViewState.SignInError(e)}
111 -> {e:ExceptionString -> AuthScreenViewState.WrongLogin(e)}
112 -> {e:ExceptionString -> AuthScreenViewState.WrongPassword(e)}
else -> {e:ExceptionString -> AuthScreenViewState.SomeError(e)}
......
......@@ -102,6 +102,7 @@ class FindFlatScreenController :
when(viewState){
is FindFlatScreenViewState.Idle -> render(viewState)
is FindFlatScreenViewState.StartTour -> render(viewState)
is FindFlatScreenViewState.SomeError -> render(viewState)
}
}
......
......@@ -26,6 +26,7 @@ class FindFlatScreenPresenter @Inject constructor(
override fun bindIntents() {
val startTourIntent = intent(FindFlatScreen::startTour)
.filter { false }
.map { FindFlatScreenViewState.StartTour(it) }
val getFlatIntent = intent(FindFlatScreen::getFlat)
......
......@@ -37,6 +37,8 @@
android:layout_height="wrap_content"
android:cursorVisible="true"
android:includeFontPadding="false"
android:inputType="number"
android:maxLength="4"
android:singleLine="true" />
</com.google.android.material.textfield.TextInputLayout>
......
......@@ -7,7 +7,7 @@
<item name="colorPrimary">@color/colorPrimary</item>
<item name="colorSecondary">@color/colorAccent</item>
<item name="colorSecondaryVariant">@color/colorAccentSecondary</item>
<item name="colorPrimaryDark">@color/colorPrimaryDark</item>
<item name="colorPrimaryDark">@color/colorAccentSecondary</item>
<item name="colorAccent">@color/colorAccent</item>
<item name="materialCardViewStyle">@style/Widget.Biganto.MaterialCardView</item>
......
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