Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in / Register
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
841483ee
Commit
841483ee
authored
Jan 13, 2020
by
Vladislav Bogdashkin
🎣
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
through index save restore state
parent
087eea30
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
5 additions
and
18 deletions
+5
-18
ScreenController.kt
...l/roompark/presentation/screen/estate/ScreenController.kt
+4
-15
ScreenPresenter.kt
...al/roompark/presentation/screen/estate/ScreenPresenter.kt
+1
-3
No files found.
app/src/main/java/com/biganto/visual/roompark/presentation/screen/estate/ScreenController.kt
View file @
841483ee
...
...
@@ -7,7 +7,6 @@ import android.view.ViewGroup
import
android.webkit.WebView
import
android.widget.LinearLayout
import
androidx.core.os.bundleOf
import
androidx.core.view.get
import
androidx.core.view.isNotEmpty
import
butterknife.BindView
import
com.biganto.visual.roompark.R
...
...
@@ -46,19 +45,8 @@ class EstateScreenController :
.
checkedChanges
()
.
filter
{
planTypesTabLayout
.
isNotEmpty
()}
.
filter
{
planTypesTabLayout
.
selectedTabPosition
>=
0
}
.
doOnNext
{
Timber
.
d
(
"tag: ${planTypesTabLayout.getTabAt(0)?.tag}"
)
}
.
doOnNext
{
Timber
.
d
(
"tag: ${planTypesTabLayout.getTabAt(0)?.customView}"
)
}
.
doOnNext
{
Timber
.
d
(
"tag: ${planTypesTabLayout.getTabAt(0)?.view}"
)
}
.
doOnNext
{
Timber
.
d
(
"tabs tag: ${planTypesTabLayout.getTag(planTypesTabLayout.selectedTabPosition)}"
)
Timber
.
d
(
"tabs tag: ${planTypesTabLayout.getTabAt(0)?.customView?.tag}"
)
}
.
doOnNext
{
Timber
.
d
(
"tag: ${planTypesTabLayout.selectedTabPosition}"
)
}
.
doOnNext
{
Timber
.
d
(
"tag: ${planTypesTabLayout[planTypesTabLayout.selectedTabPosition].tag}"
)
}
.
map
{
Pair
(
planTypesTabLayout
.
getTabAt
(
0
)
?.
customView
?.
tag
as
Int
,
it
)
Pair
(
planTypesTabLayout
.
selectedTabPosition
,
it
)
}
override
fun
switchSizes
():
Observable
<
Pair
<
Int
,
Boolean
>>
=
...
...
@@ -170,6 +158,8 @@ class EstateScreenController :
private
fun
render
(
viewState
:
EstateScreenViewState
.
LoadEstate
)
{
}
...
...
@@ -182,8 +172,7 @@ class EstateScreenController :
val
tab
=
planTypesTabLayout
.
newTab
()
.
setCustomView
(
R
.
layout
.
select_text_tab
).
setTag
(
it
.
planId
)
Timber
.
d
(
"tabs tag: ${tab}"
)
Timber
.
d
(
"tabs tag: ${tab.tag}"
)
(
tab
.
customView
as
MaterialTextView
).
text
=
"Вариант $i"
planTypesTabLayout
.
addTab
(
tab
)
i
++
...
...
app/src/main/java/com/biganto/visual/roompark/presentation/screen/estate/ScreenPresenter.kt
View file @
841483ee
...
...
@@ -32,19 +32,17 @@ class EstateScreenPresenter @Inject constructor(
interactor
.
getPlan
(
plan
)
.
map
<
EstateScreenViewState
>
{
EstateScreenViewState
.
LoadPlan
(
it
)}
override
fun
bindIntents
()
{
val
prefetchCards
=
interactor
.
getEstate
(
estateId
)
.
map
{
EstateScreenViewState
.
LoadEstate
(
it
)
}
//.map { EstateScreenViewState.FavoriteEstatesLoaded(it) }
val
fetchPlans
=
interactor
.
getPlanTypes
(
estateId
)
.
doOnNext
{
planList
=
it
.
toList
()
}
.
map
{
EstateScreenViewState
.
LoadPlanTypes
(
it
)
}
val
fetchPlan
=
intent
(
EstateScreen
::
planTypesTabSelected
)
.
map
{
plan
->
planList
?.
first
{
it
.
planId
==
plan
}
}
.
map
{
plan
List
?.
get
(
it
)
}
.
flatMap
{
interactor
.
getPlan
(
it
)
.
map
<
EstateScreenViewState
>
{
plan
->
EstateScreenViewState
.
LoadPlan
(
plan
)
}
.
startWith
(
Observable
.
just
<
EstateScreenViewState
>(
EstateScreenViewState
.
PlanTypeSelected
(
it
)))
...
...
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