Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Room Park Android
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Vladislav Bogdashkin
Room Park Android
Commits
58e4df01
Commit
58e4df01
authored
Nov 18, 2019
by
Vladislav Bogdashkin
🎣
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'feature/flat_fix' into develop
parents
5d7e5a33
5b1541a9
Changes
6
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
16 additions
and
25 deletions
+16
-25
ScreenController.kt
...ual/roompark/presentation/screen/auth/ScreenController.kt
+11
-11
ScreenPresenter.kt
...sual/roompark/presentation/screen/auth/ScreenPresenter.kt
+0
-13
ScreenController.kt
.../roompark/presentation/screen/to_flat/ScreenController.kt
+1
-0
ScreenPresenter.kt
...l/roompark/presentation/screen/to_flat/ScreenPresenter.kt
+1
-0
find_flat_screen.xml
app/src/main/res/layout/find_flat_screen.xml
+2
-0
styles.xml
app/src/main/res/values/styles.xml
+1
-1
No files found.
app/src/main/java/com/biganto/visual/roompark/presentation/screen/auth/ScreenController.kt
View file @
58e4df01
...
...
@@ -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
...
...
app/src/main/java/com/biganto/visual/roompark/presentation/screen/auth/ScreenPresenter.kt
View file @
58e4df01
...
...
@@ -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
)}
...
...
app/src/main/java/com/biganto/visual/roompark/presentation/screen/to_flat/ScreenController.kt
View file @
58e4df01
...
...
@@ -102,6 +102,7 @@ class FindFlatScreenController :
when
(
viewState
){
is
FindFlatScreenViewState
.
Idle
->
render
(
viewState
)
is
FindFlatScreenViewState
.
StartTour
->
render
(
viewState
)
is
FindFlatScreenViewState
.
SomeError
->
render
(
viewState
)
}
}
...
...
app/src/main/java/com/biganto/visual/roompark/presentation/screen/to_flat/ScreenPresenter.kt
View file @
58e4df01
...
...
@@ -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
)
...
...
app/src/main/res/layout/find_flat_screen.xml
View file @
58e4df01
...
...
@@ -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>
...
...
app/src/main/res/values/styles.xml
View file @
58e4df01
...
...
@@ -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/color
PrimaryDark
</item>
<item
name=
"colorPrimaryDark"
>
@color/color
AccentSecondary
</item>
<item
name=
"colorAccent"
>
@color/colorAccent
</item>
<item
name=
"materialCardViewStyle"
>
@style/Widget.Biganto.MaterialCardView
</item>
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment