Commit 841483ee authored by Vladislav Bogdashkin's avatar Vladislav Bogdashkin 🎣

through index save restore state

parent 087eea30
......@@ -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++
......
......@@ -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 { planList?.get(it) }
.flatMap{ interactor.getPlan(it)
.map<EstateScreenViewState> {plan -> EstateScreenViewState.LoadPlan(plan) }
.startWith(Observable.just<EstateScreenViewState>(EstateScreenViewState.PlanTypeSelected(it)))
......
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